* [PATCH v2 0/2] board: sophgo: Add support for Milk-V Duo S
@ 2026-10-25 14:30 João Paulo Gonçalves
2026-10-25 14:30 ` [PATCH v2 1/2] clk: sophgo: cv1800b: Add SG2000 compatible string João Paulo Gonçalves
2026-10-25 14:30 ` [PATCH v2 2/2] board: sophgo: Add support for Milk-V Duo S João Paulo Gonçalves
0 siblings, 2 replies; 6+ messages in thread
From: João Paulo Gonçalves @ 2026-10-25 14:30 UTC (permalink / raw)
To: u-boot, Yao Zi
Cc: Tom Rini, Sumit Garg, Gui-Dong Han, Joshua Milas, Chen Wang,
Inochi Amaoto, Lukasz Majewski, Peng Fan, Tim Ouyang, Leo Liang,
Hiago De Franco, Raymond Mao, Michal Simek, Yixun Lan,
Andrei Lalaev, E Shattow, Zhuxu Ran,
João Paulo Gonçalves
This series adds support for the Milk-V Duo S, a development board based
on the Sophgo SG2000 SoC with 512 MiB of RAM. The board uses the
upstream Linux devicetree via OF_UPSTREAM.
The Duo S gets its own board directory, based on the Milk-V Duo 256M
one. Apart from the devicetree, the two boards share almost all of their
configuration. However, they use different SoCs (SG2000 vs. SG2002), so
the Duo S is not treated as a variant of the Duo 256M.
Hiago and Andrei reviewed these patches internally before submission,
hence their Acked-by tags. Since they already work with these boards,
they have agreed to maintain the Duo S support.
For now, the documentation improvements (boot flow, FSBL, fip.bin,
OpenSBI requirements) are in the Milk-V Duo S board doc. Since most of
this information is common to all CV18xx/SG200x boards, a follow-up
series will, following Yao Zi's suggestion, move the common parts into a
generic SoC document, referenced by the Milk-V Duo, Duo 256M and Duo S
board docs.
Tested on a Milk-V Duo S.
---
Changes in v2:
- Drop the two devicetree cherry-picks: dts/upstream is now synced to
v7.3, which already includes the SG2000 dtsi and the Milk-V Duo S
devicetree
- board: doc: Clarify the OpenSBI version requirement (v1.5 or later)
- board: doc: Describe the boot flow (FSBL, coprocessor firmware,
OpenSBI, U-Boot) and the fip.bin contents
- board: doc: Fix the fiptool command: pass --text-base to match
CONFIG_TEXT_BASE and add the required --rtos path
- clk: Drop E Shattow's Reviewed-by as requested
- Link to v1: https://patch.msgid.link/20261016-upstream-v1-milk-duo-s-v1-0-e4bf386eea2d@gmail.com
---
João Paulo Gonçalves (2):
clk: sophgo: cv1800b: Add SG2000 compatible string
board: sophgo: Add support for Milk-V Duo S
arch/riscv/Kconfig | 4 +
board/sophgo/milkv_duo_s/Kconfig | 30 +++++++
board/sophgo/milkv_duo_s/MAINTAINERS | 8 ++
board/sophgo/milkv_duo_s/Makefile | 6 ++
board/sophgo/milkv_duo_s/milkv_duo_s.env | 8 ++
configs/milkv_duo_s_defconfig | 43 ++++++++++
doc/board/sophgo/index.rst | 1 +
doc/board/sophgo/milkv_duo_s.rst | 131 +++++++++++++++++++++++++++++++
drivers/clk/sophgo/clk-cv1800b.c | 1 +
include/configs/milkv_duo_s.h | 12 +++
10 files changed, 244 insertions(+)
---
base-commit: f97bb5c1ad78e95856917b92c7270c82d4b11e21
change-id: 20261014-upstream-v1-milk-duo-s-c4d2935c4298
Best regards,
--
João Paulo Gonçalves <jpaulo.silvagoncalves@gmail.com>
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH v2 1/2] clk: sophgo: cv1800b: Add SG2000 compatible string 2026-10-25 14:30 [PATCH v2 0/2] board: sophgo: Add support for Milk-V Duo S João Paulo Gonçalves @ 2026-10-25 14:30 ` João Paulo Gonçalves 2026-10-25 14:30 ` [PATCH v2 2/2] board: sophgo: Add support for Milk-V Duo S João Paulo Gonçalves 1 sibling, 0 replies; 6+ messages in thread From: João Paulo Gonçalves @ 2026-10-25 14:30 UTC (permalink / raw) To: u-boot, Yao Zi Cc: Tom Rini, Sumit Garg, Gui-Dong Han, Joshua Milas, Chen Wang, Inochi Amaoto, Lukasz Majewski, Peng Fan, Tim Ouyang, Leo Liang, Hiago De Franco, Raymond Mao, Michal Simek, Yixun Lan, Andrei Lalaev, E Shattow, Zhuxu Ran, João Paulo Gonçalves The upstream SG2000 devicetree (sg2000.dtsi) uses "sophgo,sg2000-clk" as the clock controller compatible string. The clocks needed by U-Boot are the same as on the CV1800, so the existing driver can be reused. Add "sophgo,sg2000-clk" to the driver match table. Signed-off-by: João Paulo Gonçalves <jpaulo.silvagoncalves@gmail.com> --- drivers/clk/sophgo/clk-cv1800b.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clk/sophgo/clk-cv1800b.c b/drivers/clk/sophgo/clk-cv1800b.c index 248a69321fc1..93d71ad1c314 100644 --- a/drivers/clk/sophgo/clk-cv1800b.c +++ b/drivers/clk/sophgo/clk-cv1800b.c @@ -744,6 +744,7 @@ const struct clk_ops cv1800b_clk_ops = { static const struct udevice_id cv1800b_clk_of_match[] = { { .compatible = "sophgo,cv1800-clk" }, + { .compatible = "sophgo,sg2000-clk" }, { }, }; -- 2.53.0 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 2/2] board: sophgo: Add support for Milk-V Duo S 2026-10-25 14:30 [PATCH v2 0/2] board: sophgo: Add support for Milk-V Duo S João Paulo Gonçalves 2026-10-25 14:30 ` [PATCH v2 1/2] clk: sophgo: cv1800b: Add SG2000 compatible string João Paulo Gonçalves @ 2026-10-25 14:30 ` João Paulo Gonçalves 2026-11-04 4:31 ` Yao Zi 1 sibling, 1 reply; 6+ messages in thread From: João Paulo Gonçalves @ 2026-10-25 14:30 UTC (permalink / raw) To: u-boot, Yao Zi Cc: Tom Rini, Sumit Garg, Gui-Dong Han, Joshua Milas, Chen Wang, Inochi Amaoto, Lukasz Majewski, Peng Fan, Tim Ouyang, Leo Liang, Hiago De Franco, Raymond Mao, Michal Simek, Yixun Lan, Andrei Lalaev, E Shattow, Zhuxu Ran, João Paulo Gonçalves Add support for the Milk-V Duo S, a development board based on the Sophgo SG2000 SoC with 512 MiB of RAM. The SG2000 differs from the CV1800B used on the Milk-V Duo 64M and the SG2002 used on the Milk-V Duo 256M, but these SoCs share most of their IP blocks, including the CPU core, so the existing CV1800B support can be reused. Add a separate board directory, target and defconfig for the Duo S, based on the Milk-V Duo 256M ones. Like the Duo 256M, it reuses the common Milk-V Duo board code. The defconfig uses the upstream devicetree via OF_UPSTREAM. Link: https://milkv.io/docs/duo/getting-started/duos Acked-by: Andrei Lalaev <andrey.lalaev@gmail.com> Acked-by: Hiago De Franco <hfranco@baylibre.com> Signed-off-by: João Paulo Gonçalves <jpaulo.silvagoncalves@gmail.com> --- arch/riscv/Kconfig | 4 + board/sophgo/milkv_duo_s/Kconfig | 30 +++++++ board/sophgo/milkv_duo_s/MAINTAINERS | 8 ++ board/sophgo/milkv_duo_s/Makefile | 6 ++ board/sophgo/milkv_duo_s/milkv_duo_s.env | 8 ++ configs/milkv_duo_s_defconfig | 43 ++++++++++ doc/board/sophgo/index.rst | 1 + doc/board/sophgo/milkv_duo_s.rst | 131 +++++++++++++++++++++++++++++++ include/configs/milkv_duo_s.h | 12 +++ 9 files changed, 243 insertions(+) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 386241efd4a0..df10354e9aef 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -32,6 +32,9 @@ config TARGET_MILKV_DUO config TARGET_MILKV_DUO_256M bool "Support Milk-V Duo 256M Board" +config TARGET_MILKV_DUO_S + bool "Support Milk-V Duo S Board" + config TARGET_OPENPITON_RISCV64 bool "Support RISC-V cores on OpenPiton SoC" @@ -125,6 +128,7 @@ source "board/sifive/unmatched/Kconfig" source "board/sipeed/maix/Kconfig" source "board/sophgo/milkv_duo/Kconfig" source "board/sophgo/milkv_duo_256m/Kconfig" +source "board/sophgo/milkv_duo_s/Kconfig" source "board/sophgo/licheerv_nano/Kconfig" source "board/spacemit/k1/Kconfig" source "board/spacemit/k3/Kconfig" diff --git a/board/sophgo/milkv_duo_s/Kconfig b/board/sophgo/milkv_duo_s/Kconfig new file mode 100644 index 000000000000..6ec6bd65d938 --- /dev/null +++ b/board/sophgo/milkv_duo_s/Kconfig @@ -0,0 +1,30 @@ +if TARGET_MILKV_DUO_S + +config SYS_BOARD + default "milkv_duo_s" + +config SYS_VENDOR + default "sophgo" + +config SYS_CPU + default "cv1800b" + +config SYS_CONFIG_NAME + default "milkv_duo_s" + +# The vendor FIP tool prepends a 32-byte loader header to u-boot.bin and loads +# the result at 0x80200000, so the U-Boot code runs 0x20 bytes above that. +config TEXT_BASE + default 0x80200020 + +config ENV_SIZE + default 0x20000 + +config ENV_SECT_SIZE + default 0x40000 + +config BOARD_SPECIFIC_OPTIONS + def_bool y + select SOPHGO_CV1800B + +endif diff --git a/board/sophgo/milkv_duo_s/MAINTAINERS b/board/sophgo/milkv_duo_s/MAINTAINERS new file mode 100644 index 000000000000..86533c03fd9a --- /dev/null +++ b/board/sophgo/milkv_duo_s/MAINTAINERS @@ -0,0 +1,8 @@ +Milk-V Duo S +M: Andrei Lalaev <andrey.lalaev@gmail.com> +M: Hiago De Franco <hfranco@baylibre.com> +S: Maintained +F: board/sophgo/milkv_duo_s/ +F: configs/milkv_duo_s_defconfig +F: doc/board/sophgo/milkv_duo_s.rst +F: include/configs/milkv_duo_s.h diff --git a/board/sophgo/milkv_duo_s/Makefile b/board/sophgo/milkv_duo_s/Makefile new file mode 100644 index 000000000000..a1b6aaee1489 --- /dev/null +++ b/board/sophgo/milkv_duo_s/Makefile @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# Copyright (c) 2026, João Paulo Gonçalves <jpaulo.silvagoncalves@gmail.com> + +obj-y += ../milkv_duo/board.o +obj-$(CONFIG_NET_LEGACY) += ../common/ethernet.o diff --git a/board/sophgo/milkv_duo_s/milkv_duo_s.env b/board/sophgo/milkv_duo_s/milkv_duo_s.env new file mode 100644 index 000000000000..4c9f53d08118 --- /dev/null +++ b/board/sophgo/milkv_duo_s/milkv_duo_s.env @@ -0,0 +1,8 @@ +fdt_addr_r=0x84000000 +fdtfile=DEFAULT_DEVICE_TREE.dtb +kernel_addr_r=0x80200000 +kernel_comp_addr_r=0x88000000 +kernel_comp_size=0x4000000 +pxefile_addr_r=0x84300000 +ramdisk_addr_r=0x84400000 +scriptaddr=0x84200000 diff --git a/configs/milkv_duo_s_defconfig b/configs/milkv_duo_s_defconfig new file mode 100644 index 000000000000..41a31c4ad46c --- /dev/null +++ b/configs/milkv_duo_s_defconfig @@ -0,0 +1,43 @@ +CONFIG_RISCV=y +CONFIG_SYS_MALLOC_LEN=0x820000 +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="sophgo/sg2000-milkv-duo-s" +CONFIG_SYS_LOAD_ADDR=0x80080000 +CONFIG_IDENT_STRING=" milkv_duo_s" +CONFIG_TARGET_MILKV_DUO_S=y +CONFIG_ARCH_RV64I=y +CONFIG_RISCV_SMODE=y +CONFIG_FIT=y +CONFIG_BOOTSTD_FULL=y +# CONFIG_BOOTMETH_EFI_BOOTMGR is not set +CONFIG_SD_BOOT=y +CONFIG_SYS_CBSIZE=512 +CONFIG_SYS_PBSIZE=544 +CONFIG_SYS_PROMPT="milkv_duo_s# " +# CONFIG_CMD_BOOTDEV is not set +CONFIG_CMD_MBR=y +CONFIG_CMD_MMC=y +CONFIG_CMD_POWEROFF=y +# CONFIG_CMD_MII is not set +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 +CONFIG_MMC=y +CONFIG_MMC_IO_VOLTAGE=y +CONFIG_MMC_UHS_SUPPORT=y +CONFIG_MMC_SDHCI=y +CONFIG_MMC_SDHCI_ADMA=y +CONFIG_MMC_SDHCI_CV1800B=y +CONFIG_ETH_DESIGNWARE=y +CONFIG_SYS_NS16550=y +CONFIG_SYS_NS16550_MEM32=y +CONFIG_SPI=y +CONFIG_SYSRESET=y +CONFIG_SYSRESET_CV1800B=y diff --git a/doc/board/sophgo/index.rst b/doc/board/sophgo/index.rst index 19c9a19b1d4b..61aceafceea3 100644 --- a/doc/board/sophgo/index.rst +++ b/doc/board/sophgo/index.rst @@ -7,4 +7,5 @@ Sophgo milkv_duo milkv_duo_256m + milkv_duo_s licheerv_nano diff --git a/doc/board/sophgo/milkv_duo_s.rst b/doc/board/sophgo/milkv_duo_s.rst new file mode 100644 index 000000000000..9f6bf04d1842 --- /dev/null +++ b/doc/board/sophgo/milkv_duo_s.rst @@ -0,0 +1,131 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +Milk-V Duo S +============ + +SG2000 RISC-V SoC +----------------- +The SG2000 is a high-performance, low-power 64-bit RISC-V/ARM SoC from Sophgo. + +Mainline support +---------------- +Support for the following drivers is already enabled: + +1. ns16550 UART Driver. +2. Synopsys Designware MSHC Driver. +3. Synopsys Designware Ethernet Controller. + +Building +~~~~~~~~ +1. Add the RISC-V toolchain to your PATH. +2. Setup ARCH & cross compilation environment variable: + +.. code-block:: console + + export CROSS_COMPILE=<riscv64 toolchain prefix> + cd <U-Boot-dir> + make milkv_duo_s_defconfig + make + +This will generate u-boot.bin + +Boot flow +~~~~~~~~~ +The board boots from a FIP image, fip.bin, which contains the following +binaries: + +- FSBL (First Stage Boot Loader): the vendor bootloader [1]. It serves the + same purpose as U-Boot SPL, but U-Boot does not support SPL for this SoC + yet, so the vendor FSBL is required. +- Coprocessor firmware: the vendor firmware (cvirtos.bin) or custom firmware + for the C906L coprocessor. It is not needed to boot U-Boot, but it is + required by fiptool. +- OpenSBI (fw_dynamic.bin), built with the board devicetree. +- U-Boot (u-boot.bin). + +The boot flow is: + +1. The boot ROM loads fip.bin from the FAT partition of the SD card and runs + the FSBL. +2. The FSBL initializes the clocks and DRAM, starts the coprocessor firmware + on the C906L, and loads OpenSBI and U-Boot into DRAM. +3. The FSBL jumps to OpenSBI, which runs in M-mode. +4. OpenSBI starts U-Boot in S-mode. + +The fip.bin image is created with the Sophgo fiptool [2], which provides +prebuilt vendor binaries: data/fsbl/cv181x.bin, the FSBL for the CV181x/SG200x +SoCs, and data/cvirtos.bin, the coprocessor firmware. The fiptool also requires +the data/ddr_param.bin file. + +Booting +~~~~~~~ +Currently, we rely on the vendor FSBL to initialize the clock and DRAM, and +load OpenSBI and the u-boot image, then bootup from it. + +To run u-boot.bin on top of FSBL, follow these steps: + +1. Generate a compatible u-boot.bin using U-Boot with the Milk-V Duo S + default configuration. + +2. Use mainline OpenSBI v1.5+ (v1.5 is the first release supporting the SG2000 + [3]). Use FW_FDT_PATH to point to sg2000-milkv-duo-s.dtb device tree file + while compiling fw_dynamic. Example: + +.. code-block:: console + + cd <OpenSBI-dir> + make PLATFORM=generic FW_FDT_PATH=<U-Boot-dir>/dts/upstream/src/riscv/sophgo/sg2000-milkv-duo-s.dtb + +This will generate build/platform/generic/firmware/fw_dynamic.bin. + +3. Use the vendor-provided tool [2] to create a unified fip.bin file containing + FSBL, coprocessor firmware, OpenSBI, and U-Boot. Note that you will have to + use the file cv181x.bin as the FSBL, and that the U-Boot load address must + match CONFIG_TEXT_BASE (0x80200020). The tool also requires the + data/ddr_param.bin file. Example: + +.. code-block:: console + + cd <fiptool-dir> + ./fiptool \ + --fsbl data/fsbl/cv181x.bin \ + --ddr_param data/ddr_param.bin \ + --rtos data/cvirtos.bin \ + --opensbi <OpenSBI-dir>/build/platform/generic/firmware/fw_dynamic.bin \ + --uboot <U-Boot-dir>/u-boot.bin \ + --text-base $((0x80200020)) + +4. Place the generated fip.bin file into the FAT partition of the SD card. + +5. Set the board's boot core selection switch to RISC-V. + +6. Insert the SD card into the board and power it on. + +The board will automatically execute the FSBL from the fip.bin file. +Subsequently, it will transition to OpenSBI, and finally, OpenSBI will invoke +U-Boot. + +[1]: https://github.com/sophgo/fsbl + +[2]: https://github.com/sophgo/fiptool + +[3]: https://github.com/riscv-software-src/opensbi/releases/tag/v1.5 + +Sample boot log from Milk-V Duo S board +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.. code-block:: none + + U-Boot 2026.10-g3c39950264fd (Oct 23 2026 - 21:28:58 -0300) milkv_duo_s + + DRAM: 512 MiB + Core: 28 devices, 13 uclasses, devicetree: separate + MMC: mmc@4310000: 0, mmc@4320000: 2, mmc@4300000: 1 + Loading Environment from nowhere... OK + In: serial@4140000 + Out: serial@4140000 + Err: serial@4140000 + Net: + Warning: ethernet@4070000 (eth0) using random MAC address - 4e:27:14:9f:7c:d6 + eth0: ethernet@4070000 + Hit any key to stop autoboot: 0 + milkv_duo_s# diff --git a/include/configs/milkv_duo_s.h b/include/configs/milkv_duo_s.h new file mode 100644 index 000000000000..f60aa23fc181 --- /dev/null +++ b/include/configs/milkv_duo_s.h @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (c) 2026, João Paulo Gonçalves <jpaulo.silvagoncalves@gmail.com> + * + */ + +#ifndef __CONFIG_H +#define __CONFIG_H + +#define CFG_SYS_SDRAM_BASE 0x80000000 + +#endif /* __CONFIG_H */ -- 2.53.0 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2 2/2] board: sophgo: Add support for Milk-V Duo S 2026-10-25 14:30 ` [PATCH v2 2/2] board: sophgo: Add support for Milk-V Duo S João Paulo Gonçalves @ 2026-11-04 4:31 ` Yao Zi 2026-11-07 17:52 ` João Paulo Gonçalves 0 siblings, 1 reply; 6+ messages in thread From: Yao Zi @ 2026-11-04 4:31 UTC (permalink / raw) To: João Paulo Gonçalves, u-boot, Yao Zi Cc: Tom Rini, Sumit Garg, Gui-Dong Han, Joshua Milas, Chen Wang, Inochi Amaoto, Lukasz Majewski, Peng Fan, Tim Ouyang, Leo Liang, Hiago De Franco, Raymond Mao, Michal Simek, Yixun Lan, Andrei Lalaev, E Shattow, Zhuxu Ran On Sun, Oct 25, 2026 at 11:30:24AM -0300, João Paulo Gonçalves wrote: > Add support for the Milk-V Duo S, a development board based on the > Sophgo SG2000 SoC with 512 MiB of RAM. > > The SG2000 differs from the CV1800B used on the Milk-V Duo 64M and the > SG2002 used on the Milk-V Duo 256M, but these SoCs share most of their > IP blocks, including the CPU core, so the existing CV1800B support can > be reused. > > Add a separate board directory, target and defconfig for the Duo S, > based on the Milk-V Duo 256M ones. Like the Duo 256M, it reuses the > common Milk-V Duo board code. The defconfig uses the upstream devicetree > via OF_UPSTREAM. > > Link: https://milkv.io/docs/duo/getting-started/duos > Acked-by: Andrei Lalaev <andrey.lalaev@gmail.com> > Acked-by: Hiago De Franco <hfranco@baylibre.com> > Signed-off-by: João Paulo Gonçalves <jpaulo.silvagoncalves@gmail.com> > --- > arch/riscv/Kconfig | 4 + > board/sophgo/milkv_duo_s/Kconfig | 30 +++++++ > board/sophgo/milkv_duo_s/MAINTAINERS | 8 ++ > board/sophgo/milkv_duo_s/Makefile | 6 ++ > board/sophgo/milkv_duo_s/milkv_duo_s.env | 8 ++ > configs/milkv_duo_s_defconfig | 43 ++++++++++ > doc/board/sophgo/index.rst | 1 + > doc/board/sophgo/milkv_duo_s.rst | 131 +++++++++++++++++++++++++++++++ Please separate documentation changes into another commit. > include/configs/milkv_duo_s.h | 12 +++ > 9 files changed, 243 insertions(+) ... > diff --git a/configs/milkv_duo_s_defconfig b/configs/milkv_duo_s_defconfig > new file mode 100644 > index 000000000000..41a31c4ad46c > --- /dev/null > +++ b/configs/milkv_duo_s_defconfig > @@ -0,0 +1,43 @@ > +CONFIG_RISCV=y > +CONFIG_SYS_MALLOC_LEN=0x820000 > +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="sophgo/sg2000-milkv-duo-s" > +CONFIG_SYS_LOAD_ADDR=0x80080000 > +CONFIG_IDENT_STRING=" milkv_duo_s" > +CONFIG_TARGET_MILKV_DUO_S=y > +CONFIG_ARCH_RV64I=y > +CONFIG_RISCV_SMODE=y > +CONFIG_FIT=y > +CONFIG_BOOTSTD_FULL=y > +# CONFIG_BOOTMETH_EFI_BOOTMGR is not set > +CONFIG_SD_BOOT=y > +CONFIG_SYS_CBSIZE=512 > +CONFIG_SYS_PBSIZE=544 > +CONFIG_SYS_PROMPT="milkv_duo_s# " > +# CONFIG_CMD_BOOTDEV is not set > +CONFIG_CMD_MBR=y > +CONFIG_CMD_MMC=y > +CONFIG_CMD_POWEROFF=y > +# CONFIG_CMD_MII is not set > +CONFIG_CMD_EXT4_WRITE=y > +# CONFIG_ISO_PARTITION is not set > +# CONFIG_EFI_PARTITION is not set Personally speaking, I prefer to turn on EFI related stuff (BOOTMETH_EFI_BOOTMGR and EFI_PARTITION). Here EFI is more practical since Duo-S carries 512MiB RAM, and I do have a device booted through EFI. But anyway, it's a embedded device and takes forever to boot a generic distribution, so what you've done here is fine, too. ... > diff --git a/doc/board/sophgo/index.rst b/doc/board/sophgo/index.rst > index 19c9a19b1d4b..61aceafceea3 100644 > --- a/doc/board/sophgo/index.rst > +++ b/doc/board/sophgo/index.rst > @@ -7,4 +7,5 @@ Sophgo > > milkv_duo > milkv_duo_256m > + milkv_duo_s > licheerv_nano > diff --git a/doc/board/sophgo/milkv_duo_s.rst b/doc/board/sophgo/milkv_duo_s.rst > new file mode 100644 > index 000000000000..9f6bf04d1842 > --- /dev/null > +++ b/doc/board/sophgo/milkv_duo_s.rst ... > +Boot flow > +~~~~~~~~~ > +The board boots from a FIP image, fip.bin, which contains the following > +binaries: > + > +- FSBL (First Stage Boot Loader): the vendor bootloader [1]. It serves the > + same purpose as U-Boot SPL, but U-Boot does not support SPL for this SoC > + yet, so the vendor FSBL is required. > +- Coprocessor firmware: the vendor firmware (cvirtos.bin) or custom firmware > + for the C906L coprocessor. It is not needed to boot U-Boot, but it is > + required by fiptool. Please confirm whether this is correct. I remembered the coprocessor firmware is optional, too. > +- OpenSBI (fw_dynamic.bin), built with the board devicetree. > +- U-Boot (u-boot.bin). ... > +5. Set the board's boot core selection switch to RISC-V. It'll be nice to describe the exact position of the switch. ... Regards, Yao Zi ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 2/2] board: sophgo: Add support for Milk-V Duo S 2026-11-04 4:31 ` Yao Zi @ 2026-11-07 17:52 ` João Paulo Gonçalves 2026-11-07 18:32 ` Yao Zi 0 siblings, 1 reply; 6+ messages in thread From: João Paulo Gonçalves @ 2026-11-07 17:52 UTC (permalink / raw) To: Yao Zi Cc: u-boot, Tom Rini, Sumit Garg, Gui-Dong Han, Joshua Milas, Chen Wang, Inochi Amaoto, Lukasz Majewski, Peng Fan, Tim Ouyang, Leo Liang, Hiago De Franco, Raymond Mao, Michal Simek, Yixun Lan, Andrei Lalaev, E Shattow, Zhuxu Ran Hi Yao Zi, > Personally speaking, I prefer to turn on EFI related stuff > (BOOTMETH_EFI_BOOTMGR and EFI_PARTITION). Here EFI is more practical > since Duo-S carries 512MiB RAM, and I do have a device booted through > EFI. > I will add the EFI configs on v3. > > diff --git a/doc/board/sophgo/index.rst b/doc/board/sophgo/index.rst > > index 19c9a19b1d4b..61aceafceea3 100644 > > --- a/doc/board/sophgo/index.rst > > +++ b/doc/board/sophgo/index.rst > > @@ -7,4 +7,5 @@ Sophgo > > > > milkv_duo > > milkv_duo_256m > > + milkv_duo_s > > licheerv_nano > > diff --git a/doc/board/sophgo/milkv_duo_s.rst b/doc/board/sophgo/milkv_duo_s.rst > > new file mode 100644 > > index 000000000000..9f6bf04d1842 > > --- /dev/null > > +++ b/doc/board/sophgo/milkv_duo_s.rst > > ... > > > +Boot flow > > +~~~~~~~~~ > > +The board boots from a FIP image, fip.bin, which contains the following > > +binaries: > > + > > +- FSBL (First Stage Boot Loader): the vendor bootloader [1]. It serves the > > + same purpose as U-Boot SPL, but U-Boot does not support SPL for this SoC > > + yet, so the vendor FSBL is required. > > +- Coprocessor firmware: the vendor firmware (cvirtos.bin) or custom firmware > > + for the C906L coprocessor. It is not needed to boot U-Boot, but it is > > + required by fiptool. > > Please confirm whether this is correct. I remembered the coprocessor > firmware is optional, too. > The coprocessor firmware is optional and is not needed to boot U-Boot. However, the fiptool from [1] always packs an RTOS image. If --rtos is not given, it falls back to a cvirtos.bin that does not exist at that path, so it fails: $ ./fiptool \ --fsbl data/fsbl/cv181x.bin \ --ddr_param data/ddr_param.bin \ --opensbi fw_dynamic.bin \ --uboot u-boot.bin \ --text-base $((0x80200020)) Packing Param1... Param1: 0x0 FSBL: 0x1000 Packing Param2... Traceback (most recent call last): ... File "fiptool/fiptool", line 84, in pack_param2 with open(args.rtos, 'rb') as f: FileNotFoundError: [Errno 2] No such file or directory: '.../fiptool/cvirtos.bin' Passing an empty file does not help either, because the tool always sets the coprocessor load address in the FIP header, so the FSBL would still try to load and start it. The FSBL repository has its own fiptool [2] that can generate fip.bin without the coprocessor firmware. When no coprocessor image is packed, the FSBL prints "No C906L image." and continues booting. This is also how meta-riscv [3] and the vendor Buildroot SDK [4] generate fip.bin, so it seems to be the more correct approach. If you prefer, I can document this flow instead. In that case the documentation also needs to describe how to build the FSBL from source, since that fiptool is part of the FSBL build. [1] https://github.com/sophgo/fiptool [2] https://github.com/sophgo/fsbl/blob/sg200x-dev/plat/cv181x/fiptool.py [3] https://github.com/riscv/meta-riscv/blob/master/recipes-bsp/milkv-duo-fsbl/milkv-duo-fsbl.bb [4] https://github.com/milkv-duo/duo-buildroot-sdk-v2 > Regards, > Yao Zi Best Regards, João Paulo Gonçalves ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 2/2] board: sophgo: Add support for Milk-V Duo S 2026-11-07 17:52 ` João Paulo Gonçalves @ 2026-11-07 18:32 ` Yao Zi 0 siblings, 0 replies; 6+ messages in thread From: Yao Zi @ 2026-11-07 18:32 UTC (permalink / raw) To: João Paulo Gonçalves, Yao Zi Cc: u-boot, Tom Rini, Sumit Garg, Gui-Dong Han, Joshua Milas, Chen Wang, Inochi Amaoto, Lukasz Majewski, Peng Fan, Tim Ouyang, Leo Liang, Hiago De Franco, Raymond Mao, Michal Simek, Yixun Lan, Andrei Lalaev, E Shattow, Zhuxu Ran On Sat, Nov 07, 2026 at 02:52:13PM -0300, João Paulo Gonçalves wrote: > Hi Yao Zi, > > > Personally speaking, I prefer to turn on EFI related stuff > > (BOOTMETH_EFI_BOOTMGR and EFI_PARTITION). Here EFI is more practical > > since Duo-S carries 512MiB RAM, and I do have a device booted through > > EFI. > > > > I will add the EFI configs on v3. > > > > diff --git a/doc/board/sophgo/index.rst b/doc/board/sophgo/index.rst > > > index 19c9a19b1d4b..61aceafceea3 100644 > > > --- a/doc/board/sophgo/index.rst > > > +++ b/doc/board/sophgo/index.rst > > > @@ -7,4 +7,5 @@ Sophgo > > > > > > milkv_duo > > > milkv_duo_256m > > > + milkv_duo_s > > > licheerv_nano > > > diff --git a/doc/board/sophgo/milkv_duo_s.rst b/doc/board/sophgo/milkv_duo_s.rst > > > new file mode 100644 > > > index 000000000000..9f6bf04d1842 > > > --- /dev/null > > > +++ b/doc/board/sophgo/milkv_duo_s.rst > > > > ... > > > > > +Boot flow > > > +~~~~~~~~~ > > > +The board boots from a FIP image, fip.bin, which contains the following > > > +binaries: > > > + > > > +- FSBL (First Stage Boot Loader): the vendor bootloader [1]. It serves the > > > + same purpose as U-Boot SPL, but U-Boot does not support SPL for this SoC > > > + yet, so the vendor FSBL is required. > > > +- Coprocessor firmware: the vendor firmware (cvirtos.bin) or custom firmware > > > + for the C906L coprocessor. It is not needed to boot U-Boot, but it is > > > + required by fiptool. > > > > Please confirm whether this is correct. I remembered the coprocessor > > firmware is optional, too. > > > > The coprocessor firmware is optional and is not needed to > boot U-Boot. However, the fiptool from [1] always packs an RTOS image. > If --rtos is not given, it falls back to a cvirtos.bin that does not > exist at that path, so it fails: > > $ ./fiptool \ > --fsbl data/fsbl/cv181x.bin \ > --ddr_param data/ddr_param.bin \ > --opensbi fw_dynamic.bin \ > --uboot u-boot.bin \ > --text-base $((0x80200020)) > Packing Param1... > Param1: 0x0 > FSBL: 0x1000 > Packing Param2... > Traceback (most recent call last): > ... > File "fiptool/fiptool", line 84, in pack_param2 > with open(args.rtos, 'rb') as f: > FileNotFoundError: [Errno 2] No such file or directory: '.../fiptool/cvirtos.bin' > > Passing an empty file does not help either, because the tool always sets > the coprocessor load address in the FIP header, so the FSBL would still > try to load and start it. > > The FSBL repository has its own fiptool [2] that can generate fip.bin > without the coprocessor firmware. When no coprocessor image is packed, > the FSBL prints "No C906L image." and continues booting. This is also > how meta-riscv [3] and the vendor Buildroot SDK [4] generate fip.bin, > so it seems to be the more correct approach. > > If you prefer, I can document this flow instead. In that case the > documentation also needs to describe how to build the FSBL from source, > since that fiptool is part of the FSBL build. Yes, please do so. This sounds clearer. > [1] https://github.com/sophgo/fiptool > [2] https://github.com/sophgo/fsbl/blob/sg200x-dev/plat/cv181x/fiptool.py > [3] https://github.com/riscv/meta-riscv/blob/master/recipes-bsp/milkv-duo-fsbl/milkv-duo-fsbl.bb > [4] https://github.com/milkv-duo/duo-buildroot-sdk-v2 > > > Regards, > > Yao Zi > > Best Regards, > João Paulo Gonçalves -- Thanks, Yao Zi Meow-mrrp-mrow, I'm a cat. ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-11-07 18:33 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-10-25 14:30 [PATCH v2 0/2] board: sophgo: Add support for Milk-V Duo S João Paulo Gonçalves 2026-10-25 14:30 ` [PATCH v2 1/2] clk: sophgo: cv1800b: Add SG2000 compatible string João Paulo Gonçalves 2026-10-25 14:30 ` [PATCH v2 2/2] board: sophgo: Add support for Milk-V Duo S João Paulo Gonçalves 2026-11-04 4:31 ` Yao Zi 2026-11-07 17:52 ` João Paulo Gonçalves 2026-11-07 18:32 ` Yao Zi
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox