From: Yao Zi <me@ziyao.cc>
To: Hiago De Franco <hfranco@baylibre.com>,
u-boot@lists.u-boot-project.org, Yao Zi <me@ziyao.cc>
Cc: Tom Rini <trini@konsulko.com>, Simon Glass <sjg@chromium.org>,
Alper Nebi Yasak <alpernebiyasak@gmail.com>,
Marek Vasut <marex@nabladev.com>,
Tim Ouyang <tim609@andestech.com>,
Leo Liang <leo.liang@sifive.com>,
Kongyang Liu <seashell11234455@gmail.com>,
Neha Malcom Francis <n-francis@ti.com>, Bin Liu <b-liu@ti.com>,
Quentin Schulz <quentin.schulz@cherry.de>,
Andrei Lalaev <andrey.lalaev@gmail.com>,
Zhuxu Ran <zhuxu_ran@zohomail.com>, Udit Kumar <u-kumar1@ti.com>
Subject: Re: [PATCH 4/8] board: sophgo: milkv_duo: add SPL support
Date: Wed, 4 Nov 2026 03:56:32 +0000 [thread overview]
Message-ID: <auqs8BSPdzT2N9dL@pie> (raw)
In-Reply-To: <20261021-milkv-duo-spl-v1-4-ee7618860237@baylibre.com>
On Wed, Oct 21, 2026 at 09:54:20AM -0300, Hiago De Franco wrote:
> Wire up SPL for the Milk-V Duo so it no longer depends on the vendor
> FSBL.
>
> The SPL uses the BootROM ROMAPI to load the FIT image with OpenSBI,
> U-Boot and the device tree, from offset 0x40000 of fip.bin.
>
> The BootROM loads the SPL into the 100 KiB VC SRAM at 0x3bc00000 and
> jumps past the 32-byte BL2 header, so SPL_TEXT_BASE is 0x3bc00020.
> SPL_MAX_SIZE (0x13fe0) is exactly SPL_BSS_START_ADDR (0x3bc14000) minus
> SPL_TEXT_BASE, so the SPL image cannot grow into its own BSS.
> SPL_BSS_MAX_SIZE (0x1000) caps that 4 KiB BSS, ending at 0x3bc15000, and
> SPL_STACK (0x3bc19000) is the end of the SRAM, leaving 16 KiB below it
> for the stack, the pre-relocation malloc_f pool (SPL_SYS_MALLOC_F_LEN, 8
> KiB) and the global data, as the generic SPL board_init_f flow expects.
Thanks for the helpful explanation, I think it would be better to add
some documentation for the SoC bootflow.
> In DRAM, SPL_OPENSBI_LOAD_ADDR (0x80000000) is the base of RAM: the
> fixed link address OpenSBI's "generic" platform uses for fw_dynamic, and
> the load address given to it in the FIT. SPL_CUSTOM_SYS_MALLOC_ADDR
> (0x81000000) moves the SPL heap into DRAM once it is up, 16 MiB in,
> clear of SYS_LOAD_ADDR (0x80080000), U-Boot's default load address, and
> of TEXT_BASE (0x80200000).
>
> SPL_SMP is disabled, as only one hart is brought up, and
> SPL_OPENSBI_SCRATCH_OPTIONS is cleared so that OpenSBI prints its boot
> banner, which the default (SBI_SCRATCH_NO_BOOT_PRINTS) hides.
Should we avoid this to keep aligned with other RISC-V boards? The
banner, IMHO, is only meaningful for debugging purpose.
> Signed-off-by: Hiago De Franco <hfranco@baylibre.com>
> ---
> arch/riscv/dts/cv1800b-milkv-duo-u-boot.dtsi | 92 +++++++++++++++++++++++++++
> arch/riscv/include/asm/arch-cv1800b/rom_api.h | 36 +++++++++++
> board/sophgo/milkv_duo/Kconfig | 5 ++
> board/sophgo/milkv_duo/MAINTAINERS | 5 +-
> board/sophgo/milkv_duo/Makefile | 1 +
> board/sophgo/milkv_duo/spl.c | 76 ++++++++++++++++++++++
> configs/milkv_duo_defconfig | 18 ++++++
> 7 files changed, 232 insertions(+), 1 deletion(-)
>
> diff --git a/arch/riscv/dts/cv1800b-milkv-duo-u-boot.dtsi b/arch/riscv/dts/cv1800b-milkv-duo-u-boot.dtsi
> new file mode 100644
> index 00000000000..7f9a7a03c5d
> --- /dev/null
> +++ b/arch/riscv/dts/cv1800b-milkv-duo-u-boot.dtsi
> @@ -0,0 +1,92 @@
> +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
> +/*
> + * Copyright (c) 2026, Hiago De Franco <hfranco@baylibre.com>
> + */
...
> +&uart0 {
> + bootph-pre-ram;
> + clock-frequency = <25000000>;
The upstream UART 8250 binding disallows clocks and clock-frequency
to co-exist, and with current Linux drivers, it does cause issues, see
this series[1].
If you worry about the burden of introducing clock related stuff to SPL,
consider define CFG_SYS_NS16550_CLK in the board configuration header
instead.
...
Best regards,
Yao Zi
[1]: https://lore.kernel.org/all/20250623093445.62327-1-ziyao@disroot.org/
next prev parent reply other threads:[~2026-11-04 3:57 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-21 12:54 [PATCH 0/8] riscv: sophgo: add SPL support for the Milk-V Duo Hiago De Franco
2026-10-21 12:54 ` [PATCH 1/8] binman: add Sophgo CV18xx FIP entry type Hiago De Franco
2026-11-03 14:54 ` Simon Glass
2026-10-21 12:54 ` [PATCH 2/8] riscv: cv1800b: add SPL support Hiago De Franco
2026-11-03 13:53 ` Yao Zi
2026-10-21 12:54 ` [PATCH 3/8] ram: sophgo: add CV180x DDR2 driver Hiago De Franco
2026-10-21 12:54 ` [PATCH 4/8] board: sophgo: milkv_duo: add SPL support Hiago De Franco
2026-11-04 3:56 ` Yao Zi [this message]
2026-10-21 12:54 ` [PATCH 5/8] board: sophgo: milkv_duo: initialize PLLs in SPL Hiago De Franco
2026-11-04 4:19 ` Yao Zi
2026-10-21 12:54 ` [PATCH 6/8] board: sophgo: milkv_duo: enable RTC power and reset Hiago De Franco
2026-11-03 17:31 ` João Paulo Gonçalves
2026-11-04 3:59 ` Yao Zi
2026-10-21 12:54 ` [PATCH 7/8] doc: board: sophgo: milkv_duo: update documentation Hiago De Franco
2026-10-21 12:54 ` [PATCH 8/8] doc: board: sophgo: milkv_duo: document the SPL boot flow Hiago De Franco
2026-10-25 17:33 ` [PATCH 0/8] riscv: sophgo: add SPL support for the Milk-V Duo Andrei Lalaev
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=auqs8BSPdzT2N9dL@pie \
--to=me@ziyao.cc \
--cc=alpernebiyasak@gmail.com \
--cc=andrey.lalaev@gmail.com \
--cc=b-liu@ti.com \
--cc=hfranco@baylibre.com \
--cc=leo.liang@sifive.com \
--cc=marex@nabladev.com \
--cc=n-francis@ti.com \
--cc=quentin.schulz@cherry.de \
--cc=seashell11234455@gmail.com \
--cc=sjg@chromium.org \
--cc=tim609@andestech.com \
--cc=trini@konsulko.com \
--cc=u-boot@lists.u-boot-project.org \
--cc=u-kumar1@ti.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