From: Aastha Pandey <[email protected]>

Unlike the CPU, the GPU does not throttle its speed automatically when
it reaches high temperatures.

Set up GPU cooling on Nord by throttling the Adreno 753 GPU when it
reaches 105°C. Label the GPU thermal zones and their passive trip
points, map them to the GPU as a cooling device, and add a passive
polling delay so the thermal framework can monitor the zones while
throttling.

Signed-off-by: Aastha Pandey <[email protected]>
Signed-off-by: Akhil P Oommen <[email protected]>
---
 arch/arm64/boot/dts/qcom/nord-embedded.dtsi | 177 ++++++++++++++++++++++++++++
 arch/arm64/boot/dts/qcom/nord.dtsi          |  80 ++++++-------
 2 files changed, 217 insertions(+), 40 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/nord-embedded.dtsi 
b/arch/arm64/boot/dts/qcom/nord-embedded.dtsi
index 4379092b7bf8..23370007c974 100644
--- a/arch/arm64/boot/dts/qcom/nord-embedded.dtsi
+++ b/arch/arm64/boot/dts/qcom/nord-embedded.dtsi
@@ -17,6 +17,7 @@
 #include <dt-bindings/interconnect/qcom,nord-rpmh.h>
 #include <dt-bindings/power/qcom,rpmhpd.h>
 #include <dt-bindings/soc/qcom,rpmh-rsc.h>
+#include <dt-bindings/thermal/thermal.h>
 
 #include "nord.dtsi"
 
@@ -2042,3 +2043,179 @@ opp-403000000 {
                };
        };
 };
+
+&gpu_0_0_0_thermal {
+       polling-delay-passive = <10>;
+
+       cooling-maps {
+               map0 {
+                       trip = <&gpu_0_0_0_alert0>;
+                       cooling-device = <&gpu_0 THERMAL_NO_LIMIT 
THERMAL_NO_LIMIT>;
+               };
+       };
+};
+
+&gpu_0_0_1_thermal {
+       polling-delay-passive = <10>;
+
+       cooling-maps {
+               map0 {
+                       trip = <&gpu_0_0_1_alert0>;
+                       cooling-device = <&gpu_0 THERMAL_NO_LIMIT 
THERMAL_NO_LIMIT>;
+               };
+       };
+};
+
+&gpu_0_1_0_thermal {
+       polling-delay-passive = <10>;
+
+       cooling-maps {
+               map0 {
+                       trip = <&gpu_0_1_0_alert0>;
+                       cooling-device = <&gpu_0 THERMAL_NO_LIMIT 
THERMAL_NO_LIMIT>;
+               };
+       };
+};
+
+&gpu_0_1_1_thermal {
+       polling-delay-passive = <10>;
+
+       cooling-maps {
+               map0 {
+                       trip = <&gpu_0_1_1_alert0>;
+                       cooling-device = <&gpu_0 THERMAL_NO_LIMIT 
THERMAL_NO_LIMIT>;
+               };
+       };
+};
+
+&gpuss_0_1_0_thermal {
+       polling-delay-passive = <10>;
+
+       cooling-maps {
+               map0 {
+                       trip = <&gpuss_0_1_0_alert0>;
+                       cooling-device = <&gpu_0 THERMAL_NO_LIMIT 
THERMAL_NO_LIMIT>;
+               };
+       };
+};
+
+&gpuss_0_1_1_thermal {
+       polling-delay-passive = <10>;
+
+       cooling-maps {
+               map0 {
+                       trip = <&gpuss_0_1_1_alert0>;
+                       cooling-device = <&gpu_0 THERMAL_NO_LIMIT 
THERMAL_NO_LIMIT>;
+               };
+       };
+};
+
+&gpuss_0_1_thermal {
+       polling-delay-passive = <10>;
+
+       cooling-maps {
+               map0 {
+                       trip = <&gpuss_0_1_alert0>;
+                       cooling-device = <&gpu_0 THERMAL_NO_LIMIT 
THERMAL_NO_LIMIT>;
+               };
+       };
+};
+
+&gpuss_0_thermal {
+       polling-delay-passive = <10>;
+
+       cooling-maps {
+               map0 {
+                       trip = <&gpuss0_alert0>;
+                       cooling-device = <&gpu_0 THERMAL_NO_LIMIT 
THERMAL_NO_LIMIT>;
+               };
+       };
+};
+
+&gpuss_1_0_1_thermal {
+       polling-delay-passive = <10>;
+
+       cooling-maps {
+               map0 {
+                       trip = <&gpuss_1_0_1_alert0>;
+                       cooling-device = <&gpu_0 THERMAL_NO_LIMIT 
THERMAL_NO_LIMIT>;
+               };
+       };
+};
+
+&gpuss_1_1_0_thermal {
+       polling-delay-passive = <10>;
+
+       cooling-maps {
+               map0 {
+                       trip = <&gpuss_1_1_0_alert0>;
+                       cooling-device = <&gpu_0 THERMAL_NO_LIMIT 
THERMAL_NO_LIMIT>;
+               };
+       };
+};
+
+&gpuss_1_1_1_thermal {
+       polling-delay-passive = <10>;
+
+       cooling-maps {
+               map0 {
+                       trip = <&gpuss_1_1_1_alert0>;
+                       cooling-device = <&gpu_0 THERMAL_NO_LIMIT 
THERMAL_NO_LIMIT>;
+               };
+       };
+};
+
+&gpuss_1_thermal {
+       polling-delay-passive = <10>;
+
+       cooling-maps {
+               map0 {
+                       trip = <&gpuss1_alert0>;
+                       cooling-device = <&gpu_0 THERMAL_NO_LIMIT 
THERMAL_NO_LIMIT>;
+               };
+       };
+};
+
+&gpuss_2_0_1_thermal {
+       polling-delay-passive = <10>;
+
+       cooling-maps {
+               map0 {
+                       trip = <&gpuss_2_0_1_alert0>;
+                       cooling-device = <&gpu_0 THERMAL_NO_LIMIT 
THERMAL_NO_LIMIT>;
+               };
+       };
+};
+
+&gpuss_2_1_0_thermal {
+       polling-delay-passive = <10>;
+
+       cooling-maps {
+               map0 {
+                       trip = <&gpuss_2_1_0_alert0>;
+                       cooling-device = <&gpu_0 THERMAL_NO_LIMIT 
THERMAL_NO_LIMIT>;
+               };
+       };
+};
+
+&gpuss_2_1_1_thermal {
+       polling-delay-passive = <10>;
+
+       cooling-maps {
+               map0 {
+                       trip = <&gpuss_2_1_1_alert0>;
+                       cooling-device = <&gpu_0 THERMAL_NO_LIMIT 
THERMAL_NO_LIMIT>;
+               };
+       };
+};
+
+&gpuss_2_thermal {
+       polling-delay-passive = <10>;
+
+       cooling-maps {
+               map0 {
+                       trip = <&gpuss2_alert0>;
+                       cooling-device = <&gpu_0 THERMAL_NO_LIMIT 
THERMAL_NO_LIMIT>;
+               };
+       };
+};
diff --git a/arch/arm64/boot/dts/qcom/nord.dtsi 
b/arch/arm64/boot/dts/qcom/nord.dtsi
index 147d8e595a3a..b032d1d2ad9b 100644
--- a/arch/arm64/boot/dts/qcom/nord.dtsi
+++ b/arch/arm64/boot/dts/qcom/nord.dtsi
@@ -4101,13 +4101,13 @@ trip-point1 {
                        };
                };
 
-               gpuss-0-thermal {
+               gpuss_0_thermal: gpuss-0-thermal {
                        polling-delay-passive = <0>;
                        polling-delay = <0>;
                        thermal-sensors = <&tsens6 1>;
 
                        trips {
-                               trip-point0 {
+                               gpuss0_alert0: trip-point0 {
                                        temperature = <105000>;
                                        hysteresis = <10000>;
                                        type = "passive";
@@ -4121,13 +4121,13 @@ trip-point1 {
                        };
                };
 
-               gpuss-1-thermal {
+               gpuss_1_thermal: gpuss-1-thermal {
                        polling-delay-passive = <0>;
                        polling-delay = <0>;
                        thermal-sensors = <&tsens6 2>;
 
                        trips {
-                               trip-point0 {
+                               gpuss1_alert0: trip-point0 {
                                        temperature = <105000>;
                                        hysteresis = <10000>;
                                        type = "passive";
@@ -4141,13 +4141,13 @@ trip-point1 {
                        };
                };
 
-               gpuss-2-thermal {
+               gpuss_2_thermal: gpuss-2-thermal {
                        polling-delay-passive = <0>;
                        polling-delay = <0>;
                        thermal-sensors = <&tsens6 3>;
 
                        trips {
-                               trip-point0 {
+                               gpuss2_alert0: trip-point0 {
                                        temperature = <105000>;
                                        hysteresis = <10000>;
                                        type = "passive";
@@ -4161,13 +4161,13 @@ trip-point1 {
                        };
                };
 
-               gpu-0-0-0-thermal {
+               gpu_0_0_0_thermal: gpu-0-0-0-thermal {
                        polling-delay-passive = <0>;
                        polling-delay = <0>;
                        thermal-sensors = <&tsens6 4>;
 
                        trips {
-                               trip-point0 {
+                               gpu_0_0_0_alert0: trip-point0 {
                                        temperature = <105000>;
                                        hysteresis = <10000>;
                                        type = "passive";
@@ -4181,13 +4181,13 @@ trip-point1 {
                        };
                };
 
-               gpuss-1-0-thermal {
+               gpuss_1_0_thermal: gpuss-1-0-thermal {
                        polling-delay-passive = <0>;
                        polling-delay = <0>;
                        thermal-sensors = <&tsens6 5>;
 
                        trips {
-                               trip-point0 {
+                               gpuss_1_0_alert0: trip-point0 {
                                        temperature = <105000>;
                                        hysteresis = <10000>;
                                        type = "passive";
@@ -4201,13 +4201,13 @@ trip-point1 {
                        };
                };
 
-               gpuss-1-1-thermal {
+               gpuss_1_1_thermal: gpuss-1-1-thermal {
                        polling-delay-passive = <0>;
                        polling-delay = <0>;
                        thermal-sensors = <&tsens6 6>;
 
                        trips {
-                               trip-point0 {
+                               gpuss_1_1_alert0: trip-point0 {
                                        temperature = <105000>;
                                        hysteresis = <10000>;
                                        type = "passive";
@@ -4321,13 +4321,13 @@ trip-point1 {
                        };
                };
 
-               gpuss-0-1-1-thermal {
+               gpuss_0_1_1_thermal: gpuss-0-1-1-thermal {
                        polling-delay-passive = <0>;
                        polling-delay = <0>;
                        thermal-sensors = <&tsens6 12>;
 
                        trips {
-                               trip-point0 {
+                               gpuss_0_1_1_alert0: trip-point0 {
                                        temperature = <105000>;
                                        hysteresis = <10000>;
                                        type = "passive";
@@ -4341,13 +4341,13 @@ trip-point1 {
                        };
                };
 
-               gpuss-1-1-1-thermal {
+               gpuss_1_1_1_thermal: gpuss-1-1-1-thermal {
                        polling-delay-passive = <0>;
                        polling-delay = <0>;
                        thermal-sensors = <&tsens6 13>;
 
                        trips {
-                               trip-point0 {
+                               gpuss_1_1_1_alert0: trip-point0 {
                                        temperature = <105000>;
                                        hysteresis = <10000>;
                                        type = "passive";
@@ -4361,13 +4361,13 @@ trip-point1 {
                        };
                };
 
-               gpuss-2-1-1-thermal {
+               gpuss_2_1_1_thermal: gpuss-2-1-1-thermal {
                        polling-delay-passive = <0>;
                        polling-delay = <0>;
                        thermal-sensors = <&tsens6 14>;
 
                        trips {
-                               trip-point0 {
+                               gpuss_2_1_1_alert0: trip-point0 {
                                        temperature = <105000>;
                                        hysteresis = <10000>;
                                        type = "passive";
@@ -4381,13 +4381,13 @@ trip-point1 {
                        };
                };
 
-               gpu-0-1-1-thermal {
+               gpu_0_1_1_thermal: gpu-0-1-1-thermal {
                        polling-delay-passive = <0>;
                        polling-delay = <0>;
                        thermal-sensors = <&tsens6 15>;
 
                        trips {
-                               trip-point0 {
+                               gpu_0_1_1_alert0: trip-point0 {
                                        temperature = <105000>;
                                        hysteresis = <10000>;
                                        type = "passive";
@@ -4421,13 +4421,13 @@ trip-point1 {
                        };
                };
 
-               gpuss-0-1-0-thermal {
+               gpuss_0_1_0_thermal: gpuss-0-1-0-thermal {
                        polling-delay-passive = <0>;
                        polling-delay = <0>;
                        thermal-sensors = <&tsens7 1>;
 
                        trips {
-                               trip-point0 {
+                               gpuss_0_1_0_alert0: trip-point0 {
                                        temperature = <105000>;
                                        hysteresis = <10000>;
                                        type = "passive";
@@ -4441,13 +4441,13 @@ trip-point1 {
                        };
                };
 
-               gpuss-1-1-0-thermal {
+               gpuss_1_1_0_thermal: gpuss-1-1-0-thermal {
                        polling-delay-passive = <0>;
                        polling-delay = <0>;
                        thermal-sensors = <&tsens7 2>;
 
                        trips {
-                               trip-point0 {
+                               gpuss_1_1_0_alert0: trip-point0 {
                                        temperature = <105000>;
                                        hysteresis = <10000>;
                                        type = "passive";
@@ -4461,13 +4461,13 @@ trip-point1 {
                        };
                };
 
-               gpuss-2-1-0-thermal {
+               gpuss_2_1_0_thermal: gpuss-2-1-0-thermal {
                        polling-delay-passive = <0>;
                        polling-delay = <0>;
                        thermal-sensors = <&tsens7 3>;
 
                        trips {
-                               trip-point0 {
+                               gpuss_2_1_0_alert0: trip-point0 {
                                        temperature = <105000>;
                                        hysteresis = <10000>;
                                        type = "passive";
@@ -4481,13 +4481,13 @@ trip-point1 {
                        };
                };
 
-               gpu-0-1-0-thermal {
+               gpu_0_1_0_thermal: gpu-0-1-0-thermal {
                        polling-delay-passive = <0>;
                        polling-delay = <0>;
                        thermal-sensors = <&tsens7 4>;
 
                        trips {
-                               trip-point0 {
+                               gpu_0_1_0_alert0: trip-point0 {
                                        temperature = <105000>;
                                        hysteresis = <10000>;
                                        type = "passive";
@@ -4501,13 +4501,13 @@ trip-point1 {
                        };
                };
 
-               gpuss-1-2-thermal {
+               gpuss_1_2_thermal: gpuss-1-2-thermal {
                        polling-delay-passive = <0>;
                        polling-delay = <0>;
                        thermal-sensors = <&tsens7 5>;
 
                        trips {
-                               trip-point0 {
+                               gpuss_1_2_alert0: trip-point0 {
                                        temperature = <105000>;
                                        hysteresis = <10000>;
                                        type = "passive";
@@ -4521,13 +4521,13 @@ trip-point1 {
                        };
                };
 
-               gpu-1-0-thermal {
+               gpu_1_0_thermal: gpu-1-0-thermal {
                        polling-delay-passive = <0>;
                        polling-delay = <0>;
                        thermal-sensors = <&tsens7 6>;
 
                        trips {
-                               trip-point0 {
+                               gpu_1_0_alert0: trip-point0 {
                                        temperature = <105000>;
                                        hysteresis = <10000>;
                                        type = "passive";
@@ -4641,13 +4641,13 @@ trip-point1 {
                        };
                };
 
-               gpuss-0-1-thermal {
+               gpuss_0_1_thermal: gpuss-0-1-thermal {
                        polling-delay-passive = <0>;
                        polling-delay = <0>;
                        thermal-sensors = <&tsens7 12>;
 
                        trips {
-                               trip-point0 {
+                               gpuss_0_1_alert0: trip-point0 {
                                        temperature = <105000>;
                                        hysteresis = <10000>;
                                        type = "passive";
@@ -4661,13 +4661,13 @@ trip-point1 {
                        };
                };
 
-               gpuss-1-0-1-thermal {
+               gpuss_1_0_1_thermal: gpuss-1-0-1-thermal {
                        polling-delay-passive = <0>;
                        polling-delay = <0>;
                        thermal-sensors = <&tsens7 13>;
 
                        trips {
-                               trip-point0 {
+                               gpuss_1_0_1_alert0: trip-point0 {
                                        temperature = <105000>;
                                        hysteresis = <10000>;
                                        type = "passive";
@@ -4681,13 +4681,13 @@ trip-point1 {
                        };
                };
 
-               gpuss-2-0-1-thermal {
+               gpuss_2_0_1_thermal: gpuss-2-0-1-thermal {
                        polling-delay-passive = <0>;
                        polling-delay = <0>;
                        thermal-sensors = <&tsens7 14>;
 
                        trips {
-                               trip-point0 {
+                               gpuss_2_0_1_alert0: trip-point0 {
                                        temperature = <105000>;
                                        hysteresis = <10000>;
                                        type = "passive";
@@ -4701,13 +4701,13 @@ trip-point1 {
                        };
                };
 
-               gpu-0-0-1-thermal {
+               gpu_0_0_1_thermal: gpu-0-0-1-thermal {
                        polling-delay-passive = <0>;
                        polling-delay = <0>;
                        thermal-sensors = <&tsens7 15>;
 
                        trips {
-                               trip-point0 {
+                               gpu_0_0_1_alert0: trip-point0 {
                                        temperature = <105000>;
                                        hysteresis = <10000>;
                                        type = "passive";

-- 
2.55.0

Reply via email to