]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
arm64: dts: ti: k3-am62a: Enable CPU freq throttling on thermal alert
authorDaniel Schultz <d.schultz@phytec.de>
Tue, 6 May 2025 11:41:33 +0000 (04:41 -0700)
committerNishanth Menon <nm@ti.com>
Fri, 9 May 2025 11:18:30 +0000 (06:18 -0500)
Enable throttling down the CPU frequency when an alert temperature
threshold (lower than the critical threshold) is reached.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Bryan Brattlof <bb@ti.com>
Link: https://lore.kernel.org/r/20250506114134.3514899-1-d.schultz@phytec.de
Signed-off-by: Nishanth Menon <nm@ti.com>
arch/arm64/boot/dts/ti/k3-am62a-thermal.dtsi
arch/arm64/boot/dts/ti/k3-am62a7.dtsi

index c7486fb2a5b45cfa2bd7798eb4746ad2af8c390a..3aa127157d242286824f670c48a76b29e25d9f76 100644 (file)
@@ -12,12 +12,29 @@ thermal_zones: thermal-zones {
                thermal-sensors = <&wkup_vtm0 0>;
 
                trips {
+                       main0_alert: main0-alert {
+                               temperature = <115000>;
+                               hysteresis = <2000>;
+                               type = "passive";
+                       };
+
                        main0_crit: main0-crit {
                                temperature = <125000>; /* 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 {
@@ -26,25 +43,59 @@ thermal_zones: thermal-zones {
                thermal-sensors = <&wkup_vtm0 1>;
 
                trips {
+                       main1_alert: main1-alert {
+                               temperature = <115000>;
+                               hysteresis = <2000>;
+                               type = "passive";
+                       };
+
                        main1_crit: main1-crit {
                                temperature = <125000>; /* 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>;
+                       };
+               };
        };
 
        main2_thermal: main2-thermal {
-              polling-delay-passive = <250>;   /* milliSeconds */
-              polling-delay = <500>;           /* milliSeconds */
-              thermal-sensors = <&wkup_vtm0 2>;
+               polling-delay-passive = <250>;  /* milliSeconds */
+               polling-delay = <500>;          /* milliSeconds */
+               thermal-sensors = <&wkup_vtm0 2>;
 
                trips {
+                       main2_alert: main2-alert {
+                               temperature = <115000>;
+                               hysteresis = <2000>;
+                               type = "passive";
+                       };
+
                        main2_crit: main2-crit {
                                temperature = <125000>; /* milliCelsius */
                                hysteresis = <2000>;    /* milliCelsius */
                                type = "critical";
                        };
                };
+
+               cooling-maps {
+                       map0 {
+                               trip = <&main2_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>;
+                       };
+               };
        };
 };
index 6c99221beb6bd8e5ad93888e6b659cc6e08fb679..b6e5eee993706d6e868ead810202c90e69cd0394 100644 (file)
@@ -50,6 +50,7 @@
                        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 @@
                        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 @@
                        next-level-cache = <&L2_0>;
                        operating-points-v2 = <&a53_opp_table>;
                        clocks = <&k3_clks 137 0>;
+                       #cooling-cells = <2>;
                };
 
                cpu3: cpu@3 {
                        next-level-cache = <&L2_0>;
                        operating-points-v2 = <&a53_opp_table>;
                        clocks = <&k3_clks 138 0>;
+                       #cooling-cells = <2>;
                };
        };