boot/opensbi: add options to enable/disable image installation
authorThomas Petazzoni <thomas.petazzoni@bootlin.com>
Tue, 4 May 2021 20:51:33 +0000 (22:51 +0200)
committerYann E. MORIN <yann.morin.1998@free.fr>
Fri, 7 May 2021 20:29:02 +0000 (22:29 +0200)
Until now, whenever a BR2_TARGET_OPENSBI_PLAT value was specified,
opensbi.mk was assuming that both fw_jump and fw_dynamic would be
produced. However, this is not the case: the OpenSBI per-platform
config.mk can decide which image to build.

As an example, the config.mk for VIC7100-based BeagleV only enables
producing the fw_payload image.

This commit adds three options to enable the installation of images:
one for fw_jump, one for fw_dynamic, one for fw_payload.

The options for fw_jump and fw_dynamic are "default y" when
BR2_TARGET_OPENSBI_PLAT is not empty, to preserve existing behavior.

The option for fw_payload is forcefully selected when either Linux or
U-Boot are selected as payloads.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
boot/opensbi/Config.in
boot/opensbi/opensbi.mk

index 236bf74a90133bf7f6d03f49583379c1169ca8ce..55a644506faace5525945e88050217c8df03b771 100644 (file)
@@ -74,11 +74,30 @@ config BR2_TARGET_OPENSBI_PLAT
          the platform specific static library libplatsbi.a and firmware
          examples are built.
 
+config BR2_TARGET_OPENSBI_INSTALL_DYNAMIC_IMG
+       bool "Install fw_dynamic image"
+       default y if BR2_TARGET_OPENSBI_PLAT != ""
+       help
+         This installs the fw_dynamic image.
+
+config BR2_TARGET_OPENSBI_INSTALL_JUMP_IMG
+       bool "Install fw_jump image"
+       default y if BR2_TARGET_OPENSBI_PLAT != ""
+       help
+         This installs the fw_jump image.
+
+config BR2_TARGET_OPENSBI_INSTALL_PAYLOAD_IMG
+       bool "Install fw_payload image"
+       help
+         This option enables the installation of the fw_paylaod
+         image.
+
 config BR2_TARGET_OPENSBI_LINUX_PAYLOAD
        bool "Include Linux as OpenSBI Payload"
        depends on BR2_TARGET_OPENSBI_PLAT != ""
        depends on BR2_LINUX_KERNEL
        depends on BR2_LINUX_KERNEL_IMAGE
+       select BR2_TARGET_OPENSBI_INSTALL_PAYLOAD_IMG
        help
          Build OpenSBI with the Linux kernel as a Payload.
 
@@ -86,6 +105,7 @@ config BR2_TARGET_OPENSBI_UBOOT_PAYLOAD
        bool "Include U-Boot as OpenSBI Payload"
        depends on BR2_TARGET_OPENSBI_PLAT != ""
        depends on BR2_TARGET_UBOOT
+       select BR2_TARGET_OPENSBI_INSTALL_PAYLOAD_IMG
        help
          Build OpenSBI with the U-Boot as a Payload.
 
index 8ebe4566fd989fa879433dcea2b762daa04a3774..f8cbbb8fcca69e7760a22b892798d1891d7b193a 100644 (file)
@@ -50,15 +50,19 @@ define OPENSBI_BUILD_CMDS
        $(TARGET_MAKE_ENV) $(OPENSBI_MAKE_ENV) $(MAKE) -C $(@D)
 endef
 
-ifneq ($(OPENSBI_PLAT),)
+ifeq ($(BR2_TARGET_OPENSBI_INSTALL_DYNAMIC_IMG),y)
 OPENSBI_INSTALL_IMAGES = YES
-OPENSBI_FW_IMAGES += jump dynamic
-ifeq ($(BR2_TARGET_OPENSBI_LINUX_PAYLOAD),y)
-OPENSBI_FW_IMAGES += payload
+OPENSBI_FW_IMAGES += dynamic
 endif
-ifeq ($(BR2_TARGET_OPENSBI_UBOOT_PAYLOAD),y)
-OPENSBI_FW_IMAGES = payload
+
+ifeq ($(BR2_TARGET_OPENSBI_INSTALL_JUMP_IMG),y)
+OPENSBI_INSTALL_IMAGES = YES
+OPENSBI_FW_IMAGES += jump
 endif
+
+ifeq ($(BR2_TARGET_OPENSBI_INSTALL_PAYLOAD_IMG),y)
+OPENSBI_INSTALL_IMAGES = YES
+OPENSBI_FW_IMAGES += payload
 endif
 
 define OPENSBI_INSTALL_IMAGES_CMDS