Re: reading on-die temperature sensor of AMD A10 5700 processor

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

 



Hi,

Sorry for the verbose email. I am trying to read the temperature value as accurately as possible, that's why.

It is evident that there are some computations happening internally before these values are reported. Here is what I have to say about the 4.5C reported value.

I am using A10 5700 APU amd processor. It has bulldozer architecure (http://www.cpu-world.com/CPUs/Bulldozer/TYPE-A10-Series.html). Bulldozer architecture corresponds to 15h micro-architecture family  (http://en.wikipedia.org/wiki/List_of_AMD_CPU_microarchitectures). So, I looked at the official manual of 15h family http://support.amd.com/us/Processor_TechDocs/42301_15h_Mod_00h-0Fh_BKDG.pdf). And, I found the following:

Page 219 and 393 (figure-14) of the document mention that bits 31:21 (11 bits) of the register D18F3xA4 denote the current temperature of the die as reported by temperature calculation circuit (TCC). The maximum value that could be represented by 11 bits is 2048 (2047, but ignore this for now) and they want to translate that to 256. So, I think the magic number 125 is obtained by computing 256/2048*1000. Line number 66-68 in k10temp.c (as downloaded from the drivers' link) use 125 as the factor to compute the value to be reported. I guess the factor of 1000 would be taken care somewhere else inside the kernel. 

It also means that the lowest resolution of reading the temperature is 0.125C, which might mean that we could get a sub-degree resolution in temperature reading?

I got a little confused about the way temperature-computation is explained on page 393. The interpretation of D18F3xA4[31:21] seems to be different based on the D18F3xA4[17:16] bits. Something similar, but not exactly the same thing, is implemented in k10temp.c in lines 85-90. The value (D18F3xA4[18:16]) is multiplied by 500 and then 52000 is added to it. While, on page 393, I see <(CurTmp[10:2]*0.5)-49>. In line 89 of k10temp.c, the hysteresis is computed as (D18F3xA4[27:24])*500,  i.e. four bits are used. While on page 393, three bits (equivalent to 0.125*8 = 1C) is used as hysteresis. Am I understanding things correctly here?

Also, if I want to apply any further correction to the reported raw values, I guess I just need to put following piece of code in /etc/sensors3.conf file:

-------------------------------------------------------------
chip "k10temp-*"
     compute temp1 (@+correction),(@-correction)
-------------------------------------------------------------

This should add correction to the temp1 value under PCI adapter alone and not to the temp1 value under ISA adapter?

Thanks,
Kapil


On Wed, Aug 14, 2013 at 6:39 PM, Guenter Roeck <linux@xxxxxxxxxxxx> wrote:
On Wed, Aug 14, 2013 at 04:45:43PM -0400, Dev, Kapil wrote:

[ ... ]

> Kapil: After making above changes, I think it seems to work now. Now I am
> getting following output from sensors:
> f71869-isa-0e80
> Adapter: ISA adapter
> in0:         +1.69 V
> in1:         +0.90 V
> in2:         +1.21 V
> in3:         +1.22 V
> in4:         +1.49 V
> in5:         +1.22 V
> in6:         +1.19 V
> in7:         +1.73 V
> in8:         +1.66 V
> fan1:       2177 RPM
> fan2:          0 RPM  ALARM
> fan3:          0 RPM  ALARM
> temp1:       +24.0 C  (high = +85.0 C, hyst = +81.0 C)
>                       (crit = +100.0 C, hyst = +96.0 C)  sensor = thermistor
> temp2:       +32.0 C  (high = +85.0 C, hyst = +81.0 C)
>                       (crit = +100.0 C, hyst = +96.0 C)  sensor = thermistor
> temp3:       +48.0 C  (high = +70.0 C, hyst = +68.0 C)
>                       (crit = +85.0 C, hyst = +83.0 C)  sensor = thermistor
>
> k10temp-pci-00c3
> Adapter: PCI adapter
> temp1:       +4.5 C  (high = +70.0 C, crit = +70.0 C)
>
> I believe temp1 from PCI adapter denotes the core-temperature? But, it is

Correct.

> definitely off by 20-30C; its hard to believe that the temperature would be
> 4.5C under fan based cooling system. I ran a SPEC hmmer benchmark and
> plotted the temperature over time. temp1 seems to change now. I am
> attaching the plots herewith.
>
Yes, that is pretty common with AMD chips.

> Please let me know if there is a way to calibrate the core-temperature.
>
Yes, you'll have to do it in /etc/sensors3.conf. Basically you'll have to
figure out what you think the real temperature is and add it to the raw
temperature provided by the driver.

Guenter

_______________________________________________
lm-sensors mailing list
lm-sensors@xxxxxxxxxxxxxx
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux