Commit be56de6f authored by Tim Harvey's avatar Tim Harvey Committed by Stefano Babic
Browse files

thermal: imx_thermal: increase critical temperature threshold

The CPU temperature grade from OTP is now used to define the critical
threshold at which point we busyloop until we are below, however this
threshold is still too low.

Instead of 20C below the max CPU temperature, change it to 5C defined now
by TEMPERATURE_HOT_DETLA for clarity. Rename 'passive' to 'critical'
as that better defines our use case here. Additionally change the output
of the busyloop message to show the max CPU temperature as well as current.

CPU Temperature is 101 C, too hot to boot, waiting...
CPU Temperature is 101 C, too hot to boot, waiting...

CPU Temperature (101C) too close to max (105C) waiting...
CPU Temperature (101C) too close to max (105C) waiting...

Cc: Stefan Roese <>
Cc: Eric Nelson <>
Cc: Heiko Schocher <>
Cc: Nikita Kiryanov <>
Cc: Jon Nettleton <>
Cc: Jason Liu <>
Cc: Ye Li <>
Cc: Fabio Estevam <>
Cc: Christian Gmeiner <>
Cc: Markus Niebel <>
Cc: Peng Fan <>
Signed-off-by: default avatarTim Harvey <>
parent 7254d92e
......@@ -19,6 +19,8 @@
#include <thermal.h>
#include <imx_thermal.h>
/* board will busyloop until this many degrees C below CPU max temperature */
#define TEMPERATURE_HOT_DELTA 5 /* CPU maxT - 5C */
#define FACTOR0 10000000
#define FACTOR1 15976
#define FACTOR2 4297157
......@@ -34,7 +36,7 @@
struct thermal_data {
unsigned int fuse;
int passive;
int critical;
int minc;
int maxc;
......@@ -129,9 +131,10 @@ int imx_thermal_get_temp(struct udevice *dev, int *temp)
cpu_tmp = read_cpu_temperature(dev);
while (cpu_tmp > priv->minc && cpu_tmp < priv->maxc) {
if (cpu_tmp >= priv->passive) {
printf("CPU Temperature is %d C, too hot to boot, waiting...\n",
if (cpu_tmp >= priv->critical) {
printf("CPU Temperature (%dC) too close to max (%dC)",
cpu_tmp, priv->maxc);
puts(" waiting...\n");
cpu_tmp = read_cpu_temperature(dev);
} else {
......@@ -164,9 +167,9 @@ static int imx_thermal_probe(struct udevice *dev)
return -EPERM;
/* set passive cooling temp to max - 20C */
/* set critical cooling temp */
get_cpu_temp_grade(&priv->minc, &priv->maxc);
priv->passive = priv->maxc - 20;
priv->critical = priv->maxc - TEMPERATURE_HOT_DELTA;
priv->fuse = fuse;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment