[meta-rockchip,3/6] u-boot: include optee-os as BL32 when requested by DISTRO_FEATURE

Submitted by yann.dirson@blade-group.com on April 13, 2021, 3:43 p.m. | Patch ID: 179616

Details

Message ID 20210413154316.3666881-4-yann@blade-group.com
State New
Headers show

Commit Message

yann.dirson@blade-group.com April 13, 2021, 3:43 p.m.
From: Yann Dirson <yann@blade-group.com>

This causes OP-TEE to get included into the u-boot.itb fitImage so u-boot
can load it for the trusted-firmware-a BL31 to run it.

This is configured automatically when DISTRO_FEATURE includes "optee".

Signed-off-by: Yann Dirson <yann@blade-group.com>
---
 recipes-bsp/u-boot/u-boot%.bbappend | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

Patch hide | download patch | download mbox

diff --git a/recipes-bsp/u-boot/u-boot%.bbappend b/recipes-bsp/u-boot/u-boot%.bbappend
index 95c019d..c8e150b 100644
--- a/recipes-bsp/u-boot/u-boot%.bbappend
+++ b/recipes-bsp/u-boot/u-boot%.bbappend
@@ -5,6 +5,8 @@  do_compile_append_rock2-square () {
 	fi
 }
 
+# TF-A, when supported
+
 ATF_DEPENDS ??= ""
 
 EXTRA_OEMAKE_append_rk3399 = " BL31=${DEPLOY_DIR_IMAGE}/bl31-rk3399.elf"
@@ -14,3 +16,15 @@  ATF_DEPENDS_rk3328 = " virtual/trusted-firmware-a:do_deploy"
 
 do_compile[depends] .= "${ATF_DEPENDS}"
 
+# OP-TEE, dependent on "optee" DISTRO_FEATURES
+
+OPTEE_DEPENDS ?= "optee-os:do_deploy"
+OPTEE_OEMAKE ?= " TEE=${DEPLOY_DIR_IMAGE}/optee/tee.elf"
+
+do_compile[depends] .= " \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'optee', ' ${OPTEE_DEPENDS}', '', d)} \
+"
+
+EXTRA_OEMAKE_append = " \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'optee', ' ${OPTEE_OEMAKE}', '', d)} \
+"