From c760240dd2fd3516f05b95ca4dc1e79d15577fd5 Mon Sep 17 00:00:00 2001 From: Ross Burton Date: Mon, 2 Nov 2020 15:33:41 +0000 Subject: [PATCH] arm/optee: consolidate common variables Move a number of shared varibles into optee.inc so that they don't have to be duplicated repeatedly. Change-Id: Ie2565dfa66cbd61aad199224a4cdc7b2e1af0c5d Signed-off-by: Ross Burton Signed-off-by: Jon Mason --- .../recipes-security/optee/optee-examples.inc | 17 +++------------ meta-arm/recipes-security/optee/optee-os.inc | 14 +------------ .../recipes-security/optee/optee-test.inc | 16 +++----------- meta-arm/recipes-security/optee/optee.inc | 21 +++++++++++++++++++ 4 files changed, 28 insertions(+), 40 deletions(-) diff --git a/meta-arm/recipes-security/optee/optee-examples.inc b/meta-arm/recipes-security/optee/optee-examples.inc index 73193f51..851043b5 100644 --- a/meta-arm/recipes-security/optee/optee-examples.inc +++ b/meta-arm/recipes-security/optee/optee-examples.inc @@ -15,26 +15,15 @@ SRC_URI = "git://github.com/linaro-swg/optee_examples.git \ file://0001-make-Pass-ldflags-during-link.patch \ " -OPTEE_COMPILER = "${@d.getVar('TOOLCHAIN') or 'gcc'}" - -EXTRA_OEMAKE = " TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \ - OPTEE_CLIENT_EXPORT=${OPTEE_CLIENT_EXPORT} \ - TEEC_EXPORT=${TEEC_EXPORT} \ - HOST_CROSS_COMPILE=${TARGET_PREFIX} \ - LIBGCC_LOCATE_CFLAGS=--sysroot=${STAGING_DIR_HOST} \ - COMPILER=${OPTEE_COMPILER} \ - TA_CROSS_COMPILE=${TARGET_PREFIX} \ - V=1 \ +EXTRA_OEMAKE += "TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \ + HOST_CROSS_COMPILE=${HOST_PREFIX} \ + TA_CROSS_COMPILE=${HOST_PREFIX} \ OUTPUT_DIR=${B} \ " S = "${WORKDIR}/git" B = "${WORKDIR}/build" -OPTEE_CLIENT_EXPORT = "${STAGING_DIR_HOST}${prefix}" -TEEC_EXPORT = "${STAGING_DIR_HOST}${prefix}" -TA_DEV_KIT_DIR = "${STAGING_INCDIR}/optee/export-user_ta" - do_compile() { oe_runmake -C ${S} } diff --git a/meta-arm/recipes-security/optee/optee-os.inc b/meta-arm/recipes-security/optee/optee-os.inc index e513fcc4..ea6c4967 100644 --- a/meta-arm/recipes-security/optee/optee-os.inc +++ b/meta-arm/recipes-security/optee/optee-os.inc @@ -17,25 +17,13 @@ SRC_URI = "git://github.com/OP-TEE/optee_os.git" S = "${WORKDIR}/git" B = "${WORKDIR}/build" -OPTEEMACHINE ?= "${MACHINE}" -OPTEEMACHINE_aarch64_qemuall ?= "vexpress-qemu_armv8a" -OPTEE_ARCH = "null" -OPTEE_ARCH_armv7a = "arm32" -OPTEE_ARCH_aarch64 = "arm64" -OPTEE_CORE = "${@d.getVar('OPTEE_ARCH').upper()}" -OPTEE_COMPILER = "${@d.getVar('TOOLCHAIN') or 'gcc'}" - - -EXTRA_OEMAKE = " \ +EXTRA_OEMAKE += " \ PLATFORM=${OPTEEMACHINE} \ CFG_${OPTEE_CORE}_core=y \ CROSS_COMPILE_core=${HOST_PREFIX} \ CROSS_COMPILE_ta_${OPTEE_ARCH}=${HOST_PREFIX} \ NOWERROR=1 \ - V=1 \ ta-targets=ta_${OPTEE_ARCH} \ - LIBGCC_LOCATE_CFLAGS=--sysroot=${STAGING_DIR_HOST} \ - COMPILER=${OPTEE_COMPILER} \ O=${B} \ " diff --git a/meta-arm/recipes-security/optee/optee-test.inc b/meta-arm/recipes-security/optee/optee-test.inc index 95ed3110..467e6876 100644 --- a/meta-arm/recipes-security/optee/optee-test.inc +++ b/meta-arm/recipes-security/optee/optee-test.inc @@ -19,19 +19,9 @@ SRC_URI = "git://github.com/OP-TEE/optee_test.git \ S = "${WORKDIR}/git" B = "${WORKDIR}/build" -OPTEE_CLIENT_EXPORT = "${STAGING_DIR_HOST}${prefix}" -TEEC_EXPORT = "${STAGING_DIR_HOST}${prefix}" -TA_DEV_KIT_DIR = "${STAGING_INCDIR}/optee/export-user_ta" -OPTEE_COMPILER = "${@d.getVar('TOOLCHAIN') or 'gcc'}" - -EXTRA_OEMAKE = " TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \ - OPTEE_CLIENT_EXPORT=${OPTEE_CLIENT_EXPORT} \ - TEEC_EXPORT=${TEEC_EXPORT} \ - LIBGCC_LOCATE_CFLAGS=--sysroot=${STAGING_DIR_HOST} \ - COMPILER=${OPTEE_COMPILER} \ - CROSS_COMPILE_HOST=${TARGET_PREFIX} \ - CROSS_COMPILE_TA=${TARGET_PREFIX} \ - V=1 \ +EXTRA_OEMAKE += "TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \ + CROSS_COMPILE_HOST=${HOST_PREFIX} \ + CROSS_COMPILE_TA=${HOST_PREFIX} \ O=${B} \ " diff --git a/meta-arm/recipes-security/optee/optee.inc b/meta-arm/recipes-security/optee/optee.inc index 4bf87fed..8aaf616c 100644 --- a/meta-arm/recipes-security/optee/optee.inc +++ b/meta-arm/recipes-security/optee/optee.inc @@ -1,3 +1,24 @@ COMPATIBLE_MACHINE ?= "invalid" COMPATIBLE_MACHINE_qemuarm64 ?= "qemuarm64" # Please add supported machines below or set it in .bbappend or .conf + +OPTEEMACHINE ?= "${MACHINE}" +OPTEEMACHINE_aarch64_qemuall ?= "vexpress-qemu_armv8a" + +OPTEE_ARCH = "null" +OPTEE_ARCH_armv7a = "arm32" +OPTEE_ARCH_aarch64 = "arm64" +OPTEE_CORE = "${@d.getVar('OPTEE_ARCH').upper()}" + +OPTEE_COMPILER = "${@d.getVar('TOOLCHAIN') or 'gcc'}" + +# Set here but not passed to EXTRA_OEMAKE by default as that breaks +# the optee-os build +TA_DEV_KIT_DIR = "${STAGING_INCDIR}/optee/export-user_ta" + +EXTRA_OEMAKE += "V=1 \ + LIBGCC_LOCATE_CFLAGS=--sysroot=${STAGING_DIR_HOST} \ + COMPILER=${OPTEE_COMPILER} \ + OPTEE_CLIENT_EXPORT=${STAGING_DIR_HOST}${prefix} \ + TEEC_EXPORT=${STAGING_DIR_HOST}${prefix} \ + "