summaryrefslogtreecommitdiffstats
path: root/recipes-security/optee-imx/optee-os_3.15.0.imx.bb
diff options
context:
space:
mode:
authorOtavio Salvador <otavio@ossystems.com.br>2022-02-24 21:45:56 -0300
committerGitHub <noreply@github.com>2022-02-24 21:45:56 -0300
commite4f465dbcb083028ca29807a342e0fec0e0e25ed (patch)
treeb87d5ae0e5c1009d44bef2eaea31a2c5b24e21f0 /recipes-security/optee-imx/optee-os_3.15.0.imx.bb
parent12f30e596061e1dd5b43c3a1d532a8f55d0075eb (diff)
parentc661ec7a177b90a76494a23ecbd44c6a840c97e7 (diff)
downloadmeta-freescale-e4f465dbcb083028ca29807a342e0fec0e0e25ed.tar.gz
Merge pull request #985 from thochstein/optee
Optee: Upgrade 3.10.0.imx -> 3.15.0.imx
Diffstat (limited to 'recipes-security/optee-imx/optee-os_3.15.0.imx.bb')
-rw-r--r--recipes-security/optee-imx/optee-os_3.15.0.imx.bb103
1 files changed, 103 insertions, 0 deletions
diff --git a/recipes-security/optee-imx/optee-os_3.15.0.imx.bb b/recipes-security/optee-imx/optee-os_3.15.0.imx.bb
new file mode 100644
index 00000000..ffa3cc85
--- /dev/null
+++ b/recipes-security/optee-imx/optee-os_3.15.0.imx.bb
@@ -0,0 +1,103 @@
1# Copyright (C) 2017-2021 NXP
2
3SUMMARY = "OPTEE OS"
4DESCRIPTION = "OPTEE OS"
5HOMEPAGE = "http://www.optee.org/"
6LICENSE = "BSD-2-Clause"
7LIC_FILES_CHKSUM = "file://LICENSE;md5=c1f21c4f72f372ef38a5a4aee55ec173"
8
9DEPENDS = "python3-pycryptodomex-native python3-pyelftools-native u-boot-mkimage-native"
10
11SRCBRANCH = "lf-5.10.72_2.2.0"
12SRC_URI = "\
13 git://source.codeaurora.org/external/imx/imx-optee-os.git;protocol=https;branch=${SRCBRANCH} \
14"
15
16SRCREV = "c939619d64dea014ad1b8382356eee4d1cbfbb22"
17
18S = "${WORKDIR}/git"
19
20inherit deploy python3native autotools features_check
21
22REQUIRED_MACHINE_FEATURES = "optee"
23
24# The platform flavor corresponds to the Yocto machine without the leading 'i'.
25PLATFORM_FLAVOR = "${@d.getVar('MACHINE')[1:]}"
26PLATFORM_FLAVOR:imx6qdlsabresd = "mx6qsabresd"
27PLATFORM_FLAVOR:imx6qdlsabreauto = "mx6qsabreauto"
28PLATFORM_FLAVOR:imx6qpdlsolox = "mx6qsabresd"
29PLATFORM_FLAVOR:imx6ul = "mx6ulevk"
30PLATFORM_FLAVOR:imx6ull = "mx6ullevk"
31PLATFORM_FLAVOR:imx6ull = "mx6ullevk"
32PLATFORM_FLAVOR:imx6ulz = "mx6ulzevk"
33PLATFORM_FLAVOR:mx8mq-nxp-bsp = "mx8mqevk"
34PLATFORM_FLAVOR:mx8mm-nxp-bsp = "mx8mmevk"
35PLATFORM_FLAVOR:mx8mn-nxp-bsp = "mx8mnevk"
36PLATFORM_FLAVOR:mx8mp-nxp-bsp = "mx8mpevk"
37PLATFORM_FLAVOR:mx8qm-nxp-bsp = "mx8qmmek"
38PLATFORM_FLAVOR:mx8qxp-nxp-bsp = "mx8qxpmek"
39PLATFORM_FLAVOR:mx8dx-nxp-bsp = "mx8dxmek"
40PLATFORM_FLAVOR:mx8dxl-nxp-bsp = "mx8dxlevk"
41
42OPTEE_ARCH ?= "arm32"
43OPTEE_ARCH:armv7a = "arm32"
44OPTEE_ARCH:aarch64 = "arm64"
45
46# Optee-os can be built for 32 bits and 64 bits at the same time
47# as long as the compilers are correctly defined.
48# For 64bits, CROSS_COMPILE64 must be set
49# When defining CROSS_COMPILE and CROSS_COMPILE64, we assure that
50# any 32 or 64 bits builds will pass
51EXTRA_OEMAKE = " \
52 PLATFORM=imx \
53 PLATFORM_FLAVOR=${PLATFORM_FLAVOR} \
54 CROSS_COMPILE=${HOST_PREFIX} \
55 CROSS_COMPILE64=${HOST_PREFIX} \
56 CFG_TEE_TA_LOG_LEVEL=0 \
57 CFG_TEE_CORE_LOG_LEVEL=0 \
58 -C ${S} O=${B}\
59"
60
61LDFLAGS = ""
62CFLAGS += "--sysroot=${STAGING_DIR_HOST}"
63CXXFLAGS += "--sysroot=${STAGING_DIR_HOST}"
64
65do_deploy () {
66 install -d ${DEPLOYDIR}
67 cp ${B}/core/tee-raw.bin ${DEPLOYDIR}/tee.${PLATFORM_FLAVOR}.bin
68 ln -sf tee.${PLATFORM_FLAVOR}.bin ${DEPLOYDIR}/tee.bin
69
70 if [ "${OPTEE_ARCH}" != "arm64" ]; then
71 IMX_LOAD_ADDR=`${TARGET_PREFIX}readelf -h ${B}/core/tee.elf | grep "Entry point address" | awk '{print $4}'`
72 uboot-mkimage -A arm -O linux -C none -a ${IMX_LOAD_ADDR} -e ${IMX_LOAD_ADDR} \
73 -d ${DEPLOYDIR}/tee.${PLATFORM_FLAVOR}.bin ${DEPLOYDIR}/uTee-${OPTEE_BIN_EXT}
74 fi
75}
76
77do_install () {
78 install -d ${D}${nonarch_base_libdir}/firmware/
79 install -m 644 ${B}/core/*.bin ${D}${nonarch_base_libdir}/firmware/
80
81 # Install the TA devkit
82 install -d ${D}${includedir}/optee/export-user_ta_${OPTEE_ARCH}/
83
84 for f in ${B}/export-ta_${OPTEE_ARCH}/*; do
85 cp -aR $f ${D}${includedir}/optee/export-user_ta_${OPTEE_ARCH}/
86 done
87
88 # Install embedded TAs
89 install -d ${D}${nonarch_base_libdir}/optee_armtz
90 find ${B}/ta -name '*.ta' | while read name; do
91 install -m 444 $name ${D}${nonarch_base_libdir}/optee_armtz/
92 done
93}
94
95addtask deploy after do_compile before do_install
96
97
98FILES:${PN} = "${nonarch_base_libdir}/firmware/ ${nonarch_base_libdir}/optee_armtz/"
99FILES:${PN}-staticdev = "/usr/include/optee/"
100RDEPENDS:${PN}-dev += "${PN}-staticdev"
101
102PACKAGE_ARCH = "${MACHINE_ARCH}"
103COMPATIBLE_MACHINE = "(imx-nxp-bsp)"