Read CPU temperature in u-boot

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

Read CPU temperature in u-boot

Jump to solution
2,593 Views
ko-hey
Senior Contributor II

Hi all

My customer is using i.MX6S and L3.10.17.

I want to check whether the value changes or not when I changed TEMPERATURE_HOT parameter in soc.c.

Does i.MX6's register change when user changed TEMPERATURE_HOT parameter in soc.c ?

I guess that it will change the value of TEMPERATURE_HOT when user changed TEMPERATURE_HOT parameter in soc.c.

Am I correct ?

If my understanding is wrong, is it just reading the value of the temperature sensor?

Ko-hey

Original Attachment has been moved to: soc.c.zip

Labels (3)
0 Kudos
1 Solution
1,619 Views
BiyongSUN
NXP Employee
NXP Employee

It  is to set a hot point to  compare to the value gets from thermal sensor, to decide in the uboot stage if the temperature if it is fine for boot to  the next stage here is linux.

 

void check_cpu_temperature(void)
{
int cpu_tmp = 0;

cpu_tmp = read_cpu_temperature();
while (cpu_tmp > TEMPERATURE_MIN && cpu_tmp < TEMPERATURE_MAX) {
if (cpu_tmp >= TEMPERATURE_HOT) {
printf("CPU is %d C, too hot to boot, waiting...\n",
cpu_tmp);
udelay(5000000);
cpu_tmp = read_cpu_temperature();
} else
break;
}
if (cpu_tmp > TEMPERATURE_MIN && cpu_tmp < TEMPERATURE_MAX)
printf("CPU:   Temperature %d C, calibration data: 0x%x\n",
cpu_tmp, fuse);
else
printf("CPU:   Temperature: can't get valid data!\n");
}

View solution in original post

0 Kudos
2 Replies
1,620 Views
BiyongSUN
NXP Employee
NXP Employee

It  is to set a hot point to  compare to the value gets from thermal sensor, to decide in the uboot stage if the temperature if it is fine for boot to  the next stage here is linux.

 

void check_cpu_temperature(void)
{
int cpu_tmp = 0;

cpu_tmp = read_cpu_temperature();
while (cpu_tmp > TEMPERATURE_MIN && cpu_tmp < TEMPERATURE_MAX) {
if (cpu_tmp >= TEMPERATURE_HOT) {
printf("CPU is %d C, too hot to boot, waiting...\n",
cpu_tmp);
udelay(5000000);
cpu_tmp = read_cpu_temperature();
} else
break;
}
if (cpu_tmp > TEMPERATURE_MIN && cpu_tmp < TEMPERATURE_MAX)
printf("CPU:   Temperature %d C, calibration data: 0x%x\n",
cpu_tmp, fuse);
else
printf("CPU:   Temperature: can't get valid data!\n");
}

0 Kudos
1,619 Views
ko-hey
Senior Contributor II

Could someone follow and answer this question ?

Ko-hey

0 Kudos