@@ -111,7 +111,8 @@ config BR2_TARGET_OPENSBI_UBOOT_PAYLOAD
config BR2_TARGET_OPENSBI_FW_FDT_PATH
bool "Include U-Boot DTB in OpenSBI Payload"
- depends on BR2_TARGET_OPENSBI_UBOOT_PAYLOAD
+ depends on BR2_TARGET_OPENSBI_PLAT != ""
+ depends on BR2_TARGET_UBOOT
select BR2_TARGET_UBOOT_FORMAT_DTB
help
Build OpenSBI with FW_FDT_PATH set to
@@ -47,10 +47,12 @@ endif
ifeq ($(BR2_TARGET_OPENSBI_UBOOT_PAYLOAD),y)
OPENSBI_DEPENDENCIES += uboot
OPENSBI_MAKE_ENV += FW_PAYLOAD_PATH="$(BINARIES_DIR)/u-boot.bin"
+endif
+
ifeq ($(BR2_TARGET_OPENSBI_FW_FDT_PATH),y)
+OPENSBI_DEPENDENCIES += uboot
OPENSBI_MAKE_ENV += FW_FDT_PATH="$(BINARIES_DIR)/u-boot.dtb"
endif
-endif
define OPENSBI_BUILD_CMDS
$(TARGET_MAKE_ENV) $(OPENSBI_MAKE_ENV) $(MAKE) -C $(@D)
OpenSBI firmware can be built in three different ways depending on how it transitions to the bootloader (fw_dynamic, fw_jump, and fw_payload). Additionally, it is possible to pass a device-tree to OpenSBI during compilation using the FW_FDT_PATH variable. If this variable is not provided at compilation time, OpenSBI expects the previous boot stage to supply the required device-tree. Currently, in Buildroot, the only way to use the FW_FDT_PATH variable is to include the device-tree blob generated by U-Boot. The upstream Buildroot currently forces the user to install fw_payload for this purpose. This patch allows specifying FW_FDT_PATH without installing fw_payload, as permitted by the "Firmware Configuration and Compilation" section[1]. [1] https://github.com/riscv-software-src/opensbi/blob/master/docs/firmware/fw.md Signed-off-by: Thomas Bonnefille <thomas.bonnefille@bootlin.com> --- Changes in v2: - Rework commit message - Add dependency on U-Boot to build u-boot.dtb - Link to v1: https://lore.kernel.org/r/20241106-extract-fw_fdt_path-v1-1-0983c183f71e@bootlin.com --- boot/opensbi/Config.in | 3 ++- boot/opensbi/opensbi.mk | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) --- base-commit: d242ab6b8e2805ee173de54bec47dbbcbcecc939 change-id: 20241029-extract-fw_fdt_path-87cb8e4be2bb Best regards,