summaryrefslogtreecommitdiffstats
path: root/recipes-security/optee-imx/optee-os_3.19.0.imx.bb
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-security/optee-imx/optee-os_3.19.0.imx.bb')
-rw-r--r--recipes-security/optee-imx/optee-os_3.19.0.imx.bb125
1 files changed, 5 insertions, 120 deletions
diff --git a/recipes-security/optee-imx/optee-os_3.19.0.imx.bb b/recipes-security/optee-imx/optee-os_3.19.0.imx.bb
index 82751a80..9059b538 100644
--- a/recipes-security/optee-imx/optee-os_3.19.0.imx.bb
+++ b/recipes-security/optee-imx/optee-os_3.19.0.imx.bb
@@ -1,125 +1,10 @@
1# Copyright (C) 2017-2021 NXP 1# Copyright (C) 2017-2021 NXP
2 2
3SUMMARY = "OPTEE OS" 3require optee-os-fslc-imx.inc
4DESCRIPTION = "OPTEE OS"
5HOMEPAGE = "http://www.optee.org/"
6LICENSE = "BSD-2-Clause"
7LIC_FILES_CHKSUM = "file://LICENSE;md5=c1f21c4f72f372ef38a5a4aee55ec173"
8 4
9DEPENDS = "python3-pyelftools-native u-boot-mkimage-native \ 5SRC_URI += "file://0001-core-Define-section-attributes-for-clang.patch \
10 python3-cryptography-native" 6 file://0006-allow-setting-sysroot-for-libgcc-lookup.patch \
11DEPENDS:append:toolchain-clang = " compiler-rt" 7 file://0007-allow-setting-sysroot-for-clang.patch \
12 8 file://0010-add-note-GNU-stack-section.patch"
13SRC_URI = "git://github.com/nxp-imx/imx-optee-os.git;protocol=https;branch=${SRCBRANCH} \
14 file://0001-core-Define-section-attributes-for-clang.patch \
15 file://0006-allow-setting-sysroot-for-libgcc-lookup.patch \
16 file://0007-allow-setting-sysroot-for-clang.patch \
17 file://0010-add-note-GNU-stack-section.patch"
18SRCBRANCH = "lf-5.15.71_2.2.0" 9SRCBRANCH = "lf-5.15.71_2.2.0"
19SRCREV = "00919403f040fad4f8603e605932281ff8451b1d" 10SRCREV = "00919403f040fad4f8603e605932281ff8451b1d"
20
21S = "${WORKDIR}/git"
22B = "${WORKDIR}/build"
23
24inherit deploy python3native autotools features_check
25
26REQUIRED_MACHINE_FEATURES = "optee"
27
28# The platform flavor corresponds to the Yocto machine without the leading 'i'.
29PLATFORM_FLAVOR = "${@d.getVar('MACHINE')[1:]}"
30PLATFORM_FLAVOR:imx6qdlsabresd = "mx6qsabresd"
31PLATFORM_FLAVOR:imx6qdlsabreauto = "mx6qsabreauto"
32PLATFORM_FLAVOR:imx6qpdlsolox = "mx6qsabresd"
33PLATFORM_FLAVOR:mx6ul-nxp-bsp = "mx6ulevk"
34PLATFORM_FLAVOR:mx6ull-nxp-bsp = "mx6ullevk"
35PLATFORM_FLAVOR:mx6ulz-nxp-bsp = "mx6ulzevk"
36PLATFORM_FLAVOR:mx8mq-nxp-bsp = "mx8mqevk"
37PLATFORM_FLAVOR:mx8mm-nxp-bsp = "mx8mmevk"
38PLATFORM_FLAVOR:mx8mn-nxp-bsp = "mx8mnevk"
39PLATFORM_FLAVOR:mx8mnul-nxp-bsp = "mx8mnevk"
40PLATFORM_FLAVOR:mx8mp-nxp-bsp = "mx8mpevk"
41PLATFORM_FLAVOR:mx8mpul-nxp-bsp = "mx8mpevk"
42PLATFORM_FLAVOR:mx8qm-nxp-bsp = "mx8qmmek"
43PLATFORM_FLAVOR:mx8qxp-nxp-bsp = "mx8qxpmek"
44PLATFORM_FLAVOR:mx8dx-nxp-bsp = "mx8dxmek"
45PLATFORM_FLAVOR:mx8dxl-nxp-bsp = "mx8dxlevk"
46PLATFORM_FLAVOR:mx8ulp-nxp-bsp = "mx8ulpevk"
47PLATFORM_FLAVOR:mx93-nxp-bsp = "mx93evk"
48
49OPTEE_ARCH:arm = "arm32"
50OPTEE_ARCH:aarch64 = "arm64"
51
52COMPILER ?= "gcc"
53COMPILER:toolchain-clang = "clang"
54
55# Optee-os can be built for 32 bits and 64 bits at the same time
56# as long as the compilers are correctly defined.
57# For 64bits, CROSS_COMPILE64 must be set
58# When defining CROSS_COMPILE and CROSS_COMPILE64, we assure that
59# any 32 or 64 bits builds will pass
60EXTRA_OEMAKE = " \
61 PLATFORM=imx-${PLATFORM_FLAVOR} \
62 CROSS_COMPILE=${HOST_PREFIX} \
63 CROSS_COMPILE64=${HOST_PREFIX} \
64 CFG_TEE_TA_LOG_LEVEL=0 \
65 CFG_TEE_CORE_LOG_LEVEL=0 \
66 OPENSSL_MODULES=${STAGING_LIBDIR_NATIVE}/ossl-modules \
67 COMPILER=${COMPILER} \
68 -C ${S} O=${B} \
69"
70
71LDFLAGS[unexport] = "1"
72CPPFLAGS[unexport] = "1"
73AS[unexport] = "1"
74LD[unexport] = "1"
75
76CFLAGS += "--sysroot=${STAGING_DIR_HOST}"
77CXXFLAGS += "--sysroot=${STAGING_DIR_HOST}"
78
79do_configure[noexec] = "1"
80
81do_compile:prepend() {
82 PLAT_LIBGCC_PATH=$(${CC} -print-libgcc-file-name)
83}
84
85do_compile:arm () {
86 oe_runmake all uTee
87}
88
89do_compile:aarch64 () {
90 oe_runmake all
91}
92do_compile[cleandirs] = "${B}"
93
94do_deploy () {
95 install -d ${DEPLOYDIR}
96 cp ${B}/core/tee-raw.bin ${DEPLOYDIR}/tee.${PLATFORM_FLAVOR}.bin
97 ln -sf tee.${PLATFORM_FLAVOR}.bin ${DEPLOYDIR}/tee.bin
98}
99
100do_deploy:append:arm () {
101 cp ${B}/core/uTee ${DEPLOYDIR}/uTee-${OPTEE_BIN_EXT}
102}
103
104do_install () {
105 install -d ${D}${nonarch_base_libdir}/firmware/
106 install -m 644 ${B}/core/*.bin ${D}${nonarch_base_libdir}/firmware/
107
108 # Install embedded TAs
109 install -d ${D}${nonarch_base_libdir}/optee_armtz/
110 install -m 444 ${B}/ta/*/*.ta ${D}${nonarch_base_libdir}/optee_armtz/
111
112 # Install the TA devkit
113 install -d ${D}${includedir}/optee/export-user_ta_${OPTEE_ARCH}/
114 cp -aR ${B}/export-ta_${OPTEE_ARCH}/* \
115 ${D}${includedir}/optee/export-user_ta_${OPTEE_ARCH}/
116}
117
118addtask deploy after do_compile before do_install
119
120FILES:${PN} = "${nonarch_base_libdir}/firmware/ ${nonarch_base_libdir}/optee_armtz/"
121FILES:${PN}-staticdev = "${includedir}/optee/"
122RDEPENDS:${PN}-dev += "${PN}-staticdev"
123
124PACKAGE_ARCH = "${MACHINE_ARCH}"
125COMPATIBLE_MACHINE = "(imx-nxp-bsp)"