Skip to content

boot/opensbi: support building an out-of-tree platform

Richard Vodden buildroot 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v1 Latest posting 2/22 patches 0 repliesNew
  2. v1 posting 1/22 patches 0 repliesSuperseded

Patches in v1 posting 2/2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2boot/opensbi: allow building against an external platformConfig.in.legacy boot/opensbi/Config.in boot/opensbi/opensbi.mk +13 more+100 -280 replies
2/2DEVELOPERS: add Richard Vodden for boot/opensbiDEVELOPERS+3 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [Buildroot] [PATCH RESEND 0/2] boot/opensbi: support building an out-of-tree platform

Resending: I sent this on 2026-08-13 and it hasn't had any comments. The patches are unchanged, rebased onto current master.

OpenSBI can build a platform that lives outside its source tree via PLATFORM_DIR. For a board whose platform is not upstream - as is the case for LiteX/VexRiscv - that is considerably simpler than patching a platform directory into the OpenSBI source or maintaining a custom tarball, and it decouples the platform from the OpenSBI release so upstream can be tracked.

Patch 1 replaces the BR2_TARGET_OPENSBI_PLAT string with a choice of reference platform, external platform, or no platform. Three existing conditionals compared that symbol against the empty string; they are moved to !BR2_TARGET_OPENSBI_PLAT_NONE, as leaving them referring to the removed symbol would silently have disabled INSTALL_JUMP_IMG and INSTALL_DYNAMIC_IMG and produced no firmware at all. The 13 in-tree defconfigs that set the old symbol are converted, and a Config.in.legacy entry carries an existing value over to the reference platform.

Tested when I first sent this:

- The external platform path is what builds OpenSBI 1.5.1, 1.6 and 1.9 for a LiteX/VexRiscv rv32 target here; all three boot to a shell on hardware (ALINX AX7035, xc7a35t).
- qemu_riscv64_virt_defconfig builds clean and installs its firmware from build/platform/generic/firmware/, exercising the reference platform path. The resulting fw_jump.bin boots under qemu-system-riscv64 to a login prompt (OpenSBI v1.6, Linux 6.18.7).

What I've re-checked since the rebase:

- All 13 converted defconfigs generate a configuration and resolve OPENSBI_PLAT=generic, and none of them sets BR2_LEGACY.
- An old-style configuration setting BR2_TARGET_OPENSBI_PLAT="generic" still converts to BR2_TARGET_OPENSBI_PLAT_REF with the name carried over, and sets BR2_LEGACY as expected.
- check-symbols is clean, and the checkpackagelib and checksymbolslib unit tests pass. check-package reports nothing on the changed files beyond the two missing-BR2_DOWNLOAD_FORCE_CHECK_HASHES warnings master already has on the sipeed_lichee_rv defconfigs.

Richard Vodden (2):
boot/opensbi: allow building against an external platform
DEVELOPERS: add Richard Vodden for boot/opensbi

 Config.in.legacy                        | 18 ++++++++
 DEVELOPERS                              |  3 ++
 boot/opensbi/Config.in                  | 55 +++++++++++++++++++------
 boot/opensbi/opensbi.mk                 | 16 +++++--
 configs/andes_ae350_45_defconfig        |  3 +-
 configs/hifive_unleashed_defconfig      |  3 +-
 configs/hifive_unmatched_defconfig      |  3 +-
 configs/nezha_defconfig                 |  3 +-
 configs/pine64_star64_defconfig         |  3 +-
 configs/qemu_riscv32_virt_defconfig     |  3 +-
 configs/qemu_riscv64_virt_defconfig     |  3 +-
 configs/sipeed_lichee_rv_defconfig      |  3 +-
 configs/sipeed_lichee_rv_dock_defconfig |  3 +-
 configs/sipeed_licheepi_4a_defconfig    |  3 +-
 configs/spike_riscv32_defconfig         |  3 +-
 configs/spike_riscv64_defconfig         |  3 +-
 configs/visionfive2_defconfig           |  3 +-
 17 files changed, 103 insertions(+), 28 deletions(-)

base-commit: a962be2eea146e06661712159698bc7cbf3305f2

Signature · 6 lines
2.47.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot