[PATCH] arm64: dts: rockchip: pwm-fan overlay for NanoPC-T6
From: Hugh Cole-Baker <hidden>
Date: 2025-10-26 19:49:05
Also in:
linux-devicetree, linux-rockchip, lkml
Subsystem:
the rest · Maintainer:
Linus Torvalds
FriendlyELEC offers an optional heatsink and fan addon for the NanoPC-T6 and T6 LTS. Add an overlay which can be applied if the fan is fitted and configures the fan as an active cooling device for the SoC package. Signed-off-by: Hugh Cole-Baker <redacted> --- FriendlyELEC heatsink with fan addon: https://www.friendlyelec.com/index.php?route=product/product&product_id=305 Vendor DT with trip points and PWM duty cycle values: https://github.com/friendlyarm/kernel-rockchip/blob/4944602540b62f5aad139fe602a76cf7c3176128/arch/arm64/boot/dts/rockchip/rk3588-nanopi6-rev01.dts#L75-L90 arch/arm64/boot/dts/rockchip/Makefile | 9 +++ .../dts/rockchip/rk3588-nanopc-t6-fan.dtso | 78 +++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6-fan.dtso
diff --git a/arch/arm64/boot/dts/rockchip/Makefile b/arch/arm64/boot/dts/rockchip/Makefile
index 4cd8ef607f55c..7a67b68a6bb03 100644
--- a/arch/arm64/boot/dts/rockchip/Makefile
+++ b/arch/arm64/boot/dts/rockchip/Makefile@@ -178,6 +178,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-jaguar-ethernet-switch.dtbo dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-jaguar-pre-ict-tester.dtbo dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-reform2.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-nanopc-t6.dtb +dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-nanopc-t6-fan.dtbo dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-nanopc-t6-lts.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-ok3588-c.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-orangepi-5-max.dtb
@@ -271,6 +272,14 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-jaguar-pre-ict-tester.dtb rk3588-jaguar-pre-ict-tester-dtbs := rk3588-jaguar.dtb \ rk3588-jaguar-pre-ict-tester.dtbo +dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-nanopc-t6-with-fan.dtb +rk3588-nanopc-t6-with-fan-dtbs := rk3588-nanopc-t6.dtb \ + rk3588-nanopc-t6-fan.dtbo + +dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-nanopc-t6-lts-with-fan.dtb +rk3588-nanopc-t6-lts-with-fan-dtbs := rk3588-nanopc-t6-lts.dtb \ + rk3588-nanopc-t6-fan.dtbo + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-rock-5b-pcie-ep.dtb rk3588-rock-5b-pcie-ep-dtbs := rk3588-rock-5b.dtb \ rk3588-rock-5b-pcie-ep.dtbo
diff --git a/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6-fan.dtso b/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6-fan.dtso
new file mode 100644
index 0000000000000..08c4782fb4148
--- /dev/null
+++ b/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6-fan.dtso@@ -0,0 +1,78 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/dts-v1/; +/plugin/; + +#include <dt-bindings/thermal/thermal.h> + +&{/} { + fan: pwm-fan { + compatible = "pwm-fan"; + cooling-levels = <0 35 64 100 150 255>; + fan-supply = <&vcc5v0_sys>; + pwms = <&pwm1 0 50000 0>; + #cooling-cells = <2>; + }; +}; + +&package_thermal { + polling-delay = <1000>; + + trips { + package_fan0: package-fan0 { + temperature = <50000>; + hysteresis = <2000>; + type = "active"; + }; + + package_fan1: package-fan1 { + temperature = <55000>; + hysteresis = <2000>; + type = "active"; + }; + + package_fan2: package-fan2 { + temperature = <60000>; + hysteresis = <2000>; + type = "active"; + }; + + package_fan3: package-fan3 { + temperature = <65000>; + hysteresis = <2000>; + type = "active"; + }; + + package_fan4: package-fan4 { + temperature = <70000>; + hysteresis = <2000>; + type = "active"; + }; + }; + + cooling-maps { + map0 { + trip = <&package_fan0>; + cooling-device = <&fan THERMAL_NO_LIMIT 1>; + }; + + map1 { + trip = <&package_fan1>; + cooling-device = <&fan 2 3>; + }; + + map2 { + trip = <&package_fan2>; + cooling-device = <&fan 3 4>; + }; + + map3 { + trip = <&package_fan3>; + cooling-device = <&fan 4 5>; + }; + + map4 { + trip = <&package_fan4>; + cooling-device = <&fan 5 THERMAL_NO_LIMIT>; + }; + }; +};
--
2.50.1 (Apple Git-155)