summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormortimer <mortimer@openbsd.org>2019-12-17 01:34:59 +0000
committermortimer <mortimer@openbsd.org>2019-12-17 01:34:59 +0000
commit8a1857e33af31cf54d13ef86daf5673bac2223ea (patch)
tree0949d91855a8c0a9ad0c2592f8690c69577193c5
parentrm more unuseful files (diff)
downloadwireguard-openbsd-8a1857e33af31cf54d13ef86daf5673bac2223ea.tar.xz
wireguard-openbsd-8a1857e33af31cf54d13ef86daf5673bac2223ea.zip
Add support for NCT6775F, NCT5104D, NCT6779D, NCT679[1235]D sensors.
From Joe Gidi.
-rw-r--r--share/man/man4/lm.46
-rw-r--r--sys/dev/ic/lm78.c73
-rw-r--r--sys/dev/ic/lm78var.h4
-rw-r--r--sys/dev/isa/wbsio.c24
-rw-r--r--sys/dev/isa/wbsioreg.h8
5 files changed, 105 insertions, 10 deletions
diff --git a/share/man/man4/lm.4 b/share/man/man4/lm.4
index 6e71d3ec245..73d8212b9f1 100644
--- a/share/man/man4/lm.4
+++ b/share/man/man4/lm.4
@@ -1,4 +1,4 @@
-.\" $OpenBSD: lm.4,v 1.25 2013/07/16 16:05:49 schwarze Exp $
+.\" $OpenBSD: lm.4,v 1.26 2019/12/17 01:34:59 mortimer Exp $
.\" $NetBSD: lm.4,v 1.11 2001/09/22 01:22:49 wiz Exp $
.\"
.\" Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: July 16 2013 $
+.Dd $Mdocdate: December 17 2019 $
.Dt LM 4
.Os
.Sh NAME
@@ -82,7 +82,7 @@ National Semiconductor LM79
.It
National Semiconductor LM81
.It
-Nuvoton NCT6776F
+Nuvoton NCT6775F, NCT6776F, NCT6779D, NCT6791D, NCT6792D, NCT6793D, NCT6795D
.It
Winbond W83627HF, W83627THF, W83637HF and W83697HF
.It
diff --git a/sys/dev/ic/lm78.c b/sys/dev/ic/lm78.c
index bc0664f0418..88538623a7a 100644
--- a/sys/dev/ic/lm78.c
+++ b/sys/dev/ic/lm78.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lm78.c,v 1.24 2015/03/14 03:38:47 jsg Exp $ */
+/* $OpenBSD: lm78.c,v 1.25 2019/12/17 01:34:59 mortimer Exp $ */
/*
* Copyright (c) 2005, 2006 Mark Kettenis
@@ -215,6 +215,43 @@ struct lm_sensor nct6776f_sensors[] = {
{ NULL }
};
+/* NCT6779D */
+struct lm_sensor nct6779d_sensors[] = {
+ /* Voltage */
+ { "VCore", SENSOR_VOLTS_DC, 4, 0x80, lm_refresh_volt, RFACT_NONE },
+ { "VIN1", SENSOR_VOLTS_DC, 4, 0x81, lm_refresh_volt, RFACT(56, 10) / 2 },
+ { "AVCC", SENSOR_VOLTS_DC, 4, 0x82, lm_refresh_volt, RFACT(34, 34) / 2 },
+ { "+3.3V", SENSOR_VOLTS_DC, 4, 0x83, lm_refresh_volt, RFACT(34, 34) / 2 },
+ { "VIN0", SENSOR_VOLTS_DC, 4, 0x84, lm_refresh_volt, RFACT(48600, 10000) },
+ { "VIN8", SENSOR_VOLTS_DC, 4, 0x85, lm_refresh_volt, RFACT_NONE / 2 },
+ { "VIN4", SENSOR_VOLTS_DC, 4, 0x86, lm_refresh_volt, RFACT_NONE / 2 },
+ { "+3.3VSB", SENSOR_VOLTS_DC, 4, 0x87, lm_refresh_volt, RFACT(34, 34) / 2 },
+ { "VBAT", SENSOR_VOLTS_DC, 4, 0x88, lm_refresh_volt, RFACT_NONE },
+ { "VTT", SENSOR_VOLTS_DC, 4, 0x89, lm_refresh_volt, RFACT_NONE },
+ { "VIN5", SENSOR_VOLTS_DC, 4, 0x8a, lm_refresh_volt, RFACT_NONE / 2 },
+ { "VIN6", SENSOR_VOLTS_DC, 4, 0x8b, lm_refresh_volt, RFACT_NONE / 2 },
+ { "VIN2", SENSOR_VOLTS_DC, 4, 0x8c, lm_refresh_volt, RFACT_NONE },
+ { "VIN3", SENSOR_VOLTS_DC, 4, 0x8d, lm_refresh_volt, RFACT(14414, 10000) },
+ { "VIN7", SENSOR_VOLTS_DC, 4, 0x8e, lm_refresh_volt, RFACT_NONE / 2 },
+
+ /* Temperature */
+ { "MB Temperature", SENSOR_TEMP, 4, 0x90, lm_refresh_temp, 0 },
+ { "CPU Temperature", SENSOR_TEMP, 4, 0x91, wb_refresh_temp, 0 },
+ { "Aux Temp0", SENSOR_TEMP, 4, 0x92, wb_refresh_temp, 0 },
+ { "Aux Temp1", SENSOR_TEMP, 4, 0x93, wb_refresh_temp, 0 },
+ { "Aux Temp2", SENSOR_TEMP, 4, 0x94, wb_refresh_temp, 0 },
+ { "Aux Temp3", SENSOR_TEMP, 4, 0x95, wb_refresh_temp, 0 },
+
+ /* Fans */
+ { "System Fan", SENSOR_FANRPM, 4, 0xc0, wb_nct6776f_refresh_fanrpm, 0 },
+ { "CPU Fan", SENSOR_FANRPM, 4, 0xc2, wb_nct6776f_refresh_fanrpm, 0 },
+ { "Aux Fan0", SENSOR_FANRPM, 4, 0xc4, wb_nct6776f_refresh_fanrpm, 0 },
+ { "Aux Fan1", SENSOR_FANRPM, 4, 0xc6, wb_nct6776f_refresh_fanrpm, 0 },
+ { "Aux Fan2", SENSOR_FANRPM, 4, 0xc8, wb_nct6776f_refresh_fanrpm, 0 },
+
+ { NULL }
+};
+
struct lm_sensor w83637hf_sensors[] = {
/* Voltage */
{ "VCore", SENSOR_VOLTS_DC, 0, 0x20, wb_w83637hf_refresh_vcore },
@@ -526,10 +563,40 @@ wb_match(struct lm_softc *sc)
lm_setup_sensors(sc, w83627ehf_sensors);
break;
case WB_CHIPID_W83627DHG:
- if (sc->sioid == WBSIO_ID_NCT6776F) {
+ switch (sc->sioid) {
+ case WBSIO_ID_NCT6775F:
+ printf(": NCT6775F\n");
+ lm_setup_sensors(sc, nct6776f_sensors);
+ break;
+ case WBSIO_ID_NCT6776F:
printf(": NCT6776F\n");
lm_setup_sensors(sc, nct6776f_sensors);
- } else {
+ break;
+ case WBSIO_ID_NCT5104D:
+ printf(": NCT5104D\n");
+ lm_setup_sensors(sc, nct6776f_sensors);
+ break;
+ case WBSIO_ID_NCT6779D:
+ printf(": NCT6779D\n");
+ lm_setup_sensors(sc, nct6779d_sensors);
+ break;
+ case WBSIO_ID_NCT6791D:
+ printf(": NCT6791D\n");
+ lm_setup_sensors(sc, nct6779d_sensors);
+ break;
+ case WBSIO_ID_NCT6792D:
+ printf(": NCT6792D\n");
+ lm_setup_sensors(sc, nct6779d_sensors);
+ break;
+ case WBSIO_ID_NCT6793D:
+ printf(": NCT6793D\n");
+ lm_setup_sensors(sc, nct6779d_sensors);
+ break;
+ case WBSIO_ID_NCT6795D:
+ printf(": NCT6795D\n");
+ lm_setup_sensors(sc, nct6779d_sensors);
+ break;
+ default:
printf(": W83627DHG\n");
lm_setup_sensors(sc, w83627dhg_sensors);
}
diff --git a/sys/dev/ic/lm78var.h b/sys/dev/ic/lm78var.h
index 9996e6c78a7..374b208bf81 100644
--- a/sys/dev/ic/lm78var.h
+++ b/sys/dev/ic/lm78var.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: lm78var.h,v 1.18 2016/03/15 20:50:22 krw Exp $ */
+/* $OpenBSD: lm78var.h,v 1.19 2019/12/17 01:34:59 mortimer Exp $ */
/*
* Copyright (c) 2005, 2006 Mark Kettenis
@@ -123,7 +123,7 @@
#define WB_VREF 3600
#define WB_W83627EHF_VREF 2048
-#define WB_MAX_SENSORS 19
+#define WB_MAX_SENSORS 36
struct lm_softc;
diff --git a/sys/dev/isa/wbsio.c b/sys/dev/isa/wbsio.c
index 7147d481732..de36287d157 100644
--- a/sys/dev/isa/wbsio.c
+++ b/sys/dev/isa/wbsio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wbsio.c,v 1.10 2015/03/14 03:38:47 jsg Exp $ */
+/* $OpenBSD: wbsio.c,v 1.11 2019/12/17 01:34:59 mortimer Exp $ */
/*
* Copyright (c) 2008 Mark Kettenis <kettenis@openbsd.org>
*
@@ -110,8 +110,12 @@ wbsio_probe(struct device *parent, void *match, void *aux)
case WBSIO_ID_W83627UHG:
case WBSIO_ID_W83637HF:
case WBSIO_ID_W83697HF:
+ case WBSIO_ID_NCT6775F:
case WBSIO_ID_NCT6776F:
case WBSIO_ID_NCT5104D:
+ case WBSIO_ID_NCT6779D:
+ case WBSIO_ID_NCT6791D:
+ case WBSIO_ID_NCT6792D:
ia->ipa_nio = 1;
ia->ipa_io[0].length = WBSIO_IOSIZE;
ia->ipa_nmem = 0;
@@ -170,9 +174,27 @@ wbsio_attach(struct device *parent, struct device *self, void *aux)
case WBSIO_ID_W83697HF:
printf(": W83697HF");
break;
+ case WBSIO_ID_NCT6775F:
+ printf(": NCT6775F");
+ break;
case WBSIO_ID_NCT6776F:
printf(": NCT6776F");
break;
+ case WBSIO_ID_NCT6779D:
+ printf(": NCT6779D");
+ break;
+ case WBSIO_ID_NCT6791D:
+ printf(": NCT6791D");
+ break;
+ case WBSIO_ID_NCT6792D:
+ printf(": NCT6792D");
+ break;
+ case WBSIO_ID_NCT6793D:
+ printf(": NCT6793D");
+ break;
+ case WBSIO_ID_NCT6795D:
+ printf(": NCT6795D");
+ break;
case WBSIO_ID_NCT5104D:
printf(": NCT5104D");
break;
diff --git a/sys/dev/isa/wbsioreg.h b/sys/dev/isa/wbsioreg.h
index 574a19f358b..a7f7237fb0c 100644
--- a/sys/dev/isa/wbsioreg.h
+++ b/sys/dev/isa/wbsioreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: wbsioreg.h,v 1.4 2015/01/02 23:02:54 chris Exp $ */
+/* $OpenBSD: wbsioreg.h,v 1.5 2019/12/17 01:34:59 mortimer Exp $ */
/*
* Copyright (c) 2008 Mark Kettenis <kettenis@openbsd.org>
*
@@ -42,8 +42,14 @@
#define WBSIO_ID_W83627SF 0x59
#define WBSIO_ID_W83637HF 0x70
#define WBSIO_ID_W83697HF 0x60
+#define WBSIO_ID_NCT6775F 0xb4
#define WBSIO_ID_NCT6776F 0xc3
#define WBSIO_ID_NCT5104D 0xc4
+#define WBSIO_ID_NCT6779D 0xc5
+#define WBSIO_ID_NCT6791D 0xc8
+#define WBSIO_ID_NCT6792D 0xc9
+#define WBSIO_ID_NCT6793D 0xd1
+#define WBSIO_ID_NCT6795D 0xd3
/* Logical Device Number (LDN) Assignments */
#define WBSIO_LDN_HM 0x0b