arm64: tegra: Enable PWM fan on Jetson Nano
authorTamás Szűcs <tszucs@protonmail.ch>
Sun, 8 Dec 2019 19:55:31 +0000 (20:55 +0100)
committerThierry Reding <treding@nvidia.com>
Fri, 10 Jan 2020 15:41:28 +0000 (16:41 +0100)
Enable PWM fan and extend CPU thermal zones for monitoring and fan control.
This will trigger the PWM fan on J15 and cool down the system if necessary.

Signed-off-by: Tamás Szűcs <tszucs@protonmail.ch>
Signed-off-by: Thierry Reding <treding@nvidia.com>
arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dts

index 90381d5..f2a138b 100644 (file)
                };
        };
 
+       fan: fan {
+               compatible = "pwm-fan";
+               pwms = <&pwm 3 45334>;
+
+               cooling-levels = <0 64 128 255>;
+               #cooling-cells = <2>;
+       };
+
+       thermal-zones {
+               cpu {
+                       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 {
+                               cpu-critical {
+                                       cooling-device = <&fan 3 3>;
+                                       trip = <&cpu_trip_critical>;
+                               };
+
+                               cpu-hot {
+                                       cooling-device = <&fan 2 2>;
+                                       trip = <&cpu_trip_hot>;
+                               };
+
+                               cpu-active {
+                                       cooling-device = <&fan 1 1>;
+                                       trip = <&cpu_trip_active>;
+                               };
+
+                               cpu-passive {
+                                       cooling-device = <&fan 0 0>;
+                                       trip = <&cpu_trip_passive>;
+                               };
+                       };
+               };
+       };
+
        gpio-keys {
                compatible = "gpio-keys";