mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 1/2] dt-bindings: soc: sophgo: add Milk-V Duo 256M board
@ 2026-06-10 12:10 Chen-Yu Yeh
  2026-06-10 12:10 ` [PATCH v2 2/2] riscv: dts: sophgo: Add Milk-V Duo 256M board support Chen-Yu Yeh
  2026-06-10 16:34 ` [PATCH v2 1/2] dt-bindings: soc: sophgo: add Milk-V Duo 256M board Conor Dooley
  0 siblings, 2 replies; 6+ messages in thread
From: Chen-Yu Yeh @ 2026-06-10 12:10 UTC (permalink / raw)
  To: unicorn_wang, inochiama
  Cc: Chen-Yu Yeh, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Nutty Liu, Han Gao, Alexander Sverdlin, Chao Wei,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list:SOPHGO DEVICETREES and DRIVERS, open list

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

Signed-off-by: Chen-Yu Yeh <chenyou910331@gmail.com>
---
 Documentation/devicetree/bindings/soc/sophgo/sophgo.yaml | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/soc/sophgo/sophgo.yaml b/Documentation/devicetree/bindings/soc/sophgo/sophgo.yaml
index 1c502618de51..fcb1d905da7d 100644
--- a/Documentation/devicetree/bindings/soc/sophgo/sophgo.yaml
+++ b/Documentation/devicetree/bindings/soc/sophgo/sophgo.yaml
@@ -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
-- 
2.43.0


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

* [PATCH v2 2/2] riscv: dts: sophgo: Add Milk-V Duo 256M board support
  2026-06-10 12:10 [PATCH v2 1/2] dt-bindings: soc: sophgo: add Milk-V Duo 256M board Chen-Yu Yeh
@ 2026-06-10 12:10 ` Chen-Yu Yeh
  2026-07-02  3:38   ` Inochi Amaoto
  2026-06-10 16:34 ` [PATCH v2 1/2] dt-bindings: soc: sophgo: add Milk-V Duo 256M board Conor Dooley
  1 sibling, 1 reply; 6+ messages in thread
From: Chen-Yu Yeh @ 2026-06-10 12:10 UTC (permalink / raw)
  To: unicorn_wang, inochiama
  Cc: Chen-Yu Yeh, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
	Han Gao, Nutty Liu, Longbin Li,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list:RISC-V ARCHITECTURE,
	open list:SOPHGO DEVICETREES and DRIVERS, open list

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.

Signed-off-by: Chen-Yu Yeh <chenyou910331@gmail.com>
---
Changes since v1:
- Removed the leds node because &porte is not yet supported in cv180x.dtsi,
  which would cause a dtc compilation error.
- Retained the &usb node because it is already defined in cv180x.dtsi.
- Cleaned up the trailing blank line in the Makefile.

 arch/riscv/boot/dts/sophgo/Makefile           |   3 +-
 .../boot/dts/sophgo/sg2002-milkv-duo256m.dts  | 108 ++++++++++++++++++
 2 files changed, 110 insertions(+), 1 deletion(-)
 create mode 100644 arch/riscv/boot/dts/sophgo/sg2002-milkv-duo256m.dts

diff --git a/arch/riscv/boot/dts/sophgo/Makefile b/arch/riscv/boot/dts/sophgo/Makefile
index 6f65526d4193..f9415c30a2c5 100644
--- a/arch/riscv/boot/dts/sophgo/Makefile
+++ b/arch/riscv/boot/dts/sophgo/Makefile
@@ -2,7 +2,8 @@
 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
+dtb-$(CONFIG_ARCH_SOPHGO) += sg2044-sophgo-srd3-10.dtb
\ No newline at end of file
diff --git a/arch/riscv/boot/dts/sophgo/sg2002-milkv-duo256m.dts b/arch/riscv/boot/dts/sophgo/sg2002-milkv-duo256m.dts
new file mode 100644
index 000000000000..4cf441ab3790
--- /dev/null
+++ b/arch/riscv/boot/dts/sophgo/sg2002-milkv-duo256m.dts
@@ -0,0 +1,108 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2023 Jisheng Zhang <jszhang@kernel.org>
+ */
+
+/dts-v1/;
+
+#include "sg2002.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+
+/ {
+	model = "Milk-V Duo 256M";
+	compatible = "milkv,duo256m", "sophgo,sg2002";
+
+	aliases {
+		serial0 = &uart0;
+		serial1 = &uart1;
+		serial2 = &uart2;
+		serial3 = &uart3;
+		serial4 = &uart4;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+
+	reserved-memory {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+
+		coprocessor_rtos: region@83f40000 {
+			reg = <0x83f40000 0xc0000>;
+			no-map;
+		};
+	};
+};
+
+&osc {
+	clock-frequency = <25000000>;
+};
+
+&pinctrl {
+	uart0_cfg: uart0-cfg {
+		uart0-pins {
+			pinmux = <PINMUX(PIN_UART0_TX, 0)>,
+				 <PINMUX(PIN_UART0_RX, 0)>;
+			bias-pull-up;
+			drive-strength-microamp = <10800>;
+			power-source = <3300>;
+		};
+	};
+
+	sdhci0_cfg: sdhci0-cfg {
+		sdhci0-clk-pins {
+			pinmux = <PINMUX(PIN_SD0_CLK, 0)>;
+			bias-pull-up;
+			drive-strength-microamp = <16100>;
+			power-source = <3300>;
+		};
+
+		sdhci0-cmd-pins {
+			pinmux = <PINMUX(PIN_SD0_CMD, 0)>;
+			bias-pull-up;
+			drive-strength-microamp = <10800>;
+			power-source = <3300>;
+		};
+
+		sdhci0-data-pins {
+			pinmux = <PINMUX(PIN_SD0_D0, 0)>,
+				 <PINMUX(PIN_SD0_D1, 0)>,
+				 <PINMUX(PIN_SD0_D2, 0)>,
+				 <PINMUX(PIN_SD0_D3, 0)>;
+			bias-pull-up;
+			drive-strength-microamp = <10800>;
+			power-source = <3300>;
+		};
+
+		sdhci0-cd-pins {
+			pinmux = <PINMUX(PIN_SD0_CD, 0)>;
+			bias-pull-up;
+			drive-strength-microamp = <10800>;
+			power-source = <3300>;
+		};
+	};
+};
+
+&sdhci0 {
+	pinctrl-0 = <&sdhci0_cfg>;
+	pinctrl-names = "default";
+	status = "okay";
+	bus-width = <4>;
+	no-1-8-v;
+	no-mmc;
+	no-sdio;
+	disable-wp;
+};
+
+&uart0 {
+	pinctrl-0 = <&uart0_cfg>;
+	pinctrl-names = "default";
+	status = "okay";
+};
+
+&usb {
+	dr_mode = "host";
+	status = "okay";
+};
-- 
2.43.0


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

* Re: [PATCH v2 1/2] dt-bindings: soc: sophgo: add Milk-V Duo 256M board
  2026-06-10 12:10 [PATCH v2 1/2] dt-bindings: soc: sophgo: add Milk-V Duo 256M board Chen-Yu Yeh
  2026-06-10 12:10 ` [PATCH v2 2/2] riscv: dts: sophgo: Add Milk-V Duo 256M board support Chen-Yu Yeh
@ 2026-06-10 16:34 ` Conor Dooley
  1 sibling, 0 replies; 6+ messages in thread
From: Conor Dooley @ 2026-06-10 16:34 UTC (permalink / raw)
  To: Chen-Yu Yeh
  Cc: unicorn_wang, inochiama, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Nutty Liu, Han Gao, Alexander Sverdlin, Chao Wei,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list:SOPHGO DEVICETREES and DRIVERS, open list

[-- Attachment #1: Type: text/plain, Size: 75 bytes --]

Acked-by: Conor Dooley <conor.dooley@microchip.com>
pw-bot: not-applicable

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* Re: [PATCH v2 2/2] riscv: dts: sophgo: Add Milk-V Duo 256M board support
  2026-06-10 12:10 ` [PATCH v2 2/2] riscv: dts: sophgo: Add Milk-V Duo 256M board support Chen-Yu Yeh
@ 2026-07-02  3:38   ` Inochi Amaoto
  2026-07-02  9:51     ` Inochi Amaoto
  0 siblings, 1 reply; 6+ messages in thread
From: Inochi Amaoto @ 2026-07-02  3:38 UTC (permalink / raw)
  To: Chen-Yu Yeh, unicorn_wang, inochiama
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Han Gao, Nutty Liu,
	Longbin Li,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list:RISC-V ARCHITECTURE,
	open list:SOPHGO DEVICETREES and DRIVERS, open list

On Wed, Jun 10, 2026 at 08:10:10PM +0800, Chen-Yu Yeh wrote:
> 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.
> 

IIRC the led is not controlled by the small core, so the node should
be described in the dts.

I see the Sashiko does provide some good question, please check.

> Signed-off-by: Chen-Yu Yeh <chenyou910331@gmail.com>
> ---
> Changes since v1:
> - Removed the leds node because &porte is not yet supported in cv180x.dtsi,
>   which would cause a dtc compilation error.
> - Retained the &usb node because it is already defined in cv180x.dtsi.
> - Cleaned up the trailing blank line in the Makefile.
> 
>  arch/riscv/boot/dts/sophgo/Makefile           |   3 +-
>  .../boot/dts/sophgo/sg2002-milkv-duo256m.dts  | 108 ++++++++++++++++++
>  2 files changed, 110 insertions(+), 1 deletion(-)
>  create mode 100644 arch/riscv/boot/dts/sophgo/sg2002-milkv-duo256m.dts
> 
> diff --git a/arch/riscv/boot/dts/sophgo/Makefile b/arch/riscv/boot/dts/sophgo/Makefile
> index 6f65526d4193..f9415c30a2c5 100644
> --- a/arch/riscv/boot/dts/sophgo/Makefile
> +++ b/arch/riscv/boot/dts/sophgo/Makefile
> @@ -2,7 +2,8 @@
>  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
> +dtb-$(CONFIG_ARCH_SOPHGO) += sg2044-sophgo-srd3-10.dtb
> \ No newline at end of file


Why you change this? Please do not touch unrelated things.

> diff --git a/arch/riscv/boot/dts/sophgo/sg2002-milkv-duo256m.dts b/arch/riscv/boot/dts/sophgo/sg2002-milkv-duo256m.dts
> new file mode 100644
> index 000000000000..4cf441ab3790
> --- /dev/null
> +++ b/arch/riscv/boot/dts/sophgo/sg2002-milkv-duo256m.dts
> @@ -0,0 +1,108 @@
> +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
> +/*
> + * Copyright (C) 2023 Jisheng Zhang <jszhang@kernel.org>

I guess a right copyright is needed for your code.

> + */
> +
> +/dts-v1/;
> +
> +#include "sg2002.dtsi"
> +#include <dt-bindings/gpio/gpio.h>
> +
> +/ {
> +	model = "Milk-V Duo 256M";
> +	compatible = "milkv,duo256m", "sophgo,sg2002";
> +
> +	aliases {
> +		serial0 = &uart0;
> +		serial1 = &uart1;
> +		serial2 = &uart2;
> +		serial3 = &uart3;
> +		serial4 = &uart4;
> +	};
> +
> +	chosen {
> +		stdout-path = "serial0:115200n8";
> +	};
> +
> +	reserved-memory {
> +		#address-cells = <1>;
> +		#size-cells = <1>;
> +		ranges;
> +
> +		coprocessor_rtos: region@83f40000 {
> +			reg = <0x83f40000 0xc0000>;
> +			no-map;
> +		};
> +	};
> +};
> +
> +&osc {
> +	clock-frequency = <25000000>;
> +};
> +
> +&pinctrl {
> +	uart0_cfg: uart0-cfg {
> +		uart0-pins {
> +			pinmux = <PINMUX(PIN_UART0_TX, 0)>,
> +				 <PINMUX(PIN_UART0_RX, 0)>;
> +			bias-pull-up;
> +			drive-strength-microamp = <10800>;
> +			power-source = <3300>;
> +		};
> +	};
> +
> +	sdhci0_cfg: sdhci0-cfg {
> +		sdhci0-clk-pins {
> +			pinmux = <PINMUX(PIN_SD0_CLK, 0)>;
> +			bias-pull-up;
> +			drive-strength-microamp = <16100>;
> +			power-source = <3300>;
> +		};
> +
> +		sdhci0-cmd-pins {
> +			pinmux = <PINMUX(PIN_SD0_CMD, 0)>;
> +			bias-pull-up;
> +			drive-strength-microamp = <10800>;
> +			power-source = <3300>;
> +		};
> +
> +		sdhci0-data-pins {
> +			pinmux = <PINMUX(PIN_SD0_D0, 0)>,
> +				 <PINMUX(PIN_SD0_D1, 0)>,
> +				 <PINMUX(PIN_SD0_D2, 0)>,
> +				 <PINMUX(PIN_SD0_D3, 0)>;
> +			bias-pull-up;
> +			drive-strength-microamp = <10800>;
> +			power-source = <3300>;
> +		};
> +
> +		sdhci0-cd-pins {
> +			pinmux = <PINMUX(PIN_SD0_CD, 0)>;
> +			bias-pull-up;
> +			drive-strength-microamp = <10800>;
> +			power-source = <3300>;
> +		};
> +	};
> +};
> +
> +&sdhci0 {
> +	pinctrl-0 = <&sdhci0_cfg>;
> +	pinctrl-names = "default";
> +	status = "okay";
> +	bus-width = <4>;
> +	no-1-8-v;
> +	no-mmc;
> +	no-sdio;
> +	disable-wp;
> +};
> +
> +&uart0 {
> +	pinctrl-0 = <&uart0_cfg>;
> +	pinctrl-names = "default";
> +	status = "okay";
> +};
> +
> +&usb {
> +	dr_mode = "host";
> +	status = "okay";
> +};
> -- 
> 2.43.0
> 

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

* Re: [PATCH v2 2/2] riscv: dts: sophgo: Add Milk-V Duo 256M board support
  2026-07-02  3:38   ` Inochi Amaoto
@ 2026-07-02  9:51     ` Inochi Amaoto
  2026-07-10  8:07       ` 葉宸佑
  0 siblings, 1 reply; 6+ messages in thread
From: Inochi Amaoto @ 2026-07-02  9:51 UTC (permalink / raw)
  To: Chen-Yu Yeh, unicorn_wang, inochiama
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Han Gao, Nutty Liu,
	Longbin Li,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list:RISC-V ARCHITECTURE,
	open list:SOPHGO DEVICETREES and DRIVERS, open list

On Thu, Jul 02, 2026 at 11:38:09AM +0800, Inochi Amaoto wrote:
> On Wed, Jun 10, 2026 at 08:10:10PM +0800, Chen-Yu Yeh wrote:
> > 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.
> > 
> 
> IIRC the led is not controlled by the small core, so the node should
> be described in the dts.
> 
> I see the Sashiko does provide some good question, please check.
> 
> > Signed-off-by: Chen-Yu Yeh <chenyou910331@gmail.com>
> > ---
> > Changes since v1:
> > - Removed the leds node because &porte is not yet supported in cv180x.dtsi,
> >   which would cause a dtc compilation error.
> > - Retained the &usb node because it is already defined in cv180x.dtsi.
> > - Cleaned up the trailing blank line in the Makefile.
> > 


So why not adding the porte?

Regards,
Inochi

> >  arch/riscv/boot/dts/sophgo/Makefile           |   3 +-
> >  .../boot/dts/sophgo/sg2002-milkv-duo256m.dts  | 108 ++++++++++++++++++
> >  2 files changed, 110 insertions(+), 1 deletion(-)
> >  create mode 100644 arch/riscv/boot/dts/sophgo/sg2002-milkv-duo256m.dts
> > 
> > diff --git a/arch/riscv/boot/dts/sophgo/Makefile b/arch/riscv/boot/dts/sophgo/Makefile
> > index 6f65526d4193..f9415c30a2c5 100644
> > --- a/arch/riscv/boot/dts/sophgo/Makefile
> > +++ b/arch/riscv/boot/dts/sophgo/Makefile
> > @@ -2,7 +2,8 @@
> >  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
> > +dtb-$(CONFIG_ARCH_SOPHGO) += sg2044-sophgo-srd3-10.dtb
> > \ No newline at end of file
> 
> 
> Why you change this? Please do not touch unrelated things.
> 
> > diff --git a/arch/riscv/boot/dts/sophgo/sg2002-milkv-duo256m.dts b/arch/riscv/boot/dts/sophgo/sg2002-milkv-duo256m.dts
> > new file mode 100644
> > index 000000000000..4cf441ab3790
> > --- /dev/null
> > +++ b/arch/riscv/boot/dts/sophgo/sg2002-milkv-duo256m.dts
> > @@ -0,0 +1,108 @@
> > +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
> > +/*
> > + * Copyright (C) 2023 Jisheng Zhang <jszhang@kernel.org>
> 
> I guess a right copyright is needed for your code.
> 
> > + */
> > +
> > +/dts-v1/;
> > +
> > +#include "sg2002.dtsi"
> > +#include <dt-bindings/gpio/gpio.h>
> > +
> > +/ {
> > +	model = "Milk-V Duo 256M";
> > +	compatible = "milkv,duo256m", "sophgo,sg2002";
> > +
> > +	aliases {
> > +		serial0 = &uart0;
> > +		serial1 = &uart1;
> > +		serial2 = &uart2;
> > +		serial3 = &uart3;
> > +		serial4 = &uart4;
> > +	};
> > +
> > +	chosen {
> > +		stdout-path = "serial0:115200n8";
> > +	};
> > +
> > +	reserved-memory {
> > +		#address-cells = <1>;
> > +		#size-cells = <1>;
> > +		ranges;
> > +
> > +		coprocessor_rtos: region@83f40000 {
> > +			reg = <0x83f40000 0xc0000>;
> > +			no-map;
> > +		};
> > +	};
> > +};
> > +
> > +&osc {
> > +	clock-frequency = <25000000>;
> > +};
> > +
> > +&pinctrl {
> > +	uart0_cfg: uart0-cfg {
> > +		uart0-pins {
> > +			pinmux = <PINMUX(PIN_UART0_TX, 0)>,
> > +				 <PINMUX(PIN_UART0_RX, 0)>;
> > +			bias-pull-up;
> > +			drive-strength-microamp = <10800>;
> > +			power-source = <3300>;
> > +		};
> > +	};
> > +
> > +	sdhci0_cfg: sdhci0-cfg {
> > +		sdhci0-clk-pins {
> > +			pinmux = <PINMUX(PIN_SD0_CLK, 0)>;
> > +			bias-pull-up;
> > +			drive-strength-microamp = <16100>;
> > +			power-source = <3300>;
> > +		};
> > +
> > +		sdhci0-cmd-pins {
> > +			pinmux = <PINMUX(PIN_SD0_CMD, 0)>;
> > +			bias-pull-up;
> > +			drive-strength-microamp = <10800>;
> > +			power-source = <3300>;
> > +		};
> > +
> > +		sdhci0-data-pins {
> > +			pinmux = <PINMUX(PIN_SD0_D0, 0)>,
> > +				 <PINMUX(PIN_SD0_D1, 0)>,
> > +				 <PINMUX(PIN_SD0_D2, 0)>,
> > +				 <PINMUX(PIN_SD0_D3, 0)>;
> > +			bias-pull-up;
> > +			drive-strength-microamp = <10800>;
> > +			power-source = <3300>;
> > +		};
> > +
> > +		sdhci0-cd-pins {
> > +			pinmux = <PINMUX(PIN_SD0_CD, 0)>;
> > +			bias-pull-up;
> > +			drive-strength-microamp = <10800>;
> > +			power-source = <3300>;
> > +		};
> > +	};
> > +};
> > +
> > +&sdhci0 {
> > +	pinctrl-0 = <&sdhci0_cfg>;
> > +	pinctrl-names = "default";
> > +	status = "okay";
> > +	bus-width = <4>;
> > +	no-1-8-v;
> > +	no-mmc;
> > +	no-sdio;
> > +	disable-wp;
> > +};
> > +
> > +&uart0 {
> > +	pinctrl-0 = <&uart0_cfg>;
> > +	pinctrl-names = "default";
> > +	status = "okay";
> > +};
> > +
> > +&usb {
> > +	dr_mode = "host";
> > +	status = "okay";
> > +};
> > -- 
> > 2.43.0
> > 

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

* Re: [PATCH v2 2/2] riscv: dts: sophgo: Add Milk-V Duo 256M board support
  2026-07-02  9:51     ` Inochi Amaoto
@ 2026-07-10  8:07       ` 葉宸佑
  0 siblings, 0 replies; 6+ messages in thread
From: 葉宸佑 @ 2026-07-10  8:07 UTC (permalink / raw)
  To: Inochi Amaoto
  Cc: unicorn_wang, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
	Han Gao, Nutty Liu, Longbin Li,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list:RISC-V ARCHITECTURE,
	open list:SOPHGO DEVICETREES and DRIVERS, open list

> > IIRC the led is not controlled by the small core, so the node should
> > be described in the dts.
> ...
> So why not adding the porte?

You are right, adding the porte is the proper fix. In v3 I added the
PWR_GPIO controller node to cv180x.dtsi as a separate patch, and
restored the gpio-leds node in the board dts. Verified on the actual
board that the heartbeat LED works with the new node.

> Why you change this? Please do not touch unrelated things.

Sorry, the removal of the trailing newline was accidental. I have
dropped this unrelated change in v3.

> I guess a right copyright is needed for your code.

Fixed in v3. Since the file is derived from cv1800b-milkv-duo.dts, I
kept the original copyright and added my own.

v3 has been sent:
https://lore.kernel.org/r/20260710075917.159969-1-chenyou910331@gmail.com

Thanks for the review,
Chen-Yu

Inochi Amaoto <inochiama@gmail.com> 於 2026年7月2日週四 下午5:51寫道:
>
> On Thu, Jul 02, 2026 at 11:38:09AM +0800, Inochi Amaoto wrote:
> > On Wed, Jun 10, 2026 at 08:10:10PM +0800, Chen-Yu Yeh wrote:
> > > 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.
> > >
> >
> > IIRC the led is not controlled by the small core, so the node should
> > be described in the dts.
> >
> > I see the Sashiko does provide some good question, please check.
> >
> > > Signed-off-by: Chen-Yu Yeh <chenyou910331@gmail.com>
> > > ---
> > > Changes since v1:
> > > - Removed the leds node because &porte is not yet supported in cv180x.dtsi,
> > >   which would cause a dtc compilation error.
> > > - Retained the &usb node because it is already defined in cv180x.dtsi.
> > > - Cleaned up the trailing blank line in the Makefile.
> > >
>
>
> So why not adding the porte?
>
> Regards,
> Inochi
>
> > >  arch/riscv/boot/dts/sophgo/Makefile           |   3 +-
> > >  .../boot/dts/sophgo/sg2002-milkv-duo256m.dts  | 108 ++++++++++++++++++
> > >  2 files changed, 110 insertions(+), 1 deletion(-)
> > >  create mode 100644 arch/riscv/boot/dts/sophgo/sg2002-milkv-duo256m.dts
> > >
> > > diff --git a/arch/riscv/boot/dts/sophgo/Makefile b/arch/riscv/boot/dts/sophgo/Makefile
> > > index 6f65526d4193..f9415c30a2c5 100644
> > > --- a/arch/riscv/boot/dts/sophgo/Makefile
> > > +++ b/arch/riscv/boot/dts/sophgo/Makefile
> > > @@ -2,7 +2,8 @@
> > >  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
> > > +dtb-$(CONFIG_ARCH_SOPHGO) += sg2044-sophgo-srd3-10.dtb
> > > \ No newline at end of file
> >
> >
> > Why you change this? Please do not touch unrelated things.
> >
> > > diff --git a/arch/riscv/boot/dts/sophgo/sg2002-milkv-duo256m.dts b/arch/riscv/boot/dts/sophgo/sg2002-milkv-duo256m.dts
> > > new file mode 100644
> > > index 000000000000..4cf441ab3790
> > > --- /dev/null
> > > +++ b/arch/riscv/boot/dts/sophgo/sg2002-milkv-duo256m.dts
> > > @@ -0,0 +1,108 @@
> > > +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
> > > +/*
> > > + * Copyright (C) 2023 Jisheng Zhang <jszhang@kernel.org>
> >
> > I guess a right copyright is needed for your code.
> >
> > > + */
> > > +
> > > +/dts-v1/;
> > > +
> > > +#include "sg2002.dtsi"
> > > +#include <dt-bindings/gpio/gpio.h>
> > > +
> > > +/ {
> > > +   model = "Milk-V Duo 256M";
> > > +   compatible = "milkv,duo256m", "sophgo,sg2002";
> > > +
> > > +   aliases {
> > > +           serial0 = &uart0;
> > > +           serial1 = &uart1;
> > > +           serial2 = &uart2;
> > > +           serial3 = &uart3;
> > > +           serial4 = &uart4;
> > > +   };
> > > +
> > > +   chosen {
> > > +           stdout-path = "serial0:115200n8";
> > > +   };
> > > +
> > > +   reserved-memory {
> > > +           #address-cells = <1>;
> > > +           #size-cells = <1>;
> > > +           ranges;
> > > +
> > > +           coprocessor_rtos: region@83f40000 {
> > > +                   reg = <0x83f40000 0xc0000>;
> > > +                   no-map;
> > > +           };
> > > +   };
> > > +};
> > > +
> > > +&osc {
> > > +   clock-frequency = <25000000>;
> > > +};
> > > +
> > > +&pinctrl {
> > > +   uart0_cfg: uart0-cfg {
> > > +           uart0-pins {
> > > +                   pinmux = <PINMUX(PIN_UART0_TX, 0)>,
> > > +                            <PINMUX(PIN_UART0_RX, 0)>;
> > > +                   bias-pull-up;
> > > +                   drive-strength-microamp = <10800>;
> > > +                   power-source = <3300>;
> > > +           };
> > > +   };
> > > +
> > > +   sdhci0_cfg: sdhci0-cfg {
> > > +           sdhci0-clk-pins {
> > > +                   pinmux = <PINMUX(PIN_SD0_CLK, 0)>;
> > > +                   bias-pull-up;
> > > +                   drive-strength-microamp = <16100>;
> > > +                   power-source = <3300>;
> > > +           };
> > > +
> > > +           sdhci0-cmd-pins {
> > > +                   pinmux = <PINMUX(PIN_SD0_CMD, 0)>;
> > > +                   bias-pull-up;
> > > +                   drive-strength-microamp = <10800>;
> > > +                   power-source = <3300>;
> > > +           };
> > > +
> > > +           sdhci0-data-pins {
> > > +                   pinmux = <PINMUX(PIN_SD0_D0, 0)>,
> > > +                            <PINMUX(PIN_SD0_D1, 0)>,
> > > +                            <PINMUX(PIN_SD0_D2, 0)>,
> > > +                            <PINMUX(PIN_SD0_D3, 0)>;
> > > +                   bias-pull-up;
> > > +                   drive-strength-microamp = <10800>;
> > > +                   power-source = <3300>;
> > > +           };
> > > +
> > > +           sdhci0-cd-pins {
> > > +                   pinmux = <PINMUX(PIN_SD0_CD, 0)>;
> > > +                   bias-pull-up;
> > > +                   drive-strength-microamp = <10800>;
> > > +                   power-source = <3300>;
> > > +           };
> > > +   };
> > > +};
> > > +
> > > +&sdhci0 {
> > > +   pinctrl-0 = <&sdhci0_cfg>;
> > > +   pinctrl-names = "default";
> > > +   status = "okay";
> > > +   bus-width = <4>;
> > > +   no-1-8-v;
> > > +   no-mmc;
> > > +   no-sdio;
> > > +   disable-wp;
> > > +};
> > > +
> > > +&uart0 {
> > > +   pinctrl-0 = <&uart0_cfg>;
> > > +   pinctrl-names = "default";
> > > +   status = "okay";
> > > +};
> > > +
> > > +&usb {
> > > +   dr_mode = "host";
> > > +   status = "okay";
> > > +};
> > > --
> > > 2.43.0
> > >

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

end of thread, other threads:[~2026-07-10  8:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-10 12:10 [PATCH v2 1/2] dt-bindings: soc: sophgo: add Milk-V Duo 256M board Chen-Yu Yeh
2026-06-10 12:10 ` [PATCH v2 2/2] riscv: dts: sophgo: Add Milk-V Duo 256M board support Chen-Yu Yeh
2026-07-02  3:38   ` Inochi Amaoto
2026-07-02  9:51     ` Inochi Amaoto
2026-07-10  8:07       ` 葉宸佑
2026-06-10 16:34 ` [PATCH v2 1/2] dt-bindings: soc: sophgo: add Milk-V Duo 256M board Conor Dooley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome