All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] Fix binman_sym functionality on RISC-V port
@ 2025-04-16 16:25 Yao Zi
  2025-04-16 16:25 ` [PATCH v2 1/3] riscv: dts: binman.dtsi: Switch to u-boot-nodtb entry for proper U-Boot Yao Zi
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Yao Zi @ 2025-04-16 16:25 UTC (permalink / raw)
  To: Rick Chen, Leo, Tom Rini, Minda Chen, Hal Feng, Simon Glass,
	Chia-Wei Wang, Heinrich Schuchardt, E Shattow, Yu-Chien Peter Lin,
	Sumit Garg, Bin Meng
  Cc: u-boot, Yao Zi

It's found that BINMAN_SYMBOLS_OK always evaluates to false on RISC-V,
because our linkerscripts don't define symbol __image_copy_start, on
which binman depends for determining the base address of an entry.
Binman simply bails out in case of missing the symbol.

This series contains three main changes,

1. Correct the entry type used for proper U-Boot, ensuring binman could
   find it, which is mandatory since SPL_BINMAN_UBOOT_SYMBOLS defaults
   to Y on RISC-V
2. Mark the SPL image of StarFive VisionFive2 as "no-write-symbols",
   since the SPL and proper U-Boot are split into two images.
3. Finally provide __image_copy{start,end} in RISC-V linkerscripts of
   both SPL and proper U-Boot, fixing functionality of binman_sym

I've tested building with
  - ae350_rv64_defconfig
  - ae350_rv64_spl_defconfig
  - bananapi-f3_defconfig
  - k230_canmv_defconfig
  - microchip_mpfs_icicle_defconfig
  - milkv_duo_defconfig

and booting successfully on
  - qemu-riscv64_smode_defconfig
  - qemu-riscv64_defconfig
  - sifive_unleashed_defconfig
  - starfive_visionfive2_defconfig
with either real hardware or QEMU.

Thank you Jonas Karlman for pointing out the root cause of binman
failures with SPL_BINMAN_UBOOT_SYMBOLS enabled. I'm looking forward to
further reviews.

Changed from v2
- Drop the patch which disables SPL_BINMAN_UBOOT_SYMBOLS by default on
  RISC-V
- Add patch to correct entry type of proper U-Boot in default binman
  configuration for RISC-V
- Add patch to prevent binman from relocating SPL of VisionFive 2
- Fix typo (one missing underscore) in linkerscript and collect Simon's
  r-b tag.
- Link to v1: https://lore.kernel.org/u-boot/20250407033744.4025-1-ziyao@disroot.org/

Yao Zi (3):
  riscv: dts: binman.dtsi: Switch to u-boot-nodtb entry for proper
    U-Boot
  riscv: dts: starfive: Prevent binman from relocating symbols in SPL
  riscv: Provide __image_copy_{start_end} symbols in linkerscript

 arch/riscv/cpu/u-boot-spl.lds                   | 2 ++
 arch/riscv/cpu/u-boot.lds                       | 3 +++
 arch/riscv/dts/binman.dtsi                      | 2 +-
 arch/riscv/dts/starfive-visionfive2-binman.dtsi | 1 +
 4 files changed, 7 insertions(+), 1 deletion(-)

-- 
2.49.0


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

end of thread, other threads:[~2025-04-18  4:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-16 16:25 [PATCH v2 0/3] Fix binman_sym functionality on RISC-V port Yao Zi
2025-04-16 16:25 ` [PATCH v2 1/3] riscv: dts: binman.dtsi: Switch to u-boot-nodtb entry for proper U-Boot Yao Zi
2025-04-17 21:35   ` Simon Glass
2025-04-18  4:10     ` Yao Zi
2025-04-16 16:25 ` [PATCH v2 2/3] riscv: dts: starfive: Prevent binman from relocating symbols in SPL Yao Zi
2025-04-16 16:25 ` [PATCH v2 3/3] riscv: Provide __image_copy_{start_end} symbols in linkerscript 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.