Skip to contentSkip to conversation

dt-bindings: soc: sophgo: add Milk-V Duo 256M board

PATCH Superseded Chen-Yu Yeh 2 participants 3 messages Jun 10

Subsystems (3)

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 dt-bindings: soc: sophgo: add Milk-V Duo 256M board

Add compatible string for the Milk-V Duo 256M board.

---
 Documentation/devicetree/bindings/soc/sophgo/sophgo.yaml | 4 ++++
 1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/soc/sophgo/sophgo.yaml +4 -0
index 1c502618de51..fcb1d905da7d 100644
@@ -31,6 +31,10 @@ properties:
               - milkv,duo-module-01-evb
           - const: milkv,duo-module-01
           - const: sophgo,sg2000
+      - items:
+          - enum:
+              - milkv,duo256m
+          - const: sophgo,sg2002
       - items:
           - enum:
               - sipeed,licheerv-nano-b
Signature · 1 line
2.43.0
#1 lore raw

PATCH 2/2 riscv: dts: sophgo: Add Milk-V Duo 256M board support

The Milk-V Duo 256M is a small form factor development board based on the Sophgo SG2002 SoC.

This patch adds basic device tree support for the board, including:
- UART console
- SD/MMC controller
- USB host
- Onboard blue status LED (connected to PWR_GPIO[2] / porte 2)

Tested on actual Milk-V Duo 256M hardware, verified boot to shell and heartbeat LED functionality.

---
 arch/riscv/boot/dts/sophgo/Makefile           |   2 +
 .../boot/dts/sophgo/sg2002-milkv-duo256m.dts  | 119 ++++++++++++++++++
 2 files changed, 121 insertions(+)
 create mode 100644 arch/riscv/boot/dts/sophgo/sg2002-milkv-duo256m.dts
arch/riscv/boot/dts/sophgo/Makefile +2 -0
index 6f65526d4193..e49c8233ae1f 100644
@@ -2,7 +2,9 @@
 dtb-$(CONFIG_ARCH_SOPHGO) += cv1800b-milkv-duo.dtb
 dtb-$(CONFIG_ARCH_SOPHGO) += cv1812h-huashan-pi.dtb
 dtb-$(CONFIG_ARCH_SOPHGO) += sg2002-licheerv-nano-b.dtb
+dtb-$(CONFIG_ARCH_SOPHGO) += sg2002-milkv-duo256m.dtb
 dtb-$(CONFIG_ARCH_SOPHGO) += sg2042-milkv-pioneer.dtb
 dtb-$(CONFIG_ARCH_SOPHGO) += sg2042-evb-v1.dtb
 dtb-$(CONFIG_ARCH_SOPHGO) += sg2042-evb-v2.dtb
 dtb-$(CONFIG_ARCH_SOPHGO) += sg2044-sophgo-srd3-10.dtb
+
arch/riscv/boot/dts/sophgo/sg2002-milkv-duo256m.dts new file +119 -0

119 lines not on this page · raw message

Signature · 1 line
2.43.0
#2 lore raw

Re: [PATCH 2/2] riscv: dts: sophgo: Add Milk-V Duo 256M board support

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider: - [Low] The device tree references a non-existent `&porte` phandle, which will cause a fatal `dtc`…

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [Low] The device tree references a non-existent &porte phandle, which will cause a fatal dtc compilation error.
- [Low] The device tree references a non-existent &usb phandle, which will cause a fatal dtc compilation error.
- [Low] An unnecessary trailing blank line is added to the Makefile.
--

commit 789d472cb56d573e2ba1106b883551407093dd43
Author: Chen-Yu Yeh <[email protected]>

riscv: dts: sophgo: Add Milk-V Duo 256M board support

This commit adds basic device tree support for the Milk-V Duo 256M board, based on the Sophgo SG2002 SoC. It configures the UART console, SD/MMC controller, USB host, and a status LED.

Quoted 4 lines
arch/riscv/boot/dts/sophgo/Makefile +0 -0
index 6f65526d4193b..e49c8233ae1ff 100644

[ ... ]

arch/riscv/boot/dts/sophgo/Makefile line 10

Quoted 10 lines
arch/riscv/boot/dts/sophgo/Makefile +2 -0
@@ -2,7 +2,9 @@
 dtb-$(CONFIG_ARCH_SOPHGO) += cv1800b-milkv-duo.dtb
 dtb-$(CONFIG_ARCH_SOPHGO) += cv1812h-huashan-pi.dtb
 dtb-$(CONFIG_ARCH_SOPHGO) += sg2002-licheerv-nano-b.dtb
+dtb-$(CONFIG_ARCH_SOPHGO) += sg2002-milkv-duo256m.dtb
 dtb-$(CONFIG_ARCH_SOPHGO) += sg2042-milkv-pioneer.dtb
 dtb-$(CONFIG_ARCH_SOPHGO) += sg2042-evb-v1.dtb
 dtb-$(CONFIG_ARCH_SOPHGO) += sg2042-evb-v2.dtb
 dtb-$(CONFIG_ARCH_SOPHGO) += sg2044-sophgo-srd3-10.dtb
+

[Severity: Low]
This isn't a bug, but is this trailing blank line intended? It adds unnecessary whitespace at the end of the Makefile.

Quoted 5 lines
arch/riscv/boot/dts/sophgo/sg2002-milkv-duo256m.dts new file +0 -0
new file mode 100644
index 0000000000000..882fba441396b

[ ... ]

arch/riscv/boot/dts/sophgo/sg2002-milkv-duo256m.dts line 32

Quoted 6 lines
arch/riscv/boot/dts/sophgo/sg2002-milkv-duo256m.dts new file +6 -0
+	leds {
+		compatible = "gpio-leds";
+
+		led-blue {
+			label = "milkv:blue:status";
+			gpios = <&porte 2 GPIO_ACTIVE_HIGH>;

[Severity: Low]
Will this compile successfully? It appears the porte phandle is not yet defined in the parent dtsi files, which would cause a fatal dtc compilation error.

[ ... ]

arch/riscv/boot/dts/sophgo/sg2002-milkv-duo256m.dts line 119

Quoted 10 lines

+&uart0 {

arch/riscv/boot/dts/sophgo/sg2002-milkv-duo256m.dts new file +9 -0
+	pinctrl-0 = <&uart0_cfg>;
+	pinctrl-names = "default";
+	status = "okay";
+};
+
+&usb {
+	dr_mode = "host";
+	status = "okay";
+};

[Severity: Low]
Similar to the porte phandle above, is the usb label defined in the parent SoC dtsi files? Overriding an undefined label will also cause a dtc build failure.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2