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.inc110
1 files changed, 53 insertions, 57 deletions
diff --git a/recipes-security/optee-imx/optee-os-fslc.inc b/recipes-security/optee-imx/optee-os-fslc.inc
index 61906344f..c1f1f48f5 100644
--- a/recipes-security/optee-imx/optee-os-fslc.inc
+++ b/recipes-security/optee-imx/optee-os-fslc.inc
@@ -1,90 +1,86 @@
1# Copyright (C) 2017-2021,2024 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 22S = "${WORKDIR}/git"
16# as long as the compilers are correctly defined. 23B = "${WORKDIR}/build"
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 24
30EXTRA_OEMAKE:append:imx8mq-lpddr4-wevk = " \ 25EXTRA_OEMAKE += " \
31 CFG_CORE_LARGE_PHYS_ADDR=y \ 26 PLATFORM=${OPTEEMACHINE} \
32 CFG_CORE_ARM64_PA_BITS=36 \ 27 CFG_${OPTEE_CORE}_core=y \
33 CFG_DDR_SIZE=0x100000000 \ 28 CROSS_COMPILE_core=${HOST_PREFIX} \
34 CFG_TZDRAM_START=0xfe000000 \ 29 CROSS_COMPILE_ta_${OPTEE_ARCH}=${HOST_PREFIX} \
30 NOWERROR=1 \
31 ta-targets=ta_${OPTEE_ARCH} \
32 O=${B} \
35" 33"
34EXTRA_OEMAKE += " HOST_PREFIX=${HOST_PREFIX}"
35EXTRA_OEMAKE += " CROSS_COMPILE64=${HOST_PREFIX}"
36 36
37LDFLAGS[unexport] = "1" 37LDFLAGS[unexport] = "1"
38CPPFLAGS[unexport] = "1" 38CPPFLAGS[unexport] = "1"
39AS[unexport] = "1" 39AS[unexport] = "1"
40LD[unexport] = "1" 40LD[unexport] = "1"
41 41
42do_configure[noexec] = "1"
43
44do_compile:prepend() { 42do_compile:prepend() {
45 PLAT_LIBGCC_PATH=$(${CC} -print-libgcc-file-name) 43 PLAT_LIBGCC_PATH=$(${CC} -print-libgcc-file-name)
46}
47
48do_compile:arm () {
49 oe_runmake all uTee
50} 44}
51 45
52do_compile:aarch64 () { 46do_compile() {
53 oe_runmake all 47 oe_runmake -C ${S} all
54} 48}
55do_compile[cleandirs] = "${B}" 49do_compile[cleandirs] = "${B}"
56 50
57do_deploy () { 51do_install() {
58 install -d ${DEPLOYDIR} 52 #install core in firmware
59 cp ${B}/core/tee-raw.bin ${DEPLOYDIR}/tee.${PLATFORM_FLAVOR}.bin 53 install -d ${D}${nonarch_base_libdir}/firmware/
60 ln -sf tee.${PLATFORM_FLAVOR}.bin ${DEPLOYDIR}/tee.bin 54 install -m 644 ${B}/core/*.bin ${B}/core/tee.elf ${D}${nonarch_base_libdir}/firmware/
61}
62 55
63do_deploy:append:arm () { 56 #install tas in optee_armtz
64 cp ${B}/core/uTee ${DEPLOYDIR}/uTee-${OPTEE_BIN_EXT} 57 install -d ${D}${nonarch_base_libdir}/optee_armtz/
58 install -m 444 ${B}/ta/*/*.ta ${D}${nonarch_base_libdir}/optee_armtz
65} 59}
66 60
67do_install () { 61PACKAGE_ARCH = "${MACHINE_ARCH}"
68 install -d ${D}${nonarch_base_libdir}/firmware/
69 install -m 644 ${B}/core/*.bin ${D}${nonarch_base_libdir}/firmware/
70 62
71 # Install embedded TAs 63do_deploy() {
72 install -d ${D}${nonarch_base_libdir}/optee_armtz/ 64 install -d ${DEPLOYDIR}/${MLPREFIX}optee
73 install -m 444 ${B}/ta/*/*.ta ${D}${nonarch_base_libdir}/optee_armtz/ 65 install -m 644 ${D}${nonarch_base_libdir}/firmware/* ${DEPLOYDIR}/${MLPREFIX}optee
74 66
75 # Install the TA devkit 67 install -d ${DEPLOYDIR}/${MLPREFIX}optee/ta
76 install -d ${D}${includedir}/optee/export-user_ta_${OPTEE_ARCH}/ 68 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} 69}
80 70
81addtask deploy after do_compile before do_install 71addtask deploy before do_build after do_install
82 72
83FILES:${PN} = "${nonarch_base_libdir}/firmware/ ${nonarch_base_libdir}/optee_armtz/" 73SYSROOT_DIRS += "${nonarch_base_libdir}/firmware"
84FILES:${PN}-staticdev = "${includedir}/optee/"
85RDEPENDS:${PN}-dev += "${PN}-staticdev"
86 74
87# FIXME: Build paths are currently embedded 75PACKAGES += "${PN}-ta"
88INSANE_SKIP:${PN}-staticdev += "buildpaths" 76FILES:${PN} = "${nonarch_base_libdir}/firmware/"
77FILES:${PN}-ta = "${nonarch_base_libdir}/optee_armtz/*"
78
79
80# note: "textrel" is not triggered on all archs
81INSANE_SKIP:${PN} = "textrel"
82# Build paths are currently embedded
83INSANE_SKIP:${PN} += "buildpaths"
84INSANE_SKIP:${PN}-dev = "staticdev"
85INHIBIT_PACKAGE_STRIP = "1"
89 86
90PACKAGE_ARCH = "${MACHINE_ARCH}"