diff options
author | Peng Fan <peng.fan@nxp.com> | 2024-09-19 12:01:34 +0800 |
---|---|---|
committer | Fabio Estevam <festevam@gmail.com> | 2024-09-19 00:12:41 -0300 |
commit | d0fe80890ab1bee431ffaed5e75f35dfb5054b7b (patch) | |
tree | e1e010249891c07620dc175e7539affe1440b64b /arch/arm/mach-imx/imx8m | |
parent | 5ee773e60b3f5e024d1177d4be52c07d741c228d (diff) | |
download | u-boot-d0fe80890ab1bee431ffaed5e75f35dfb5054b7b.tar.gz |
imx: Generalize fixup_thermal_trips
i.MX8M and i.MX9 have duplicated fixup_thermal_trips, so move it
to arch/arm/mach-imx/fdt.c to avoid duplicated code.
The critial temperature point for i.MX9 set to "maxc - 5" back to give
some margin.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'arch/arm/mach-imx/imx8m')
-rw-r--r-- | arch/arm/mach-imx/imx8m/soc.c | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c index b8a026fb840..46974bf0618 100644 --- a/arch/arm/mach-imx/imx8m/soc.c +++ b/arch/arm/mach-imx/imx8m/soc.c @@ -1215,48 +1215,6 @@ static int cleanup_nodes_for_efi(void *blob) return 0; } -static int fixup_thermal_trips(void *blob, const char *name) -{ - int minc, maxc; - int node, trip; - - node = fdt_path_offset(blob, "/thermal-zones"); - if (node < 0) - return node; - - node = fdt_subnode_offset(blob, node, name); - if (node < 0) - return node; - - node = fdt_subnode_offset(blob, node, "trips"); - if (node < 0) - return node; - - get_cpu_temp_grade(&minc, &maxc); - - fdt_for_each_subnode(trip, blob, node) { - const char *type; - int temp, ret; - - type = fdt_getprop(blob, trip, "type", NULL); - if (!type) - continue; - - temp = 0; - if (!strcmp(type, "critical")) - temp = 1000 * maxc; - else if (!strcmp(type, "passive")) - temp = 1000 * (maxc - 10); - if (temp) { - ret = fdt_setprop_u32(blob, trip, "temperature", temp); - if (ret) - return ret; - } - } - - return 0; -} - #define OPTEE_SHM_SIZE 0x00400000 static int ft_add_optee_node(void *fdt, struct bd_info *bd) { |