瀏覽代碼

boot/uboot: add support for bundling TEE in ELF format into U-Boot

Some U-Boot platforms (e.g. rockchip) can bundle OPTEE's tee.elf
into the U-Boot image. This patch brings the necessary changes to
enable this feature.

Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Christoph Muellner 5 年之前
父節點
當前提交
5521539eb1
共有 2 個文件被更改,包括 14 次插入0 次删除
  1. 9 0
      boot/uboot/Config.in
  2. 5 0
      boot/uboot/uboot.mk

+ 9 - 0
boot/uboot/Config.in

@@ -229,6 +229,15 @@ config BR2_TARGET_UBOOT_NEEDS_ATF_BL31_ELF
 
 
 endchoice
 endchoice
 
 
+config BR2_TARGET_UBOOT_NEEDS_OPTEE_TEE
+	bool "U-Boot needs OPTEE TEE"
+	depends on BR2_TARGET_OPTEE_OS_CORE
+	help
+	  Some platforms (such as Rockchip) encapsulate the TEE inside
+	  U-Boot. This option makes sure optee-os gets built prior to
+	  U-Boot, and that the TEE variable pointing to OPTEE's
+	  tee.elf, is passed during the Buildroot build.
+
 config BR2_TARGET_UBOOT_NEEDS_OPENSBI
 config BR2_TARGET_UBOOT_NEEDS_OPENSBI
 	bool "U-Boot needs OpenSBI"
 	bool "U-Boot needs OpenSBI"
 	depends on BR2_TARGET_OPENSBI
 	depends on BR2_TARGET_OPENSBI

+ 5 - 0
boot/uboot/uboot.mk

@@ -175,6 +175,11 @@ UBOOT_PRE_BUILD_HOOKS += UBOOT_COPY_ATF_FIRMWARE
 endif
 endif
 endif
 endif
 
 
+ifeq ($(BR2_TARGET_UBOOT_NEEDS_OPTEE_TEE),y)
+UBOOT_DEPENDENCIES += optee-os
+UBOOT_MAKE_OPTS += TEE=$(BINARIES_DIR)/tee.elf
+endif
+
 ifeq ($(BR2_TARGET_UBOOT_NEEDS_OPENSBI),y)
 ifeq ($(BR2_TARGET_UBOOT_NEEDS_OPENSBI),y)
 UBOOT_DEPENDENCIES += opensbi
 UBOOT_DEPENDENCIES += opensbi
 UBOOT_MAKE_OPTS += OPENSBI=$(BINARIES_DIR)/fw_dynamic.bin
 UBOOT_MAKE_OPTS += OPENSBI=$(BINARIES_DIR)/fw_dynamic.bin