浏览代码

boot/uboot: introduce BR2_TARGET_UBOOT_NEEDS_OPENSBI

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>
Bin Meng 4 年之前
父节点
当前提交
3fccb15705
共有 2 个文件被更改,包括 15 次插入0 次删除
  1. 10 0
      boot/uboot/Config.in
  2. 5 0
      boot/uboot/uboot.mk

+ 10 - 0
boot/uboot/Config.in

@@ -229,6 +229,16 @@ config BR2_TARGET_UBOOT_NEEDS_ATF_BL31_ELF
 
 
 endchoice
 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"
 menu "U-Boot binary format"
 
 
 config BR2_TARGET_UBOOT_FORMAT_AIS
 config BR2_TARGET_UBOOT_FORMAT_AIS

+ 5 - 0
boot/uboot/uboot.mk

@@ -163,6 +163,11 @@ UBOOT_MAKE_OPTS += BL31=$(BINARIES_DIR)/bl31.bin
 endif
 endif
 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)
 ifeq ($(BR2_TARGET_UBOOT_NEEDS_DTC),y)
 UBOOT_DEPENDENCIES += host-dtc
 UBOOT_DEPENDENCIES += host-dtc
 endif
 endif