From: Hiago De Franco <hfranco@baylibre.com>
To: Zhuxu Ran <zhuxu_ran@zohomail.com>
Cc: u-boot@lists.u-boot-project.org, Chao Wei <chao.wei@sophgo.com>,
Chen Wang <unicorn_wang@outlook.com>, Yao Zi <me@ziyao.cc>,
Lukasz Majewski <lukma@denx.de>, Tom Rini <trini@konsulko.com>,
Peng Fan <peng.fan@nxp.com>,
Jaehoon Chung <jh80.chung@samsung.com>,
Stefan Roese <stefan.roese@mailbox.org>,
Sumit Garg <sumit.garg@kernel.org>,
Inochi Amaoto <inochiama@gmail.com>,
Conor Dooley <conor.dooley@microchip.com>,
Chen-Yu Yeh <chenyou910331@gmail.com>,
Chen Wang <chen.wang@linux.dev>,
Kongyang Liu <seashell11234455@gmail.com>,
Leo Liang <leo.liang@sifive.com>,
Thomas Bonnefille <thomas.bonnefille@bootlin.com>,
Quentin Schulz <quentin.schulz@cherry.de>,
Johan Jonker <jbx6244@gmail.com>,
Casey Connolly <casey.connolly@linaro.org>,
Varadarajan Narayanan <varadarajan.narayanan@oss.qualcomm.com>,
Alexander Koch <akoch@initse.com>,
Andreas Schwab <schwab@suse.de>,
Junhui Liu <junhui.liu@pigmoral.tech>,
Marek Vasut <marex@nabladev.com>,
Sumit Garg <sumit.garg@oss.qualcomm.com>,
Peter Robinson <pbrobinson@gmail.com>,
Ilias Apalodimas <ilias.apalodimas@linaro.org>
Subject: Re: [PATCH v4 08/11] riscv: milkv_duo_256m: Use upstream devicetree
Date: Thu, 24 Sep 2026 09:45:41 -0300 [thread overview]
Message-ID: <arUZwbtnDO9g3cUZ@hiagonb> (raw)
In-Reply-To: <20260922-milkv-duo-upstream-dts-v4-8-d45b74dfad36@zohomail.com>
Hi Zhuxu,
On Tue, Sep 22, 2026 at 11:46:23PM +0800, Zhuxu Ran wrote:
> Switch Milk-V Duo 256M to the upstream SG2002 devicetree by enabling
> CONFIG_OF_UPSTREAM and selecting sophgo/sg2002-milkv-duo256m.
>
> The upstream devicetree keeps the Ethernet MAC disabled. Add a U-Boot
> override to preserve the existing networking support when the optional
> IO board is attached.
>
> Remove the local board devicetree and update the OpenSBI build
> instructions to use the upstream DTB.
>
> Signed-off-by: Zhuxu Ran <zhuxu_ran@zohomail.com>
> ---
> arch/riscv/dts/Makefile | 1 -
> arch/riscv/dts/sg2002-milkv-duo256m-u-boot.dtsi | 16 +++++++++
> arch/riscv/dts/sg2002-milkv-duo256m.dts | 46 -------------------------
> board/sophgo/milkv_duo_256m/MAINTAINERS | 1 +
> configs/milkv_duo_256m_defconfig | 3 +-
> doc/board/sophgo/milkv_duo_256m.rst | 2 +-
> 6 files changed, 20 insertions(+), 49 deletions(-)
>
> diff --git a/arch/riscv/dts/Makefile b/arch/riscv/dts/Makefile
> index 8ba75fdb9f5..71c5c13d221 100644
> --- a/arch/riscv/dts/Makefile
> +++ b/arch/riscv/dts/Makefile
> @@ -5,7 +5,6 @@ dtb-$(CONFIG_TARGET_ANDES_VOYAGER) += qilai-voyager.dtb
> dtb-$(CONFIG_TARGET_K230_CANMV) += k230-canmv.dtb
> dtb-$(CONFIG_TARGET_MICROCHIP_ICICLE) += mpfs-icicle-kit.dtb
> dtb-$(CONFIG_TARGET_MILKV_DUO) += cv1800b-milkv-duo.dtb
> -dtb-$(CONFIG_TARGET_MILKV_DUO_256M) += sg2002-milkv-duo256m.dtb
> dtb-$(CONFIG_TARGET_LICHEERV_NANO) += sg2002-licheerv-nano-b.dtb
> dtb-$(CONFIG_TARGET_QEMU_VIRT) += qemu-virt32.dtb qemu-virt64.dtb
> dtb-$(CONFIG_TARGET_OPENPITON_RISCV64) += openpiton-riscv64.dtb
> diff --git a/arch/riscv/dts/sg2002-milkv-duo256m-u-boot.dtsi b/arch/riscv/dts/sg2002-milkv-duo256m-u-boot.dtsi
> new file mode 100644
> index 00000000000..3872343636f
> --- /dev/null
> +++ b/arch/riscv/dts/sg2002-milkv-duo256m-u-boot.dtsi
> @@ -0,0 +1,16 @@
> +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
> +/*
> + * Copyright (C) 2026 Zhuxu Ran <zhuxu_ran@zohomail.com>
> + */
> +
> +/*
> + * The Ethernet signals are routed to the RJ45 connector on the optional
> + * IO Board. Keep Ethernet available in U-Boot when the IO Board is attached.
> + */
> +&gmac0 {
> + status = "okay";
> +};
> +
> +&mdio {
> + status = "okay";
> +};
I see that milkv_duo_256m_defconfig doesn't enable DM_MDIO, DM_MDIO_MUX
or MDIO_MUX_MMIOREG, so nothing binds to the mdio-mux node.
Note that the upstream gmac0 node uses phy-mode = "internal" and a
phy-handle into the mdio mux, while the old local DT used phy-mode =
"rmii".
Can you check this? Have you tested the ethernet port on Duo 256M?
> diff --git a/arch/riscv/dts/sg2002-milkv-duo256m.dts b/arch/riscv/dts/sg2002-milkv-duo256m.dts
> deleted file mode 100644
> index 4ad86ce39ec..00000000000
> --- a/arch/riscv/dts/sg2002-milkv-duo256m.dts
> +++ /dev/null
> @@ -1,46 +0,0 @@
> -// SPDX-License-Identifier: (GPL-2.0 OR MIT)
> -/*
> - * Copyright (C) 2026 Hiago De Franco <hfranco@baylibre.com>
> - */
> -
> -/dts-v1/;
> -
> -#include "sg2002.dtsi"
> -
> -/ {
> - 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";
> - };
> -};
> -
> -ðernet0 {
> - status = "okay";
> - phy-mode = "rmii";
> -};
> -
> -&osc {
> - clock-frequency = <25000000>;
> -};
> -
> -&sdhci0 {
> - status = "okay";
> - bus-width = <4>;
> - no-1-8-v;
> - no-mmc;
> - no-sdio;
> -};
> -
> -&uart0 {
> - status = "okay";
> -};
> diff --git a/board/sophgo/milkv_duo_256m/MAINTAINERS b/board/sophgo/milkv_duo_256m/MAINTAINERS
> index 929960e7251..3488db28145 100644
> --- a/board/sophgo/milkv_duo_256m/MAINTAINERS
> +++ b/board/sophgo/milkv_duo_256m/MAINTAINERS
> @@ -1,5 +1,6 @@
> Milk-V Duo 256M
> M: Hiago De Franco <hfranco@baylibre.com>
> S: Maintained
> +F: arch/riscv/dts/sg2002-milkv-duo256m-u-boot.dtsi
> F: board/sophgo/milkv_duo_256m/
> F: configs/milkv_duo_256m_defconfig
> diff --git a/configs/milkv_duo_256m_defconfig b/configs/milkv_duo_256m_defconfig
> index 9d92eec6394..436bdb1549a 100644
> --- a/configs/milkv_duo_256m_defconfig
> +++ b/configs/milkv_duo_256m_defconfig
> @@ -4,7 +4,7 @@ CONFIG_SYS_MALLOC_F_LEN=0x8000
> CONFIG_NR_DRAM_BANKS=1
> CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
> CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x82300000
> -CONFIG_DEFAULT_DEVICE_TREE="sg2002-milkv-duo256m"
> +CONFIG_DEFAULT_DEVICE_TREE="sophgo/sg2002-milkv-duo256m"
> CONFIG_SYS_LOAD_ADDR=0x80080000
> CONFIG_IDENT_STRING="milkv_duo_256m"
> CONFIG_TARGET_MILKV_DUO_256M=y
> @@ -25,6 +25,7 @@ CONFIG_CMD_POWEROFF=y
> CONFIG_CMD_EXT4_WRITE=y
> # CONFIG_ISO_PARTITION is not set
> # CONFIG_EFI_PARTITION is not set
> +CONFIG_OF_UPSTREAM=y
> CONFIG_ENV_OVERWRITE=y
> CONFIG_NET_RANDOM_ETHADDR=y
> CONFIG_CLK_SOPHGO_CV1800B=y
> diff --git a/doc/board/sophgo/milkv_duo_256m.rst b/doc/board/sophgo/milkv_duo_256m.rst
> index 9e2cbddf4db..9562e6c48fd 100644
> --- a/doc/board/sophgo/milkv_duo_256m.rst
> +++ b/doc/board/sophgo/milkv_duo_256m.rst
> @@ -46,7 +46,7 @@ To run u-boot.bin on top of FSBL, follow these steps:
> .. code-block:: console
>
> cd open-sbi
> - PLATFORM=generic FW_FDT_PATH=../u-boot/arch/riscv/dts/sg2002-milkv-duo256m.dtb make
> + PLATFORM=generic FW_FDT_PATH=../u-boot/dts/upstream/src/riscv/sophgo/sg2002-milkv-duo256m.dtb make
>
> This will generate build/platform/generic/firmware/fw_dynamic.bin.
>
>
> --
> 2.55.0
Regards,
--
Hiago
next prev parent reply other threads:[~2026-09-24 12:46 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260922-milkv-duo-upstream-dts-v4-0-d45b74dfad36@zohomail.com>
2026-09-22 14:59 ` [PATCH v4 01/11] clk: sophgo: cv1800b: Add SoC-specific compatible strings Zhuxu Ran
2026-09-22 14:59 ` [PATCH v4 02/11] mmc: cv1800b: Add SG2002 compatible string Zhuxu Ran
2026-09-22 14:59 ` [PATCH v4 03/11] dt-bindings: soc: sophgo: add Milk-V Duo 256M board Zhuxu Ran
2026-09-22 14:59 ` [PATCH v4 04/11] riscv: dts: sophgo: cv180x: Add PWR_GPIO controller Zhuxu Ran
2026-09-22 14:59 ` [PATCH v4 05/11] riscv: dts: sophgo: Add Milk-V Duo 256M board support Zhuxu Ran
2026-09-22 14:59 ` [PATCH v4 06/11] riscv: milkv_duo: Use upstream devicetree Zhuxu Ran
2026-09-22 15:46 ` [PATCH v4 07/11] riscv: licheerv_nano: " Zhuxu Ran
2026-09-22 15:46 ` [PATCH v4 08/11] riscv: milkv_duo_256m: " Zhuxu Ran
2026-09-24 12:45 ` Hiago De Franco [this message]
2026-09-24 14:47 ` Zhuxu Ran
2026-09-22 15:46 ` [PATCH v4 09/11] rtc: cv1800: Add RTC and system reset support Zhuxu Ran
2026-09-23 17:51 ` Yao Zi
2026-09-24 4:05 ` Zhuxu Ran
2026-09-22 15:46 ` [PATCH v4 10/11] riscv: dts: sophgo: Drop local CV18xx devicetrees Zhuxu Ran
2026-09-22 15:46 ` [PATCH v4 11/11] clk: sophgo: cv1800b: Drop legacy compatible string Zhuxu Ran
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=arUZwbtnDO9g3cUZ@hiagonb \
--to=hfranco@baylibre.com \
--cc=akoch@initse.com \
--cc=casey.connolly@linaro.org \
--cc=chao.wei@sophgo.com \
--cc=chen.wang@linux.dev \
--cc=chenyou910331@gmail.com \
--cc=conor.dooley@microchip.com \
--cc=ilias.apalodimas@linaro.org \
--cc=inochiama@gmail.com \
--cc=jbx6244@gmail.com \
--cc=jh80.chung@samsung.com \
--cc=junhui.liu@pigmoral.tech \
--cc=leo.liang@sifive.com \
--cc=lukma@denx.de \
--cc=marex@nabladev.com \
--cc=me@ziyao.cc \
--cc=pbrobinson@gmail.com \
--cc=peng.fan@nxp.com \
--cc=quentin.schulz@cherry.de \
--cc=schwab@suse.de \
--cc=seashell11234455@gmail.com \
--cc=stefan.roese@mailbox.org \
--cc=sumit.garg@kernel.org \
--cc=sumit.garg@oss.qualcomm.com \
--cc=thomas.bonnefille@bootlin.com \
--cc=trini@konsulko.com \
--cc=u-boot@lists.u-boot-project.org \
--cc=unicorn_wang@outlook.com \
--cc=varadarajan.narayanan@oss.qualcomm.com \
--cc=zhuxu_ran@zohomail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox