From 5c1a30e532674d274b091da8cbfac11700c6a3ac Mon Sep 17 00:00:00 2001 From: Denys Dmytriyenko Date: Thu, 14 May 2020 16:47:27 -0400 Subject: [PATCH] trusted-firmware-a: add support for SPD (Secure Payload Dispatcher) services Some platforms use Secure Payload Dispatcher - allow selecting one with TFA_SPD. Official SPD description: /******************************************************************************* * This is the Secure Payload Dispatcher (SPD). The dispatcher is meant to be a * plug-in component to the Secure Monitor, registered as a runtime service. The * SPD is expected to be a functional extension of the Secure Payload (SP) that * executes in Secure EL1. The Secure Monitor will delegate all SMCs targeting * the Trusted OS/Applications range to the dispatcher. The SPD will either * handle the request locally or delegate it to the Secure Payload. It is also * responsible for initialising and maintaining communication with the SP. ******************************************************************************/ Clean other EXTRA_OEMAKE to remove leading space not needed with += Signed-off-by: Denys Dmytriyenko Reviewed-by: Diego Sueiro Signed-off-by: Jon Mason --- .../trusted-firmware-a/trusted-firmware-a.inc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc b/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc index 899b7785..25d5179a 100644 --- a/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc +++ b/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc @@ -16,6 +16,11 @@ TFA_PLATFORM ?= "invalid" # Leave empty for default behavior TFA_BOARD ?= "" +# Some platforms use SPD (Secure Payload Dispatcher) services +# Few options are "opteed", "tlkd", "trusty", "tspd"... +# Leave empty to not use SPD +TFA_SPD ?= "" + # Build for debug (set TFA_DEBUG to 1 to activate) TFA_DEBUG ?= "0" @@ -73,16 +78,19 @@ EXTRA_OEMAKE += "BUILD_BASE=${B} PLAT=${TFA_PLATFORM}" EXTRA_OEMAKE += "${@'TARGET_BOARD=${TFA_BOARD}' if d.getVar('TFA_BOARD') else ''}" BUILD_DIR = "${TFA_PLATFORM}${@'/${TFA_BOARD}' if d.getVar('TFA_BOARD') else ''}" +# Handle TFA_SPD parameter +EXTRA_OEMAKE += "${@'SPD=${TFA_SPD}' if d.getVar('TFA_SPD') else ''}" + # Handle TFA_DEBUG parameter -EXTRA_OEMAKE += "${@bb.utils.contains('TFA_DEBUG', '1', ' DEBUG=${TFA_DEBUG}', '', d)}" +EXTRA_OEMAKE += "${@bb.utils.contains('TFA_DEBUG', '1', 'DEBUG=${TFA_DEBUG}', '', d)}" # Handle MBEDTLS -EXTRA_OEMAKE += "${@bb.utils.contains('TFA_MBEDTLS', '1', ' MBEDTLS_DIR=${TFA_MBEDTLS_DIR}', '', d)}" +EXTRA_OEMAKE += "${@bb.utils.contains('TFA_MBEDTLS', '1', 'MBEDTLS_DIR=${TFA_MBEDTLS_DIR}', '', d)}" # Uboot support DEPENDS += " ${@bb.utils.contains('TFA_UBOOT', '1', 'u-boot', '', d)}" do_compile[depends] += " ${@bb.utils.contains('TFA_UBOOT', '1', 'u-boot:do_deploy', '', d)}" -EXTRA_OEMAKE += "${@bb.utils.contains('TFA_UBOOT', '1', ' BL33=${DEPLOY_DIR_IMAGE}/u-boot.bin', '',d)}" +EXTRA_OEMAKE += "${@bb.utils.contains('TFA_UBOOT', '1', 'BL33=${DEPLOY_DIR_IMAGE}/u-boot.bin', '',d)}" # The following hack is needed to fit properly in yocto build environment # TFA is forcing the host compiler and its flags in the Makefile using :=