summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Griffin <peter.griffin@linaro.org>2019-10-25 11:37:08 +0200
committerOtavio Salvador <otavio@ossystems.com.br>2019-11-08 15:31:25 -0300
commit6397a6716be475deec08ae1bbb248be444e4bdb9 (patch)
tree7841033d68ed3811ffa500b90a3abed22c96e316
parent752c4b7b293e16e38c5d1e432449d92c08089d61 (diff)
downloadmeta-freescale-6397a6716be475deec08ae1bbb248be444e4bdb9.tar.gz
optee-os: add optee-os imx fork
Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
-rw-r--r--recipes-security/optee-imx/optee-os_3.2.0.imx.bb92
1 files changed, 92 insertions, 0 deletions
diff --git a/recipes-security/optee-imx/optee-os_3.2.0.imx.bb b/recipes-security/optee-imx/optee-os_3.2.0.imx.bb
new file mode 100644
index 00000000..594aec35
--- /dev/null
+++ b/recipes-security/optee-imx/optee-os_3.2.0.imx.bb
@@ -0,0 +1,92 @@
1# Copyright (C) 2017-2018 NXP
2
3SUMMARY = "OPTEE OS"
4DESCRIPTION = "OPTEE OS"
5HOMEPAGE = "http://www.optee.org/"
6LICENSE = "BSD"
7LIC_FILES_CHKSUM = "file://LICENSE;md5=69663ab153298557a59c67a60a743e5b"
8
9inherit deploy pythonnative autotools
10DEPENDS = "python-pycrypto-native u-boot-mkimage-native"
11
12SRCBRANCH = "imx_4.14.78_1.0.0_ga"
13OPTEE_OS_SRC ?= "git://source.codeaurora.org/external/imx/imx-optee-os.git;protocol=https"
14SRC_URI = "${OPTEE_OS_SRC};branch=${SRCBRANCH}"
15SRCREV = "6a52487eb0ff664e4ebbd48497f0d3322844d51d"
16
17S = "${WORKDIR}/git"
18B = "${WORKDIR}/build.${PLATFORM_FLAVOR}"
19
20# The platform flavor corresponds to the Yocto machine without the leading 'i'.
21PLATFORM_FLAVOR = "${@d.getVar('MACHINE')[1:]}"
22PLATFORM_FLAVOR_imx6qpdlsolox = "mx6qsabresd"
23PLATFORM_FLAVOR_imx6ul7d = "mx6ulevk"
24PLATFORM_FLAVOR_imx6ull14x14evk = "mx6ullevk"
25PLATFORM_FLAVOR_imx6ull9x9evk = "mx6ullevk"
26PLATFORM_FLAVOR_imx6ulz14x14evk = "mx6ullevk"
27PLATFORM_FLAVOR_mx8mm = "mx8mmevk"
28
29OPTEE_ARCH ?= "arm32"
30OPTEE_ARCH_armv7a = "arm32"
31OPTEE_ARCH_aarch64 = "arm64"
32
33# Optee-os can be built for 32 bits and 64 bits at the same time
34# as long as the compilers are correctly defined.
35# For 64bits, CROSS_COMPILE64 must be set
36# When defining CROSS_COMPILE and CROSS_COMPILE64, we assure that
37# any 32 or 64 bits builds will pass
38EXTRA_OEMAKE = "PLATFORM=imx PLATFORM_FLAVOR=${PLATFORM_FLAVOR} \
39 CROSS_COMPILE=${HOST_PREFIX} \
40 CROSS_COMPILE64=${HOST_PREFIX} \
41 NOWERROR=1 \
42 LDFLAGS= \
43 O=${B} \
44 CFG_SECURE_DATA_PATH=y \
45 CFG_TEE_SDP_MEM_BASE=0xCC000000 \
46 CFG_TEE_SDP_MEM_SIZE=0x02000000 \
47 CFG_TEE_SDP_NONCACHE=y \
48 "
49
50
51do_compile () {
52 unset LDFLAGS
53 export CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_HOST}"
54 oe_runmake -C ${S} all CFG_TEE_TA_LOG_LEVEL=0
55}
56
57
58do_deploy () {
59 install -d ${DEPLOYDIR}
60 ${TARGET_PREFIX}objcopy -O binary ${B}/core/tee.elf ${DEPLOYDIR}/tee.${PLATFORM_FLAVOR}.bin
61
62 if [ "${OPTEE_ARCH}" != "arm64" ]; then
63 IMX_LOAD_ADDR=`cat ${B}/core/tee-init_load_addr.txt` && \
64 uboot-mkimage -A arm -O linux -C none -a ${IMX_LOAD_ADDR} -e ${IMX_LOAD_ADDR} \
65 -d ${DEPLOYDIR}/tee.${PLATFORM_FLAVOR}.bin ${DEPLOYDIR}/uTee-${OPTEE_BIN_EXT}
66 fi
67
68 cd ${DEPLOYDIR}
69 ln -sf tee.${PLATFORM_FLAVOR}.bin tee.bin
70 cd -
71}
72
73do_install () {
74 install -d ${D}/lib/firmware/
75 install -m 644 ${B}/core/*.bin ${D}/lib/firmware/
76
77 # Install the TA devkit
78 install -d ${D}/usr/include/optee/export-user_ta_${OPTEE_ARCH}/
79
80 for f in ${B}/export-ta_${OPTEE_ARCH}/*; do
81 cp -aR $f ${D}/usr/include/optee/export-user_ta_${OPTEE_ARCH}/
82 done
83}
84
85addtask deploy after do_compile before do_install
86
87
88FILES_${PN} = "${nonarch_base_libdir}/firmware/"
89FILES_${PN}-staticdev = "/usr/include/optee/"
90RDEPENDS_${PN}-dev += "${PN}-staticdev"
91
92PACKAGE_ARCH = "${MACHINE_ARCH}"