thermal: imx_thermal: increase critical temperature threshold
Subsystems (2)
PATCH 1/1 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.
Before:
CPU Temperature is 101 C, too hot to boot, waiting... CPU Temperature is 101 C, too hot to boot, waiting...
After:
CPU Temperature (101C) too close to max (105C) waiting... CPU Temperature (101C) too close to max (105C) waiting...
--- drivers/thermal/imx_thermal.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
drivers/thermal/imx_thermal.c +9 -6
@@ -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" , - cpu_tmp); +if (cpu_tmp >= priv->critical) { +printf ("CPU Temperature (%dC) too close to max (%dC)" , + cpu_tmp, priv->maxc); +puts (" waiting...\n" );udelay (5000000 ); 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;enable_thermal_clk ();
Signature · 1 line
1.9.1
PATCH 1/1 thermal: imx_thermal: increase critical temperature threshold
________________________________________
From: Tim Harvey <[email protected]>
Sent: Thursday, May 21, 2015 11:40 PM
To: Stefano Babic
Cc: u-boot at lists.denx.de; Stefan Roese; Eric Nelson; Heiko Schocher; Nikita Kiryanov; Jon Nettleton; Liu Hui-R64343; Li Ye-B37916; Estevam Fabio-R49496; Christian Gmeiner; Markus Niebel; Fan Peng-B51431
Subject: [U-Boot] [PATCH] 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.
Before:
CPU Temperature is 101 C, too hot to boot, waiting... CPU Temperature is 101 C, too hot to boot, waiting...
After:
CPU Temperature (101C) too close to max (105C) waiting... CPU Temperature (101C) too close to max (105C) waiting...
--- drivers/thermal/imx_thermal.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
Looks good to me, thus:
Jason Liu
drivers/thermal/imx_thermal.c +9 -6
@@ -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" , - cpu_tmp); +if (cpu_tmp >= priv->critical) { +printf ("CPU Temperature (%dC) too close to max (%dC)" , + cpu_tmp, priv->maxc); +puts (" waiting...\n" );udelay (5000000 ); 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;enable_thermal_clk ();
--
1.9.1
PATCH 1/1 thermal: imx_thermal: increase critical temperature threshold
In reply to Tim HarveyQuoted 72 lines · Tim Harvey
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_DETLAfor 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.Before:
CPU Temperature is 101 C, too hot to boot, waiting... CPU Temperature is 101 C, too hot to boot, waiting...After:
CPU Temperature (101C) too close to max (105C) waiting... CPU Temperature (101C) too close to max (105C) waiting...Cc Stefan Roese <[email protected]>Cc Eric Nelson <[email protected]>Cc Heiko Schocher <[email protected]>Cc Nikita Kiryanov <[email protected]>Cc Jon Nettleton <[email protected]>Cc Jason Liu <[email protected]>Cc Ye Li <[email protected]>Cc Fabio Estevam <[email protected]>Cc Christian Gmeiner <[email protected]>Cc Markus Niebel <[email protected]>Cc Peng Fan <[email protected]>Signed-off-by Tim Harvey <[email protected]>--- drivers/thermal/imx_thermal.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)drivers/thermal/imx_thermal.c +7
-4@@ -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" , - cpu_tmp); +if (cpu_tmp >= priv->critical) { +printf ("CPU Temperature (%dC) too close to max (%dC)" , + cpu_tmp, priv->maxc); +puts (" waiting...\n" );udelay (5000000 ); cpu_tmp =read_cpu_temperature (dev); }else {@@ -164,9 +167,9 @@ static int imx_thermal_probe(struct udevice *dev)return -EPERM ;
drivers/thermal/imx_thermal.c static int imx_thermal_probe(struct udevice *dev) · line 175
Quoted 10 lines
drivers/thermal/imx_thermal.c +2
-2} -/* 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;enable_thermal_clk ();
Applied to u-boot-imx, thanks!
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================