boot/uboot: introduce BR2_TARGET_UBOOT_NEEDS_OPENSBI
authorBin Meng <bin.meng@windriver.com>
Mon, 11 Jan 2021 09:01:11 +0000 (17:01 +0800)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sat, 16 Jan 2021 21:41:19 +0000 (22:41 +0100)
Some RISC-V platforms (such as SiFive HiFive Unleashed) encapsulate
the OpenSBI firmware image inside U-Boot.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
boot/uboot/Config.in
boot/uboot/uboot.mk

index e4a0f48debd591c2ced4d9dcf86c513af200ec67..b18216ab718c70b55aaa258d7ed8865712f5890d 100644 (file)
@@ -229,6 +229,16 @@ config BR2_TARGET_UBOOT_NEEDS_ATF_BL31_ELF
 
 endchoice
 
+config BR2_TARGET_UBOOT_NEEDS_OPENSBI
+       bool "U-Boot needs OpenSBI"
+       depends on BR2_TARGET_OPENSBI
+       help
+         Some RISC-V platforms (such as SiFive HiFive Unleashed)
+         encapsulate the OpenSBI firmware image inside U-Boot.
+         This option makes sure OpenSBI gets built prior to U-Boot,
+         and that the OpenSBI variable pointing to OpenSBI binary,
+         is passed during the Buildroot build.
+
 menu "U-Boot binary format"
 
 config BR2_TARGET_UBOOT_FORMAT_AIS
index a29d71ffa23d45b0a16c86d9ab007dc2ad9378c2..d92000f053f7c0e3ef58f2d49c6ba5bd33c76622 100644 (file)
@@ -163,6 +163,11 @@ UBOOT_MAKE_OPTS += BL31=$(BINARIES_DIR)/bl31.bin
 endif
 endif
 
+ifeq ($(BR2_TARGET_UBOOT_NEEDS_OPENSBI),y)
+UBOOT_DEPENDENCIES += opensbi
+UBOOT_MAKE_OPTS += OPENSBI=$(BINARIES_DIR)/fw_dynamic.bin
+endif
+
 ifeq ($(BR2_TARGET_UBOOT_NEEDS_DTC),y)
 UBOOT_DEPENDENCIES += host-dtc
 endif