[meta-rockchip,2/6] truster-firmware-a: include optee support when requested by DISTRO_FEATURE

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

Details

Message ID 20210413154316.3666881-3-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 instructs TF-A to:

 - load OP-TEE OS as BL32, but still relies on the actual image to be
   provided through other means, eg. in u-boot.itb
 - run opteed as Secure Payload Dispatcher

This is configured automatically when DISTRO_FEATURE includes "optee".

Signed-off-by: Yann Dirson <yann@blade-group.com>
---
 .../trusted-firmware-a_%.bbappend             | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

Patch hide | download patch | download mbox

diff --git a/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend b/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend
index 1942c17..5b04311 100644
--- a/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend
+++ b/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend
@@ -9,3 +9,22 @@  FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
 SRC_URI += "\
     file://serial-console-baudrate.patch \
 "
+
+# OP-TEE, dependent on "optee" DISTRO_FEATURES
+
+OPTEE_DEPENDS ?= "optee-os:do_deploy"
+OPTEE_OEMAKE ?= " \
+    BL32=${STAGING_DIR_TARGET}${nonarch_base_libdir}/firmware/tee-header_v2.bin \
+    BL32_EXTRA1=${STAGING_DIR_TARGET}${nonarch_base_libdir}/firmware/tee-pager_v2.bin \
+    BL32_EXTRA2=${STAGING_DIR_TARGET}${nonarch_base_libdir}/firmware/tee-pageable_v2.bin \
+    "
+
+do_compile[depends] .= " \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'optee', ' ${OPTEE_DEPENDS}', '', d)} \
+"
+
+EXTRA_OEMAKE_append = " \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'optee', ' ${OPTEE_OEMAKE}', '', d)} \
+"
+
+TFA_SPD ?= "${@bb.utils.contains('DISTRO_FEATURES', 'optee', 'opteed', '', d)}"