summaryrefslogtreecommitdiffstats
path: root/recipes-security/optee-imx/optee-os-fslc.inc
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-security/optee-imx/optee-os-fslc.inc')
-rw-r--r--recipes-security/optee-imx/optee-os-fslc.inc108
1 files changed, 53 insertions, 55 deletions
diff --git a/recipes-security/optee-imx/optee-os-fslc.inc b/recipes-security/optee-imx/optee-os-fslc.inc
index b91a55311..56c0f3e12 100644
--- a/recipes-security/optee-imx/optee-os-fslc.inc
+++ b/recipes-security/optee-imx/optee-os-fslc.inc
@@ -1,87 +1,85 @@
1# Copyright (C) 2017-2021 NXP 1# Copied from meta-arm/recipes-security/optee/optee-os.inc.
2# See: https://github.com/nxp-imx/imx-manifest/blob/imx-linux-scarthgap/imx-6.6.52-2.2.0.xml#L30
3
4SUMMARY = "OP-TEE Trusted OS"
5DESCRIPTION = "Open Portable Trusted Execution Environment - Trusted side of the TEE"
6HOMEPAGE = "https://www.op-tee.org/"
2 7
3SUMMARY = "OPTEE OS"
4DESCRIPTION = "OPTEE OS"
5LICENSE = "BSD-2-Clause" 8LICENSE = "BSD-2-Clause"
6LIC_FILES_CHKSUM = "file://LICENSE;md5=c1f21c4f72f372ef38a5a4aee55ec173" 9LIC_FILES_CHKSUM = "file://LICENSE;md5=c1f21c4f72f372ef38a5a4aee55ec173"
7 10
11inherit deploy python3native
8require optee-fslc.inc 12require optee-fslc.inc
9 13
10DEPENDS += "python3-pyelftools-native u-boot-mkimage-native" 14CVE_PRODUCT = "linaro:op-tee op-tee:op-tee_os"
15
16DEPENDS = "python3-pyelftools-native python3-cryptography-native"
17
11DEPENDS:append:toolchain-clang = " compiler-rt" 18DEPENDS:append:toolchain-clang = " compiler-rt"
12 19
13inherit deploy autotools 20SRC_URI = "git://github.com/OP-TEE/optee_os.git;branch=master;protocol=https"
14 21
15# Optee-os can be built for 32 bits and 64 bits at the same time 22B = "${WORKDIR}/build"
16# as long as the compilers are correctly defined.
17# For 64bits, CROSS_COMPILE64 must be set
18# When defining CROSS_COMPILE and CROSS_COMPILE64, we assure that
19# any 32 or 64 bits builds will pass
20EXTRA_OEMAKE += " \
21 PLATFORM=imx-${PLATFORM_FLAVOR} \
22 CROSS_COMPILE=${HOST_PREFIX} \
23 CROSS_COMPILE64=${HOST_PREFIX} \
24 CFLAGS32=--sysroot=${STAGING_DIR_HOST} \
25 CFLAGS64=--sysroot=${STAGING_DIR_HOST} \
26 CFG_TEE_TA_LOG_LEVEL=0 \
27 CFG_TEE_CORE_LOG_LEVEL=0 \
28"
29 23
30EXTRA_OEMAKE:append:imx8mq-lpddr4-wevk = " \ 24EXTRA_OEMAKE += " \
31 CFG_CORE_LARGE_PHYS_ADDR=y \ 25 PLATFORM=${OPTEEMACHINE} \
32 CFG_CORE_ARM64_PA_BITS=36 \ 26 CFG_${OPTEE_CORE}_core=y \
33 CFG_DDR_SIZE=0x100000000 \ 27 CROSS_COMPILE_core=${HOST_PREFIX} \
34 CFG_TZDRAM_START=0xfe000000 \ 28 CROSS_COMPILE_ta_${OPTEE_ARCH}=${HOST_PREFIX} \
29 NOWERROR=1 \
30 ta-targets=ta_${OPTEE_ARCH} \
31 O=${B} \
35" 32"
33EXTRA_OEMAKE += " HOST_PREFIX=${HOST_PREFIX}"
34EXTRA_OEMAKE += " CROSS_COMPILE64=${HOST_PREFIX}"
36 35
37LDFLAGS[unexport] = "1" 36LDFLAGS[unexport] = "1"
38CPPFLAGS[unexport] = "1" 37CPPFLAGS[unexport] = "1"
39AS[unexport] = "1" 38AS[unexport] = "1"
40LD[unexport] = "1" 39LD[unexport] = "1"
41 40
42do_configure[noexec] = "1"
43
44do_compile:prepend() { 41do_compile:prepend() {
45 PLAT_LIBGCC_PATH=$(${CC} -print-libgcc-file-name) 42 PLAT_LIBGCC_PATH=$(${CC} -print-libgcc-file-name)
46} 43}
47 44
48do_compile:arm () { 45do_compile() {
49 oe_runmake all uTee 46 oe_runmake -C ${S} all
50}
51
52do_compile:aarch64 () {
53 oe_runmake all
54} 47}
55do_compile[cleandirs] = "${B}" 48do_compile[cleandirs] = "${B}"
56 49
57do_deploy () { 50do_install() {
58 install -d ${DEPLOYDIR} 51 #install core in firmware
59 cp ${B}/core/tee-raw.bin ${DEPLOYDIR}/tee.${PLATFORM_FLAVOR}.bin 52 install -d ${D}${nonarch_base_libdir}/firmware/
60 ln -sf tee.${PLATFORM_FLAVOR}.bin ${DEPLOYDIR}/tee.bin 53 install -m 644 ${B}/core/*.bin ${B}/core/tee.elf ${D}${nonarch_base_libdir}/firmware/
61}
62 54
63do_deploy:append:arm () { 55 #install tas in optee_armtz
64 cp ${B}/core/uTee ${DEPLOYDIR}/uTee-${OPTEE_BIN_EXT} 56 install -d ${D}${nonarch_base_libdir}/optee_armtz/
57 install -m 444 ${B}/ta/*/*.ta ${D}${nonarch_base_libdir}/optee_armtz
65} 58}
66 59
67do_install () { 60PACKAGE_ARCH = "${MACHINE_ARCH}"
68 install -d ${D}${nonarch_base_libdir}/firmware/
69 install -m 644 ${B}/core/*.bin ${D}${nonarch_base_libdir}/firmware/
70 61
71 # Install embedded TAs 62do_deploy() {
72 install -d ${D}${nonarch_base_libdir}/optee_armtz/ 63 install -d ${DEPLOYDIR}/${MLPREFIX}optee
73 install -m 444 ${B}/ta/*/*.ta ${D}${nonarch_base_libdir}/optee_armtz/ 64 install -m 644 ${D}${nonarch_base_libdir}/firmware/* ${DEPLOYDIR}/${MLPREFIX}optee
74 65
75 # Install the TA devkit 66 install -d ${DEPLOYDIR}/${MLPREFIX}optee/ta
76 install -d ${D}${includedir}/optee/export-user_ta_${OPTEE_ARCH}/ 67 install -m 644 ${B}/ta/*/*.elf ${DEPLOYDIR}/${MLPREFIX}optee/ta
77 cp -aR ${B}/export-ta_${OPTEE_ARCH}/* \
78 ${D}${includedir}/optee/export-user_ta_${OPTEE_ARCH}/
79} 68}
80 69
81addtask deploy after do_compile before do_install 70addtask deploy before do_build after do_install
82 71
83FILES:${PN} = "${nonarch_base_libdir}/firmware/ ${nonarch_base_libdir}/optee_armtz/" 72SYSROOT_DIRS += "${nonarch_base_libdir}/firmware"
84FILES:${PN}-staticdev = "${includedir}/optee/" 73
85RDEPENDS:${PN}-dev += "${PN}-staticdev" 74PACKAGES += "${PN}-ta"
75FILES:${PN} = "${nonarch_base_libdir}/firmware/"
76FILES:${PN}-ta = "${nonarch_base_libdir}/optee_armtz/*"
77
78
79# note: "textrel" is not triggered on all archs
80INSANE_SKIP:${PN} = "textrel"
81# Build paths are currently embedded
82INSANE_SKIP:${PN} += "buildpaths"
83INSANE_SKIP:${PN}-dev = "staticdev"
84INHIBIT_PACKAGE_STRIP = "1"
86 85
87PACKAGE_ARCH = "${MACHINE_ARCH}"