arm64: dts: allwinner: h6: Add cooling map for GPU
authorClément Péron <peron.clem@gmail.com>
Tue, 6 Sep 2022 15:30:31 +0000 (17:30 +0200)
committerJernej Skrabec <jernej.skrabec@gmail.com>
Thu, 8 Sep 2022 20:04:15 +0000 (22:04 +0200)
Add a simple cooling map for the GPU.

This cooling map come from the vendor kernel 4.9 with a
2°C hysteresis added.

Signed-off-by: Clément Péron <peron.clem@gmail.com>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Link: https://lore.kernel.org/r/20220906153034.153321-3-peron.clem@gmail.com
arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi

index 5a28303d3d4c62c99d144132315566ee75990dd0..53f6660656ac59ef98273edfbf1435786920bb91 100644 (file)
                        clocks = <&ccu CLK_GPU>, <&ccu CLK_BUS_GPU>;
                        clock-names = "core", "bus";
                        resets = <&ccu RST_BUS_GPU>;
+                       #cooling-cells = <2>;
                        status = "disabled";
                };
 
                };
 
                gpu-thermal {
-                       polling-delay-passive = <0>;
-                       polling-delay = <0>;
+                       polling-delay-passive = <1000>;
+                       polling-delay = <2000>;
                        thermal-sensors = <&ths 1>;
+
+                       trips {
+                               gpu_alert0: gpu-alert-0 {
+                                       temperature = <95000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
+                               gpu_alert1: gpu-alert-1 {
+                                       temperature = <100000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
+                               gpu_alert2: gpu-alert-2 {
+                                       temperature = <105000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
+                               gpu-crit {
+                                       temperature = <115000>;
+                                       hysteresis = <0>;
+                                       type = "critical";
+                               };
+                       };
+
+                       cooling-maps {
+                               // Forbid the GPU to go over 756MHz
+                               map0 {
+                                       trip = <&gpu_alert0>;
+                                       cooling-device = <&gpu 1 THERMAL_NO_LIMIT>;
+                               };
+
+                               // Forbid the GPU to go over 624MHz
+                               map1 {
+                                       trip = <&gpu_alert1>;
+                                       cooling-device = <&gpu 2 THERMAL_NO_LIMIT>;
+                               };
+
+                               // Forbid the GPU to go over 576MHz
+                               map2 {
+                                       trip = <&gpu_alert2>;
+                                       cooling-device = <&gpu 3 THERMAL_NO_LIMIT>;
+                               };
+                       };
                };
        };
 };