All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] board: sophgo: milkv_duo: enable standard boot
@ 2026-09-29 22:20 Hiago De Franco
  2026-09-29 22:20 ` [PATCH 1/3] board: sophgo: milkv_duo: add environment for " Hiago De Franco
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Hiago De Franco @ 2026-09-29 22:20 UTC (permalink / raw)
  To: u-boot; +Cc: Kongyang Liu, Tom Rini, Yao Zi, Zhuxu Ran, Tim Ouyang, Leo Liang

The Milk-V Duo (CV1800B, 64MB) does not enable CONFIG_BOOTSTD_DEFAULTS
and has no environment file, so U-Boot has no bootcmd and none of the
kernel_addr_r, fdt_addr_r, ramdisk_addr_r, ... variables required by
the extlinux bootmeth.

Enable CONFIG_BOOTSTD_DEFAULTS and add a milkv_duo.env with a memory
layout that fits into the 64MB of DRAM:

  0x80200000  kernel_addr_r       (16MB)
  0x81200000  kernel_comp_addr_r  (16MB, Image.gz decompression)
  0x82200000  fdt_addr_r
  0x82300000  scriptaddr
  0x82400000  pxefile_addr_r
  0x82500000  ramdisk_addr_r

Also reduce CONFIG_STACK_SIZE to 1MB. LMB reserves CONFIG_STACK_SIZE
below the relocated stack pointer, and the default 16MB left only about
1.4MB between ramdisk_addr_r and the reserved region. With 1MB, about
16MB are available for an initrd.

This series depends on Zhuxu Ran's "riscv: sophgo: Use upstream
devicetrees for CV18xx boards" (v5), which sets CONFIG_DEFAULT_DEVICE_TREE
to sophgo/<board>, so that fdtfile matches the Linux devicetree install
path (sophgo/cv1800b-milkv-duo.dtb and sophgo/sg2002-milkv-duo256m.dtb).

Link: https://lore.kernel.org/all/20260927-milkv-duo-upstream-dts-v5-0-7f64983e59e1@zohomail.com/

Tested on Milk-V Duo, booting Linux through "bootflow scan" and an
extlinux.conf on the SD card.

Signed-off-by: Hiago De Franco <hfranco@baylibre.com>
---
Hiago De Franco (3):
      board: sophgo: milkv_duo: add environment for standard boot
      configs: milkv_duo: enable BOOTSTD_DEFAULTS
      configs: milkv_duo: reduce CONFIG_STACK_SIZE to 1MB

 board/sophgo/milkv_duo/milkv_duo.env |  8 ++++++++
 configs/milkv_duo_defconfig          | 13 ++++++-------
 2 files changed, 14 insertions(+), 7 deletions(-)
---
base-commit: f8eb3469e1a17c79b047b3fd38ae820e8816a115
change-id: 20260929-milkv-duo-bootstd-14de5e4e03ef
prerequisite-change-id: 20260702-milkv-duo-upstream-dts-b54aed41fc61:v5
prerequisite-patch-id: b8e6815314b7881a02de0066232864d522c4a26c
prerequisite-patch-id: 0df1fa5db1b2bff402b429809796bad99a517483
prerequisite-patch-id: 49e1e8263cf0a5ba8d63c8b598b6382cde5284b2
prerequisite-patch-id: 86dd30e784f022f0a7bb6fbf125c9699467176d4
prerequisite-patch-id: 49070c05ecf58331ec519a57d1b82f8b2b835a89
prerequisite-patch-id: 6b6881e45cc6de6544aaa4509db21611158f4fa1
prerequisite-patch-id: 7198127d4602eeb14212087ce9bb694d84e71a4c
prerequisite-patch-id: 3a58bd8a061707ff27b8538d4897def3b595dc36
prerequisite-patch-id: 9055ea941b73e35d1e825787d7eca14ffceb8e8b
prerequisite-patch-id: 554c1487e8d596e0099677ca88eee0021b1ffbae

Best regards,
--  
Hiago


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

* [PATCH 1/3] board: sophgo: milkv_duo: add environment for standard boot
  2026-09-29 22:20 [PATCH 0/3] board: sophgo: milkv_duo: enable standard boot Hiago De Franco
@ 2026-09-29 22:20 ` Hiago De Franco
  2026-09-29 22:20 ` [PATCH 2/3] configs: milkv_duo: enable BOOTSTD_DEFAULTS Hiago De Franco
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Hiago De Franco @ 2026-09-29 22:20 UTC (permalink / raw)
  To: u-boot; +Cc: Kongyang Liu, Tom Rini, Yao Zi, Zhuxu Ran, Tim Ouyang, Leo Liang

Add the load addresses needed by standard boot. They must fit in the
64MB of DRAM:

  kernel_addr_r       0x80200000  (16MB)
  kernel_comp_addr_r  0x81200000  (16MB)
  fdt_addr_r          0x82200000
  scriptaddr          0x82300000
  pxefile_addr_r      0x82400000
  ramdisk_addr_r      0x82500000

Signed-off-by: Hiago De Franco <hfranco@baylibre.com>
---
 board/sophgo/milkv_duo/milkv_duo.env | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/board/sophgo/milkv_duo/milkv_duo.env b/board/sophgo/milkv_duo/milkv_duo.env
new file mode 100644
index 00000000000..38b972c7b57
--- /dev/null
+++ b/board/sophgo/milkv_duo/milkv_duo.env
@@ -0,0 +1,8 @@
+fdt_addr_r=0x82200000
+fdtfile=DEFAULT_DEVICE_TREE.dtb
+kernel_addr_r=0x80200000
+kernel_comp_addr_r=0x81200000
+kernel_comp_size=0x1000000
+pxefile_addr_r=0x82400000
+ramdisk_addr_r=0x82500000
+scriptaddr=0x82300000

-- 
2.53.0


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

* [PATCH 2/3] configs: milkv_duo: enable BOOTSTD_DEFAULTS
  2026-09-29 22:20 [PATCH 0/3] board: sophgo: milkv_duo: enable standard boot Hiago De Franco
  2026-09-29 22:20 ` [PATCH 1/3] board: sophgo: milkv_duo: add environment for " Hiago De Franco
@ 2026-09-29 22:20 ` Hiago De Franco
  2026-10-07 21:25   ` Yao Zi
  2026-09-29 22:20 ` [PATCH 3/3] configs: milkv_duo: reduce CONFIG_STACK_SIZE to 1MB Hiago De Franco
  2026-10-07 21:27 ` [PATCH 0/3] board: sophgo: milkv_duo: enable standard boot Yao Zi
  3 siblings, 1 reply; 6+ messages in thread
From: Hiago De Franco @ 2026-09-29 22:20 UTC (permalink / raw)
  To: u-boot; +Cc: Kongyang Liu, Tom Rini, Yao Zi, Zhuxu Ran, Tim Ouyang, Leo Liang

Enable CONFIG_BOOTSTD_DEFAULTS so the board can boot an extlinux.conf
with standard boot. This sets bootcmd to "bootflow scan" and enables
the script bootmeth, the ext4 commands and ping.

Disable CONFIG_BOOTMETH_EFI_BOOTMGR, as the Milk-V Duo 256M does. There
is no EFI system partition to store variables, and the EFI boot manager
fails on every boot before extlinux is tried.

The rest of the diff comes from savedefconfig.

Signed-off-by: Hiago De Franco <hfranco@baylibre.com>
---
 configs/milkv_duo_defconfig | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/configs/milkv_duo_defconfig b/configs/milkv_duo_defconfig
index f1f3930564b..20e19fde712 100644
--- a/configs/milkv_duo_defconfig
+++ b/configs/milkv_duo_defconfig
@@ -11,18 +11,16 @@ CONFIG_TARGET_MILKV_DUO=y
 CONFIG_ARCH_RV64I=y
 CONFIG_RISCV_SMODE=y
 CONFIG_FIT=y
-CONFIG_SUPPORT_RAW_INITRD=y
+CONFIG_BOOTSTD_DEFAULTS=y
+# CONFIG_BOOTMETH_EFI_BOOTMGR is not set
 CONFIG_SYS_CBSIZE=512
 CONFIG_SYS_PBSIZE=544
-CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="milkv_duo# "
 CONFIG_CMD_MMC=y
-CONFIG_CMD_PART=y
 CONFIG_CMD_POWEROFF=y
-CONFIG_CMD_DHCP=y
-CONFIG_CMD_PXE=y
-CONFIG_CMD_FAT=y
-CONFIG_CMD_FS_GENERIC=y
+# CONFIG_CMD_MII is not set
+# CONFIG_ISO_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
 CONFIG_ENV_OVERWRITE=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_CLK_SOPHGO_CV1800B=y

-- 
2.53.0


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

* [PATCH 3/3] configs: milkv_duo: reduce CONFIG_STACK_SIZE to 1MB
  2026-09-29 22:20 [PATCH 0/3] board: sophgo: milkv_duo: enable standard boot Hiago De Franco
  2026-09-29 22:20 ` [PATCH 1/3] board: sophgo: milkv_duo: add environment for " Hiago De Franco
  2026-09-29 22:20 ` [PATCH 2/3] configs: milkv_duo: enable BOOTSTD_DEFAULTS Hiago De Franco
@ 2026-09-29 22:20 ` Hiago De Franco
  2026-10-07 21:27 ` [PATCH 0/3] board: sophgo: milkv_duo: enable standard boot Yao Zi
  3 siblings, 0 replies; 6+ messages in thread
From: Hiago De Franco @ 2026-09-29 22:20 UTC (permalink / raw)
  To: u-boot; +Cc: Kongyang Liu, Tom Rini, Yao Zi, Zhuxu Ran, Tim Ouyang, Leo Liang

LMB reserves CONFIG_STACK_SIZE below the relocated stack pointer. The
default 16MB is a quarter of the 64MB of DRAM on this board and leaves
only about 1.4MB free above ramdisk_addr_r.

Use 1MB, as the other small memory RISC-V boards do (sipeed_maix_bitm,
sipeed_maix_smode). This is well above the 128KiB required by the UEFI
specification, and leaves about 16MB for an initrd.

Signed-off-by: Hiago De Franco <hfranco@baylibre.com>
---
 configs/milkv_duo_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/milkv_duo_defconfig b/configs/milkv_duo_defconfig
index 20e19fde712..2b4572077f2 100644
--- a/configs/milkv_duo_defconfig
+++ b/configs/milkv_duo_defconfig
@@ -10,6 +10,7 @@ CONFIG_IDENT_STRING="milkv_duo"
 CONFIG_TARGET_MILKV_DUO=y
 CONFIG_ARCH_RV64I=y
 CONFIG_RISCV_SMODE=y
+CONFIG_STACK_SIZE=0x100000
 CONFIG_FIT=y
 CONFIG_BOOTSTD_DEFAULTS=y
 # CONFIG_BOOTMETH_EFI_BOOTMGR is not set

-- 
2.53.0


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

* Re: [PATCH 2/3] configs: milkv_duo: enable BOOTSTD_DEFAULTS
  2026-09-29 22:20 ` [PATCH 2/3] configs: milkv_duo: enable BOOTSTD_DEFAULTS Hiago De Franco
@ 2026-10-07 21:25   ` Yao Zi
  0 siblings, 0 replies; 6+ messages in thread
From: Yao Zi @ 2026-10-07 21:25 UTC (permalink / raw)
  To: Hiago De Franco, u-boot
  Cc: Kongyang Liu, Tom Rini, Yao Zi, Zhuxu Ran, Tim Ouyang, Leo Liang

On Tue, Sep 29, 2026 at 07:20:32PM -0300, Hiago De Franco wrote:
> Enable CONFIG_BOOTSTD_DEFAULTS so the board can boot an extlinux.conf
> with standard boot. This sets bootcmd to "bootflow scan" and enables
> the script bootmeth, the ext4 commands and ping.
> 
> Disable CONFIG_BOOTMETH_EFI_BOOTMGR, as the Milk-V Duo 256M does. There
> is no EFI system partition to store variables, and the EFI boot manager
> fails on every boot before extlinux is tried.

EFI bootmgr works even without variables, since it scans for removable
paths as well.

I don't have strong opinions on this change. Duo is too resource
constrained for generic distributions, so it shouldn't be too surprising
not to have UEFI by default.

But if it's me, I'll be happy to keep it enabled if the storage (usually
SD-card here, and I don't think the BROM imposes a limitation) and
boot time allows.

Regards,
Yao Zi

> The rest of the diff comes from savedefconfig.
> 
> Signed-off-by: Hiago De Franco <hfranco@baylibre.com>

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

* Re: [PATCH 0/3] board: sophgo: milkv_duo: enable standard boot
  2026-09-29 22:20 [PATCH 0/3] board: sophgo: milkv_duo: enable standard boot Hiago De Franco
                   ` (2 preceding siblings ...)
  2026-09-29 22:20 ` [PATCH 3/3] configs: milkv_duo: reduce CONFIG_STACK_SIZE to 1MB Hiago De Franco
@ 2026-10-07 21:27 ` Yao Zi
  3 siblings, 0 replies; 6+ messages in thread
From: Yao Zi @ 2026-10-07 21:27 UTC (permalink / raw)
  To: Hiago De Franco, u-boot
  Cc: Kongyang Liu, Tom Rini, Yao Zi, Zhuxu Ran, Tim Ouyang, Leo Liang

On Tue, Sep 29, 2026 at 07:20:30PM -0300, Hiago De Franco wrote:
> The Milk-V Duo (CV1800B, 64MB) does not enable CONFIG_BOOTSTD_DEFAULTS
> and has no environment file, so U-Boot has no bootcmd and none of the
> kernel_addr_r, fdt_addr_r, ramdisk_addr_r, ... variables required by
> the extlinux bootmeth.
> 
> Enable CONFIG_BOOTSTD_DEFAULTS and add a milkv_duo.env with a memory
> layout that fits into the 64MB of DRAM:
> 
>   0x80200000  kernel_addr_r       (16MB)
>   0x81200000  kernel_comp_addr_r  (16MB, Image.gz decompression)
>   0x82200000  fdt_addr_r
>   0x82300000  scriptaddr
>   0x82400000  pxefile_addr_r
>   0x82500000  ramdisk_addr_r
> 
> Also reduce CONFIG_STACK_SIZE to 1MB. LMB reserves CONFIG_STACK_SIZE
> below the relocated stack pointer, and the default 16MB left only about
> 1.4MB between ramdisk_addr_r and the reserved region. With 1MB, about
> 16MB are available for an initrd.
> 
> This series depends on Zhuxu Ran's "riscv: sophgo: Use upstream
> devicetrees for CV18xx boards" (v5), which sets CONFIG_DEFAULT_DEVICE_TREE
> to sophgo/<board>, so that fdtfile matches the Linux devicetree install
> path (sophgo/cv1800b-milkv-duo.dtb and sophgo/sg2002-milkv-duo256m.dtb).
> 
> Link: https://lore.kernel.org/all/20260927-milkv-duo-upstream-dts-v5-0-7f64983e59e1@zohomail.com/
> 
> Tested on Milk-V Duo, booting Linux through "bootflow scan" and an
> extlinux.conf on the SD card.
> 
> Signed-off-by: Hiago De Franco <hfranco@baylibre.com>

For the series,

Reviewed-by: Yao Zi <me@ziyao.cc>

Thanks,
Yao Zi

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

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

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-29 22:20 [PATCH 0/3] board: sophgo: milkv_duo: enable standard boot Hiago De Franco
2026-09-29 22:20 ` [PATCH 1/3] board: sophgo: milkv_duo: add environment for " Hiago De Franco
2026-09-29 22:20 ` [PATCH 2/3] configs: milkv_duo: enable BOOTSTD_DEFAULTS Hiago De Franco
2026-10-07 21:25   ` Yao Zi
2026-09-29 22:20 ` [PATCH 3/3] configs: milkv_duo: reduce CONFIG_STACK_SIZE to 1MB Hiago De Franco
2026-10-07 21:27 ` [PATCH 0/3] board: sophgo: milkv_duo: enable standard boot Yao Zi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.