From e219da138ae68e4d772277ab910d1590d42c70cd Mon Sep 17 00:00:00 2001 From: Yi-Wei Wang Date: Sat, 29 Jul 2023 00:52:45 +0800 Subject: [PATCH] [UPSTREAM v6.5]: arm64: tegra: Enable thermal support on Jetson AGX Orin Add thermal zone details and enable the PWM fan as cooling device. Note that this also changes the cooling levels for the PWM fan, which should have no effect, though, because the fan wasn't previously connected to anything and by default would be turned off at probe time. Cherry picked from commit 1d3fbd3d41a6c7552126ce39b81591de942a4207 Bug 3960800 Bug 4035713 Bug 4204722 Acked-by: Jon Hunter Signed-off-by: Thierry Reding Signed-off-by: Yi-Wei Wang Change-Id: Ice10f86ddbbd5c27b1967f1df2d840c69e002651 Reviewed-on: https://git-master.nvidia.com/r/c/device/hardware/nvidia/t23x-public-dts/+/2941395 (cherry picked from commit 2352a5f8220445d209f4ab0584bfcf7cacfa0426) Reviewed-on: https://git-master.nvidia.com/r/c/device/hardware/nvidia/t23x-public-dts/+/2944241 Tested-by: mobile promotions Reviewed-by: mobile promotions --- tegra234-p3701-0000.dtsi | 22 ++++++++++++++++++++++ tegra234-p3737-0000+p3701-0000.dts | 18 +++++++++++++++++- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/tegra234-p3701-0000.dtsi b/tegra234-p3701-0000.dtsi index dfc8c39..51609ba 100644 --- a/tegra234-p3701-0000.dtsi +++ b/tegra234-p3701-0000.dtsi @@ -140,4 +140,26 @@ gpio = <&gpio TEGRA234_MAIN_GPIO(A, 1) GPIO_ACTIVE_LOW>; regulator-boot-on; }; + + thermal-zones { + tj-thermal { + polling-delay = <1000>; + polling-delay-passive = <1000>; + status = "okay"; + + trips { + tj_trip_active0: active-0 { + temperature = <75000>; + hysteresis = <4000>; + type = "active"; + }; + + tj_trip_active1: active-1 { + temperature = <95000>; + hysteresis = <4000>; + type = "active"; + }; + }; + }; + }; }; diff --git a/tegra234-p3737-0000+p3701-0000.dts b/tegra234-p3737-0000+p3701-0000.dts index e9ed6ae..817ac50 100644 --- a/tegra234-p3737-0000+p3701-0000.dts +++ b/tegra234-p3737-0000+p3701-0000.dts @@ -320,7 +320,7 @@ }; pwm-fan { - cooling-levels = <0 95 178 255>; + cooling-levels = <66 215 255>; }; serial { @@ -388,4 +388,20 @@ label = "NVIDIA Jetson AGX Orin APE"; }; + + thermal-zones { + tj-thermal { + cooling-maps { + map-active-0 { + cooling-device = <&fan 0 1>; + trip = <&tj_trip_active0>; + }; + + map-active-1 { + cooling-device = <&fan 1 2>; + trip = <&tj_trip_active1>; + }; + }; + }; + }; };