* [PATCH 0/2] Add pwm-fan for Milk-V Pioneer
@ 2025-02-12 9:41 ` Chen Wang
0 siblings, 0 replies; 8+ messages in thread
From: Chen Wang @ 2025-02-12 9:41 UTC (permalink / raw)
To: aou, unicorn_wang, conor+dt, guoren, inochiama, krzk+dt, palmer,
paul.walmsley, robh, devicetree, linux-kernel, linux-riscv,
chao.wei, xiaoguang.xing, chunzhi.lin, inochiama, sophgo
From: Chen Wang <unicorn_wang@outlook.com>
Milk-V Pioneer uses fan as cooling-device, and speed of the fan is
controlled by the first channel of pwm controller of SG2042.
This patchset depends on another patchset for the SG2042 pwm controller,
the driver part is now on pwm/for-next [pwm-for-next] and the dts part is
now on sophgo/for-next [sophgo-for-next]. If you want to have a test,
you need to apply the corresponding patchset.
Link: https://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux.git [pwm-for-next]
Link: https://github.com/sophgo/linux.git [sophgo-for-next]
Thanks,
Chen
---
Chen Wang (2):
riscv: sophgo: dts: add pwm-fan for Milk-V Pioneer
riscv: sophgo: dts: add cooling maps for Milk-V Pioneer
.../boot/dts/sophgo/sg2042-milkv-pioneer.dts | 36 +++++++++++++++++++
1 file changed, 36 insertions(+)
base-commit: 2014c95afecee3e76ca4a56956a936e23283f05b
prerequisite-patch-id: c4b7f2697276f9278f13e3f2f54669eabed14157
prerequisite-patch-id: e6e1753842784bbc41eae5917470d4abfacd21a0
prerequisite-patch-id: 768254e961eb246d230258ff33922e4f2a36597e
--
2.34.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/2] riscv: sophgo: dts: add pwm-fan for Milk-V Pioneer
2025-02-12 9:41 ` Chen Wang
@ 2025-02-12 9:42 ` Chen Wang
-1 siblings, 0 replies; 8+ messages in thread
From: Chen Wang @ 2025-02-12 9:42 UTC (permalink / raw)
To: aou, unicorn_wang, conor+dt, guoren, inochiama, krzk+dt, palmer,
paul.walmsley, robh, devicetree, linux-kernel, linux-riscv,
chao.wei, xiaoguang.xing, chunzhi.lin, inochiama, sophgo
From: Chen Wang <unicorn_wang@outlook.com>
Milk-V Pioneer uses fan as cooling-device, and speed of the fan is
controlled by the first channel of pwm controller of SG2042.
Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
---
arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts b/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts
index be596d01ff8d..74c997ed8283 100644
--- a/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts
+++ b/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts
@@ -73,6 +73,13 @@ &uart0 {
};
/ {
+ pwmfan: pwm-fan {
+ compatible = "pwm-fan";
+ cooling-levels = <103 128 179 230 255>;
+ pwms = <&pwm 0 40000 0>;
+ #cooling-cells = <2>;
+ };
+
thermal-zones {
soc-thermal {
polling-delay-passive = <1000>;
--
2.34.1
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 1/2] riscv: sophgo: dts: add pwm-fan for Milk-V Pioneer
@ 2025-02-12 9:42 ` Chen Wang
0 siblings, 0 replies; 8+ messages in thread
From: Chen Wang @ 2025-02-12 9:42 UTC (permalink / raw)
To: aou, unicorn_wang, conor+dt, guoren, inochiama, krzk+dt, palmer,
paul.walmsley, robh, devicetree, linux-kernel, linux-riscv,
chao.wei, xiaoguang.xing, chunzhi.lin, inochiama, sophgo
From: Chen Wang <unicorn_wang@outlook.com>
Milk-V Pioneer uses fan as cooling-device, and speed of the fan is
controlled by the first channel of pwm controller of SG2042.
Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
---
arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts b/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts
index be596d01ff8d..74c997ed8283 100644
--- a/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts
+++ b/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts
@@ -73,6 +73,13 @@ &uart0 {
};
/ {
+ pwmfan: pwm-fan {
+ compatible = "pwm-fan";
+ cooling-levels = <103 128 179 230 255>;
+ pwms = <&pwm 0 40000 0>;
+ #cooling-cells = <2>;
+ };
+
thermal-zones {
soc-thermal {
polling-delay-passive = <1000>;
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/2] riscv: sophgo: dts: add cooling maps for Milk-V Pioneer
2025-02-12 9:41 ` Chen Wang
@ 2025-02-12 9:42 ` Chen Wang
-1 siblings, 0 replies; 8+ messages in thread
From: Chen Wang @ 2025-02-12 9:42 UTC (permalink / raw)
To: aou, unicorn_wang, conor+dt, guoren, inochiama, krzk+dt, palmer,
paul.walmsley, robh, devicetree, linux-kernel, linux-riscv,
chao.wei, xiaoguang.xing, chunzhi.lin, inochiama, sophgo
From: Chen Wang <unicorn_wang@outlook.com>
The normal operating temperature range of SG2042 is -20 degrees
Celsius ~ 85 degrees Celsius.
Simultaneously monitor soc temperature and board temperature to
improve redundancy and safety.
Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
---
.../boot/dts/sophgo/sg2042-milkv-pioneer.dts | 29 +++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts b/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts
index 74c997ed8283..34645a5f6038 100644
--- a/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts
+++ b/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts
@@ -111,6 +111,28 @@ soc_hot: soc-hot {
type = "hot";
};
};
+
+ cooling-maps {
+ map0 {
+ trip = <&soc_active1>;
+ cooling-device = <&pwmfan 0 1>;
+ };
+
+ map1 {
+ trip = <&soc_active2>;
+ cooling-device = <&pwmfan 1 2>;
+ };
+
+ map2 {
+ trip = <&soc_active3>;
+ cooling-device = <&pwmfan 2 3>;
+ };
+
+ map3 {
+ trip = <&soc_hot>;
+ cooling-device = <&pwmfan 3 4>;
+ };
+ };
};
board-thermal {
@@ -125,6 +147,13 @@ board_active: board-active {
type = "active";
};
};
+
+ cooling-maps {
+ map4 {
+ trip = <&board_active>;
+ cooling-device = <&pwmfan 3 4>;
+ };
+ };
};
};
};
--
2.34.1
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 2/2] riscv: sophgo: dts: add cooling maps for Milk-V Pioneer
@ 2025-02-12 9:42 ` Chen Wang
0 siblings, 0 replies; 8+ messages in thread
From: Chen Wang @ 2025-02-12 9:42 UTC (permalink / raw)
To: aou, unicorn_wang, conor+dt, guoren, inochiama, krzk+dt, palmer,
paul.walmsley, robh, devicetree, linux-kernel, linux-riscv,
chao.wei, xiaoguang.xing, chunzhi.lin, inochiama, sophgo
From: Chen Wang <unicorn_wang@outlook.com>
The normal operating temperature range of SG2042 is -20 degrees
Celsius ~ 85 degrees Celsius.
Simultaneously monitor soc temperature and board temperature to
improve redundancy and safety.
Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
---
.../boot/dts/sophgo/sg2042-milkv-pioneer.dts | 29 +++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts b/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts
index 74c997ed8283..34645a5f6038 100644
--- a/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts
+++ b/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts
@@ -111,6 +111,28 @@ soc_hot: soc-hot {
type = "hot";
};
};
+
+ cooling-maps {
+ map0 {
+ trip = <&soc_active1>;
+ cooling-device = <&pwmfan 0 1>;
+ };
+
+ map1 {
+ trip = <&soc_active2>;
+ cooling-device = <&pwmfan 1 2>;
+ };
+
+ map2 {
+ trip = <&soc_active3>;
+ cooling-device = <&pwmfan 2 3>;
+ };
+
+ map3 {
+ trip = <&soc_hot>;
+ cooling-device = <&pwmfan 3 4>;
+ };
+ };
};
board-thermal {
@@ -125,6 +147,13 @@ board_active: board-active {
type = "active";
};
};
+
+ cooling-maps {
+ map4 {
+ trip = <&board_active>;
+ cooling-device = <&pwmfan 3 4>;
+ };
+ };
};
};
};
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 0/2] Add pwm-fan for Milk-V Pioneer
2025-02-12 9:41 ` Chen Wang
@ 2025-02-19 2:02 ` Inochi Amaoto
-1 siblings, 0 replies; 8+ messages in thread
From: Inochi Amaoto @ 2025-02-19 2:02 UTC (permalink / raw)
To: aou, unicorn_wang, conor+dt, guoren, inochiama, krzk+dt, palmer,
paul.walmsley, robh, devicetree, linux-kernel, linux-riscv,
chao.wei, xiaoguang.xing, chunzhi.lin, sophgo, Chen Wang
Cc: Inochi Amaoto
On Wed, 12 Feb 2025 17:41:44 +0800, Chen Wang wrote:
> From: Chen Wang <unicorn_wang@outlook.com>
>
> Milk-V Pioneer uses fan as cooling-device, and speed of the fan is
> controlled by the first channel of pwm controller of SG2042.
>
> This patchset depends on another patchset for the SG2042 pwm controller,
> the driver part is now on pwm/for-next [pwm-for-next] and the dts part is
> now on sophgo/for-next [sophgo-for-next]. If you want to have a test,
> you need to apply the corresponding patchset.
>
> [...]
Applied to for-next, thanks!
[1/2] riscv: sophgo: dts: add pwm-fan for Milk-V Pioneer
https://github.com/sophgo/linux/commit/62cdf0a06dd5a650e4ca95b6f3a13daa48cf517a
[2/2] riscv: sophgo: dts: add cooling maps for Milk-V Pioneer
https://github.com/sophgo/linux/commit/f047a9285f9f3fd5c0d5ae53af350b8b619e470a
Thanks,
Inochi
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH 0/2] Add pwm-fan for Milk-V Pioneer
@ 2025-02-19 2:02 ` Inochi Amaoto
0 siblings, 0 replies; 8+ messages in thread
From: Inochi Amaoto @ 2025-02-19 2:02 UTC (permalink / raw)
To: aou, unicorn_wang, conor+dt, guoren, inochiama, krzk+dt, palmer,
paul.walmsley, robh, devicetree, linux-kernel, linux-riscv,
chao.wei, xiaoguang.xing, chunzhi.lin, sophgo, Chen Wang
Cc: Inochi Amaoto
On Wed, 12 Feb 2025 17:41:44 +0800, Chen Wang wrote:
> From: Chen Wang <unicorn_wang@outlook.com>
>
> Milk-V Pioneer uses fan as cooling-device, and speed of the fan is
> controlled by the first channel of pwm controller of SG2042.
>
> This patchset depends on another patchset for the SG2042 pwm controller,
> the driver part is now on pwm/for-next [pwm-for-next] and the dts part is
> now on sophgo/for-next [sophgo-for-next]. If you want to have a test,
> you need to apply the corresponding patchset.
>
> [...]
Applied to for-next, thanks!
[1/2] riscv: sophgo: dts: add pwm-fan for Milk-V Pioneer
https://github.com/sophgo/linux/commit/62cdf0a06dd5a650e4ca95b6f3a13daa48cf517a
[2/2] riscv: sophgo: dts: add cooling maps for Milk-V Pioneer
https://github.com/sophgo/linux/commit/f047a9285f9f3fd5c0d5ae53af350b8b619e470a
Thanks,
Inochi
^ permalink raw reply [flat|nested] 8+ messages in thread