aboutsummaryrefslogtreecommitdiff
path: root/drivers/thermal
diff options
context:
space:
mode:
authorTim Harvey <tharvey@gateworks.com>2021-02-05 16:11:05 -0800
committerStefano Babic <sbabic@denx.de>2021-03-01 10:21:36 +0100
commitdeb78ff34ec0c188c433e9b1280a3deecc4eec28 (patch)
tree8cfdb7c3e4651d3effd8a8366aa2b7cfa0ae6d7a /drivers/thermal
parent1ce6e10c61c7d74fce79749ef37066dcf5b52b41 (diff)
downloadu-boot-deb78ff34ec0c188c433e9b1280a3deecc4eec28.zip
u-boot-deb78ff34ec0c188c433e9b1280a3deecc4eec28.tar.gz
u-boot-deb78ff34ec0c188c433e9b1280a3deecc4eec28.tar.bz2
thermal: imx_tmu: enable monitoring and default alert/critical
Set default critical/alert temperature and enabling monoitoring. Without calling imx_tmu_enable_msite() monitoring will not be enabled and read_temperature will return 0. Additionally without setting alert temperature will cause imx_tmu_get_temp() to spin indefiniately thinking the system needs to cool. This resolves the board spinning endlessly when enabling IMX_TMU in the SPL. Reviewed-by: Fabio Estevam <festevam@gmail.com> Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Diffstat (limited to 'drivers/thermal')
-rw-r--r--drivers/thermal/imx_tmu.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/thermal/imx_tmu.c b/drivers/thermal/imx_tmu.c
index 02cefec..07766ba 100644
--- a/drivers/thermal/imx_tmu.c
+++ b/drivers/thermal/imx_tmu.c
@@ -344,6 +344,7 @@ static int imx_tmu_bind(struct udevice *dev)
ofnode node, offset;
const char *name;
const void *prop;
+ int minc, maxc;
debug("%s dev name %s\n", __func__, dev->name);
@@ -352,6 +353,10 @@ static int imx_tmu_bind(struct udevice *dev)
return 0;
pdata->zone_node = 1;
+ /* default alert/crit temps based on temp grade */
+ get_cpu_temp_grade(&minc, &maxc);
+ pdata->critical = maxc * 1000;
+ pdata->alert = (maxc - 10) * 1000;
node = ofnode_path("/thermal-zones");
ofnode_for_each_subnode(offset, node) {
@@ -443,6 +448,7 @@ static int imx_tmu_probe(struct udevice *dev)
if (pdata->zone_node) {
imx_tmu_init(dev);
imx_tmu_calibration(dev);
+ imx_tmu_enable_msite(dev);
} else {
imx_tmu_enable_msite(dev);
}