i.MX28 die temperature

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.MX28 die temperature

2,589 Views
BillRandle
Contributor II

Does anyone have any code (kernel or user space) for reading the internal die temperature on the MX28? I've read the reference manual and know what registers to read, but thought I would check and see if anyone else has already done this before diving in.

    -Bill

Labels (1)
9 Replies

1,447 Views
BillRandle
Contributor II

Thanks for the kernel patch! I appreciate you sharing it.

    -Bill

Pierantonio Tabaro said:

Hi, if someone is interested i have written a driver for having die temp on sysfs.

Is possible to show temp by the command:

root@picomaster ~$ cat /sys/devices/platform/mx_cputemp.0/temp1_*
61
Core 0
root@picomaster ~$


i have duplicated the code for MeasureInternalDieTemperature() and ddi_power_GetDieTemp() because i don't have the battery and related battery module on my kernel.

0 Kudos

1,447 Views
PierantonioTaba
Contributor II

Hi, if someone is interested i have written a driver for having die temp on sysfs.

Is possible to show temp by the command:

root@picomaster ~$ cat /sys/devices/platform/mx_cputemp.0/temp1_*
61
Core 0
root@picomaster ~$


i have duplicated the code for MeasureInternalDieTemperature() and ddi_power_GetDieTemp() because i don't have the battery and related battery module on my kernel.

1,447 Views
dimitarboevski
Contributor II

Thanks for the patch! i modified it slightly to work with the 3.7.0 kernel. all i did is add two old header files (instead of renaming all of the macros in the C files) and fix a virtual address mapping that has changed in the new kernel. i also made it easier to use with scripts - now it only displays one number (temperature in degrees C) which is an average of 3 readings taken at 200ms intervals. That adds a 0.4s delay to the reading but is a bit more precise.


i've attached the patch for the 3.7.0 kernel.

1,447 Views
fabio_estevam
NXP Employee
NXP Employee

Hi Dimitar,

Do you plan to upstream this patch?

1,447 Views
spearson
Contributor III

Dimitar,

If you have not already done so, take a look at the Linux Kernel version 3.8.4.  It has a lot of improvements over 3.7.0 (including some lradc support) that might save you some development time.

Thanks for sharing your development efforts.

0 Kudos

1,447 Views
spearson
Contributor III

Somewhat obvious, but I am adding the kernel configuration process for completeness.

1 - Run ./ltib -m config

2 - Press spacebar to [*] Configure the Kernel

3 - Exit, saving changes.

4 - run ./ltib

5 - Press enter to Enter the Device Drivers --->

6 - Highlight < > Hardware Monitoring Support --->

7 - Press spacebar to Select to include <*> Hardware Monitoring Support--->

This is important as the submenu will be empty if this is not done.

8 - Press enter to Enter the Hardware Monitoring Support Submenu--->

9 - Select MX28 CPU temperature sensor (NEW)

10- Exit, saving changes.

Thanks for your efforts.

1,447 Views
AhmetYUCE
Contributor II
I couldn't find the e-mail received from Freescale support. But as i recall Rth junction to case is pretty small. As an alternative, you can use case temperature as junction temperature. Difference between junction temp and case temp should be <3 degree. Regards Ahmet
0 Kudos

1,447 Views
BillRandle
Contributor II

Thanks, Yuri! I appreciate the pointer to ddi_power_GetDieTemp() and the driver patch!

0 Kudos

1,447 Views
Yuri
NXP Employee
NXP Employee

There is 

ddi_power_GetDieTemp (int16_t *pLow, int16_t *pHigh)

routine to get the temperature.

You may try the enclosed patch  (for 2.6.35_10.12.01 from the BSP team) as an example
how to print internal temperature on console.  
 

0 Kudos