From b83129f918dedef2f3c075f52a9d3c2acf2abb71 Mon Sep 17 00:00:00 2001 From: Yi-Wei Wang Date: Sat, 29 Jul 2023 00:57:00 +0800 Subject: [PATCH] [UPSTREAM v6.5]: arm64: tegra: Enable thermal support on Jetson Orin NX Enable the TJ thermal zone and hook up cooling maps for the PWM- controlled fan and two trip points. This also removes a duplicate definition of the PWM fan and changes its cooling levels. This 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 a6fb90f0eefb13e2cf18f39f1a84a9ef6054153b Bug 3960800 Bug 4035713 Bug 4204722 Acked-by: Jon Hunter Signed-off-by: Thierry Reding Signed-off-by: Yi-Wei Wang Change-Id: I222e43a16f8853ccec70006b72a40973b5e2cc86 Reviewed-on: https://git-master.nvidia.com/r/c/device/hardware/nvidia/t23x-public-dts/+/2941396 (cherry picked from commit 50b6a5db24e327d8004d18e1f0803a711cdfcad6) Reviewed-on: https://git-master.nvidia.com/r/c/device/hardware/nvidia/t23x-public-dts/+/2944435 Tested-by: mobile promotions Reviewed-by: mobile promotions --- tegra234-p3767.dtsi | 62 +++--------------------------- tegra234-p3768-0000+p3767-0000.dts | 18 ++++++++- 2 files changed, 23 insertions(+), 57 deletions(-) diff --git a/tegra234-p3767.dtsi b/tegra234-p3767.dtsi index bd60478..a8aa6e7 100644 --- a/tegra234-p3767.dtsi +++ b/tegra234-p3767.dtsi @@ -99,73 +99,23 @@ }; thermal-zones { - /* - * This monitoring is far from optimal, but it's good enough - * at this stage. - */ - cpu-thermal { + tj-thermal { polling-delay = <1000>; polling-delay-passive = <1000>; status = "okay"; trips { - critical { - temperature = <104500>; - hysteresis = <0>; - type = "critical"; + tj_trip_active0: active-0 { + temperature = <74000>; + hysteresis = <4000>; + type = "active"; }; - hot { - temperature = <99000>; - hysteresis = <1000>; - type = "hot"; - }; - - board_trip_passive: passive { + tj_trip_active1: active-1 { temperature = <95000>; - hysteresis = <2000>; - type = "passive"; - }; - - board_trip_active2: active-2 { - temperature = <80000>; hysteresis = <4000>; type = "active"; }; - - board_trip_active1: active-1 { - temperature = <65000>; - hysteresis = <4000>; - type = "active"; - }; - - board_trip_active0: active-0 { - temperature = <50000>; - hysteresis = <4000>; - type = "active"; - }; - }; - - cooling-maps { - passive { - cooling-device = <&fan 3 3>; - trip = <&board_trip_passive>; - }; - - active2 { - cooling-device = <&fan 2 3>; - trip = <&board_trip_active2>; - }; - - active1 { - cooling-device = <&fan 1 2>; - trip = <&board_trip_active1>; - }; - - active0 { - cooling-device = <&fan 0 1>; - trip = <&board_trip_active0>; - }; }; }; }; diff --git a/tegra234-p3768-0000+p3767-0000.dts b/tegra234-p3768-0000+p3767-0000.dts index 32eb95d..2f1a7fe 100644 --- a/tegra234-p3768-0000+p3767-0000.dts +++ b/tegra234-p3768-0000+p3767-0000.dts @@ -69,7 +69,7 @@ }; pwm-fan { - cooling-levels = <0 95 178 255>; + cooling-levels = <0 187 255>; }; vdd_3v3_pcie: regulator-vdd-3v3-pcie { @@ -84,4 +84,20 @@ serial { status = "okay"; }; + + 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>; + }; + }; + }; + }; };