Read CPU temperature in u-boot

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Read CPU temperature in u-boot

ソリューションへジャンプ
4,214件の閲覧回数
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

ラベル(3)
0 件の賞賛
返信
1 解決策
3,240件の閲覧回数
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 件の賞賛
返信
2 返答(返信)
3,241件の閲覧回数
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 件の賞賛
返信
3,240件の閲覧回数
ko-hey
Senior Contributor II

Could someone follow and answer this question ?

Ko-hey

0 件の賞賛
返信