Skip to contentSkip to conversation

AMD K8 digital temperature sensor

lm-sensors Rudolf Marek 3 participants 8 messages Jul 3, 2006 – Jul 12, 2006

lore
Share & tools
lore
#0 lore raw

Hello all,

After new specs was released. I discovered that even older AMD K8 have digital temperature sensor.

http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/32559.pdf
(page 177)

I created a device driver for that
http://assembler.cz/download/amd_digital_temp.tar.gz

You need to have AMD K8, up to four different temps can be monitored two in one core...

The driver will create new hwmon device. No userspace support yet. If someone with dual core would test it - I'm interested in results. cat /sys/class/hwmon/hwmon1/device/temp*
ls /sys/class/hwmon/hwmon1/device/temp*
cat /proc/cpuinfo

(replace 1 with correct number please)

"Many thanks" goes to Jean, helping me a lot hunting nasty bugs ;)

Regards
Rudolf

#1 lore raw

Very cool.

My initial tests on Red Hat failed because they don't have HWMON in the kernel yet. So I tried a beta of SLES 10 and it compiled and loaded just fine. I found the temperature files under:

Quoted 1 line

/sys/class/hwmon/hwmon?/device/temp?_input

This system has single core CPU's but there were two hwmon devices (hwmon0, hwmon1) each with a temp1_input. (Perhaps that's because I didn't apply the kernel patch?)

This system also has IPMI (rather than lm_sensors.. :( ) so I plotted the new readings against the IPMI readings. For one CPU the digital sensor is higher, for the other it's lower...

http://www.mindspring.com/~ppokorny/temps-k8.png

Do the data sheets mention if these values are on the "Tcontrol" scale or are they supposed to be accurate measurements? Do they need to be adjusted by the CPU Tcontrol offsets?

Awesome,
:v)

Signature · 4 lines
Philip Pokorny, Director of Engineering, RHCE
Tel: 415-370-0835   Fax: 415-954-2899   Toll Free: 888-PENGUIN
PENGUIN COMPUTING, INC.
www.penguincomputing.com
Quoted 33 lines · Rudolf Marek

Hello all,

After new specs was released. I discovered that even older AMD K8 have digital temperature sensor.

http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/32559.pdf
(page 177)

I created a device driver for that
http://assembler.cz/download/amd_digital_temp.tar.gz

You need to have AMD K8, up to four different temps can be monitored two in one core...

The driver will create new hwmon device. No userspace support yet. If someone with dual core would test it - I'm interested in results. cat /sys/class/hwmon/hwmon1/device/temp*
ls /sys/class/hwmon/hwmon1/device/temp*
cat /proc/cpuinfo

(replace 1 with correct number please)

"Many thanks" goes to Jean, helping me a lot hunting nasty bugs ;)

Regards
Rudolf

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

#2 lore raw
In reply to Rudolf Marek
Quoted 1 line · Philip Pokorny

Very cool.

Yeah I like it too on my opteron 144 ;)

Quoted 10 lines

My initial tests on Red Hat failed because they don't have HWMON in the kernel yet. So I tried a beta of SLES 10 and it compiled and loaded just fine. I found the temperature files under:

Quoted 1 line

/sys/class/hwmon/hwmon?/device/temp?_input

This system has single core CPU's but there were two hwmon devices (hwmon0, hwmon1) each with a temp1_input. (Perhaps that's because I didn't apply the kernel patch?)

Hmm that is strange? Maybe you two cpus? (so two PCI devices), one for each CPU.

Quoted 5 lines

This system also has IPMI (rather than lm_sensors.. :( ) so I plotted the new readings against the IPMI readings. For one CPU the digital sensor is higher, for the other it's lower...

http://www.mindspring.com/~ppokorny/temps-k8.png

Looks good.

Quoted 3 lines

Do the data sheets mention if these values are on the "Tcontrol" scale or are they supposed to be accurate measurements? Do they need to be adjusted by the CPU Tcontrol offsets?

I belive not. You need adjustments just if you are using external device to measure the demp (ie some diode input of any chip ;)

Regards
Rudolf

#3 lore raw
In reply to Rudolf Marek

Hi all,

I have updated the archive at http://assembler.cz/download/amd_digital_temp.tar.gz

So it supports the userspace too ;)

There was a little problem with PCI support to libsensors but it seems I solved it somehow. I'm attaching the patch here too.

It adds new bus of type PCI and does not change the "address" which is scalar. Instead it "concatenates" the PCI addr together.

0000:00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control

k8temp-pci-0183
Adapter: PCI adapter
Core0Temp: +47?C

Regards
Rudolf

-------------- next part --------------
A non-text attachment was scrubbed...
Name: add_pci_and_k8temp.patch
Type: text/x-patch
Size: 8333 bytes
Desc: not available
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20060706/cec73032/attachment-0001.bin

#4 lore raw
In reply to Rudolf Marek

Hi Rudolf,

Quoted 9 lines

After new specs was released. I discovered that even older AMD K8 have digital temperature sensor.

http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/32559.pdf
(page 177)

I created a device driver for that
http://assembler.cz/download/amd_digital_temp.tar.gz

Quoted 8 lines

You need to have AMD K8, up to four different temps can be monitored two in one core...

The driver will create new hwmon device. No userspace support yet. If someone with dual core would test it - I'm interested in results. cat /sys/class/hwmon/hwmon1/device/temp*
ls /sys/class/hwmon/hwmon1/device/temp*
cat /proc/cpuinfo

I'll attempt to apply this to my kernel tonight. I have an Athlon 64 X2, so I can give you dual-core results. The temperatures reported by the W83627EHF have puzzled me, because I thought I was getting two readings from the CPU. Why is that?

Quoted 4 lines

(replace 1 with correct number please)

"Many thanks" goes to Jean, helping me a lot hunting nasty bugs ;)

David

#5 lore raw
In reply to Rudolf Marek

Hi Rudolf,

Attached is a zip file containing the results of the k8temp driver on my machine. It compiles and installs with no problems. The temperature readings do not compare to what the w83627ehf reports. In the zip file is comp_temp.gif which plots the results. It seems the digital temperature sensors are located nearer the surface of the chip, or perhaps are isolated thermally somehow, since they respond much faster to a change in the load average. I did not test whether the temperatures respond differently to a load applied to just one CPU. Also, I do not know why the w83627ehf reports two temperatures from the athlon 64 x2. It may be the processor has two analog temperature pins. However, the temperatures are always within 1 degree C of each other.

David

Quoted 15 lines · Rudolf Marek

Hi all,

I have updated the archive at http://assembler.cz/download/amd_digital_temp.tar.gz

So it supports the userspace too ;)

There was a little problem with PCI support to libsensors but it seems I solved it somehow. I'm attaching the patch here too.

It adds new bus of type PCI and does not change the "address" which is scalar. Instead it "concatenates" the PCI addr together.

0000:00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control

Quoted 6 lines

k8temp-pci-0183
Adapter: PCI adapter
Core0Temp: +47?C

Regards
Rudolf

-------------- next part --------------
A non-text attachment was scrubbed...
Name: comp_temp_athlon64_x2.zip
Type: application/zip
Size: 165197 bytes
Desc: not available
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20060711/bd9325e4/attachment-0001.zip

#6 lore raw
In reply to Rudolf Marek
Quoted 9 lines · David Hubbard

Hi Rudolf,

Attached is a zip file containing the results of the k8temp driver on my machine. It compiles and installs with no problems. The temperature readings do not compare to what the w83627ehf reports. In the zip file is comp_temp.gif which plots the results. It seems the digital temperature sensors are located nearer the surface of the chip, or perhaps are isolated thermally somehow, since they respond much faster to a change in the load average.

Yes they should be somewhere in the core imho.

Quoted 5 lines

I did not test whether the
temperatures respond differently to a load applied to just one CPU. Also, I do not know why the w83627ehf reports two temperatures from the athlon 64 x2. It may be the processor has two analog temperature pins.

Yes it has two analog pins.

Quoted 2 lines

However, the temperatures are always within 1 degree C of each other.

I think thats because of the load balancing.

Many thanks for the test. Now we know:

1) it works on single core
2) it works on dualcore
3) it works on 2x CPU
4) it shoud work on 2x dualcore ;)

Just a curios did you test with latest version :) ? (it has dword reads for temps)

Regards
Rudolf

#7 lore raw
In reply to Rudolf Marek

Hi Rudolf,

Quoted 9 lines
Quoted 7 lines

Attached is a zip file containing the results of the k8temp driver on my machine. It compiles and installs with no problems. The temperature readings do not compare to what the w83627ehf reports. In the zip file is comp_temp.gif which plots the results. It seems the digital temperature sensors are located nearer the surface of the chip, or perhaps are isolated thermally somehow, since they respond much faster to a change in the load average.

Yes they should be somewhere in the core imho.

It looks like there are four sensors then?

Quoted 6 lines
Quoted 5 lines

I did not test whether the
temperatures respond differently to a load applied to just one CPU. Also, I do not know why the w83627ehf reports two temperatures from the athlon 64 x2. It may be the processor has two analog temperature pins.

Quoted 6 lines

Yes it has two analog pins.

Quoted 2 lines

However, the temperatures are always within 1 degree C of each other.

I think thats because of the load balancing.

I could test that, I don't think it's load balancing, but I don't have any data to back it up.

Quoted 8 lines

Many thanks for the test. Now we know:

1) it works on single core
2) it works on dualcore
3) it works on 2x CPU
4) it shoud work on 2x dualcore ;)

Just a curios did you test with latest version :) ? (it has dword reads for temps)

I'll double-check, but I downloaded
http://assembler.cz/download/amd_digital_temp.tar.gz on Friday.

David