aboutsummaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorTim Harvey2021-08-18 15:24:30 -0700
committerStefano Babic2021-10-07 16:53:50 +0200
commitf8a792e51d17c32b62e957d10be93d6ab9008f53 (patch)
tree1159022173c6efa3a980f070d4057c628cbe025a /board
parentcd7f37666a79d7cc7eaad9815e70568d64ef3115 (diff)
board: gateworks: venice: update thermal temp thresholds per cpu grade
Update the passive/critical thermal zone dt config per CPU temperature grade. Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Diffstat (limited to 'board')
-rw-r--r--board/gateworks/venice/imx8mm_venice.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/board/gateworks/venice/imx8mm_venice.c b/board/gateworks/venice/imx8mm_venice.c
index 46f4bff9253..4e05802b6ff 100644
--- a/board/gateworks/venice/imx8mm_venice.c
+++ b/board/gateworks/venice/imx8mm_venice.c
@@ -156,8 +156,26 @@ int board_mmc_get_env_dev(int devno)
int ft_board_setup(void *blob, struct bd_info *bd)
{
+ int off;
+
/* set board model dt prop */
fdt_setprop_string(blob, 0, "board", gsc_get_model());
+ /* update temp thresholds */
+ off = fdt_path_offset(blob, "/thermal-zones/cpu-thermal/trips");
+ if (off >= 0) {
+ int minc, maxc, prop;
+
+ get_cpu_temp_grade(&minc, &maxc);
+ fdt_for_each_subnode(prop, blob, off) {
+ const char *type = fdt_getprop(blob, prop, "type", NULL);
+
+ if (type && (!strcmp("critical", type)))
+ fdt_setprop_u32(blob, prop, "temperature", maxc * 1000);
+ else if (type && (!strcmp("passive", type)))
+ fdt_setprop_u32(blob, prop, "temperature", (maxc - 10) * 1000);
+ }
+ }
+
return 0;
}