From fca2d7886c8a2d0ef17fe8b7b5a30629570d1160 Mon Sep 17 00:00:00 2001 From: Aaron Kling Date: Mon, 21 Apr 2025 16:20:03 -0500 Subject: [PATCH] arm64: tegra: Enable PWM fan on P2571 This is based on 6f78a94, which enabled added the fan and thermal zones for the Jetson Nano Devkit. The fan and thermal characteristics of the two devices are similar, so using the same configuration. Signed-off-by: Aaron Kling --- arch/arm64/boot/dts/nvidia/tegra210-p2571.dts | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/arch/arm64/boot/dts/nvidia/tegra210-p2571.dts b/arch/arm64/boot/dts/nvidia/tegra210-p2571.dts index e2a347e57215..7f14e8a394c2 100644 --- a/arch/arm64/boot/dts/nvidia/tegra210-p2571.dts +++ b/arch/arm64/boot/dts/nvidia/tegra210-p2571.dts @@ -1300,4 +1300,78 @@ }; }; }; + + fan: pwm-fan { + compatible = "pwm-fan"; + pwms = <&pwm 3 45334>; + fan-supply = <&vdd_fan>; + interrupt-parent = <&gpio>; + interrupts = ; + + cooling-levels = <0 64 128 255>; + #cooling-cells = <2>; + }; + + vdd_fan: regulator-vdd-fan { + compatible = "regulator-fixed"; + regulator-name = "VDD_FAN"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&gpio TEGRA_GPIO(E, 4) GPIO_ACTIVE_LOW>; + enable-active-high; + + regulator-enable-ramp-delay = <284>; + }; + + thermal-zones { + cpu-thermal { + trips { + cpu_trip_critical: critical { + temperature = <96500>; + hysteresis = <0>; + type = "critical"; + }; + + cpu_trip_hot: hot { + temperature = <70000>; + hysteresis = <2000>; + type = "hot"; + }; + + cpu_trip_active: active { + temperature = <50000>; + hysteresis = <2000>; + type = "active"; + }; + + cpu_trip_passive: passive { + temperature = <30000>; + hysteresis = <2000>; + type = "passive"; + }; + }; + + cooling-maps { + map0 { + cooling-device = <&fan 3 3>; + trip = <&cpu_trip_critical>; + }; + + map1 { + cooling-device = <&fan 2 2>; + trip = <&cpu_trip_hot>; + }; + + map2 { + cooling-device = <&fan 1 1>; + trip = <&cpu_trip_active>; + }; + + map3 { + cooling-device = <&fan 0 0>; + trip = <&cpu_trip_passive>; + }; + }; + }; + }; };