[PATCH] arm64: dts: ti: k3-am62: enable cpu freq throttling on thermal alert

From: A. Zini
Date: Wed Aug 14 2024 - 17:44:19 EST


From: Alessandro Zini <alessandro.zini@xxxxxxxxxxx>

Enable throttling down the cpu frequency when an alert temperature
threshold (lower than the critical threshold) is reached.

Signed-off-by: Alessandro Zini <alessandro.zini@xxxxxxxxxxx>
---
arch/arm64/boot/dts/ti/k3-am62-thermal.dtsi | 34 +++++++++++++++++++++
arch/arm64/boot/dts/ti/k3-am625.dtsi | 4 +++
2 files changed, 38 insertions(+)

diff --git a/arch/arm64/boot/dts/ti/k3-am62-thermal.dtsi b/arch/arm64/boot/dts/ti/k3-am62-thermal.dtsi
index a358757e26f0..c1683bbb241d 100644
--- a/arch/arm64/boot/dts/ti/k3-am62-thermal.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-am62-thermal.dtsi
@@ -9,12 +9,29 @@ main0_thermal: main0-thermal {
thermal-sensors = <&wkup_vtm0 0>;

trips {
+ main0_alert: main0-alert {
+ temperature = <95000>;
+ hysteresis = <2000>;
+ type = "passive";
+ };
+
main0_crit: main0-crit {
temperature = <105000>; /* milliCelsius */
hysteresis = <2000>; /* milliCelsius */
type = "critical";
};
};
+
+ cooling-maps {
+ map0 {
+ trip = <&main0_alert>;
+ cooling-device =
+ <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+ <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+ <&cpu2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+ <&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+ };
+ };
};

main1_thermal: main1-thermal {
@@ -23,11 +40,28 @@ main1_thermal: main1-thermal {
thermal-sensors = <&wkup_vtm0 1>;

trips {
+ main1_alert: main1-alert {
+ temperature = <95000>;
+ hysteresis = <2000>;
+ type = "passive";
+ };
+
main1_crit: main1-crit {
temperature = <105000>; /* milliCelsius */
hysteresis = <2000>; /* milliCelsius */
type = "critical";
};
};
+
+ cooling-maps {
+ map0 {
+ trip = <&main1_alert>;
+ cooling-device =
+ <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+ <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+ <&cpu2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+ <&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+ };
+ };
};
};
diff --git a/arch/arm64/boot/dts/ti/k3-am625.dtsi b/arch/arm64/boot/dts/ti/k3-am625.dtsi
index 4193c2b3eed6..091aebb41dd9 100644
--- a/arch/arm64/boot/dts/ti/k3-am625.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-am625.dtsi
@@ -50,6 +50,7 @@ cpu0: cpu@0 {
next-level-cache = <&L2_0>;
operating-points-v2 = <&a53_opp_table>;
clocks = <&k3_clks 135 0>;
+ #cooling-cells = <2>;
};

cpu1: cpu@1 {
@@ -66,6 +67,7 @@ cpu1: cpu@1 {
next-level-cache = <&L2_0>;
operating-points-v2 = <&a53_opp_table>;
clocks = <&k3_clks 136 0>;
+ #cooling-cells = <2>;
};

cpu2: cpu@2 {
@@ -82,6 +84,7 @@ cpu2: cpu@2 {
next-level-cache = <&L2_0>;
operating-points-v2 = <&a53_opp_table>;
clocks = <&k3_clks 137 0>;
+ #cooling-cells = <2>;
};

cpu3: cpu@3 {
@@ -98,6 +101,7 @@ cpu3: cpu@3 {
next-level-cache = <&L2_0>;
operating-points-v2 = <&a53_opp_table>;
clocks = <&k3_clks 138 0>;
+ #cooling-cells = <2>;
};
};

--
2.46.0