[PATCH 06/10] arm64: dts: amlogic: meson-s4: add the CPU thermal sensor and zone

christian.koever-draxl at student.uibk.ac.at christian.koever-draxl at student.uibk.ac.at
Fri Nov 6 02:46:55 PST 2026


From: Christian Stefan Kövér-Draxl <ckoever at outlook.de>

Add the CPU temperature sensor with its bus and functional clocks; it
reads its calibration through the secure monitor. Add a CPU thermal
zone with a passive trip that throttles the GPU, which shares the die,
and a hot and a critical trip. The CPUs can join the passive trip once
CPU frequency scaling is in place.

Signed-off-by: Christian Stefan Kövér-Draxl <ckoever at outlook.de>
---
 arch/arm64/boot/dts/amlogic/meson-s4.dtsi | 48 +++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-s4.dtsi b/arch/arm64/boot/dts/amlogic/meson-s4.dtsi
index 69105c8abf12..1e8b845b80c3 100644
--- a/arch/arm64/boot/dts/amlogic/meson-s4.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-s4.dtsi
@@ -11,6 +11,7 @@
 #include <dt-bindings/clock/amlogic,s4-peripherals-clkc.h>
 #include <dt-bindings/power/meson-s4-power.h>
 #include <dt-bindings/reset/amlogic,meson-s4-reset.h>
+#include <dt-bindings/thermal/thermal.h>
 
 / {
 	cpus {
@@ -748,6 +749,17 @@ gpio_intc: interrupt-controller at 4080 {
 					<10 11 12 13 14 15 16 17 18 19 20 21>;
 			};
 
+			cpu_temp: temperature-sensor at 20000 {
+				compatible = "amlogic,s4-thermal";
+				reg = <0x0 0x20000 0x0 0x50>;
+				interrupts = <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&clkc_periphs CLKID_TS_PLL>,
+					 <&clkc_periphs CLKID_TS>;
+				clock-names = "bus", "core";
+				#thermal-sensor-cells = <0>;
+				amlogic,secure-monitor = <&sm 1>;
+			};
+
 			eth_phy: mdio-multiplexer at 28000 {
 				compatible = "amlogic,g12a-mdio-mux";
 				reg = <0x0 0x28000 0x0 0xa4>;
@@ -1025,4 +1037,40 @@ emmc: mmc at fe08c000 {
 			assigned-clock-rates = <24000000>;
 		};
 	};
+
+	thermal-zones {
+		cpu-thermal {
+			polling-delay = <1000>;
+			polling-delay-passive = <100>;
+			thermal-sensors = <&cpu_temp>;
+
+			trips {
+				cpu_passive: cpu-passive {
+					temperature = <85000>;
+					hysteresis = <5000>;
+					type = "passive";
+				};
+
+				cpu_hot: cpu-hot {
+					temperature = <95000>;
+					hysteresis = <5000>;
+					type = "hot";
+				};
+
+				cpu_critical: cpu-critical {
+					temperature = <105000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+			cooling-maps {
+				/* the GPU shares the die and the sensor */
+				map0 {
+					trip = <&cpu_passive>;
+					cooling-device = <&gpu THERMAL_NO_LIMIT
+							  THERMAL_NO_LIMIT>;
+				};
+			};
+		};
+	};
 };
-- 
2.56.0




More information about the linux-arm-kernel mailing list