arm64: dts: allwinner: h6: Add thermal trip points/cooling map
authorOndrej Jirman <megous@megous.com>
Mon, 20 Apr 2020 13:00:14 +0000 (15:00 +0200)
committerMaxime Ripard <maxime@cerno.tech>
Thu, 23 Apr 2020 09:35:29 +0000 (11:35 +0200)
This enables passive cooling by down-regulating CPU voltage
and frequency.

Signed-off-by: Ondrej Jirman <megous@megous.com>
Signed-off-by: Clément Péron <peron.clem@gmail.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi

index 370e77b86fe14c7e007b53f538b7a3de58905770..7cd10e4a5e2eb087e12f32be073ea1a104068ecc 100644 (file)
@@ -27,6 +27,7 @@
                        enable-method = "psci";
                        clocks = <&ccu CLK_CPUX>;
                        clock-latency-ns = <244144>; /* 8 32k periods */
+                       #cooling-cells = <2>;
                };
 
                cpu1: cpu@1 {
@@ -36,6 +37,7 @@
                        enable-method = "psci";
                        clocks = <&ccu CLK_CPUX>;
                        clock-latency-ns = <244144>; /* 8 32k periods */
+                       #cooling-cells = <2>;
                };
 
                cpu2: cpu@2 {
@@ -45,6 +47,7 @@
                        enable-method = "psci";
                        clocks = <&ccu CLK_CPUX>;
                        clock-latency-ns = <244144>; /* 8 32k periods */
+                       #cooling-cells = <2>;
                };
 
                cpu3: cpu@3 {
@@ -54,6 +57,7 @@
                        enable-method = "psci";
                        clocks = <&ccu CLK_CPUX>;
                        clock-latency-ns = <244144>; /* 8 32k periods */
+                       #cooling-cells = <2>;
                };
        };
 
                        polling-delay-passive = <0>;
                        polling-delay = <0>;
                        thermal-sensors = <&ths 0>;
+
+                       trips {
+                               cpu_alert: cpu-alert {
+                                       temperature = <85000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
+                               cpu-crit {
+                                       temperature = <100000>;
+                                       hysteresis = <0>;
+                                       type = "critical";
+                               };
+                       };
+
+                       cooling-maps {
+                               map0 {
+                                       trip = <&cpu_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>;
+                               };
+                       };
                };
 
                gpu-thermal {