Skip to contentSkip to conversation

arm64: dts: rockchip: add package_thermal for Radxa ROCK 5A/5C

PATCH Superseded FUKAUMI Naoki 2 participants 6 messages Dec 4, 2024 – Dec 9, 2024

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 arm64: dts: rockchip: add package_thermal for Radxa ROCK 5A/5C

add and enable package temperature based active cooling.

---
this patch depends on [1] which depends on [2].

[1] https://patchwork.kernel.org/project/linux-rockchip/cover/[email protected]/
[2] https://patchwork.kernel.org/project/linux-rockchip/patch/[email protected]/

---
 .../boot/dts/rockchip/rk3588s-rock-5.dtsi     | 32 ++++++++++++++++++-
 1 file changed, 31 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/rockchip/rk3588s-rock-5.dtsi +31 -1
index a8f40f43c838..a1cac40d439e 100644
@@ -33,7 +33,7 @@ analog-sound {
 			  "Headphone", "Headphones";
 	};
 
-	fan {
+	fan: fan {
 		compatible = "pwm-fan";
 		#cooling-cells = <2>;
 		cooling-levels = <0 64 128 192 255>;
@@ -379,6 +379,36 @@ rgmii_phy1: ethernet-phy@1 {
 	};
 };
 
+&package_thermal {
+	polling-delay = <1000>;
+
+	trips {
+		package_fan0: package-fan0 {
+			hysteresis = <2000>;
+			temperature = <55000>;
+			type = "active";
+		};
+
+		package_fan1: package-fan1 {
+			hysteresis = <2000>;
+			temperature = <65000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map0 {
+			cooling-device = <&fan THERMAL_NO_LIMIT 1>;
+			trip = <&package_fan0>;
+		};
+
+		map1 {
+			cooling-device = <&fan 2 THERMAL_NO_LIMIT>;
+			trip = <&package_fan1>;
+		};
+	};
+};
+
 &pcie2x1l2 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pcie20x1_2_perstn_m0>,
Signature · 7 lines
2.43.0


_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip
#1 lore raw

PATCH 2/2 arm64: dts: rockchip: fix cooling-levels in pwm-fan for Radxa ROCK 5A/5C

fan behavior is better than current configuration.

---
this patch depends on [1] which depends on [2].

[1] https://patchwork.kernel.org/project/linux-rockchip/cover/[email protected]/
[2] https://patchwork.kernel.org/project/linux-rockchip/patch/[email protected]/

---
 arch/arm64/boot/dts/rockchip/rk3588s-rock-5.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/rockchip/rk3588s-rock-5.dtsi +1 -1
index a1cac40d439e..472b41f0d47f 100644
@@ -36,7 +36,7 @@ analog-sound {
 	fan: fan {
 		compatible = "pwm-fan";
 		#cooling-cells = <2>;
-		cooling-levels = <0 64 128 192 255>;
+		cooling-levels = <0 120 150 180 210 240 255>;
 		fan-supply = <&vcc_5v0>;
 		pwms = <&pwm3 0 60000 0>;
 	};
Signature · 7 lines
2.43.0


_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip
#2 lore raw

Re: [PATCH 2/2] arm64: dts: rockchip: fix cooling-levels in pwm-fan for Radxa ROCK 5A/5C

Hello Fukaumi,

Quoted 1 line · FUKAUMI Naoki

fan behavior is better than current configuration.

Could you, please, describe better what makes this configuration better, which fan make and model are you using, etc.?

Quoted 24 lines

---
this patch depends on [1] which depends on [2].

[1] https://patchwork.kernel.org/project/linux-rockchip/cover/[email protected]/
[2] https://patchwork.kernel.org/project/linux-rockchip/patch/[email protected]/

---
 arch/arm64/boot/dts/rockchip/rk3588s-rock-5.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/rockchip/rk3588s-rock-5.dtsi +1 -1
index a1cac40d439e..472b41f0d47f 100644
@@ -36,7 +36,7 @@ analog-sound {
 	fan: fan {
 		compatible = "pwm-fan";
 		#cooling-cells = <2>;
-		cooling-levels = <0 64 128 192 255>;
+		cooling-levels = <0 120 150 180 210 240 255>;
 		fan-supply = <&vcc_5v0>;
 		pwms = <&pwm3 0 60000 0>;
 	};
#3 lore raw

Re: [PATCH 2/2] arm64: dts: rockchip: fix cooling-levels in pwm-fan for Radxa ROCK 5A/5C

Hi,

thank you for your review!

Quoted 7 lines · Dragan Simic

Hello Fukaumi,

Quoted 1 line · FUKAUMI Naoki

fan behavior is better than current configuration.

Could you, please, describe better what makes this configuration better, which fan make and model are you using, etc.?

I have three Heatshink 2513[1] and I noticed they behave very differently... it's difficult to say which cooling-levels is better or worse with these heatsink.

I'll drop this patch.

Best regards,

[1] https://radxa.com/products/accessories/heatsink-2513

--
FUKAUMI Naoki
Radxa Computer (Shenzhen) Co., Ltd.

Quoted 10 lines
Quoted 10 lines

---
this patch depends on [1] which depends on [2].

[1] https://patchwork.kernel.org/project/linux-rockchip/ cover/[email protected]/
[2] https://patchwork.kernel.org/project/linux-rockchip/ patch/[email protected]/
---
 arch/arm64/boot/dts/rockchip/rk3588s-rock-5.dtsi | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 15 lines
Quoted 6 lines
arch/arm64/boot/dts/rockchip/rk3588s-rock-5.dtsi +0 -0
index a1cac40d439e..472b41f0d47f 100644

arch/arm64/boot/dts/rockchip/rk3588s-rock-5.dtsi analog-sound { · line 42

Quoted 8 lines
arch/arm64/boot/dts/rockchip/rk3588s-rock-5.dtsi +1 -1
@@ -36,7 +36,7 @@ analog-sound {
      fan: fan {
          compatible = "pwm-fan";
          #cooling-cells = <2>;
-        cooling-levels = <0 64 128 192 255>;
+        cooling-levels = <0 120 150 180 210 240 255>;
          fan-supply = <&vcc_5v0>;
          pwms = <&pwm3 0 60000 0>;
      };

_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip

#4 lore raw
In reply to FUKAUMI Naoki

Hello Fukaumi,

Please, see a few comments below.

Quoted 1 line · FUKAUMI Naoki

add and enable package temperature based active cooling.

I'd suggest that you rewrite the patch summary to read like this:

arm64: dts: rockchip: Enable automatic fan control on Rock 5A/5C

and to rewrite the patch description like this, which is a recycled and a bit improved description of the commit 4a152231b050 ("arm64:
dts: rockchip: enable automatic fan control on Rock 5B"):

Link the PWM fan on Radxa ROCK 5A/5C as an active cooling device managed automatically by the thermal subsystem, with a target SoC temperature of 65 oC and a minimum-spin interval from 55 oC to 65 oC, to ensure airflow when the system gets warm.

Quoted 16 lines

---
this patch depends on [1] which depends on [2].

[1] https://patchwork.kernel.org/project/linux-rockchip/cover/[email protected]/
[2] https://patchwork.kernel.org/project/linux-rockchip/patch/[email protected]/

---
 .../boot/dts/rockchip/rk3588s-rock-5.dtsi     | 32 ++++++++++++++++++-
 1 file changed, 31 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/rockchip/rk3588s-rock-5.dtsi +0 -0
index a8f40f43c838..a1cac40d439e 100644

arch/arm64/boot/dts/rockchip/rk3588s-rock-5.dtsi analog-sound { · line 36

Quoted 5 lines
arch/arm64/boot/dts/rockchip/rk3588s-rock-5.dtsi +1 -1
@@ -33,7 +33,7 @@ analog-sound {
 			  "Headphone", "Headphones";
 	};
 
-	fan {
+	fan: fan {

It would be better to use "fan: pwm-fan { ... }", to ensure some kind of consistency with the other similar portions of board dts files.

Quoted 30 lines
arch/arm64/boot/dts/rockchip/rk3588s-rock-5.dtsi +23 -0
 		compatible = "pwm-fan";
 		#cooling-cells = <2>;
 		cooling-levels = <0 64 128 192 255>;
@@ -379,6 +379,36 @@ rgmii_phy1: ethernet-phy@1 {
 	};
 };
 
+&package_thermal {
+	polling-delay = <1000>;
+
+	trips {
+		package_fan0: package-fan0 {
+			hysteresis = <2000>;
+			temperature = <55000>;
+			type = "active";
+		};
+
+		package_fan1: package-fan1 {
+			hysteresis = <2000>;
+			temperature = <65000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map0 {
+			cooling-device = <&fan THERMAL_NO_LIMIT 1>;
+			trip = <&package_fan0>;
+		};
+

arch/arm64/boot/dts/rockchip/rk3588s-rock-5.dtsi rgmii_phy1: ethernet-phy@1 { · line 414

Quoted 10 lines
arch/arm64/boot/dts/rockchip/rk3588s-rock-5.dtsi +7 -0
+		map1 {
+			cooling-device = <&fan 2 THERMAL_NO_LIMIT>;
+			trip = <&package_fan1>;
+		};
+	};
+};
+
 &pcie2x1l2 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pcie20x1_2_perstn_m0>,

The rest of the patch is looking good to me. Thanks for the patch!

#5 lore raw

Hi,

Quoted 11 lines · Dragan Simic

Hello Fukaumi,

Please, see a few comments below.

Quoted 1 line · FUKAUMI Naoki

add and enable package temperature based active cooling.

I'd suggest that you rewrite the patch summary to read like this:

  arm64: dts: rockchip: Enable automatic fan control on Rock 5A/5C

Quoted 8 lines

and to rewrite the patch description like this, which is a recycled and a bit improved description of the commit 4a152231b050 ("arm64:
dts: rockchip: enable automatic fan control on Rock 5B"):

  Link the PWM fan on Radxa ROCK 5A/5C as an active cooling device managed automatically by the thermal subsystem, with a target SoC temperature of 65 oC and a minimum-spin interval from 55 oC to 65 oC, to ensure airflow when the system gets warm.

thanks! I'll use this message :)

Quoted 19 lines
Quoted 19 lines

---
this patch depends on [1] which depends on [2].

[1] https://patchwork.kernel.org/project/linux-rockchip/ cover/[email protected]/
[2] https://patchwork.kernel.org/project/linux-rockchip/ patch/[email protected]/
---
 .../boot/dts/rockchip/rk3588s-rock-5.dtsi     | 32 ++++++++++++++++++-

 1 file changed, 31 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/rockchip/rk3588s-rock-5.dtsi +0 -0
index a8f40f43c838..a1cac40d439e 100644
@@ -33,7 +33,7 @@ analog-sound {
                "Headphone", "Headphones";
      };
 
Quoted 5 lines

arch/arm64/boot/dts/rockchip/rk3588s-rock-5.dtsi analog-sound { · line 36

Quoted 2 lines
arch/arm64/boot/dts/rockchip/rk3588s-rock-5.dtsi +1 -1
-    fan {
+    fan: fan {

It would be better to use "fan: pwm-fan { ... }", to ensure some kind of consistency with the other similar portions of board dts files.

sure. I'll change it in previous patch series for Radxa ROCK 4C.

Best regards,

--
FUKAUMI Naoki
Radxa Computer (Shenzhen) Co., Ltd.

Quoted 34 lines
Quoted 34 lines
arch/arm64/boot/dts/rockchip/rk3588s-rock-5.dtsi +27 -0
          compatible = "pwm-fan";
          #cooling-cells = <2>;
          cooling-levels = <0 64 128 192 255>;
@@ -379,6 +379,36 @@ rgmii_phy1: ethernet-phy@1 {
      };
  };
 
+&package_thermal {
+    polling-delay = <1000>;
+
+    trips {
+        package_fan0: package-fan0 {
+            hysteresis = <2000>;
+            temperature = <55000>;
+            type = "active";
+        };
+
+        package_fan1: package-fan1 {
+            hysteresis = <2000>;
+            temperature = <65000>;
+            type = "active";
+        };
+    };
+
+    cooling-maps {
+        map0 {
+            cooling-device = <&fan THERMAL_NO_LIMIT 1>;
+            trip = <&package_fan0>;
+        };
+
+        map1 {
+            cooling-device = <&fan 2 THERMAL_NO_LIMIT>;
+            trip = <&package_fan1>;
+        };
Quoted 9 lines

arch/arm64/boot/dts/rockchip/rk3588s-rock-5.dtsi rgmii_phy1: ethernet-phy@1 { · line 414

Quoted 6 lines
arch/arm64/boot/dts/rockchip/rk3588s-rock-5.dtsi +3 -0
+    };
+};
+
  &pcie2x1l2 {
      pinctrl-names = "default";
      pinctrl-0 = <&pcie20x1_2_perstn_m0>,

The rest of the patch is looking good to me.  Thanks for the patch!

_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip