public inbox for linux-rockchip@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 0/2] arm64: dts: rockchip: Fan updates for Radxa Rock 5C
@ 2025-01-20 19:22 Alexey Charkov
  2025-01-20 19:22 ` [PATCH 1/2] arm64: dts: rockchip: Add finer-grained PWM states for the fan on " Alexey Charkov
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Alexey Charkov @ 2025-01-20 19:22 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner
  Cc: devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
	Alexey Charkov

Couple of small additions to the recently added Radxa Rock 5C device tree
to improve cooling control using the onboard PWM fan, similar to other
Radxa boards already in mainline

Signed-off-by: Alexey Charkov <alchark@gmail.com>
---
Alexey Charkov (2):
      arm64: dts: rockchip: Add finer-grained PWM states for the fan on Rock 5C
      arm64: dts: rockchip: Enable automatic fan control on Radxa Rock 5C

 arch/arm64/boot/dts/rockchip/rk3588s-rock-5c.dts | 34 ++++++++++++++++++++++--
 1 file changed, 32 insertions(+), 2 deletions(-)
---
base-commit: 4ec376748558ba132a2a49513acd3b08774384e3
change-id: 20250120-rock-5c-fan-16d85b3abbc7

Best regards,
-- 
Alexey Charkov <alchark@gmail.com>


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/2] arm64: dts: rockchip: Add finer-grained PWM states for the fan on Rock 5C
  2025-01-20 19:22 [PATCH 0/2] arm64: dts: rockchip: Fan updates for Radxa Rock 5C Alexey Charkov
@ 2025-01-20 19:22 ` Alexey Charkov
  2025-01-20 20:08   ` Dragan Simic
  2025-01-20 19:22 ` [PATCH 2/2] arm64: dts: rockchip: Enable automatic fan control on Radxa " Alexey Charkov
  2025-02-03  8:15 ` [PATCH 0/2] arm64: dts: rockchip: Fan updates for " Heiko Stuebner
  2 siblings, 1 reply; 6+ messages in thread
From: Alexey Charkov @ 2025-01-20 19:22 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner
  Cc: devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
	Alexey Charkov

Radxa Heatsink 6540B, which is the official cooling accessory for the
Rock 5C board, includes a small 5V fan, which in my testing spins up
reliably at a PWM setting of 24 (out of 255). It is also quite loud
at the current minimum setting of 64, and noticeably less so at 24.

Introduce two intermediate PWM states at the lower end of the fan's
operating range to enable better balance between noise and cooling.

Note further that, in my testing, having the fan run at 44 is enough
to keep the system from thermal throttling with sustained 100% load
on its 8 CPU cores (in 22C ambient temperature and no case)

Signed-off-by: Alexey Charkov <alchark@gmail.com>
---
 arch/arm64/boot/dts/rockchip/rk3588s-rock-5c.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3588s-rock-5c.dts b/arch/arm64/boot/dts/rockchip/rk3588s-rock-5c.dts
index 9b14d5383cdc16947c955b1c6e2a32a50c5df3e6..1b66a69cf0f8795d7305852fa7fef3d0672ada7f 100644
--- a/arch/arm64/boot/dts/rockchip/rk3588s-rock-5c.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3588s-rock-5c.dts
@@ -71,7 +71,7 @@ led-1 {
 	fan {
 		compatible = "pwm-fan";
 		#cooling-cells = <2>;
-		cooling-levels = <0 64 128 192 255>;
+		cooling-levels = <0 24 44 64 128 192 255>;
 		fan-supply = <&vcc_5v0>;
 		pwms = <&pwm3 0 10000 0>;
 	};

-- 
2.48.1


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] arm64: dts: rockchip: Enable automatic fan control on Radxa Rock 5C
  2025-01-20 19:22 [PATCH 0/2] arm64: dts: rockchip: Fan updates for Radxa Rock 5C Alexey Charkov
  2025-01-20 19:22 ` [PATCH 1/2] arm64: dts: rockchip: Add finer-grained PWM states for the fan on " Alexey Charkov
@ 2025-01-20 19:22 ` Alexey Charkov
  2025-01-20 20:12   ` Dragan Simic
  2025-02-03  8:15 ` [PATCH 0/2] arm64: dts: rockchip: Fan updates for " Heiko Stuebner
  2 siblings, 1 reply; 6+ messages in thread
From: Alexey Charkov @ 2025-01-20 19:22 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner
  Cc: devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
	Alexey Charkov

Add the necessary cooling map to enable the kernel's thermal subsystem
to manage the fan speed automatically depending on the overall SoC
package temperature on Radxa Rock 5C

Signed-off-by: Alexey Charkov <alchark@gmail.com>
---
 arch/arm64/boot/dts/rockchip/rk3588s-rock-5c.dts | 32 +++++++++++++++++++++++-
 1 file changed, 31 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3588s-rock-5c.dts b/arch/arm64/boot/dts/rockchip/rk3588s-rock-5c.dts
index 1b66a69cf0f8795d7305852fa7fef3d0672ada7f..6e56d7704cbe0dc06242cb39df56b2fc9d6bc774 100644
--- a/arch/arm64/boot/dts/rockchip/rk3588s-rock-5c.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3588s-rock-5c.dts
@@ -68,7 +68,7 @@ led-1 {
 		};
 	};
 
-	fan {
+	fan: fan {
 		compatible = "pwm-fan";
 		#cooling-cells = <2>;
 		cooling-levels = <0 24 44 64 128 192 255>;
@@ -417,6 +417,36 @@ rgmii_phy1: ethernet-phy@1 {
 	};
 };
 
+&package_thermal {
+	polling-delay = <1000>;
+
+	trips {
+		package_fan0: package-fan0 {
+			temperature = <55000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+
+		package_fan1: package-fan1 {
+			temperature = <65000>;
+			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 THERMAL_NO_LIMIT>;
+		};
+	};
+};
+
 &pcie2x1l2 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pcie20x1_2_perstn_m0>;

-- 
2.48.1


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] arm64: dts: rockchip: Add finer-grained PWM states for the fan on Rock 5C
  2025-01-20 19:22 ` [PATCH 1/2] arm64: dts: rockchip: Add finer-grained PWM states for the fan on " Alexey Charkov
@ 2025-01-20 20:08   ` Dragan Simic
  0 siblings, 0 replies; 6+ messages in thread
From: Dragan Simic @ 2025-01-20 20:08 UTC (permalink / raw)
  To: Alexey Charkov
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner,
	devicetree, linux-arm-kernel, linux-rockchip, linux-kernel

Hello Alexey,

On 2025-01-20 20:22, Alexey Charkov wrote:
> Radxa Heatsink 6540B, which is the official cooling accessory for the
> Rock 5C board, includes a small 5V fan, which in my testing spins up
> reliably at a PWM setting of 24 (out of 255). It is also quite loud
> at the current minimum setting of 64, and noticeably less so at 24.
> 
> Introduce two intermediate PWM states at the lower end of the fan's
> operating range to enable better balance between noise and cooling.
> 
> Note further that, in my testing, having the fan run at 44 is enough
> to keep the system from thermal throttling with sustained 100% load
> on its 8 CPU cores (in 22C ambient temperature and no case)
> 
> Signed-off-by: Alexey Charkov <alchark@gmail.com>

Thanks for the patch, it's looking good to me and the explanations
are fine.  Please, feel free to include

Acked-by: Dragan Simic <dsimic@manjaro.org>

> ---
>  arch/arm64/boot/dts/rockchip/rk3588s-rock-5c.dts | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/boot/dts/rockchip/rk3588s-rock-5c.dts
> b/arch/arm64/boot/dts/rockchip/rk3588s-rock-5c.dts
> index
> 9b14d5383cdc16947c955b1c6e2a32a50c5df3e6..1b66a69cf0f8795d7305852fa7fef3d0672ada7f
> 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3588s-rock-5c.dts
> +++ b/arch/arm64/boot/dts/rockchip/rk3588s-rock-5c.dts
> @@ -71,7 +71,7 @@ led-1 {
>  	fan {
>  		compatible = "pwm-fan";
>  		#cooling-cells = <2>;
> -		cooling-levels = <0 64 128 192 255>;
> +		cooling-levels = <0 24 44 64 128 192 255>;
>  		fan-supply = <&vcc_5v0>;
>  		pwms = <&pwm3 0 10000 0>;
>  	};

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] arm64: dts: rockchip: Enable automatic fan control on Radxa Rock 5C
  2025-01-20 19:22 ` [PATCH 2/2] arm64: dts: rockchip: Enable automatic fan control on Radxa " Alexey Charkov
@ 2025-01-20 20:12   ` Dragan Simic
  0 siblings, 0 replies; 6+ messages in thread
From: Dragan Simic @ 2025-01-20 20:12 UTC (permalink / raw)
  To: Alexey Charkov
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner,
	devicetree, linux-arm-kernel, linux-rockchip, linux-kernel

Hello Alexey,

On 2025-01-20 20:22, Alexey Charkov wrote:
> Add the necessary cooling map to enable the kernel's thermal subsystem
> to manage the fan speed automatically depending on the overall SoC
> package temperature on Radxa Rock 5C
> 
> Signed-off-by: Alexey Charkov <alchark@gmail.com>
> ---
>  arch/arm64/boot/dts/rockchip/rk3588s-rock-5c.dts | 32 
> +++++++++++++++++++++++-
>  1 file changed, 31 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/boot/dts/rockchip/rk3588s-rock-5c.dts
> b/arch/arm64/boot/dts/rockchip/rk3588s-rock-5c.dts
> index
> 1b66a69cf0f8795d7305852fa7fef3d0672ada7f..6e56d7704cbe0dc06242cb39df56b2fc9d6bc774
> 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3588s-rock-5c.dts
> +++ b/arch/arm64/boot/dts/rockchip/rk3588s-rock-5c.dts
> @@ -68,7 +68,7 @@ led-1 {
>  		};
>  	};
> 
> -	fan {
> +	fan: fan {
>  		compatible = "pwm-fan";
>  		#cooling-cells = <2>;
>  		cooling-levels = <0 24 44 64 128 192 255>;
> @@ -417,6 +417,36 @@ rgmii_phy1: ethernet-phy@1 {
>  	};
>  };
> 
> +&package_thermal {
> +	polling-delay = <1000>;
> +
> +	trips {
> +		package_fan0: package-fan0 {
> +			temperature = <55000>;
> +			hysteresis = <2000>;
> +			type = "active";
> +		};
> +
> +		package_fan1: package-fan1 {
> +			temperature = <65000>;
> +			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 THERMAL_NO_LIMIT>;
> +		};
> +	};
> +};
> +
>  &pcie2x1l2 {
>  	pinctrl-names = "default";
>  	pinctrl-0 = <&pcie20x1_2_perstn_m0>;

Thanks for the patch, it follows the usual approach for keeping
the fan noise down, and it's looking good to me.  Please, feel
free to include

Reviewed-by: Dragan Simic <dsimic@manjaro.org>

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/2] arm64: dts: rockchip: Fan updates for Radxa Rock 5C
  2025-01-20 19:22 [PATCH 0/2] arm64: dts: rockchip: Fan updates for Radxa Rock 5C Alexey Charkov
  2025-01-20 19:22 ` [PATCH 1/2] arm64: dts: rockchip: Add finer-grained PWM states for the fan on " Alexey Charkov
  2025-01-20 19:22 ` [PATCH 2/2] arm64: dts: rockchip: Enable automatic fan control on Radxa " Alexey Charkov
@ 2025-02-03  8:15 ` Heiko Stuebner
  2 siblings, 0 replies; 6+ messages in thread
From: Heiko Stuebner @ 2025-02-03  8:15 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Alexey Charkov
  Cc: Heiko Stuebner, devicetree, linux-arm-kernel, linux-rockchip,
	linux-kernel


On Mon, 20 Jan 2025 23:22:45 +0400, Alexey Charkov wrote:
> Couple of small additions to the recently added Radxa Rock 5C device tree
> to improve cooling control using the onboard PWM fan, similar to other
> Radxa boards already in mainline
> 
> 

Applied, thanks!

[1/2] arm64: dts: rockchip: Add finer-grained PWM states for the fan on Rock 5C
      commit: 6ed35e6ff556626734c400fff5a636b38b91fe19
[2/2] arm64: dts: rockchip: Enable automatic fan control on Radxa Rock 5C
      commit: cd5681e63fb9887bd05d4ef59151d6a6b39c9d33

Best regards,
-- 
Heiko Stuebner <heiko@sntech.de>

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-02-03  8:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-20 19:22 [PATCH 0/2] arm64: dts: rockchip: Fan updates for Radxa Rock 5C Alexey Charkov
2025-01-20 19:22 ` [PATCH 1/2] arm64: dts: rockchip: Add finer-grained PWM states for the fan on " Alexey Charkov
2025-01-20 20:08   ` Dragan Simic
2025-01-20 19:22 ` [PATCH 2/2] arm64: dts: rockchip: Enable automatic fan control on Radxa " Alexey Charkov
2025-01-20 20:12   ` Dragan Simic
2025-02-03  8:15 ` [PATCH 0/2] arm64: dts: rockchip: Fan updates for " Heiko Stuebner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox