boot/optee-os: support alternate image files
authorEtienne Carriere <etienne.carriere@linaro.org>
Fri, 1 Mar 2019 16:47:13 +0000 (17:47 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sat, 3 Aug 2019 16:07:57 +0000 (18:07 +0200)
Some platform may generate specific boot image files instead of
the generic files tee.bin and tee-*_v2.bin when building OP-TEE OS
package.

This change introduces optee-os configuration directive
BR2_TARGET_OPTEE_OS_CORE_IMAGES that allows board configuration
to specify its expected boot image file names.

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
[Thomas: use the current hardcoded values as the default for the new
config option, to avoid breaking existing setups, and therefore use
$(wildcard ...) to support wildcards]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
boot/optee-os/Config.in
boot/optee-os/optee-os.mk

index bd685b58bf73b9316d5577723ce7b98f78fd8b05..18b81ab01d1558ef861b31dd6db6e1beab0ec52f 100644 (file)
@@ -99,4 +99,11 @@ config BR2_TARGET_OPTEE_OS_ADDITIONAL_VARIABLES
          Additional parameters for the OP-TEE OS build
          E.g. 'CFG_TEE_CORE_LOG_LEVEL=3 CFG_UNWIND=y'
 
+config BR2_TARGET_OPTEE_OS_CORE_IMAGES
+       string "Binary boot images"
+       default "tee.bin tee-*_v2.bin"
+       help
+         Names of generated image files that are installed in the
+         output images/ directory.
+
 endif # BR2_TARGET_OPTEE_OS
index bd415512c7410aae4f21ae19371feb08673ad020..28f5add480b78c42c1001a70fd8b22b6e7197c66 100644 (file)
@@ -62,6 +62,8 @@ OPTEE_OS_LOCAL_SDK = $(OPTEE_OS_BUILDDIR_OUT)/export-ta_arm32
 OPTEE_OS_SDK = $(STAGING_DIR)/lib/optee/export-ta_arm32
 endif
 
+OPTEE_OS_IMAGE_FILES = $(call qstrip,$(BR2_TARGET_OPTEE_OS_CORE_IMAGES))
+
 ifeq ($(BR2_TARGET_OPTEE_OS_CORE),y)
 define OPTEE_OS_BUILD_CORE
        $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) O=$(OPTEE_OS_BUILDDIR_OUT) \
@@ -69,8 +71,9 @@ define OPTEE_OS_BUILD_CORE
 endef
 define OPTEE_OS_INSTALL_IMAGES_CORE
        mkdir -p $(BINARIES_DIR)
-       cp -dpf $(@D)/$(OPTEE_OS_BUILDDIR_OUT)/core/tee.bin $(BINARIES_DIR)
-       cp -dpf $(@D)/$(OPTEE_OS_BUILDDIR_OUT)/core/tee-*_v2.bin $(BINARIES_DIR)
+       $(foreach f,$(OPTEE_OS_IMAGE_FILES), \
+               cp -dpf $(wildcard $(@D)/$(OPTEE_OS_BUILDDIR_OUT)/core/$(f)) $(BINARIES_DIR)/
+       )
 endef
 endif # BR2_TARGET_OPTEE_OS_CORE