From: Francesco Dolcini <[email protected]>

Adjust the thermal trip points (a55-thermal and ana-thermal) according
to the temperature grade of the SoC (automotive, industrial, ...).

A zone missing from the devicetree is skipped, not every SCMI based
i.MX9 devicetree defines them.

Signed-off-by: Francesco Dolcini <[email protected]>
---
 arch/arm/mach-imx/imx9/scmi/fdt.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/arch/arm/mach-imx/imx9/scmi/fdt.c 
b/arch/arm/mach-imx/imx9/scmi/fdt.c
index a1d9afbf69ad..be4927fdf173 100644
--- a/arch/arm/mach-imx/imx9/scmi/fdt.c
+++ b/arch/arm/mach-imx/imx9/scmi/fdt.c
@@ -620,6 +620,18 @@ static void ft_disable_periph(void *blob, u32 fuse_bank, 
u32 fuse_word,
        }
 }
 
+static void ft_fixup_thermal(void *blob)
+{
+       static const char * const zones[] = { "a55-thermal", "ana-thermal" };
+       int i, ret;
+
+       for (i = 0; i < ARRAY_SIZE(zones); i++) {
+               ret = fixup_thermal_trips(blob, zones[i]);
+               if (ret && ret != -FDT_ERR_NOTFOUND)
+                       printf("Failed to update %s trip(s)\n", zones[i]);
+       }
+}
+
 int ft_system_setup(void *blob, struct bd_info *bd)
 {
        /* Common peripheral disable fuse process */
@@ -628,6 +640,8 @@ int ft_system_setup(void *blob, struct bd_info *bd)
        ft_disable_periph(blob, 2, 3, f19_grp, ARRAY_SIZE(f19_grp), false);
        ft_disable_periph(blob, 2, 4, f20_grp, ARRAY_SIZE(f20_grp), false);
 
+       ft_fixup_thermal(blob);
+
        return 0;
 }
 
-- 
2.47.3

Reply via email to