devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Add initial Milk-V Duo S board support
@ 2025-10-11  1:48 Joshua Milas
  2025-10-11  1:48 ` [PATCH 1/3] dt-bindings: soc: sophgo: add Milk-V Duo S board compatibles Joshua Milas
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: Joshua Milas @ 2025-10-11  1:48 UTC (permalink / raw)
  To: robh, krzk+dt, conor+dt, unicorn_wang, inochiama, paul.walmsley,
	palmer, aou, alex, alexander.sverdlin, rabenda.cn,
	thomas.bonnefille, chao.wei, liujingqi
  Cc: josh.milas, devicetree, sophgo, linux-riscv

This adds an initial device tree for the Milk-V Duo S board
with support for reading from the SD card and network over
ethernet. This is continued work from Michael Opdenacker's
v6 series [1] on the ARM64 and RISCV side. It has been tested
with both ARM64 and RISCV64.

---

v2
- Made new entry in docs to avoid DTC check error
- "Milk-V DuoS" -> "Milk-V Duo S"
- Sorting of aliases
- Added uart*, emmc, mdio, gmac0, i2c*, spi*, dmac, saradc
  to device tree matching what is available on the pinout [2]
  and available in the device tree includes
- Removal of 'no-mmc' and 'no-sdio' for sdhci0 as it works
  without
- Added riscv device tree

Link: https://lore.kernel.org/linux-riscv/20240421055710.143617-1-michael.opdenacker@bootlin.com/ [1]
Link: https://milkv.io/duo-s/duos-pinout.webp [2]

Joshua Milas (3):
  dt-bindings: soc: sophgo: add Milk-V Duo S board compatibles
  arm64: dts: sophgo: add initial Milk-V Duo S board support
  riscv64: dts: sophgo: add initial Milk-V Duo S board support

 .../bindings/soc/sophgo/sophgo.yaml           |   5 +
 arch/arm64/boot/dts/sophgo/Makefile           |   1 +
 .../boot/dts/sophgo/sg2000-milkv-duo-s.dts    | 110 ++++++++++++++++++
 arch/riscv/boot/dts/sophgo/Makefile           |   1 +
 .../boot/dts/sophgo/cv1812h-milkv-duo-s.dts   | 110 ++++++++++++++++++
 5 files changed, 227 insertions(+)
 create mode 100644 arch/arm64/boot/dts/sophgo/sg2000-milkv-duo-s.dts
 create mode 100644 arch/riscv/boot/dts/sophgo/cv1812h-milkv-duo-s.dts


base-commit: 0251a1deaec78252cb311fc8305d3670bc5eee0e
-- 
2.51.0


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 1/3] dt-bindings: soc: sophgo: add Milk-V Duo S board compatibles
  2025-10-11  1:48 [PATCH 0/3] Add initial Milk-V Duo S board support Joshua Milas
@ 2025-10-11  1:48 ` Joshua Milas
  2025-10-11  1:50   ` Inochi Amaoto
  2025-10-11  1:48 ` [PATCH 2/3] arm64: dts: sophgo: add initial Milk-V Duo S board support Joshua Milas
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 16+ messages in thread
From: Joshua Milas @ 2025-10-11  1:48 UTC (permalink / raw)
  To: robh, krzk+dt, conor+dt, unicorn_wang, inochiama, paul.walmsley,
	palmer, aou, alex, alexander.sverdlin, rabenda.cn,
	thomas.bonnefille, chao.wei, liujingqi
  Cc: josh.milas, devicetree, sophgo, linux-riscv

Document the compatible strings for the Milk-V Duo S board [1]
which uses the SOPHGO SG2000 SoC [2] on the ARM64 side. The RISCV
side uses the SOPHGO CV1812h [3].

Link: https://milkv.io/duo-s [1]
Link: https://en.sophgo.com/sophon-u/product/introduce/sg200x.html [2]
Link: https://www.sophgo.com/sophon-u/product/introduce/cv181xh.html [3]

Signed-off-by: Joshua Milas <josh.milas@gmail.com>
---
 Documentation/devicetree/bindings/soc/sophgo/sophgo.yaml | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/soc/sophgo/sophgo.yaml b/Documentation/devicetree/bindings/soc/sophgo/sophgo.yaml
index 1c502618de51..63773811b80f 100644
--- a/Documentation/devicetree/bindings/soc/sophgo/sophgo.yaml
+++ b/Documentation/devicetree/bindings/soc/sophgo/sophgo.yaml
@@ -25,12 +25,17 @@ properties:
       - items:
           - enum:
               - sophgo,huashan-pi
+              - milkv,duo-s
           - const: sophgo,cv1812h
       - items:
           - enum:
               - milkv,duo-module-01-evb
           - const: milkv,duo-module-01
           - const: sophgo,sg2000
+      - items:
+          - enum:
+              - milkv,duo-s
+          - const: sophgo,sg2000
       - items:
           - enum:
               - sipeed,licheerv-nano-b
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 2/3] arm64: dts: sophgo: add initial Milk-V Duo S board support
  2025-10-11  1:48 [PATCH 0/3] Add initial Milk-V Duo S board support Joshua Milas
  2025-10-11  1:48 ` [PATCH 1/3] dt-bindings: soc: sophgo: add Milk-V Duo S board compatibles Joshua Milas
@ 2025-10-11  1:48 ` Joshua Milas
  2025-10-11  1:56   ` Inochi Amaoto
  2025-10-11  1:48 ` [PATCH 3/3] riscv64: " Joshua Milas
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 16+ messages in thread
From: Joshua Milas @ 2025-10-11  1:48 UTC (permalink / raw)
  To: robh, krzk+dt, conor+dt, unicorn_wang, inochiama, paul.walmsley,
	palmer, aou, alex, alexander.sverdlin, rabenda.cn,
	thomas.bonnefille, chao.wei, liujingqi
  Cc: josh.milas, devicetree, sophgo, linux-riscv

This adds initial arm64 support for the Milk-V Duo S board
[1] making it possible to boot Linux to the command line.

Link: https://milkv.io/duo-s [1]

Signed-off-by: Joshua Milas <josh.milas@gmail.com>
---
 arch/arm64/boot/dts/sophgo/Makefile           |   1 +
 .../boot/dts/sophgo/sg2000-milkv-duo-s.dts    | 110 ++++++++++++++++++
 2 files changed, 111 insertions(+)
 create mode 100644 arch/arm64/boot/dts/sophgo/sg2000-milkv-duo-s.dts

diff --git a/arch/arm64/boot/dts/sophgo/Makefile b/arch/arm64/boot/dts/sophgo/Makefile
index 94f52cd7d994..68aace728223 100644
--- a/arch/arm64/boot/dts/sophgo/Makefile
+++ b/arch/arm64/boot/dts/sophgo/Makefile
@@ -1,2 +1,3 @@
 # SPDX-License-Identifier: GPL-2.0
 dtb-$(CONFIG_ARCH_SOPHGO) += sg2000-milkv-duo-module-01-evb.dtb
+dtb-$(CONFIG_ARCH_SOPHGO) += sg2000-milkv-duo-s.dtb
diff --git a/arch/arm64/boot/dts/sophgo/sg2000-milkv-duo-s.dts b/arch/arm64/boot/dts/sophgo/sg2000-milkv-duo-s.dts
new file mode 100644
index 000000000000..e9afad6fd106
--- /dev/null
+++ b/arch/arm64/boot/dts/sophgo/sg2000-milkv-duo-s.dts
@@ -0,0 +1,110 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+
+/dts-v1/;
+
+#include <dt-bindings/pinctrl/pinctrl-sg2000.h>
+#include "sg2000.dtsi"
+
+/ {
+	model = "Milk-V Duo S";
+	compatible = "milkv,duo-s", "sophgo,sg2000";
+
+	aliases {
+		mmc0 = &sdhci0;
+		serial0 = &uart0;
+		serial1 = &uart1;
+		serial2 = &uart2;
+		serial3 = &uart3;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+};
+
+&osc {
+	clock-frequency = <25000000>;
+};
+
+&dmac {
+	status = "okay";
+};
+
+&emmc {
+	bus-width = <4>;
+	no-1-8-v;
+	cap-mmc-hw-reset;
+	no-sd;
+	no-sdio;
+	non-removable;
+	status = "okay";
+};
+
+&gmac0 {
+	status = "okay";
+};
+
+&i2c1 {
+	status = "okay";
+};
+
+&i2c2 {
+	status = "okay";
+};
+
+&i2c3 {
+	status = "okay";
+};
+
+&i2c4 {
+	status = "okay";
+};
+
+&mdio {
+	status = "okay";
+};
+
+&saradc {
+	status = "okay";
+};
+
+&sdhci0 {
+	bus-width = <4>;
+	no-1-8-v;
+	disable-wp;
+	status = "okay";
+};
+
+&sdhci1 {
+	bus-width = <4>;
+	cap-sdio-irq;
+	no-mmc;
+	no-sd;
+	non-removable;
+	status = "okay";
+};
+
+&spi0 {
+	status = "okay";
+};
+
+&spi3 {
+	status = "okay";
+};
+
+&uart0 {
+	status = "okay";
+};
+
+&uart1 {
+	status = "okay";
+};
+
+&uart2 {
+	status = "okay";
+};
+
+&uart3 {
+	status = "okay";
+};
+
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 3/3] riscv64: dts: sophgo: add initial Milk-V Duo S board support
  2025-10-11  1:48 [PATCH 0/3] Add initial Milk-V Duo S board support Joshua Milas
  2025-10-11  1:48 ` [PATCH 1/3] dt-bindings: soc: sophgo: add Milk-V Duo S board compatibles Joshua Milas
  2025-10-11  1:48 ` [PATCH 2/3] arm64: dts: sophgo: add initial Milk-V Duo S board support Joshua Milas
@ 2025-10-11  1:48 ` Joshua Milas
  2025-10-11  1:57   ` Inochi Amaoto
  2025-10-11  2:16 ` [PATCH 0/3] Add " Chen Wang
  2025-10-14  3:27 ` Chen Wang
  4 siblings, 1 reply; 16+ messages in thread
From: Joshua Milas @ 2025-10-11  1:48 UTC (permalink / raw)
  To: robh, krzk+dt, conor+dt, unicorn_wang, inochiama, paul.walmsley,
	palmer, aou, alex, alexander.sverdlin, rabenda.cn,
	thomas.bonnefille, chao.wei, liujingqi
  Cc: josh.milas, devicetree, sophgo, linux-riscv

This adds initial riscv support for the Milk-V Duo S board
[1] making it possible to boot Linux to the command line.

Link: https://milkv.io/duo-s [1]

Signed-off-by: Joshua Milas <josh.milas@gmail.com>
---
 arch/riscv/boot/dts/sophgo/Makefile           |   1 +
 .../boot/dts/sophgo/cv1812h-milkv-duo-s.dts   | 110 ++++++++++++++++++
 2 files changed, 111 insertions(+)
 create mode 100644 arch/riscv/boot/dts/sophgo/cv1812h-milkv-duo-s.dts

diff --git a/arch/riscv/boot/dts/sophgo/Makefile b/arch/riscv/boot/dts/sophgo/Makefile
index 6f65526d4193..49d6ae4724ea 100644
--- a/arch/riscv/boot/dts/sophgo/Makefile
+++ b/arch/riscv/boot/dts/sophgo/Makefile
@@ -1,6 +1,7 @@
 # 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) += cv1812h-milkv-duo-s.dtb
 dtb-$(CONFIG_ARCH_SOPHGO) += sg2002-licheerv-nano-b.dtb
 dtb-$(CONFIG_ARCH_SOPHGO) += sg2042-milkv-pioneer.dtb
 dtb-$(CONFIG_ARCH_SOPHGO) += sg2042-evb-v1.dtb
diff --git a/arch/riscv/boot/dts/sophgo/cv1812h-milkv-duo-s.dts b/arch/riscv/boot/dts/sophgo/cv1812h-milkv-duo-s.dts
new file mode 100644
index 000000000000..2ab46ec1fc0e
--- /dev/null
+++ b/arch/riscv/boot/dts/sophgo/cv1812h-milkv-duo-s.dts
@@ -0,0 +1,110 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+
+/dts-v1/;
+
+#include <dt-bindings/pinctrl/pinctrl-cv1812h.h>
+#include "cv1812h.dtsi"
+
+/ {
+	model = "Milk-V Duo S";
+	compatible = "milkv,duo-s", "sophgo,cv1812h";
+
+	aliases {
+		mmc0 = &sdhci0;
+		serial0 = &uart0;
+		serial1 = &uart1;
+		serial2 = &uart2;
+		serial3 = &uart3;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+};
+
+&osc {
+	clock-frequency = <25000000>;
+};
+
+&dmac {
+	status = "okay";
+};
+
+&emmc {
+	bus-width = <4>;
+	no-1-8-v;
+	cap-mmc-hw-reset;
+	no-sd;
+	no-sdio;
+	non-removable;
+	status = "okay";
+};
+
+&gmac0 {
+	status = "okay";
+};
+
+&i2c1 {
+	status = "okay";
+};
+
+&i2c2 {
+	status = "okay";
+};
+
+&i2c3 {
+	status = "okay";
+};
+
+&i2c4 {
+	status = "okay";
+};
+
+&mdio {
+	status = "okay";
+};
+
+&saradc {
+	status = "okay";
+};
+
+&sdhci0 {
+	bus-width = <4>;
+	no-1-8-v;
+	disable-wp;
+	status = "okay";
+};
+
+&sdhci1 {
+	bus-width = <4>;
+	cap-sdio-irq;
+	no-mmc;
+	no-sd;
+	non-removable;
+	status = "okay";
+};
+
+&spi0 {
+	status = "okay";
+};
+
+&spi3 {
+	status = "okay";
+};
+
+&uart0 {
+	status = "okay";
+};
+
+&uart1 {
+	status = "okay";
+};
+
+&uart2 {
+	status = "okay";
+};
+
+&uart3 {
+	status = "okay";
+};
+
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH 1/3] dt-bindings: soc: sophgo: add Milk-V Duo S board compatibles
  2025-10-11  1:48 ` [PATCH 1/3] dt-bindings: soc: sophgo: add Milk-V Duo S board compatibles Joshua Milas
@ 2025-10-11  1:50   ` Inochi Amaoto
  0 siblings, 0 replies; 16+ messages in thread
From: Inochi Amaoto @ 2025-10-11  1:50 UTC (permalink / raw)
  To: Joshua Milas, robh, krzk+dt, conor+dt, unicorn_wang, inochiama,
	paul.walmsley, palmer, aou, alex, alexander.sverdlin, rabenda.cn,
	thomas.bonnefille, chao.wei, liujingqi
  Cc: devicetree, sophgo, linux-riscv

On Fri, Oct 10, 2025 at 09:48:09PM -0400, Joshua Milas wrote:
> Document the compatible strings for the Milk-V Duo S board [1]
> which uses the SOPHGO SG2000 SoC [2] on the ARM64 side. The RISCV
> side uses the SOPHGO CV1812h [3].
> 
> Link: https://milkv.io/duo-s [1]
> Link: https://en.sophgo.com/sophon-u/product/introduce/sg200x.html [2]
> Link: https://www.sophgo.com/sophon-u/product/introduce/cv181xh.html [3]
> 
> Signed-off-by: Joshua Milas <josh.milas@gmail.com>
> ---
>  Documentation/devicetree/bindings/soc/sophgo/sophgo.yaml | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/soc/sophgo/sophgo.yaml b/Documentation/devicetree/bindings/soc/sophgo/sophgo.yaml
> index 1c502618de51..63773811b80f 100644
> --- a/Documentation/devicetree/bindings/soc/sophgo/sophgo.yaml
> +++ b/Documentation/devicetree/bindings/soc/sophgo/sophgo.yaml
> @@ -25,12 +25,17 @@ properties:
>        - items:
>            - enum:
>                - sophgo,huashan-pi
> +              - milkv,duo-s

Why? I know no duo S board use cv1812h.

>            - const: sophgo,cv1812h
>        - items:
>            - enum:
>                - milkv,duo-module-01-evb
>            - const: milkv,duo-module-01
>            - const: sophgo,sg2000
> +      - items:
> +          - enum:
> +              - milkv,duo-s
> +          - const: sophgo,sg2000
>        - items:
>            - enum:
>                - sipeed,licheerv-nano-b
> -- 
> 2.51.0
> 

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 2/3] arm64: dts: sophgo: add initial Milk-V Duo S board support
  2025-10-11  1:48 ` [PATCH 2/3] arm64: dts: sophgo: add initial Milk-V Duo S board support Joshua Milas
@ 2025-10-11  1:56   ` Inochi Amaoto
  2025-10-11 19:19     ` Joshua Milas
  0 siblings, 1 reply; 16+ messages in thread
From: Inochi Amaoto @ 2025-10-11  1:56 UTC (permalink / raw)
  To: Joshua Milas, robh, krzk+dt, conor+dt, unicorn_wang, inochiama,
	paul.walmsley, palmer, aou, alex, alexander.sverdlin, rabenda.cn,
	thomas.bonnefille, chao.wei, liujingqi
  Cc: devicetree, sophgo, linux-riscv

On Fri, Oct 10, 2025 at 09:48:10PM -0400, Joshua Milas wrote:
> This adds initial arm64 support for the Milk-V Duo S board
> [1] making it possible to boot Linux to the command line.
> 
> Link: https://milkv.io/duo-s [1]
> 
> Signed-off-by: Joshua Milas <josh.milas@gmail.com>
> ---
>  arch/arm64/boot/dts/sophgo/Makefile           |   1 +
>  .../boot/dts/sophgo/sg2000-milkv-duo-s.dts    | 110 ++++++++++++++++++
>  2 files changed, 111 insertions(+)
>  create mode 100644 arch/arm64/boot/dts/sophgo/sg2000-milkv-duo-s.dts
> 
> diff --git a/arch/arm64/boot/dts/sophgo/Makefile b/arch/arm64/boot/dts/sophgo/Makefile
> index 94f52cd7d994..68aace728223 100644
> --- a/arch/arm64/boot/dts/sophgo/Makefile
> +++ b/arch/arm64/boot/dts/sophgo/Makefile
> @@ -1,2 +1,3 @@
>  # SPDX-License-Identifier: GPL-2.0
>  dtb-$(CONFIG_ARCH_SOPHGO) += sg2000-milkv-duo-module-01-evb.dtb
> +dtb-$(CONFIG_ARCH_SOPHGO) += sg2000-milkv-duo-s.dtb
> diff --git a/arch/arm64/boot/dts/sophgo/sg2000-milkv-duo-s.dts b/arch/arm64/boot/dts/sophgo/sg2000-milkv-duo-s.dts
> new file mode 100644
> index 000000000000..e9afad6fd106
> --- /dev/null
> +++ b/arch/arm64/boot/dts/sophgo/sg2000-milkv-duo-s.dts
> @@ -0,0 +1,110 @@
> +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
> +
> +/dts-v1/;
> +
> +#include <dt-bindings/pinctrl/pinctrl-sg2000.h>
> +#include "sg2000.dtsi"
> +
> +/ {
> +	model = "Milk-V Duo S";
> +	compatible = "milkv,duo-s", "sophgo,sg2000";
> +
> +	aliases {
> +		mmc0 = &sdhci0;
> +		serial0 = &uart0;
> +		serial1 = &uart1;
> +		serial2 = &uart2;
> +		serial3 = &uart3;
> +	};
> +
> +	chosen {
> +		stdout-path = "serial0:115200n8";
> +	};
> +};
> +
> +&osc {
> +	clock-frequency = <25000000>;
> +};
> +
> +&dmac {
> +	status = "okay";
> +};
> +
> +&emmc {
> +	bus-width = <4>;
> +	no-1-8-v;
> +	cap-mmc-hw-reset;
> +	no-sd;
> +	no-sdio;
> +	non-removable;
> +	status = "okay";
> +};
> +
> +&gmac0 {
> +	status = "okay";
> +};
> +
> +&i2c1 {
> +	status = "okay";
> +};
> +
> +&i2c2 {
> +	status = "okay";
> +};
> +
> +&i2c3 {
> +	status = "okay";
> +};
> +
> +&i2c4 {
> +	status = "okay";
> +};
> +
> +&mdio {
> +	status = "okay";
> +};
> +
> +&saradc {
> +	status = "okay";
> +};
> +
> +&sdhci0 {
> +	bus-width = <4>;
> +	no-1-8-v;
> +	disable-wp;
> +	status = "okay";
> +};
> +
> +&sdhci1 {
> +	bus-width = <4>;
> +	cap-sdio-irq;
> +	no-mmc;
> +	no-sd;
> +	non-removable;
> +	status = "okay";
> +};
> +
> +&spi0 {
> +	status = "okay";
> +};
> +
> +&spi3 {
> +	status = "okay";
> +};
> +
> +&uart0 {
> +	status = "okay";
> +};
> +
> +&uart1 {
> +	status = "okay";
> +};
> +
> +&uart2 {
> +	status = "okay";
> +};
> +
> +&uart3 {
> +	status = "okay";
> +};
> +
> -- 
> 2.51.0
> 

Only enable device that can be accessed directly. These devices share
some pins and only one of them can be used. I suggest enabling devices
that are accessed by default (which means it is compatible with the
vendor kernel).

This advice also applys to the riscv dts.

Regards,
Inochi

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 3/3] riscv64: dts: sophgo: add initial Milk-V Duo S board support
  2025-10-11  1:48 ` [PATCH 3/3] riscv64: " Joshua Milas
@ 2025-10-11  1:57   ` Inochi Amaoto
  0 siblings, 0 replies; 16+ messages in thread
From: Inochi Amaoto @ 2025-10-11  1:57 UTC (permalink / raw)
  To: Joshua Milas, robh, krzk+dt, conor+dt, unicorn_wang, inochiama,
	paul.walmsley, palmer, aou, alex, alexander.sverdlin, rabenda.cn,
	thomas.bonnefille, chao.wei, liujingqi
  Cc: devicetree, sophgo, linux-riscv

On Fri, Oct 10, 2025 at 09:48:11PM -0400, Joshua Milas wrote:
> This adds initial riscv support for the Milk-V Duo S board
> [1] making it possible to boot Linux to the command line.
> 
> Link: https://milkv.io/duo-s [1]
> 
> Signed-off-by: Joshua Milas <josh.milas@gmail.com>
> ---
>  arch/riscv/boot/dts/sophgo/Makefile           |   1 +
>  .../boot/dts/sophgo/cv1812h-milkv-duo-s.dts   | 110 ++++++++++++++++++
>  2 files changed, 111 insertions(+)
>  create mode 100644 arch/riscv/boot/dts/sophgo/cv1812h-milkv-duo-s.dts
> 
> diff --git a/arch/riscv/boot/dts/sophgo/Makefile b/arch/riscv/boot/dts/sophgo/Makefile
> index 6f65526d4193..49d6ae4724ea 100644
> --- a/arch/riscv/boot/dts/sophgo/Makefile
> +++ b/arch/riscv/boot/dts/sophgo/Makefile
> @@ -1,6 +1,7 @@
>  # 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) += cv1812h-milkv-duo-s.dtb
>  dtb-$(CONFIG_ARCH_SOPHGO) += sg2002-licheerv-nano-b.dtb
>  dtb-$(CONFIG_ARCH_SOPHGO) += sg2042-milkv-pioneer.dtb
>  dtb-$(CONFIG_ARCH_SOPHGO) += sg2042-evb-v1.dtb
> diff --git a/arch/riscv/boot/dts/sophgo/cv1812h-milkv-duo-s.dts b/arch/riscv/boot/dts/sophgo/cv1812h-milkv-duo-s.dts
> new file mode 100644
> index 000000000000..2ab46ec1fc0e
> --- /dev/null
> +++ b/arch/riscv/boot/dts/sophgo/cv1812h-milkv-duo-s.dts
> @@ -0,0 +1,110 @@
> +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
> +
> +/dts-v1/;
> +
> +#include <dt-bindings/pinctrl/pinctrl-cv1812h.h>

> +#include "cv1812h.dtsi"

SG2000 is different with CV1812H, add a new sg2000.dtsi instead.

Regards,
Inochi

> +
> +/ {
> +	model = "Milk-V Duo S";
> +	compatible = "milkv,duo-s", "sophgo,cv1812h";
> +
> +	aliases {
> +		mmc0 = &sdhci0;
> +		serial0 = &uart0;
> +		serial1 = &uart1;
> +		serial2 = &uart2;
> +		serial3 = &uart3;
> +	};
> +
> +	chosen {
> +		stdout-path = "serial0:115200n8";
> +	};
> +};
> +
> +&osc {
> +	clock-frequency = <25000000>;
> +};
> +
> +&dmac {
> +	status = "okay";
> +};
> +
> +&emmc {
> +	bus-width = <4>;
> +	no-1-8-v;
> +	cap-mmc-hw-reset;
> +	no-sd;
> +	no-sdio;
> +	non-removable;
> +	status = "okay";
> +};
> +
> +&gmac0 {
> +	status = "okay";
> +};
> +
> +&i2c1 {
> +	status = "okay";
> +};
> +
> +&i2c2 {
> +	status = "okay";
> +};
> +
> +&i2c3 {
> +	status = "okay";
> +};
> +
> +&i2c4 {
> +	status = "okay";
> +};
> +
> +&mdio {
> +	status = "okay";
> +};
> +
> +&saradc {
> +	status = "okay";
> +};
> +
> +&sdhci0 {
> +	bus-width = <4>;
> +	no-1-8-v;
> +	disable-wp;
> +	status = "okay";
> +};
> +
> +&sdhci1 {
> +	bus-width = <4>;
> +	cap-sdio-irq;
> +	no-mmc;
> +	no-sd;
> +	non-removable;
> +	status = "okay";
> +};
> +
> +&spi0 {
> +	status = "okay";
> +};
> +
> +&spi3 {
> +	status = "okay";
> +};
> +
> +&uart0 {
> +	status = "okay";
> +};
> +
> +&uart1 {
> +	status = "okay";
> +};
> +
> +&uart2 {
> +	status = "okay";
> +};
> +
> +&uart3 {
> +	status = "okay";
> +};
> +
> -- 
> 2.51.0
> 

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 0/3] Add initial Milk-V Duo S board support
  2025-10-11  1:48 [PATCH 0/3] Add initial Milk-V Duo S board support Joshua Milas
                   ` (2 preceding siblings ...)
  2025-10-11  1:48 ` [PATCH 3/3] riscv64: " Joshua Milas
@ 2025-10-11  2:16 ` Chen Wang
  2025-10-14  3:27 ` Chen Wang
  4 siblings, 0 replies; 16+ messages in thread
From: Chen Wang @ 2025-10-11  2:16 UTC (permalink / raw)
  To: Joshua Milas, robh, krzk+dt, conor+dt, inochiama, paul.walmsley,
	palmer, aou, alex, alexander.sverdlin, rabenda.cn,
	thomas.bonnefille, chao.wei, liujingqi
  Cc: devicetree, sophgo, linux-riscv

Hi, Joshua,

You should add "v2" in the title of this patchset, pleaes run git 
format-patch with "-v 2".

Please do this in next v3.

Thanks,

Chen

On 10/11/2025 9:48 AM, Joshua Milas wrote:
> This adds an initial device tree for the Milk-V Duo S board
> with support for reading from the SD card and network over
> ethernet. This is continued work from Michael Opdenacker's
> v6 series [1] on the ARM64 and RISCV side. It has been tested
> with both ARM64 and RISCV64.
>
> ---
>
> v2
> - Made new entry in docs to avoid DTC check error
> - "Milk-V DuoS" -> "Milk-V Duo S"
> - Sorting of aliases
> - Added uart*, emmc, mdio, gmac0, i2c*, spi*, dmac, saradc
>    to device tree matching what is available on the pinout [2]
>    and available in the device tree includes
> - Removal of 'no-mmc' and 'no-sdio' for sdhci0 as it works
>    without
> - Added riscv device tree
>
> Link: https://lore.kernel.org/linux-riscv/20240421055710.143617-1-michael.opdenacker@bootlin.com/ [1]
> Link: https://milkv.io/duo-s/duos-pinout.webp [2]
>
> Joshua Milas (3):
>    dt-bindings: soc: sophgo: add Milk-V Duo S board compatibles
>    arm64: dts: sophgo: add initial Milk-V Duo S board support
>    riscv64: dts: sophgo: add initial Milk-V Duo S board support
>
>   .../bindings/soc/sophgo/sophgo.yaml           |   5 +
>   arch/arm64/boot/dts/sophgo/Makefile           |   1 +
>   .../boot/dts/sophgo/sg2000-milkv-duo-s.dts    | 110 ++++++++++++++++++
>   arch/riscv/boot/dts/sophgo/Makefile           |   1 +
>   .../boot/dts/sophgo/cv1812h-milkv-duo-s.dts   | 110 ++++++++++++++++++
>   5 files changed, 227 insertions(+)
>   create mode 100644 arch/arm64/boot/dts/sophgo/sg2000-milkv-duo-s.dts
>   create mode 100644 arch/riscv/boot/dts/sophgo/cv1812h-milkv-duo-s.dts
>
>
> base-commit: 0251a1deaec78252cb311fc8305d3670bc5eee0e

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 2/3] arm64: dts: sophgo: add initial Milk-V Duo S board support
  2025-10-11  1:56   ` Inochi Amaoto
@ 2025-10-11 19:19     ` Joshua Milas
  2025-10-13  0:43       ` Inochi Amaoto
  0 siblings, 1 reply; 16+ messages in thread
From: Joshua Milas @ 2025-10-11 19:19 UTC (permalink / raw)
  To: Inochi Amaoto
  Cc: robh, krzk+dt, conor+dt, unicorn_wang, paul.walmsley, palmer, aou,
	alex, alexander.sverdlin, rabenda.cn, thomas.bonnefille, chao.wei,
	liujingqi, devicetree, sophgo, linux-riscv

Hi Inochi,

> Only enable device that can be accessed directly. These devices share
> some pins and only one of them can be used. I suggest enabling devices
> that are accessed by default (which means it is compatible with the
> vendor kernel).

I decompiled the vendor device tree and will match what is in that.
Surprisingly most of these are enabled there. I also tried to check
the pinouts [1] but didnt really get anything out of it.

Link: https://github.com/milkv-duo/duo-files/raw/refs/heads/main/duo-s/hardware/SG2000-PINOUT.xlsx [1]

Thanks,
- Joshua Milas

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 2/3] arm64: dts: sophgo: add initial Milk-V Duo S board support
  2025-10-11 19:19     ` Joshua Milas
@ 2025-10-13  0:43       ` Inochi Amaoto
  2025-10-26 21:35         ` Joshua Milas
  0 siblings, 1 reply; 16+ messages in thread
From: Inochi Amaoto @ 2025-10-13  0:43 UTC (permalink / raw)
  To: Joshua Milas, Inochi Amaoto
  Cc: robh, krzk+dt, conor+dt, unicorn_wang, paul.walmsley, palmer, aou,
	alex, alexander.sverdlin, rabenda.cn, thomas.bonnefille, chao.wei,
	liujingqi, devicetree, sophgo, linux-riscv

On Sat, Oct 11, 2025 at 03:19:19PM -0400, Joshua Milas wrote:
> Hi Inochi,
> 
> > Only enable device that can be accessed directly. These devices share
> > some pins and only one of them can be used. I suggest enabling devices
> > that are accessed by default (which means it is compatible with the
> > vendor kernel).
> 
> I decompiled the vendor device tree and will match what is in that.
> Surprisingly most of these are enabled there. 

Yeah, the vendor enable almost all, but it can not access at
the same time. The pinmux control which device can be accessed
IIRC, milkv already provides a tool, named duo-pinmux, for you
to check the pinmux.

> I also tried to check the pinouts [1] but didnt really get anything
> out of it.
> 
> Link: https://github.com/milkv-duo/duo-files/raw/refs/heads/main/duo-s/hardware/SG2000-PINOUT.xlsx [1]

You need to dump the pinconf register and check the configuration
with the document (the link you mentioned).

Regards,
Inochi

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 0/3] Add initial Milk-V Duo S board support
  2025-10-11  1:48 [PATCH 0/3] Add initial Milk-V Duo S board support Joshua Milas
                   ` (3 preceding siblings ...)
  2025-10-11  2:16 ` [PATCH 0/3] Add " Chen Wang
@ 2025-10-14  3:27 ` Chen Wang
  4 siblings, 0 replies; 16+ messages in thread
From: Chen Wang @ 2025-10-14  3:27 UTC (permalink / raw)
  To: Joshua Milas, robh, krzk+dt, conor+dt, inochiama, paul.walmsley,
	palmer, aou, alex, alexander.sverdlin, rabenda.cn,
	thomas.bonnefille, chao.wei, liujingqi
  Cc: devicetree, sophgo, linux-riscv


On 10/11/2025 9:48 AM, Joshua Milas wrote:
> This adds an initial device tree for the Milk-V Duo S board
> with support for reading from the SD card and network over
> ethernet. This is continued work from Michael Opdenacker's
> v6 series [1] on the ARM64 and RISCV side. It has been tested
> with both ARM64 and RISCV64.
>
> ---
>
> v2
> - Made new entry in docs to avoid DTC check error
> - "Milk-V DuoS" -> "Milk-V Duo S"
> - Sorting of aliases
> - Added uart*, emmc, mdio, gmac0, i2c*, spi*, dmac, saradc
>    to device tree matching what is available on the pinout [2]
>    and available in the device tree includes
> - Removal of 'no-mmc' and 'no-sdio' for sdhci0 as it works
>    without
> - Added riscv device tree

Hi, Joshua,

Better to add link to v1 so we can track the history of this patchset. 
https://lore.kernel.org/linux-riscv/20251013-tt-bh-dts-v3-0-9f058d4bbbda@oss.tenstorrent.com/ 
is a good sample for your quick reference.

Chen

>
> Link: https://lore.kernel.org/linux-riscv/20240421055710.143617-1-michael.opdenacker@bootlin.com/ [1]
> Link: https://milkv.io/duo-s/duos-pinout.webp [2]
>
> Joshua Milas (3):
>    dt-bindings: soc: sophgo: add Milk-V Duo S board compatibles
>    arm64: dts: sophgo: add initial Milk-V Duo S board support
>    riscv64: dts: sophgo: add initial Milk-V Duo S board support
>
>   .../bindings/soc/sophgo/sophgo.yaml           |   5 +
>   arch/arm64/boot/dts/sophgo/Makefile           |   1 +
>   .../boot/dts/sophgo/sg2000-milkv-duo-s.dts    | 110 ++++++++++++++++++
>   arch/riscv/boot/dts/sophgo/Makefile           |   1 +
>   .../boot/dts/sophgo/cv1812h-milkv-duo-s.dts   | 110 ++++++++++++++++++
>   5 files changed, 227 insertions(+)
>   create mode 100644 arch/arm64/boot/dts/sophgo/sg2000-milkv-duo-s.dts
>   create mode 100644 arch/riscv/boot/dts/sophgo/cv1812h-milkv-duo-s.dts
>
>
> base-commit: 0251a1deaec78252cb311fc8305d3670bc5eee0e

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 2/3] arm64: dts: sophgo: add initial Milk-V Duo S board support
  2025-10-13  0:43       ` Inochi Amaoto
@ 2025-10-26 21:35         ` Joshua Milas
  2025-10-26 22:48           ` Michael Opdenacker
  0 siblings, 1 reply; 16+ messages in thread
From: Joshua Milas @ 2025-10-26 21:35 UTC (permalink / raw)
  To: Inochi Amaoto
  Cc: robh, krzk+dt, conor+dt, unicorn_wang, paul.walmsley, palmer, aou,
	alex, alexander.sverdlin, rabenda.cn, thomas.bonnefille, chao.wei,
	liujingqi, devicetree, sophgo, linux-riscv

Inochi,

Thanks for pointing me twards duo-pinmux. I was able to use it to get
the default config which is uart0, spi3, and i2c4. I can change the
dts to match, but...

> I suggest enabling devices that are accessed by default

Would we rather enable anything that can be accessed by the pinmux?

Thanks,
- Joshua Milas


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 2/3] arm64: dts: sophgo: add initial Milk-V Duo S board support
  2025-10-26 21:35         ` Joshua Milas
@ 2025-10-26 22:48           ` Michael Opdenacker
  2025-10-28 23:23             ` Joshua Milas
  2025-10-29  0:53             ` Inochi Amaoto
  0 siblings, 2 replies; 16+ messages in thread
From: Michael Opdenacker @ 2025-10-26 22:48 UTC (permalink / raw)
  To: Joshua Milas, Inochi Amaoto
  Cc: michael.opdenacker, robh, krzk+dt, conor+dt, unicorn_wang,
	paul.walmsley, palmer, aou, alex, alexander.sverdlin, rabenda.cn,
	thomas.bonnefille, chao.wei, liujingqi, devicetree, sophgo,
	linux-riscv

Hi Joshua

Thanks a lot for working on support for Milk-V Duo S. I'll be happy to 
test your V3 :)

On 10/26/25 22:35, Joshua Milas wrote:
> Inochi,
>
> Thanks for pointing me twards duo-pinmux. I was able to use it to get
> the default config which is uart0, spi3, and i2c4. I can change the
> dts to match, but...
>
>> I suggest enabling devices that are accessed by default
> Would we rather enable anything that can be accessed by the pinmux?

If I understand correctly, you can't do that because there will be 
conflicts.
 From the Duo S pinout diagram 
(https://milkv.io/duo-s/duos-pinout.webp), on headers 41 and 39, you 
have to choose between MIPI, I2C2, PWM12/13 or SD1. If at least 2 of 
these are selected at the same time, there will be a conflict, and I 
assume that the pinctrl controller driver will flag it.

Then it sounds complicated to define a default combination for the whole 
board, because it's like a default use model. Who gets to choose? What 
Inochi suggests is to follow the vendor kernel choice, which would 
correspond to the way the vendor intended the board to be used. However 
the community could choose another default way to use the board, so the 
choice may be up to the first contributor to the mainline kernel for 
this board, possibly revised through later discussions.

I guess there are cases when the choice is easy:

- When only one configuration is available for a set of pins
- When there are important devices on I2C or SPI buses on the board. 
Then, you want to find a way to prioritize such buses. Fortunately, I 
guess the board design also guides you to the right choice.

I was facing the the same question today on another board, and that's 
why I'm happy it's raised here. As thousands of DTS files have been 
written before, I'd love to hear from people with experience on this 
topic. Are guidelines written anywhere for board DTS creators?

Cheers
Michael.

-- 
Michael Opdenacker
Root Commit
Yocto Project and OpenEmbedded Training course - Learn by doing:
https://rootcommit.com/training/yocto/


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 2/3] arm64: dts: sophgo: add initial Milk-V Duo S board support
  2025-10-26 22:48           ` Michael Opdenacker
@ 2025-10-28 23:23             ` Joshua Milas
  2025-10-29  0:53             ` Inochi Amaoto
  1 sibling, 0 replies; 16+ messages in thread
From: Joshua Milas @ 2025-10-28 23:23 UTC (permalink / raw)
  To: Michael Opdenacker
  Cc: Inochi Amaoto, robh, krzk+dt, conor+dt, unicorn_wang,
	paul.walmsley, palmer, aou, alex, alexander.sverdlin, rabenda.cn,
	thomas.bonnefille, chao.wei, liujingqi, devicetree, sophgo,
	linux-riscv

Hello Michael,

Thanks for your explanation, I didn't know it might cause an error.
My plan is it enable i2c4, uart0, and spi3 since those are the
default on the pinctrl mux. I have tested uart0 and i2c4, but I am
getting an error with SPI

[    2.423553] dw_spi_mmio 41b0000.spi: DMA init failed

Not sure what is going on. I have the DMA controller enabled and it
seems to be initalizing correctly.

[    0.732791] dw_axi_dmac_platform 4330000.dma-controller: DesignWare AXI DMA Controller, 8 channels

Let me submit v3 so I can get some eyes on it.

Thanks,
- Joshua Milas

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 2/3] arm64: dts: sophgo: add initial Milk-V Duo S board support
  2025-10-26 22:48           ` Michael Opdenacker
  2025-10-28 23:23             ` Joshua Milas
@ 2025-10-29  0:53             ` Inochi Amaoto
  2025-10-30 12:50               ` Michael Opdenacker
  1 sibling, 1 reply; 16+ messages in thread
From: Inochi Amaoto @ 2025-10-29  0:53 UTC (permalink / raw)
  To: Michael Opdenacker, Joshua Milas, Inochi Amaoto
  Cc: robh, krzk+dt, conor+dt, unicorn_wang, paul.walmsley, palmer, aou,
	alex, alexander.sverdlin, rabenda.cn, thomas.bonnefille, chao.wei,
	liujingqi, devicetree, sophgo, linux-riscv

On Sun, Oct 26, 2025 at 10:48:50PM +0000, Michael Opdenacker wrote:
> Hi Joshua
> 
> Thanks a lot for working on support for Milk-V Duo S. I'll be happy to test
> your V3 :)
> 
> On 10/26/25 22:35, Joshua Milas wrote:
> > Inochi,
> > 
> > Thanks for pointing me twards duo-pinmux. I was able to use it to get
> > the default config which is uart0, spi3, and i2c4. I can change the
> > dts to match, but...
> > 
> > > I suggest enabling devices that are accessed by default
> > Would we rather enable anything that can be accessed by the pinmux?
> 
> If I understand correctly, you can't do that because there will be
> conflicts.

> From the Duo S pinout diagram (https://milkv.io/duo-s/duos-pinout.webp), on
> headers 41 and 39, you have to choose between MIPI, I2C2, PWM12/13 or SD1.
> If at least 2 of these are selected at the same time, there will be a
> conflict, and I assume that the pinctrl controller driver will flag it.
> 

Yes, that's true. Boards with CV18XX always require setting pinctrl.

> Then it sounds complicated to define a default combination for the whole
> board, because it's like a default use model. Who gets to choose? What
> Inochi suggests is to follow the vendor kernel choice, which would
> correspond to the way the vendor intended the board to be used. However the
> community could choose another default way to use the board, so the choice
> may be up to the first contributor to the mainline kernel for this board,
> possibly revised through later discussions.
> 

In fact, I see the maintainers do not agree adding every possible
configuration to the DTS, (especially without "omit-if-unused" flag).
And in many case, it is impossible to add all possibility. As a
result, I prefer to use DTS overlay if there is something custom,
and keep the mainline DTS minimum.

> I guess there are cases when the choice is easy:
> 
> - When only one configuration is available for a set of pins
> - When there are important devices on I2C or SPI buses on the board. Then,
> you want to find a way to prioritize such buses. Fortunately, I guess the
> board design also guides you to the right choice.
> 

In fact the priority is the thing that is hard to decide. This is why
I suggesting keeping compatible with the vendor kernel, as many people
starts with vendor kernel and it is a good thing to refer.

>
> I was facing the the same question today on another board, and that's why
> I'm happy it's raised here. As thousands of DTS files have been written
> before, I'd love to hear from people with experience on this topic. Are
> guidelines written anywhere for board DTS creators?
> 
> Cheers
> Michael.
> 
> -- 
> Michael Opdenacker
> Root Commit
> Yocto Project and OpenEmbedded Training course - Learn by doing:
> https://rootcommit.com/training/yocto/
> 

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 2/3] arm64: dts: sophgo: add initial Milk-V Duo S board support
  2025-10-29  0:53             ` Inochi Amaoto
@ 2025-10-30 12:50               ` Michael Opdenacker
  0 siblings, 0 replies; 16+ messages in thread
From: Michael Opdenacker @ 2025-10-30 12:50 UTC (permalink / raw)
  To: Inochi Amaoto, Joshua Milas
  Cc: michael.opdenacker, robh, krzk+dt, conor+dt, unicorn_wang,
	paul.walmsley, palmer, aou, alex, alexander.sverdlin, rabenda.cn,
	thomas.bonnefille, chao.wei, liujingqi, devicetree, sophgo,
	linux-riscv

Hi Inochi,

Thanks a lot for the guidance!

On 10/29/25 01:53, Inochi Amaoto wrote:
> In fact, I see the maintainers do not agree adding every possible
> configuration to the DTS, (especially without "omit-if-unused" flag).
> And in many case, it is impossible to add all possibility. As a
> result, I prefer to use DTS overlay if there is something custom,
> and keep the mainline DTS minimum.

I guess you meant "/omit-if-no-ref/". Good to know!

> In fact the priority is the thing that is hard to decide. This is why
> I suggesting keeping compatible with the vendor kernel, as many people
> starts with vendor kernel and it is a good thing to refer.
This makes sense. Thanks again.
Cheers
Michael.

-- 
Michael Opdenacker
Root Commit
Yocto Project and OpenEmbedded Training course - Learn by doing:
https://rootcommit.com/training/yocto/


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2025-10-30 12:50 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-11  1:48 [PATCH 0/3] Add initial Milk-V Duo S board support Joshua Milas
2025-10-11  1:48 ` [PATCH 1/3] dt-bindings: soc: sophgo: add Milk-V Duo S board compatibles Joshua Milas
2025-10-11  1:50   ` Inochi Amaoto
2025-10-11  1:48 ` [PATCH 2/3] arm64: dts: sophgo: add initial Milk-V Duo S board support Joshua Milas
2025-10-11  1:56   ` Inochi Amaoto
2025-10-11 19:19     ` Joshua Milas
2025-10-13  0:43       ` Inochi Amaoto
2025-10-26 21:35         ` Joshua Milas
2025-10-26 22:48           ` Michael Opdenacker
2025-10-28 23:23             ` Joshua Milas
2025-10-29  0:53             ` Inochi Amaoto
2025-10-30 12:50               ` Michael Opdenacker
2025-10-11  1:48 ` [PATCH 3/3] riscv64: " Joshua Milas
2025-10-11  1:57   ` Inochi Amaoto
2025-10-11  2:16 ` [PATCH 0/3] Add " Chen Wang
2025-10-14  3:27 ` Chen Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).