aboutsummaryrefslogtreecommitdiffstats
path: root/board/gateworks/venice/imx8mm_venice.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/gateworks/venice/imx8mm_venice.c')
-rw-r--r--board/gateworks/venice/imx8mm_venice.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/board/gateworks/venice/imx8mm_venice.c b/board/gateworks/venice/imx8mm_venice.c
index 2a97d55d327..4e05802b6ff 100644
--- a/board/gateworks/venice/imx8mm_venice.c
+++ b/board/gateworks/venice/imx8mm_venice.c
@@ -114,7 +114,8 @@ int board_late_init(void)
led_default_state();
/* Set board serial/model */
- env_set_ulong("serial#", gsc_get_serial());
+ if (!env_get("serial#"))
+ env_set_ulong("serial#", gsc_get_serial());
env_set("model", gsc_get_model());
/* Set fdt_file vars */
@@ -155,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;
}