NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/59802: lm(4): Support five aux fans for NCT6794D



>Number:         59802
>Category:       kern
>Synopsis:       lm(4): Support five aux fans for NCT6794D
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sat Nov 29 02:40:00 +0000 2025
>Originator:     Tetsuya Isaki
>Release:        NetBSD 11.0_BETA
>Organization:
>Environment:
NetBSD XXXXX 11.0_BETA NetBSD 11.0_BETA (GENERIC) #1: Thu Oct 16 15:19:01 JST 2025  isaki@XXXXX:/var/obj/11/amd64/obj/sys/arch/amd64/compile/GENERIC amd64
>Description:
NCT6794D has five aux fan sensors but current lm(4) only detects three.

Current nslm7x.c looks to identify all NCT679*D as NCT6779D and its family,
and nct6779d_sensors[] defines three aux fans.
According to datasheet NCT6791D has three aux fan sensors, but
at least NCT{6794,6796}D seem to have five aux fan sensors.

# The top marking of my chip is NCT6794D-E.  The chip revision returned
# by this chip is 0x4d:2a.  So lm(4) identifies it as NCT6798D.  
# But I won't be concerned with that difference here.

The following patch adds two extra fans to nct6779d_sensors[] and
I was able to get RPM readings from them by envstat(8)!
(My motherboard has four fan connectors and it looks to connect to aux fan
sensor {0, 1, 3, 4} on NCT6794D-E.  I got readings from all four fans.)

However, I don't have access to any other NCT67** controllers.
I hope someone can take a look at this.

--- sys/dev/ic/nslm7x.c.ORG
+++ sys/dev/ic/nslm7x.c
@@ -2122,6 +2122,22 @@
 		.refresh = wb_nct6776f_refresh_fanrpm,
 		.rfact = 0
 	},
+	{
+		.desc = "Aux Fan3",
+		.type = ENVSYS_SFANRPM,
+		.bank = 4,
+		.reg = 0xca,
+		.refresh = wb_nct6776f_refresh_fanrpm,
+		.rfact = 0
+	},
+	{
+		.desc = "Aux Fan4",
+		.type = ENVSYS_SFANRPM,
+		.bank = 4,
+		.reg = 0xce,
+		.refresh = wb_nct6776f_refresh_fanrpm,
+		.rfact = 0
+	},
 
 	{ .desc = NULL }
 };


Here is related part of dmesg:
:
pci4 at ppb3 bus 4
pci4: i/o space, memory space enabled, rd/line, wr/inv ok
pcib0 at pci0 dev 31 function 0: Intel B760 eSPI (rev. 0x11)
ichsmb0 at pci0 dev 31 function 4: Intel 700 Series PCH SMBus (rev. 0x11)
ichsmb0: interrupting at ioapic0 pin 18
iic0 at ichsmb0: I2C bus
Intel 700 Series PCH SPI (FLASH) (miscellaneous serial bus, revision 0x11) at pci0 dev 31 function 5 not configured
isa0 at pcib0
com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, 16-byte FIFO
pckbc0 at isa0 port 0x60-0x64
pcppi0 at isa0 port 0x61
:
# modload lm_wbsio
wbsio0 at isa0 port 0x2e-0x2f: Nuvoton LPC Super I/O NCT6798D rev C
lm0 at wbsio0 port 0x2a0-0x2a7
lm0: Using default temp sensors
lm0: Nuvoton NCT6798D Hardware monitor
>How-To-Repeat:
Boot 11.0_BETA kernel and:
# modload lm_wbsio
# envstat
                       Current  CritMax  WarnMax  WarnMin  CritMin  Unit
(snip)
[lm0]
              VCore:     0.920                                         V
               VIN1:    10.982                                         V
               AVCC:     3.424                                         V
              +3.3V:     3.344                                         V
               VIN0:    11.814                                         V
               VIN8:     0.888                                         V
               VIN4:     2.400                                         V
            +3.3VSB:     3.424                                         V
               VBAT:     0.000                                         V
                VTT:     1.056                                         V
               VIN5:     1.072                                         V
               VIN6:     0.832                                         V
               VIN2:     2.000                                         V
               VIN3:     2.422                                         V
               VIN7:     1.496                                         V
     MB Temperature:    30.000                                      degC
    CPU Temperature:    18.000                                      degC
          Aux Temp0:    15.000                                      degC
          Aux Temp1:    22.000                                      degC
          Aux Temp2:    35.000                                      degC
          Aux Temp3:     0.000                                      degC
         System Fan:       N/A
            CPU Fan:      1053                                       RPM
           Aux Fan0:       559                                       RPM
           Aux Fan1:       512                                       RPM
           Aux Fan2:       N/A
#
>Fix:
Apply the above patch.



Home | Main Index | Thread Index | Old Index