Skip to contentSkip to conversation

imx9: scmi: fix up thermal trip points from the temperature grade

PATCH New Francesco Dolcini 1 participant 1 message Oct 21

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 imx9: scmi: fix up thermal trip points from the temperature grade

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.

---
 arch/arm/mach-imx/imx9/scmi/fdt.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
arch/arm/mach-imx/imx9/scmi/fdt.c +14 -0
index a1d9afbf69ad..be4927fdf173 100644
@@ -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;
 }
 
Signature · 1 line
2.47.3