summaryrefslogtreecommitdiffstats
path: root/recipes-security/optee-imx/optee-os-fslc.inc
diff options
context:
space:
mode:
authorOleksandr Suvorov <oleksandr.suvorov@foundries.io>2023-05-01 18:14:59 +0300
committergithub-actions[bot] <github-actions[bot]@users.noreply.github.com>2023-05-02 15:56:42 +0000
commit2cc4b5933bc895a460cdc436635832d516fb1cbb (patch)
treed1eb484f071467746f329d66f2bbe73671160211 /recipes-security/optee-imx/optee-os-fslc.inc
parent91a9885b98de7dcb7de9551d7a5d5f1b9da651c8 (diff)
downloadmeta-freescale-2cc4b5933bc895a460cdc436635832d516fb1cbb.tar.gz
optee: optimize optee-os and optee-test recipes to reuse code
Add include files for optee-os and optee-test. The include files feature requirements that are specific to optee/optee-os/optee-test projects and i.MX platforms. Recipe files with version number feature the git branch, commit hash and optionally repo URL/patch set. Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io> (cherry picked from commit c4288a04f82cea6763f12448e87d95e5c0364cf7)
Diffstat (limited to 'recipes-security/optee-imx/optee-os-fslc.inc')
-rw-r--r--recipes-security/optee-imx/optee-os-fslc.inc78
1 files changed, 78 insertions, 0 deletions
diff --git a/recipes-security/optee-imx/optee-os-fslc.inc b/recipes-security/optee-imx/optee-os-fslc.inc
new file mode 100644
index 00000000..faa8c993
--- /dev/null
+++ b/recipes-security/optee-imx/optee-os-fslc.inc
@@ -0,0 +1,78 @@
1# Copyright (C) 2017-2021 NXP
2
3SUMMARY = "OPTEE OS"
4DESCRIPTION = "OPTEE OS"
5LICENSE = "BSD-2-Clause"
6LIC_FILES_CHKSUM = "file://LICENSE;md5=c1f21c4f72f372ef38a5a4aee55ec173"
7
8require optee-fslc.inc
9
10DEPENDS += "python3-pyelftools-native u-boot-mkimage-native"
11DEPENDS:append:toolchain-clang = " compiler-rt"
12
13inherit deploy autotools
14
15# Optee-os can be built for 32 bits and 64 bits at the same time
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 CFG_TEE_TA_LOG_LEVEL=0 \
25 CFG_TEE_CORE_LOG_LEVEL=0 \
26"
27
28LDFLAGS[unexport] = "1"
29CPPFLAGS[unexport] = "1"
30AS[unexport] = "1"
31LD[unexport] = "1"
32
33do_configure[noexec] = "1"
34
35do_compile:prepend() {
36 PLAT_LIBGCC_PATH=$(${CC} -print-libgcc-file-name)
37}
38
39do_compile:arm () {
40 oe_runmake all uTee
41}
42
43do_compile:aarch64 () {
44 oe_runmake all
45}
46do_compile[cleandirs] = "${B}"
47
48do_deploy () {
49 install -d ${DEPLOYDIR}
50 cp ${B}/core/tee-raw.bin ${DEPLOYDIR}/tee.${PLATFORM_FLAVOR}.bin
51 ln -sf tee.${PLATFORM_FLAVOR}.bin ${DEPLOYDIR}/tee.bin
52}
53
54do_deploy:append:arm () {
55 cp ${B}/core/uTee ${DEPLOYDIR}/uTee-${OPTEE_BIN_EXT}
56}
57
58do_install () {
59 install -d ${D}${nonarch_base_libdir}/firmware/
60 install -m 644 ${B}/core/*.bin ${D}${nonarch_base_libdir}/firmware/
61
62 # Install embedded TAs
63 install -d ${D}${nonarch_base_libdir}/optee_armtz/
64 install -m 444 ${B}/ta/*/*.ta ${D}${nonarch_base_libdir}/optee_armtz/
65
66 # Install the TA devkit
67 install -d ${D}${includedir}/optee/export-user_ta_${OPTEE_ARCH}/
68 cp -aR ${B}/export-ta_${OPTEE_ARCH}/* \
69 ${D}${includedir}/optee/export-user_ta_${OPTEE_ARCH}/
70}
71
72addtask deploy after do_compile before do_install
73
74FILES:${PN} = "${nonarch_base_libdir}/firmware/ ${nonarch_base_libdir}/optee_armtz/"
75FILES:${PN}-staticdev = "${includedir}/optee/"
76RDEPENDS:${PN}-dev += "${PN}-staticdev"
77
78PACKAGE_ARCH = "${MACHINE_ARCH}"