Skip to contentSkip to conversation

rockchip: rockpro64: Set cooling levels for pwm-fan

PATCH New Kurt Miller 3 participants 5 messages May 28, 2020 – Jun 1, 2020 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rockchip: rockpro64: Set cooling levels for pwm-fan

The cooling levels are tuned to the fan that comes with the rockpro64 NAS case. A gpu_thermal zone was not added because having two active cooling maps control one physical fan causes them to compete for the fan speed which results in erratic fan behavior.

---

 arch/arm/dts/rk3399-rockpro64-u-boot.dtsi | 43 +++++++++++++++++++++++
 1 file changed, 43 insertions(+)
arch/arm/dts/rk3399-rockpro64-u-boot.dtsi +43 -0
index deaa3efd39..c0e0396758 100644
@@ -13,6 +13,49 @@
 	chosen {
 		u-boot,spl-boot-order = "same-as-spl", &sdmmc, &sdhci;
 	};
+
+	fan: pwm-fan {
+		cooling-levels = <0 40 80 255>;
+	};
+};
+
+&cpu_thermal {
+	trips {
+		cpu_warm: cpu_warm {
+			temperature = <50000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+
+		cpu_med: cpu_med {
+			temperature = <60000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+
+		cpu_hot: cpu_hot {
+			temperature = <65000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu_warm>;
+			cooling-device = <&fan THERMAL_NO_LIMIT 1>;
+		};
+
+		map3 {
+			trip = <&cpu_med>;
+			cooling-device = <&fan THERMAL_NO_LIMIT 2>;
+		};
+
+		map4 {
+			trip = <&cpu_hot>;
+			cooling-device = <&fan 2 THERMAL_NO_LIMIT>;
+		};
+	};
 };
 
 &vdd_center {
Signature · 1 line
2.26.2
#1 lore raw

PATCH 1/1 rockchip: rockpro64: Set cooling levels for pwm-fan

Quoted 5 lines · Kurt Miller

The cooling levels are tuned to the fan that comes with the rockpro64 NAS case. A gpu_thermal zone was not added because having two active cooling maps control one physical fan causes them to compete for the fan speed which results in erratic fan behavior.

Is there any reason this shouldn't go to the linux kernel first and then be synced back to the standard rk3399-rockpro64.dtsi?

Quoted 63 lines

---

 arch/arm/dts/rk3399-rockpro64-u-boot.dtsi | 43 +++++++++++++++++++++++
 1 file changed, 43 insertions(+)
arch/arm/dts/rk3399-rockpro64-u-boot.dtsi +43 -1
index deaa3efd39..c0e0396758 100644
@@ -13,6 +13,49 @@
        chosen {
                u-boot,spl-boot-order = "same-as-spl", &sdmmc, &sdhci;
        };
+
+       fan: pwm-fan {
+               cooling-levels = <0 40 80 255>;
+       };
+};
+
+&cpu_thermal {
+       trips {
+               cpu_warm: cpu_warm {
+                       temperature = <50000>;
+                       hysteresis = <2000>;
+                       type = "active";
+               };
+
+               cpu_med: cpu_med {
+                       temperature = <60000>;
+                       hysteresis = <2000>;
+                       type = "active";
+               };
+
+               cpu_hot: cpu_hot {
+                       temperature = <65000>;
+                       hysteresis = <2000>;
+                       type = "active";
+               };
+       };
+
+       cooling-maps {
+               map2 {
+                       trip = <&cpu_warm>;
+                       cooling-device = <&fan THERMAL_NO_LIMIT 1>;
+               };
+
+               map3 {
+                       trip = <&cpu_med>;
+                       cooling-device = <&fan THERMAL_NO_LIMIT 2>;
+               };
+
+               map4 {
+                       trip = <&cpu_hot>;
+                       cooling-device = <&fan 2 THERMAL_NO_LIMIT>;
+               };
+       };
 };
 
 &vdd_center {
--

2.26.2

#2 lore raw

PATCH 1/1 rockchip: rockpro64: Set cooling levels for pwm-fan

Quoted 9 lines · Peter Robinson
Quoted 6 lines · Kurt Miller

The cooling levels are tuned to the fan that comes with the rockpro64 NAS case. A gpu_thermal zone was not added because having two active cooling maps control one physical fan causes them to compete for the fan speed which results in erratic fan behavior.

Is there any reason this shouldn't go to the linux kernel first and then be synced back to the standard rk3399-rockpro64.dtsi?

Is that a requirement? I do my primary development on OpenBSD and while I use Linux for work tasks, I don't have available time right now to push these changes to Linux kernel first.

Quoted 65 lines
Quoted 65 lines

---

?arch/arm/dts/rk3399-rockpro64-u-boot.dtsi | 43 +++++++++++++++++++++++ ?1 file changed, 43 insertions(+)

arch/arm/dts/rk3399-rockpro64-u-boot.dtsi +43 -1
index deaa3efd39..c0e0396758 100644
@@ -13,6 +13,49 @@
 ????????chosen {
 ????????????????u-boot,spl-boot-order = "same-as-spl", &sdmmc, &sdhci;
 ????????};
+
+???????fan: pwm-fan {
+???????????????cooling-levels = <0 40 80 255>;
+???????};
+};
+
+&cpu_thermal {
+???????trips {
+???????????????cpu_warm: cpu_warm {
+???????????????????????temperature = <50000>;
+???????????????????????hysteresis = <2000>;
+???????????????????????type = "active";
+???????????????};
+
+???????????????cpu_med: cpu_med {
+???????????????????????temperature = <60000>;
+???????????????????????hysteresis = <2000>;
+???????????????????????type = "active";
+???????????????};
+
+???????????????cpu_hot: cpu_hot {
+???????????????????????temperature = <65000>;
+???????????????????????hysteresis = <2000>;
+???????????????????????type = "active";
+???????????????};
+???????};
+
+???????cooling-maps {
+???????????????map2 {
+???????????????????????trip = <&cpu_warm>;
+???????????????????????cooling-device = <&fan THERMAL_NO_LIMIT 1>;
+???????????????};
+
+???????????????map3 {
+???????????????????????trip = <&cpu_med>;
+???????????????????????cooling-device = <&fan THERMAL_NO_LIMIT 2>;
+???????????????};
+
+???????????????map4 {
+???????????????????????trip = <&cpu_hot>;
+???????????????????????cooling-device = <&fan 2 THERMAL_NO_LIMIT>;
+???????????????};
+???????};
 ?};
 
 ?&vdd_center {
--

2.26.2

#3 lore raw

PATCH 1/1 rockchip: rockpro64: Set cooling levels for pwm-fan

Hi Kurt,

Quoted 9 lines · Kurt Miller
Quoted 7 lines · Peter Robinson
Quoted 6 lines · Kurt Miller

The cooling levels are tuned to the fan that comes with the rockpro64 NAS case. A gpu_thermal zone was not added because having two active cooling maps control one physical fan causes them to compete for the fan speed which results in erratic fan behavior.

Quoted 7 lines
Quoted 2 lines

Is there any reason this shouldn't go to the linux kernel first and then be synced back to the standard rk3399-rockpro64.dtsi?

Is that a requirement? I do my primary development on OpenBSD and while I use Linux for work tasks, I don't have available time right now to push these changes to Linux kernel first.

The problem is that we need to keep Linux and U-Boot in sync. If a DT change is submitted only to one then it isn't clear who is taking on the task of syncing them up.

You don't actually need to be using Linux to send a DT change - just clone Linux, apply your patch and send to devicetree at vger.kernel.org. I wonder if it would be good enough to cc that group and the Linux maintainer on these patches, assuming the files are currently in sync? But probably a new patch is needed.

Regards,
Simon

#4 lore raw

PATCH 1/1 rockchip: rockpro64: Set cooling levels for pwm-fan

Quoted 25 lines · Simon Glass

Hi Kurt,

Quoted 12 lines · Kurt Miller
Quoted 9 lines · Peter Robinson
Quoted 7 lines · Kurt Miller

The cooling levels are tuned to the fan that comes with the rockpro64 NAS case. A gpu_thermal zone was not added because having two active cooling maps control one physical fan causes them to compete for the fan speed which results in erratic fan behavior.

Quoted 6 lines
Quoted 2 lines

Is there any reason this shouldn't go to the linux kernel first and then be synced back to the standard rk3399-rockpro64.dtsi?

Is that a requirement? I do my primary development on OpenBSD and while I use Linux for work tasks, I don't have available time right now to push these changes to Linux kernel first.

The problem is that we need to keep Linux and U-Boot in sync. If a DT change is submitted only to one then it isn't clear who is taking on the task of syncing them up.

Quoted 6 lines

You don't actually need to be using Linux to send a DT change - just clone Linux, apply your patch and send to devicetree at vger.kernel.org. I wonder if it would be good enough to cc that group and the Linux maintainer on these patches, assuming the files are currently in sync? But probably a new patch is needed.

Thank you for the pointers. I'll give that a try.

Best,
-Kurt