diff options
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.bb | 103 |
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 | |||
3 | SUMMARY = "OPTEE OS" | ||
4 | DESCRIPTION = "OPTEE OS" | ||
5 | HOMEPAGE = "http://www.optee.org/" | ||
6 | LICENSE = "BSD-2-Clause" | ||
7 | LIC_FILES_CHKSUM = "file://LICENSE;md5=c1f21c4f72f372ef38a5a4aee55ec173" | ||
8 | |||
9 | DEPENDS = "python3-pycryptodomex-native python3-pyelftools-native u-boot-mkimage-native" | ||
10 | |||
11 | SRCBRANCH = "lf-5.10.72_2.2.0" | ||
12 | SRC_URI = "\ | ||
13 | git://source.codeaurora.org/external/imx/imx-optee-os.git;protocol=https;branch=${SRCBRANCH} \ | ||
14 | " | ||
15 | |||
16 | SRCREV = "c939619d64dea014ad1b8382356eee4d1cbfbb22" | ||
17 | |||
18 | S = "${WORKDIR}/git" | ||
19 | |||
20 | inherit deploy python3native autotools features_check | ||
21 | |||
22 | REQUIRED_MACHINE_FEATURES = "optee" | ||
23 | |||
24 | # The platform flavor corresponds to the Yocto machine without the leading 'i'. | ||
25 | PLATFORM_FLAVOR = "${@d.getVar('MACHINE')[1:]}" | ||
26 | PLATFORM_FLAVOR:imx6qdlsabresd = "mx6qsabresd" | ||
27 | PLATFORM_FLAVOR:imx6qdlsabreauto = "mx6qsabreauto" | ||
28 | PLATFORM_FLAVOR:imx6qpdlsolox = "mx6qsabresd" | ||
29 | PLATFORM_FLAVOR:imx6ul = "mx6ulevk" | ||
30 | PLATFORM_FLAVOR:imx6ull = "mx6ullevk" | ||
31 | PLATFORM_FLAVOR:imx6ull = "mx6ullevk" | ||
32 | PLATFORM_FLAVOR:imx6ulz = "mx6ulzevk" | ||
33 | PLATFORM_FLAVOR:mx8mq-nxp-bsp = "mx8mqevk" | ||
34 | PLATFORM_FLAVOR:mx8mm-nxp-bsp = "mx8mmevk" | ||
35 | PLATFORM_FLAVOR:mx8mn-nxp-bsp = "mx8mnevk" | ||
36 | PLATFORM_FLAVOR:mx8mp-nxp-bsp = "mx8mpevk" | ||
37 | PLATFORM_FLAVOR:mx8qm-nxp-bsp = "mx8qmmek" | ||
38 | PLATFORM_FLAVOR:mx8qxp-nxp-bsp = "mx8qxpmek" | ||
39 | PLATFORM_FLAVOR:mx8dx-nxp-bsp = "mx8dxmek" | ||
40 | PLATFORM_FLAVOR:mx8dxl-nxp-bsp = "mx8dxlevk" | ||
41 | |||
42 | OPTEE_ARCH ?= "arm32" | ||
43 | OPTEE_ARCH:armv7a = "arm32" | ||
44 | OPTEE_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 | ||
51 | EXTRA_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 | |||
61 | LDFLAGS = "" | ||
62 | CFLAGS += "--sysroot=${STAGING_DIR_HOST}" | ||
63 | CXXFLAGS += "--sysroot=${STAGING_DIR_HOST}" | ||
64 | |||
65 | do_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 | |||
77 | do_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 | |||
95 | addtask deploy after do_compile before do_install | ||
96 | |||
97 | |||
98 | FILES:${PN} = "${nonarch_base_libdir}/firmware/ ${nonarch_base_libdir}/optee_armtz/" | ||
99 | FILES:${PN}-staticdev = "/usr/include/optee/" | ||
100 | RDEPENDS:${PN}-dev += "${PN}-staticdev" | ||
101 | |||
102 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
103 | COMPATIBLE_MACHINE = "(imx-nxp-bsp)" | ||