summaryrefslogtreecommitdiffstats
path: root/recipes-security/optee-qoriq/optee-os.nxp.inc
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-security/optee-qoriq/optee-os.nxp.inc')
-rw-r--r--recipes-security/optee-qoriq/optee-os.nxp.inc75
1 files changed, 75 insertions, 0 deletions
diff --git a/recipes-security/optee-qoriq/optee-os.nxp.inc b/recipes-security/optee-qoriq/optee-os.nxp.inc
new file mode 100644
index 00000000..72af6ca4
--- /dev/null
+++ b/recipes-security/optee-qoriq/optee-os.nxp.inc
@@ -0,0 +1,75 @@
1# Copyright 2020-2021 NXP
2
3SUMMARY = "OPTEE OS"
4DESCRIPTION = "OPTEE OS"
5HOMEPAGE = "http://www.optee.org/"
6LICENSE = "BSD"
7LIC_FILES_CHKSUM = "file://LICENSE;md5=c1f21c4f72f372ef38a5a4aee55ec173"
8
9inherit deploy python3native autotools
10DEPENDS = "python3-pycryptodome-native python3-pyelftools-native python3-pycryptodomex-native dtc-native"
11
12SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/optee_os.git;nobranch=1"
13SRCREV = "735d98806dc26fbeeecad7f5e60ffeab8170c67e"
14
15S = "${WORKDIR}/git"
16B = "${WORKDIR}/build.${PLATFORM_FLAVOR}"
17
18PLATFORM_FLAVOR ?= "${MACHINE}"
19
20OPTEE_ARCH ?= "arm64"
21OPTEE_ARCH:armv7a = "arm32"
22OPTEE_ARCH:aarch64 = "arm64"
23
24OPTEE_CORE_LOG_LEVEL ?= "1"
25OPTEE_TA_LOG_LEVEL ?= "0"
26
27# Optee-os can be built for 32 bits and 64 bits at the same time
28# as long as the compilers are correctly defined.
29# For 64bits, CROSS_COMPILE64 must be set
30# When defining CROSS_COMPILE and CROSS_COMPILE64, we assure that
31# any 32 or 64 bits builds will pass
32EXTRA_OEMAKE = " \
33 -C ${S} O=${B} \
34 PLATFORM_FLAVOR=${PLATFORM_FLAVOR} \
35 CROSS_COMPILE=${HOST_PREFIX} \
36 CROSS_COMPILE64=${HOST_PREFIX} \
37 CFG_WERROR=y \
38 CFG_TEE_CORE_LOG_LEVEL=${OPTEE_CORE_LOG_LEVEL} \
39 CFG_TEE_TA_LOG_LEVEL=${OPTEE_TA_LOG_LEVEL} \
40"
41
42do_compile() {
43 unset LDFLAGS
44 export CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_HOST}"
45 oe_runmake all
46}
47
48do_install() {
49 install -d ${D}${nonarch_base_libdir}/firmware/
50 install -m 644 ${B}/core/*.bin ${D}${nonarch_base_libdir}/firmware/
51
52 # Install the TA devkit
53 install -d ${D}${includedir}/optee/export-user_ta/
54
55 for f in ${B}/export-ta_${OPTEE_ARCH}/*; do
56 cp -aR $f ${D}${includedir}/optee/export-user_ta/
57 done
58
59 install -d ${D}${nonarch_base_libdir}/optee_armtz
60 find ${B}/export-ta_${OPTEE_ARCH}/ta -name '*.ta' | while read name; do
61 install -m 444 $name ${D}${nonarch_base_libdir}/optee_armtz/
62 done
63}
64
65do_deploy() {
66 install -d ${DEPLOYDIR}/optee
67 install -m 644 ${D}${nonarch_base_libdir}/firmware/* ${DEPLOYDIR}/optee/
68}
69addtask deploy before do_build after do_install
70
71FILES:${PN} = "${nonarch_base_libdir}/firmware/ ${nonarch_base_libdir}/optee_armtz/"
72FILES:${PN}-staticdev = "/usr/include/optee/"
73RDEPENDS:${PN}-dev += "${PN}-staticdev"
74
75PACKAGE_ARCH = "${MACHINE_ARCH}"