Skip to contentSkip to conversation

add initial Milk-V Duo S board support

PATCH Superseded [email protected] 2 participants 6 messages Apr 10, 2024

Subsystems (3)

v3 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v3 cover add initial Milk-V Duo S board support

From: Michael Opdenacker <[email protected]>

This adds an initial device tree for the Milk-V Duo S board. Last tested on linux-next as a May 9, 2024.

- Changes in V3
- Fix enum in devicetree/bindings/riscv/sophgo.yaml

- Changes in V2:
- Add a first patch to register the new compatible string for this board.
- Use a correct SoC compatible string
- Add "disable-wp" (disable write protect) property to enable write access to the external SD card.

Many thanks to reviewers!

Michael Opdenacker (2):
dt-bindings: riscv: add Milk-V Duo S board compatibles
riscv: dts: sophgo: add initial Milk-V Duo S board support

 .../devicetree/bindings/riscv/sophgo.yaml     |  1 +
 arch/riscv/boot/dts/sophgo/Makefile           |  1 +
 .../boot/dts/sophgo/sg2000-milkv-duos.dts     | 39 +++++++++++++++++++
 3 files changed, 41 insertions(+)
 create mode 100644 arch/riscv/boot/dts/sophgo/sg2000-milkv-duos.dts
Signature · 7 lines
2.34.1


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

PATCH v3 1/2 dt-bindings: riscv: add Milk-V Duo S board compatibles

From: Michael Opdenacker <[email protected]>

Document the compatible strings for the Milk-V Duo S board[1] which uses the SOPHGO SG2000 SoC, compatible with the SOPHGO CV1800B SoC[2].

---
 Documentation/devicetree/bindings/riscv/sophgo.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/riscv/sophgo.yaml +1 -0
index 9bc813dad098..1837bc550056 100644
@@ -21,6 +21,7 @@ properties:
       - items:
           - enum:
               - milkv,duo
+              - milkv,duos
           - const: sophgo,cv1800b
       - items:
           - enum:
Signature · 1 line
2.34.1
#2 lore raw

Re: [PATCH v3 1/2] dt-bindings: riscv: add Milk-V Duo S board compatibles

Quoted 18 lines · On Wed, Apr 10, 2024 at 08:22:53AM +0200, [email protected] wrote:

From: Michael Opdenacker <[email protected]>

Document the compatible strings for the Milk-V Duo S board[1] which uses the SOPHGO SG2000 SoC, compatible with the SOPHGO CV1800B SoC[2].

---
 Documentation/devicetree/bindings/riscv/sophgo.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/riscv/sophgo.yaml +0 -0
index 9bc813dad098..1837bc550056 100644

Documentation/devicetree/bindings/riscv/sophgo.yaml properties: · line 25

Quoted 5 lines
Documentation/devicetree/bindings/riscv/sophgo.yaml +1 -0
@@ -21,6 +21,7 @@ properties:
       - items:
           - enum:
               - milkv,duo
+              - milkv,duos
           - const: sophgo,cv1800b

Why not adding sg2000 property? They are different series. IIRC, it at least a cv1813h not cv1800b. I suggest checking the vendor SDK to get the right board compatibles.

Quoted 5 lines
Documentation/devicetree/bindings/riscv/sophgo.yaml +0 -0
       - items:
           - enum:
Signature · 1 line
2.34.1
#3 lore raw

Re: [PATCH v3 1/2] dt-bindings: riscv: add Milk-V Duo S board compatibles

Hi Inochi

Thanks for the reviews!

Quoted 14 lines · Inochi Amaoto
Quoted 13 lines · On Wed, Apr 10, 2024 at 08:22:53AM +0200, [email protected] wrote:

From: Michael Opdenacker <[email protected]>

Document the compatible strings for the Milk-V Duo S board[1] which uses the SOPHGO SG2000 SoC, compatible with the SOPHGO CV1800B SoC[2].

---
  Documentation/devicetree/bindings/riscv/sophgo.yaml | 1 +
  1 file changed, 1 insertion(+)
Quoted 13 lines

Documentation/devicetree/bindings/riscv/sophgo.yaml properties: · line 25

Quoted 10 lines
Documentation/devicetree/bindings/riscv/sophgo.yaml +1 -0
index 9bc813dad098..1837bc550056 100644
@@ -21,6 +21,7 @@ properties:
        - items:
            - enum:
                - milkv,duo
+              - milkv,duos
            - const: sophgo,cv1800b

Why not adding sg2000 property? They are different series. IIRC, it at least a cv1813h not cv1800b. I suggest checking the vendor SDK to get the right board compatibles.

Here's what there was in the vendor provided DTB, if I noted it correctly:
compatible = "cvitek,cv181x";

Cheers
Michael

Signature · 3 lines
Michael Opdenacker, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#4 lore raw

Re: [PATCH v3 1/2] dt-bindings: riscv: add Milk-V Duo S board compatibles

Quoted 33 lines · Michael Opdenacker

Hi Inochi

Thanks for the reviews!

Quoted 14 lines · Inochi Amaoto
Quoted 13 lines · On Wed, Apr 10, 2024 at 08:22:53AM +0200, [email protected] wrote:

From: Michael Opdenacker <[email protected]>

Document the compatible strings for the Milk-V Duo S board[1] which uses the SOPHGO SG2000 SoC, compatible with the SOPHGO CV1800B SoC[2].

---
  Documentation/devicetree/bindings/riscv/sophgo.yaml | 1 +
  1 file changed, 1 insertion(+)
Quoted 13 lines

Documentation/devicetree/bindings/riscv/sophgo.yaml properties: · line 25

Quoted 10 lines
Documentation/devicetree/bindings/riscv/sophgo.yaml +1 -0
index 9bc813dad098..1837bc550056 100644
@@ -21,6 +21,7 @@ properties:
        - items:
            - enum:
                - milkv,duo
+              - milkv,duos
            - const: sophgo,cv1800b

Why not adding sg2000 property? They are different series. IIRC, it at least a cv1813h not cv1800b. I suggest checking the vendor SDK to get the right board compatibles.

Quoted 5 lines

Here's what there was in the vendor provided DTB, if I noted it correctly:
compatible = "cvitek,cv181x";

Cheers
Michael

That's true, the chipcode can be only see in the build script or the board dts. You can use this as a base. For example, sg2000 can be something like: "sophgo,sg2000", "sophgo,cv1813h". But in fact, I do not prefer to add "sophgo,cv1813h". Because sg2000 can also boot as an aarch64 board, but cv1813h can't.

#5 lore raw

PATCH v3 2/2 riscv: dts: sophgo: add initial Milk-V Duo S board support

In reply to [email protected]

From: Michael Opdenacker <[email protected]>

This adds initial support for the Milk-V Duo S board
(https://milkv.io/duo-s), enabling the serial port and SD card support, allowing to boot Linux to the command line.

---
 arch/riscv/boot/dts/sophgo/Makefile           |  1 +
 .../boot/dts/sophgo/sg2000-milkv-duos.dts     | 39 +++++++++++++++++++
 2 files changed, 40 insertions(+)
 create mode 100644 arch/riscv/boot/dts/sophgo/sg2000-milkv-duos.dts
arch/riscv/boot/dts/sophgo/Makefile +1 -0
index 57ad82a61ea6..e008acb5240f 100644
@@ -1,4 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0
 dtb-$(CONFIG_ARCH_SOPHGO) += cv1800b-milkv-duo.dtb
 dtb-$(CONFIG_ARCH_SOPHGO) += cv1812h-huashan-pi.dtb
+dtb-$(CONFIG_ARCH_SOPHGO) += sg2000-milkv-duos.dtb
 dtb-$(CONFIG_ARCH_SOPHGO) += sg2042-milkv-pioneer.dtb
arch/riscv/boot/dts/sophgo/sg2000-milkv-duos.dts new file +39 -0
new file mode 100644
index 000000000000..679d2854938a
@@ -0,0 +1,39 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2024 Michael Opdenacker <[email protected]>
+ */
+
+/dts-v1/;
+
+#include "cv1800b.dtsi"
+
+/ {
+	model = "Milk-V Duo S";
+	compatible = "milkv,duos", "sophgo,cv1800b";
+
+	aliases {
+		serial0 = &uart0;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+
+	memory@80000000 {
+		device_type = "memory";
+		reg = <0x80000000 0x20000000>;
+	};
+};
+
+&osc {
+	clock-frequency = <25000000>;
+};
+
+&sdhci0 {
+	status = "okay";
+	disable-wp;
+};
+
+&uart0 {
+	status = "okay";
+};
Signature · 1 line
2.34.1