• Guenter Roeck's avatar
    hwmon: (k10temp) Display up to eight sets of CCD temperatures · fd8bdb23
    Guenter Roeck authored
    In HWiNFO, we see support for Tccd1, Tccd3, Tccd5, and Tccd7 temperature
    sensors on Zen2 based Threadripper CPUs. Checking register maps on
    Threadripper 3970X confirms SMN register addresses and values for those
    sensors.
    
    Register values observed in an idle system:
    
    0x059950: 00000000 00000abc 00000000 00000ad8
    0x059960: 00000000 00000ade 00000000 00000ae4
    
    Under load:
    
    0x059950: 00000000 00000c02 00000000 00000c14
    0x059960: 00000000 00000c30 00000000 00000c22
    
    More analysis shows that EPYC CPUs support up to 8 CCD temperature
    sensors. EPYC 7601 supports three CCD temperature sensors. Unlike
    Zen2 CPUs, the register space in Zen1 CPUs supports a maximum of four
    sensors, so only search for a maximum of four sensors on Zen1 CPUs.
    
    On top of that, in thm_10_0_sh_mask.h in the Linux kernel, we find
    definitions for THM_DIE{1-3}_TEMP__VALID_MASK, set to 0x00000800, as well
    as matching SMN addresses. This lets us conclude that bit 11 of the
    respective registers is a valid bit. With this assumption, the temperature
    offset is now 49 degrees C. This conveniently matches the documented
    temperature offset for Tdie, again suggesting that above registers indeed
    report temperatures sensor values. Assume that bit 11 is indeed a valid
    bit, and add support for the additional sensors.
    
    With this patch applied, output from 3970X (idle) looks as follows:
    
    k10temp-pci-00c3
    Adapter: PCI adapter
    Tdie:         +55.9°C
    Tctl:         +55.9°C
    Tccd1:        +39.8°C
    Tccd3:        +43.8°C
    Tccd5:        +43.8°C
    Tccd7:        +44.8°C
    Tested-by: default avatarMichael Larabel <michael@phoronix.com>
    Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
    fd8bdb23
k10temp.c 16.7 KB