From 94c35337e5d80b59c1073c0dd2f37e046ce37dea Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Thu, 18 Jan 2024 21:02:18 +0100 Subject: [PATCH 1/2] arm64: dts: rockchip: Add the rk3588 thermal zones MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The driver got added back in 45d7b3867a5cabb97fc31f16122cda8540c3a30c, but the dts never got updated, so here it is! I’ve added it to the rk3588s because that’s where most of the definitions are, but I’ve only tested on a rk3588 so maybe there are subtle changes. The TRM also documents slightly different values (in part 1 section 14.5.3) than the driver, but I’ve left the values alone since I have no way to determine which one is (more) correct. Only the CPU is properly mapped, as neither the GPU nor the NPU have been added to the dts for now, I’ve left some TODOs there. All of the thermal zones report almost the same value on my board, I’m not sure if this is due to a programming error or if this is to be expected. Signed-off-by: Emmanuel Gil Peyrot --- arch/arm64/boot/dts/rockchip/rk3588s.dtsi | 180 ++++++++++++++++++++++ 1 file changed, 180 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi index 36b1b7acfe6a..d18319a90b09 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi @@ -436,6 +436,186 @@ scmi_shmem: sram@0 { }; }; + thermal_zones: thermal-zones { + soc-thermal { + polling-delay-passive = <250>; /* milliseconds */ + polling-delay = <1000>; /* milliseconds */ + thermal-sensors = <&tsadc 0>; + + trips { + soc_alert: trip-alert { + temperature = <75000>; + hysteresis = <2000>; + type = "passive"; + }; + soc_crit: trip-crit { + temperature = <85000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + cooling-maps { + map0 { + trip = <&soc_alert>; + cooling-device = <&cpu_b0 0 0>, + <&cpu_b1 0 0>, + <&cpu_b2 0 0>, + <&cpu_b3 0 0>, + <&cpu_l0 0 0>, + <&cpu_l1 0 0>, + <&cpu_l2 0 0>, + <&cpu_l3 0 0>; + }; + }; + }; + + cluster1-thermal { + polling-delay-passive = <250>; /* milliseconds */ + polling-delay = <1000>; /* milliseconds */ + thermal-sensors = <&tsadc 1>; + + trips { + cluster1_alert: trip-alert { + temperature = <75000>; + hysteresis = <2000>; + type = "passive"; + }; + cluster1_crit: trip-crit { + temperature = <85000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + cooling-maps { + map0 { + trip = <&cluster1_alert>; + cooling-device = <&cpu_b0 0 0>, + <&cpu_b1 0 0>; + }; + }; + }; + + cluster2-thermal { + polling-delay-passive = <250>; /* milliseconds */ + polling-delay = <1000>; /* milliseconds */ + thermal-sensors = <&tsadc 2>; + + trips { + cluster2_alert: trip-alert { + temperature = <75000>; + hysteresis = <2000>; + type = "passive"; + }; + cluster2_crit: trip-crit { + temperature = <85000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + cooling-maps { + map0 { + trip = <&cluster2_alert>; + cooling-device = <&cpu_b2 0 0>, + <&cpu_b3 0 0>; + }; + }; + }; + + cluster0-thermal { + polling-delay-passive = <250>; /* milliseconds */ + polling-delay = <1000>; /* milliseconds */ + thermal-sensors = <&tsadc 3>; + + trips { + cluster0_alert: trip-alert { + temperature = <75000>; + hysteresis = <2000>; + type = "passive"; + }; + cluster0_crit: trip-crit { + temperature = <85000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + cooling-maps { + map0 { + trip = <&cluster0_alert>; + cooling-device = <&cpu_l0 0 0>, + <&cpu_l1 0 0>, + <&cpu_l2 0 0>, + <&cpu_l3 0 0>; + }; + }; + }; + + center-thermal { + polling-delay-passive = <250>; /* milliseconds */ + polling-delay = <1000>; /* milliseconds */ + thermal-sensors = <&tsadc 4>; + + trips { + center_alert: trip-alert { + temperature = <75000>; + hysteresis = <2000>; + type = "passive"; + }; + center_crit: trip-crit { + temperature = <85000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + cooling-maps { + /* TODO: what exactly is "center"? */ + }; + }; + + gpu-thermal { + polling-delay-passive = <250>; /* milliseconds */ + polling-delay = <1000>; /* milliseconds */ + thermal-sensors = <&tsadc 5>; + + trips { + gpu_alert: trip-alert { + temperature = <75000>; + hysteresis = <2000>; + type = "passive"; + }; + gpu_crit: trip-crit { + temperature = <85000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + cooling-maps { + /* TODO: Add the GPU here once it is supported. */ + }; + }; + + npu-thermal { + polling-delay-passive = <250>; /* milliseconds */ + polling-delay = <1000>; /* milliseconds */ + thermal-sensors = <&tsadc 6>; + + trips { + npu_alert: trip-alert { + temperature = <75000>; + hysteresis = <2000>; + type = "passive"; + }; + npu_crit: trip-crit { + temperature = <85000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + cooling-maps { + /* TODO: Add the NPU here once it is supported. */ + }; + }; + }; + usb_host0_ehci: usb@fc800000 { compatible = "rockchip,rk3588-ehci", "generic-ehci"; reg = <0x0 0xfc800000 0x0 0x40000>; -- 2.43.0