boot/opensbi: allow using U-Boot as a payload
authorThomas Petazzoni <thomas.petazzoni@bootlin.com>
Thu, 29 Apr 2021 07:46:33 +0000 (09:46 +0200)
committerPeter Korsgaard <peter@korsgaard.com>
Fri, 30 Apr 2021 07:49:15 +0000 (09:49 +0200)
The opensbi package already allows to use Linux as a payload for
OpenSBI, but in some cases, U-Boot as payload is useful. This commit
adds a BR2_TARGET_OPENSBI_UBOOT_PAYLOAD option, modeled after the
existing BR2_TARGET_OPENSBI_LINUX_PAYLOAD.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
boot/opensbi/Config.in
boot/opensbi/opensbi.mk

index 83f40f04faa5da843e807c2a5ff1fce4fa289733..236bf74a90133bf7f6d03f49583379c1169ca8ce 100644 (file)
@@ -82,4 +82,11 @@ config BR2_TARGET_OPENSBI_LINUX_PAYLOAD
        help
          Build OpenSBI with the Linux kernel as a Payload.
 
+config BR2_TARGET_OPENSBI_UBOOT_PAYLOAD
+       bool "Include U-Boot as OpenSBI Payload"
+       depends on BR2_TARGET_OPENSBI_PLAT != ""
+       depends on BR2_TARGET_UBOOT
+       help
+         Build OpenSBI with the U-Boot as a Payload.
+
 endif
index 250a6078afbf526e345be564eb2c07be88436654..8ebe4566fd989fa879433dcea2b762daa04a3774 100644 (file)
@@ -41,6 +41,11 @@ OPENSBI_DEPENDENCIES += linux
 OPENSBI_MAKE_ENV += FW_PAYLOAD_PATH="$(BINARIES_DIR)/Image"
 endif
 
+ifeq ($(BR2_TARGET_OPENSBI_UBOOT_PAYLOAD),y)
+OPENSBI_DEPENDENCIES += uboot
+OPENSBI_MAKE_ENV += FW_PAYLOAD_PATH="$(BINARIES_DIR)/u-boot.bin"
+endif
+
 define OPENSBI_BUILD_CMDS
        $(TARGET_MAKE_ENV) $(OPENSBI_MAKE_ENV) $(MAKE) -C $(@D)
 endef
@@ -51,6 +56,9 @@ OPENSBI_FW_IMAGES += jump dynamic
 ifeq ($(BR2_TARGET_OPENSBI_LINUX_PAYLOAD),y)
 OPENSBI_FW_IMAGES += payload
 endif
+ifeq ($(BR2_TARGET_OPENSBI_UBOOT_PAYLOAD),y)
+OPENSBI_FW_IMAGES = payload
+endif
 endif
 
 define OPENSBI_INSTALL_IMAGES_CMDS