diff options
author | Oleksandr Suvorov <oleksandr.suvorov@foundries.io> | 2023-05-01 18:14:59 +0300 |
---|---|---|
committer | github-actions[bot] <github-actions[bot]@users.noreply.github.com> | 2023-05-02 15:56:42 +0000 |
commit | 2cc4b5933bc895a460cdc436635832d516fb1cbb (patch) | |
tree | d1eb484f071467746f329d66f2bbe73671160211 /recipes-security/optee-imx/optee-os-fslc.inc | |
parent | 91a9885b98de7dcb7de9551d7a5d5f1b9da651c8 (diff) | |
download | meta-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.inc | 78 |
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 | |||
3 | SUMMARY = "OPTEE OS" | ||
4 | DESCRIPTION = "OPTEE OS" | ||
5 | LICENSE = "BSD-2-Clause" | ||
6 | LIC_FILES_CHKSUM = "file://LICENSE;md5=c1f21c4f72f372ef38a5a4aee55ec173" | ||
7 | |||
8 | require optee-fslc.inc | ||
9 | |||
10 | DEPENDS += "python3-pyelftools-native u-boot-mkimage-native" | ||
11 | DEPENDS:append:toolchain-clang = " compiler-rt" | ||
12 | |||
13 | inherit 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 | ||
20 | EXTRA_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 | |||
28 | LDFLAGS[unexport] = "1" | ||
29 | CPPFLAGS[unexport] = "1" | ||
30 | AS[unexport] = "1" | ||
31 | LD[unexport] = "1" | ||
32 | |||
33 | do_configure[noexec] = "1" | ||
34 | |||
35 | do_compile:prepend() { | ||
36 | PLAT_LIBGCC_PATH=$(${CC} -print-libgcc-file-name) | ||
37 | } | ||
38 | |||
39 | do_compile:arm () { | ||
40 | oe_runmake all uTee | ||
41 | } | ||
42 | |||
43 | do_compile:aarch64 () { | ||
44 | oe_runmake all | ||
45 | } | ||
46 | do_compile[cleandirs] = "${B}" | ||
47 | |||
48 | do_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 | |||
54 | do_deploy:append:arm () { | ||
55 | cp ${B}/core/uTee ${DEPLOYDIR}/uTee-${OPTEE_BIN_EXT} | ||
56 | } | ||
57 | |||
58 | do_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 | |||
72 | addtask deploy after do_compile before do_install | ||
73 | |||
74 | FILES:${PN} = "${nonarch_base_libdir}/firmware/ ${nonarch_base_libdir}/optee_armtz/" | ||
75 | FILES:${PN}-staticdev = "${includedir}/optee/" | ||
76 | RDEPENDS:${PN}-dev += "${PN}-staticdev" | ||
77 | |||
78 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||