zeule / asus-ec-sensors

Linux HWMON sensors driver for ASUS motherboards to get sensor readings from the embedded controller
GNU General Public License v2.0
45 stars 21 forks source link

definitions for asus Zenith II Extreme #26

Closed nabajour closed 2 years ago

nabajour commented 2 years ago

I adapted my changes for the Zenith II Extreme I made a while ago to your new code architecture.

Here is the output of sensors

$ sensors
k10temp-pci-00c3
Adapter: PCI adapter
Tctl:         +62.1°C
Tccd1:        +46.2°C
Tccd3:        +49.0°C
Tccd5:        +60.8°C
Tccd7:        +54.0°C

nct6798-isa-0290
Adapter: ISA adapter
in0:                        1.09 V  (min =  +0.00 V, max =  +1.74 V)
in1:                      992.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
in2:                        3.38 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in3:                        3.30 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in4:                        1.74 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in5:                      592.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
in6:                        1.09 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in7:                        3.38 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in8:                        3.26 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in9:                      888.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
in10:                     232.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
in11:                     592.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
in12:                       1.02 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in13:                       1.20 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in14:                       1.77 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
fan1:                      775 RPM  (min =    0 RPM)
fan2:                     2220 RPM  (min =    0 RPM)
fan3:                      817 RPM  (min =    0 RPM)
fan6:                        0 RPM  (min =    0 RPM)
fan7:                        0 RPM  (min =    0 RPM)
SYSTIN:                    +43.0°C  (high = +80.0°C, hyst = +75.0°C)  sensor = thermistor
CPUTIN:                    +48.0°C  (high = +80.0°C, hyst = +75.0°C)  sensor = thermistor
AUXTIN0:                   +21.0°C    sensor = thermistor
AUXTIN1:                   +72.0°C    sensor = thermistor
AUXTIN2:                   +16.0°C    sensor = thermistor
AUXTIN3:                   -19.0°C    sensor = thermistor
PECI Agent 0 Calibration:  +56.5°C
PCH_CHIP_CPU_MAX_TEMP:      +0.0°C
PCH_CHIP_TEMP:              +0.0°C
PCH_CPU_TEMP:               +0.0°C
TSI0_TEMP:                 +62.8°C
TSI1_TEMP:                 +71.0°C
intrusion0:               ALARM
intrusion1:               ALARM
beep_enable:              disabled

enp68s0-pci-4400
Adapter: PCI adapter
PHY Temperature:  +63.0°C
MAC Temperature:  +62.5°C

asusec-isa-0000
Adapter: ISA adapter
CPU Core:    1000.00 mV
CPU_Opt:        0 RPM
VRM HS:         0 RPM
Chipset:        0 RPM
Water_Flow:  5349 RPM
Chipset:      +71.0°C
CPU:          +56.0°C
Motherboard:  +43.0°C
T_Sensor:     -40.0°C
VRM:          +50.0°C
Water_In:      +0.0°C
Water_Out:    -40.0°C
CPU:           4.00 A

nvme-pci-2100
Adapter: PCI adapter
Composite:    +48.9°C  (low  = -273.1°C, high = +84.8°C)
                       (crit = +84.8°C)
Sensor 1:     +48.9°C  (low  = -273.1°C, high = +65261.8°C)
Sensor 2:     +46.9°C  (low  = -273.1°C, high = +65261.8°C)

Tell me if this looks ok to you. Thanks

zeule commented 2 years ago

Thank you for the contribution! From a quick look Water_In: +0.0°C looks suspicious (BTW, you can post output from sensors 'asusec-*' which would be enough). Also, are you sure you should use family_amd_400_series and not family_amd_500_series? Board photo show chipset fan and there is no chipset fan in family_amd_400_series. Instead what your output labels as "Water_Flow" is the chipset fan (and it would be the fan in family_amd_500_series).

nabajour commented 2 years ago

Here is the output when using family_amd_500_series:

asusec-isa-0000
Adapter: ISA adapter
CPU Core:      1.38 V
CPU_Opt:        0 RPM
VRM HS:      8680 RPM
Chipset:     5337 RPM
Water_Flow:     0 RPM
Chipset:      +67.0°C
CPU:          +56.0°C
Motherboard:  +40.0°C
T_Sensor:     +33.0°C
VRM:          +48.0°C
Water_In:     -40.0°C
Water_Out:    -40.0°C
CPU:          14.00 A

With this family, the Water_In, Water_Flow and rpm for Chipset info looks more consistent.

Just for context, my interest here was actually to monitor the VRM temperature and fan speed, as the VRM heatsink fan is going a bit bonkers.

For the above, I also reconnected the VRM HS Fan, so it reports the speed correctly. The motherboard has two temperature sensors (T_sensor 1 and T_sensor 2) reported in the BIOS. I found some sensors and connected them. What's reported as T_sensor is T_sensor1.

The BIOS reports these sensors:

  - [X] cpu temp
  - [X] cpu package temp
  - [X] motherboard temp
  - [X] vrm temp
  - [X] chipset temp
  - [X] T_Sensor 1 temp
  - [X] T_Sensor 2 temp
  - [ ] Water In T sensor temp
  - [ ] Water Out T sensor temp
  - [ ] WB In T Sensor temp   (WB: Water Block)
  - [ ] WB Out T Sensor temp
  - [ ] Node Power Supply Unit Temp
  - [X] CPU Fan Speed
  - [ ] CPU Optional Fan Speed
  - [X] Chassis Fan 1 Speed
  - [X] Chassis Fan 2 Speed
  - [ ] W_Pump+ 1 Speed
  - [ ] W_Pump+ 2 Speed
  - [X] VRM Heatsink Fan Speed
  - [X] Chipset Fan Speed
  - [ ] Node Power Supply Unit Fan Speed
  - [X] CPU Core Voltage
  - [X] 12V Voltage
  - [X] 5V Voltage
  - [X] 3.3V Voltage
  - [ ] Node Power Supply unit Vin Voltage
  - [ ] Flow Rate
  - [ ] WB Flow Rate
  - [ ] Node Power Supply Unit Power

The checked ones are the ones reporting a value on the BIOS. I can check some others by moving a fan around, but I don't have a Node power supply or a complex enough water pump (mine is just plugged into CPU_FAN header).

I don't know if there are any more values we can get, like T_sensor2. I don't know where the index in the family_amd_500_series array come from.

If there is any more I can try out or info I can find to get this working and merged, I'd be happy to help.

zeule commented 2 years ago

Here is the output when using family_amd_500_series: … With this family, the Water_In, Water_Flow and rpm for Chipset info looks more consistent.

Agree, these numbers look OK to me.

I don't know if there are any more values we can get, like T_sensor2. I don't know where the index in the family_amd_500_series array come from. If there is any more I can try out or info I can find to get this working and merged, I'd be happy to help.

Just guessing and checking various EC registers. You can use the ec_sys kernel module to dump EC registers from the first bank (bank index 0) and look for 216 (0xd8) when T_sensor2 is disconnected, as that is the blank value for temperature sensors (-40 deg Celsius). For the second bank you have to use more complicated approach. You can play with this module and add a bunch of fake sensors to cover several registers at once and check them. In this declaration: EC_SENSOR("T_Sensor", hwmon_temp, 1, 0x00, 0x3d) we use register 0x3d from bank 0x00, and the sensor spans 1 register. Alternatively, if your BIOS provides a WMI method to block read EC registers, you can call it from shell using the "acpi_call" kernel module. In any case, could you share, please, the DSDT ACPI table to keep it here for possible future refactoring? You can dump it as follows: # cat /sys/firmware/acpi/tables/DSDT.

nabajour commented 2 years ago

In any case, could you share, please, the DSDT ACPI table to keep it here for possible future refactoring? You can dump it as follows: # cat /sys/firmware/acpi/tables/DSDT.

Dsdt table in this comment from the related issue #16

zeule commented 2 years ago

@nabajour, could you also test, please, does the following sensor EC_SENSOR("Water_Block", hwmon_temp, 1, 0x01, 0x02) return -40 deg Celsius? It is from Intel motherboard, but perhaps here it is the same. And maybe 0x01, 0x03 is "WB Out T Sensor temp"?

zeule commented 2 years ago

Dsdt table in this comment from the related issue #16

Thank you!

zeule commented 2 years ago

Alternatively, if your BIOS provides a WMI method to block read EC registers…

I did not find it in the DSDT code.

nabajour commented 2 years ago

@nabajour, could you also test, please, does the following sensor EC_SENSOR("Water_Block", hwmon_temp, 1, 0x01, 0x02) return -40 deg Celsius? It is from Intel motherboard, but perhaps here it is the same. And maybe 0x01, 0x03 is "WB Out T Sensor temp"?

I appended those two sensors:

    [ec_sensor_temp_experimental_1] = EC_SENSOR("Water_Block", hwmon_temp, 1, 0x01, 0x02),
    [ec_sensor_temp_experimental_2] = EC_SENSOR("Water_Block_T", hwmon_temp, 1, 0x01, 0x03),

And got this output:

asusec-isa-0000
Adapter: ISA adapter
CPU Core:        1.38 V
CPU_Opt:          0 RPM
VRM HS:           0 RPM
Chipset:       5349 RPM
Water_Flow:       0 RPM
Chipset:        +70.0°C
CPU:            +55.0°C
Motherboard:    +42.0°C
T_Sensor:       +31.0°C
VRM:            +53.0°C
Water_In:       -40.0°C
Water_Out:      -40.0°C
Water_Block:    -40.0°C
Water_Block_T:  -40.0°C
CPU:            19.00 A
nabajour commented 2 years ago

With T_sensor1 and T_sensor2 connected:

$ sudo hexdump -C /sys/kernel/debug/ec/ec0/io
00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00000030  00 00 00 00 00 00 00 00  00 00 45 37 29 1f 30 00  |..........E7).0.|
00000040  7c 00 00 0f 0a 0f 0f ff  00 00 37 00 3c 66 5d ff  ||.........7.<f].|
00000050  00 00 00 00 00 ff ff 14  d9 00 05 00 00 00 00 00  |................|
00000060  d8 1b d8 d8 d8 00 00 00  07 00 00 00 00 00 00 00  |................|
00000070  00 00 02 00 00 00 00 00  00 00 00 05 55 00 00 00  |............U...|
00000080  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
000000a0  00 00 05 95 00 05 00 00  00 00 00 00 00 00 00 00  |................|
000000b0  00 00 00 00 14 f1 00 00  00 00 00 00 00 00 00 00  |................|
000000c0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000000d0  40 10 10 41 00 00 00 00  34 2e 00 50 00 50 08 03  |@..A....4..P.P..|
000000e0  00 00 00 00 03 03 00 02  00 00 00 57 80 00 00 00  |...........W....|
000000f0  00 00 38 00 10 00 00 00  0a 0a 00 00 00 00 0c 00  |..8.............|
00000100

With the sensors disconnected:

$ sudo hexdump -C /sys/kernel/debug/ec/ec0/io
00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00000030  00 00 00 00 00 00 00 00  00 00 44 30 28 d8 30 00  |..........D0(.0.|
00000040  7c 00 00 0f 0a 0f 0f ff  00 00 37 00 3c 66 5d ff  ||.........7.<f].|
00000050  00 00 00 00 00 ff ff 14  a9 00 05 00 00 00 00 00  |................|
00000060  d8 1b d8 d8 d8 00 00 00  07 00 00 00 00 00 00 00  |................|
00000070  00 00 02 00 00 00 00 00  00 00 00 05 55 00 00 00  |............U...|
00000080  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
000000a0  00 00 03 e2 00 05 00 00  00 00 00 00 00 00 00 00  |................|
000000b0  00 00 00 00 14 d9 00 00  00 00 00 00 00 00 00 00  |................|
000000c0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000000d0  40 10 10 41 00 00 00 00  34 2e 00 50 00 50 08 03  |@..A....4..P.P..|
000000e0  00 00 00 00 03 03 00 02  00 00 00 57 80 00 00 00  |...........W....|
000000f0  00 00 38 00 08 00 00 00  0a 0a 00 00 00 00 0c 00  |..8.............|
00000100

We have T_sensor1 at 0x3d. I don't see T_sensor2. There is some 0xd8 at 0x60, not sure what this is.

zeule commented 2 years ago

I appended those two sensors:…

Thank you, it is probably "water block out" then at 0x03.

There is no second disappearing "d8" here. Thus it is probably in the next bank.

zeule commented 2 years ago

I think the T_Sensor2 should be not far from the beginning of the bank, because ASUS seems to be filling the second bank consequently. So I would just create ten fake temp sensors starting from EC_SENSOR("Dummy_T0", hwmon_temp, 1, 0x01, 0x04). Reading arbitrary EC registers should do no harm to PC.

nabajour commented 2 years ago

Hi,

I create these sensors:

    [ec_sensor_temp_experimental_1] = EC_SENSOR("Exp_1", hwmon_temp, 1, 0x01, (offset + 0 )),
    [ec_sensor_temp_experimental_2] = EC_SENSOR("Exp_2", hwmon_temp, 1, 0x01, (offset + 1 )),
    [ec_sensor_temp_experimental_3] = EC_SENSOR("Exp_3", hwmon_temp, 1, 0x01, (offset + 2 )),
    [ec_sensor_temp_experimental_4] = EC_SENSOR("Exp_4", hwmon_temp, 1, 0x01, (offset + 3 )),
    [ec_sensor_temp_experimental_5] = EC_SENSOR("Exp_5", hwmon_temp, 1, 0x01, (offset + 4 )),
    [ec_sensor_temp_experimental_6] = EC_SENSOR("Exp_6", hwmon_temp, 1, 0x01, (offset + 5 )),
    [ec_sensor_temp_experimental_7] = EC_SENSOR("Exp_7", hwmon_temp, 1, 0x01, (offset + 6 )),  // 0x0a
    [ec_sensor_temp_experimental_8] = EC_SENSOR("Exp_8", hwmon_temp, 1, 0x01, (offset + 7 )),
    [ec_sensor_temp_experimental_9] = EC_SENSOR("Exp_9", hwmon_temp, 1, 0x01, (offset + 8 )),
    [ec_sensor_temp_experimental_0] = EC_SENSOR("Exp_0", hwmon_temp, 1, 0x01, (offset + 9 )),

with const unsigned char offset = 0x04;

This is the sensors output

[...]
Water_Out:    -40.0°C
Exp_1:         +0.0°C
Exp_2:         +0.0°C
Exp_3:         +0.0°C
Exp_4:         +0.0°C
Exp_5:        +60.0°C
Exp_6:        -40.0°C
Exp_7:        +37.0°C
Exp_8:        -40.0°C
Exp_9:        -40.0°C
Exp_0:         +0.0°C
CPU:           7.00 A

Il looks like 0x0a is T_sensor2.

zeule commented 2 years ago

I create these sensors:

Il looks like 0x0a is T_sensor2.

That's great! Thank you for the experiment! Not only you found out the address for T_Sensor2, but looks like discovered another two temperature sensors at 0x0b & 0x0c!

zeule commented 2 years ago

Does anything else hold you from wrapping this up?

nabajour commented 2 years ago

I create these sensors:

Il looks like 0x0a is T_sensor2.

That's great! Thank you for the experiment! Not only you found out the address for T_Sensor2, but looks like discovered another two temperature sensors at 0x0b & 0x0c!

Isn't there also one at 0x09, or am I missing something?

nabajour commented 2 years ago

Does anything else hold you from wrapping this up?

Mostly me being caught up in other stuff. I also read some introduction doc for ACPI and DSDT, but don't understand a lot. I was wondering if there was info in there to identify other sensors. And I'm not sure how to know what those extra sensors are for, so I'll just name them "extra" for now.

zeule commented 2 years ago

Isn't there also one at 0x09, or am I missing something?

Of course, that's similar to 0x0b & 0x0c.

nabajour commented 2 years ago

Output with latest pushed changes:

asusec-isa-0000
Adapter: ISA adapter
CPU Core:          1.01 V
CPU_Opt:            0 RPM
VRM HS:             0 RPM
Chipset:         5313 RPM
Water_Flow:         0 RPM
Chipset:          +68.0°C
CPU:              +47.0°C
Motherboard:      +42.0°C
T_Sensor:         -40.0°C
VRM:              +47.0°C
Water_In:         -40.0°C
Water_Out:        -40.0°C
Water_Block:      -40.0°C
Water_Block_Out:  -40.0°C
T_sensor_2:       +33.0°C
Extra_1:          -40.0°C
Extra_2:          -40.0°C
Extra_3:          -40.0°C
CPU:               9.00 A
zeule commented 2 years ago

Mostly me being caught up in other stuff. I also read some introduction doc for ACPI and DSDT, but don't understand a lot. I was wondering if there was info in there to identify other sensors.

The previous generation of ASUS boards had full hardware monitoring solution implemented in the DSDT table, now they just provide WMI functions to read Super I/O and EC ports for their Windows software. However, this information is surely present somewhere in .CAP files, which can be decompiled. I'm talking about the hardware monitor in BIOS, of course. But seems like to locate that information one needs hacking skills and time I'm lacking.

nabajour commented 2 years ago

The previous generation of ASUS boards had full hardware monitoring solution implemented in the DSDT table, now they just provide WMI functions to read Super I/O and EC ports for their Windows software. However, this information is surely present somewhere in .CAP files, which can be decompiled. I'm talking about the hardware monitor in BIOS, of course.

Thanks for the pointers! One more rabbit hole to go down when I find some time. Some guys did decompilation of the BIOS at overclockers.net, maybe there is more info over there.

But seems like to locate that information one needs hacking skills and time I'm lacking.

I totally understand. Thanks for doing this work!

zeule commented 2 years ago

Thanks for the pointers! One more rabbit hole to go down when I find some time. Some guys did decompilation of the BIOS at overclockers.net, maybe there is more info over there.

That would bring this driver to a whole new level, because one can download BIOS files for any model.

I totally understand. Thanks for doing this work!

Thank you for the valuable contribution!