summaryrefslogtreecommitdiffstats
path: root/recipes-security/optee-imx/optee-os_3.7.0.imx.bb
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-security/optee-imx/optee-os_3.7.0.imx.bb')
-rw-r--r--recipes-security/optee-imx/optee-os_3.7.0.imx.bb100
1 files changed, 100 insertions, 0 deletions
diff --git a/recipes-security/optee-imx/optee-os_3.7.0.imx.bb b/recipes-security/optee-imx/optee-os_3.7.0.imx.bb
new file mode 100644
index 00000000..1bef749b
--- /dev/null
+++ b/recipes-security/optee-imx/optee-os_3.7.0.imx.bb
@@ -0,0 +1,100 @@
1# Copyright (C) 2017-2020 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-pycrypto-native python3-pyelftools-native u-boot-mkimage-native"
11
12SRCBRANCH = "imx_5.4.24_2.1.0"
13
14SRC_URI = "\
15 git://source.codeaurora.org/external/imx/imx-optee-os.git;protocol=https;branch=${SRCBRANCH} \
16 file://0001-optee-os-fix-gcc10-compilation-issue-and-missing-cc-.patch \
17"
18
19SRCREV = "7a49776de59265500f10a247125429fde1555ac1"
20
21S = "${WORKDIR}/git"
22B = "${WORKDIR}/build.${PLATFORM_FLAVOR}"
23
24# The platform flavor corresponds to the Yocto machine without the leading 'i'.
25PLATFORM_FLAVOR = "${@d.getVar('MACHINE')[1:]}"
26PLATFORM_FLAVOR_imx6qpdlsolox = "mx6qsabresd"
27PLATFORM_FLAVOR_imx6ul7d = "mx6ulevk"
28PLATFORM_FLAVOR_imx6ull14x14evk = "mx6ullevk"
29PLATFORM_FLAVOR_imx6ull9x9evk = "mx6ullevk"
30PLATFORM_FLAVOR_imx6ulz14x14evk = "mx6ulzevk"
31PLATFORM_FLAVOR_mx8mm = "mx8mmevk"
32PLATFORM_FLAVOR_mx8mn = "mx8mnevk"
33PLATFORM_FLAVOR_mx8qxp = "mx8qxpmek"
34PLATFORM_FLAVOR_mx8mp = "mx8mpevk"
35PLATFORM_FLAVOR_mx8dx = "mx8dxmek"
36PLATFORM_FLAVOR_mx8dxl = "mx8dxlevk"
37PLATFORM_FLAVOR_mx8phantomdxl = "mx8qxpmek"
38
39OPTEE_ARCH ?= "arm32"
40OPTEE_ARCH_armv7a = "arm32"
41OPTEE_ARCH_aarch64 = "arm64"
42
43# Optee-os can be built for 32 bits and 64 bits at the same time
44# as long as the compilers are correctly defined.
45# For 64bits, CROSS_COMPILE64 must be set
46# When defining CROSS_COMPILE and CROSS_COMPILE64, we assure that
47# any 32 or 64 bits builds will pass
48EXTRA_OEMAKE = " \
49 PLATFORM=imx \
50 PLATFORM_FLAVOR=${PLATFORM_FLAVOR} \
51 CROSS_COMPILE=${HOST_PREFIX} \
52 CROSS_COMPILE64=${HOST_PREFIX} \
53 NOWERROR=1 \
54 LDFLAGS= \
55 O=${B} \
56"
57
58do_compile () {
59 unset LDFLAGS
60 export CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_HOST}"
61 oe_runmake -C ${S} all CFG_TEE_TA_LOG_LEVEL=0 CFG_TEE_CORE_LOG_LEVEL=0
62}
63
64
65do_deploy () {
66 install -d ${DEPLOYDIR}
67 ${TARGET_PREFIX}objcopy -O binary ${B}/core/tee.elf ${DEPLOYDIR}/tee.${PLATFORM_FLAVOR}.bin
68
69 if [ "${OPTEE_ARCH}" != "arm64" ]; then
70 IMX_LOAD_ADDR=`cat ${B}/core/tee-init_load_addr.txt` && \
71 uboot-mkimage -A arm -O linux -C none -a ${IMX_LOAD_ADDR} -e ${IMX_LOAD_ADDR} \
72 -d ${DEPLOYDIR}/tee.${PLATFORM_FLAVOR}.bin ${DEPLOYDIR}/uTee-${OPTEE_BIN_EXT}
73 fi
74
75 cd ${DEPLOYDIR}
76 ln -sf tee.${PLATFORM_FLAVOR}.bin tee.bin
77 cd -
78}
79
80do_install () {
81 install -d ${D}${nonarch_base_libdir}/firmware/
82 install -m 644 ${B}/core/*.bin ${D}${nonarch_base_libdir}/firmware/
83
84 # Install the TA devkit
85 install -d ${D}/usr/include/optee/export-user_ta_${OPTEE_ARCH}/
86
87 for f in ${B}/export-ta_${OPTEE_ARCH}/*; do
88 cp -aR $f ${D}/usr/include/optee/export-user_ta_${OPTEE_ARCH}/
89 done
90}
91
92addtask deploy after do_compile before do_install
93
94
95FILES_${PN} = "${nonarch_base_libdir}/firmware/"
96FILES_${PN}-staticdev = "/usr/include/optee/"
97RDEPENDS_${PN}-dev += "${PN}-staticdev"
98
99PACKAGE_ARCH = "${MACHINE_ARCH}"
100COMPATIBLE_MACHINE = "(imx)"