diff options
Diffstat (limited to 'recipes-security/optee-imx/optee-os-fslc.inc')
-rw-r--r-- | recipes-security/optee-imx/optee-os-fslc.inc | 108 |
1 files changed, 53 insertions, 55 deletions
diff --git a/recipes-security/optee-imx/optee-os-fslc.inc b/recipes-security/optee-imx/optee-os-fslc.inc index b91a55311..56c0f3e12 100644 --- a/recipes-security/optee-imx/optee-os-fslc.inc +++ b/recipes-security/optee-imx/optee-os-fslc.inc | |||
@@ -1,87 +1,85 @@ | |||
1 | # Copyright (C) 2017-2021 NXP | 1 | # Copied from meta-arm/recipes-security/optee/optee-os.inc. |
2 | # See: https://github.com/nxp-imx/imx-manifest/blob/imx-linux-scarthgap/imx-6.6.52-2.2.0.xml#L30 | ||
3 | |||
4 | SUMMARY = "OP-TEE Trusted OS" | ||
5 | DESCRIPTION = "Open Portable Trusted Execution Environment - Trusted side of the TEE" | ||
6 | HOMEPAGE = "https://www.op-tee.org/" | ||
2 | 7 | ||
3 | SUMMARY = "OPTEE OS" | ||
4 | DESCRIPTION = "OPTEE OS" | ||
5 | LICENSE = "BSD-2-Clause" | 8 | LICENSE = "BSD-2-Clause" |
6 | LIC_FILES_CHKSUM = "file://LICENSE;md5=c1f21c4f72f372ef38a5a4aee55ec173" | 9 | LIC_FILES_CHKSUM = "file://LICENSE;md5=c1f21c4f72f372ef38a5a4aee55ec173" |
7 | 10 | ||
11 | inherit deploy python3native | ||
8 | require optee-fslc.inc | 12 | require optee-fslc.inc |
9 | 13 | ||
10 | DEPENDS += "python3-pyelftools-native u-boot-mkimage-native" | 14 | CVE_PRODUCT = "linaro:op-tee op-tee:op-tee_os" |
15 | |||
16 | DEPENDS = "python3-pyelftools-native python3-cryptography-native" | ||
17 | |||
11 | DEPENDS:append:toolchain-clang = " compiler-rt" | 18 | DEPENDS:append:toolchain-clang = " compiler-rt" |
12 | 19 | ||
13 | inherit deploy autotools | 20 | SRC_URI = "git://github.com/OP-TEE/optee_os.git;branch=master;protocol=https" |
14 | 21 | ||
15 | # Optee-os can be built for 32 bits and 64 bits at the same time | 22 | B = "${WORKDIR}/build" |
16 | # as long as the compilers are correctly defined. | ||
17 | # For 64bits, CROSS_COMPILE64 must be set | ||
18 | # When defining CROSS_COMPILE and CROSS_COMPILE64, we assure that | ||
19 | # any 32 or 64 bits builds will pass | ||
20 | EXTRA_OEMAKE += " \ | ||
21 | PLATFORM=imx-${PLATFORM_FLAVOR} \ | ||
22 | CROSS_COMPILE=${HOST_PREFIX} \ | ||
23 | CROSS_COMPILE64=${HOST_PREFIX} \ | ||
24 | CFLAGS32=--sysroot=${STAGING_DIR_HOST} \ | ||
25 | CFLAGS64=--sysroot=${STAGING_DIR_HOST} \ | ||
26 | CFG_TEE_TA_LOG_LEVEL=0 \ | ||
27 | CFG_TEE_CORE_LOG_LEVEL=0 \ | ||
28 | " | ||
29 | 23 | ||
30 | EXTRA_OEMAKE:append:imx8mq-lpddr4-wevk = " \ | 24 | EXTRA_OEMAKE += " \ |
31 | CFG_CORE_LARGE_PHYS_ADDR=y \ | 25 | PLATFORM=${OPTEEMACHINE} \ |
32 | CFG_CORE_ARM64_PA_BITS=36 \ | 26 | CFG_${OPTEE_CORE}_core=y \ |
33 | CFG_DDR_SIZE=0x100000000 \ | 27 | CROSS_COMPILE_core=${HOST_PREFIX} \ |
34 | CFG_TZDRAM_START=0xfe000000 \ | 28 | CROSS_COMPILE_ta_${OPTEE_ARCH}=${HOST_PREFIX} \ |
29 | NOWERROR=1 \ | ||
30 | ta-targets=ta_${OPTEE_ARCH} \ | ||
31 | O=${B} \ | ||
35 | " | 32 | " |
33 | EXTRA_OEMAKE += " HOST_PREFIX=${HOST_PREFIX}" | ||
34 | EXTRA_OEMAKE += " CROSS_COMPILE64=${HOST_PREFIX}" | ||
36 | 35 | ||
37 | LDFLAGS[unexport] = "1" | 36 | LDFLAGS[unexport] = "1" |
38 | CPPFLAGS[unexport] = "1" | 37 | CPPFLAGS[unexport] = "1" |
39 | AS[unexport] = "1" | 38 | AS[unexport] = "1" |
40 | LD[unexport] = "1" | 39 | LD[unexport] = "1" |
41 | 40 | ||
42 | do_configure[noexec] = "1" | ||
43 | |||
44 | do_compile:prepend() { | 41 | do_compile:prepend() { |
45 | PLAT_LIBGCC_PATH=$(${CC} -print-libgcc-file-name) | 42 | PLAT_LIBGCC_PATH=$(${CC} -print-libgcc-file-name) |
46 | } | 43 | } |
47 | 44 | ||
48 | do_compile:arm () { | 45 | do_compile() { |
49 | oe_runmake all uTee | 46 | oe_runmake -C ${S} all |
50 | } | ||
51 | |||
52 | do_compile:aarch64 () { | ||
53 | oe_runmake all | ||
54 | } | 47 | } |
55 | do_compile[cleandirs] = "${B}" | 48 | do_compile[cleandirs] = "${B}" |
56 | 49 | ||
57 | do_deploy () { | 50 | do_install() { |
58 | install -d ${DEPLOYDIR} | 51 | #install core in firmware |
59 | cp ${B}/core/tee-raw.bin ${DEPLOYDIR}/tee.${PLATFORM_FLAVOR}.bin | 52 | install -d ${D}${nonarch_base_libdir}/firmware/ |
60 | ln -sf tee.${PLATFORM_FLAVOR}.bin ${DEPLOYDIR}/tee.bin | 53 | install -m 644 ${B}/core/*.bin ${B}/core/tee.elf ${D}${nonarch_base_libdir}/firmware/ |
61 | } | ||
62 | 54 | ||
63 | do_deploy:append:arm () { | 55 | #install tas in optee_armtz |
64 | cp ${B}/core/uTee ${DEPLOYDIR}/uTee-${OPTEE_BIN_EXT} | 56 | install -d ${D}${nonarch_base_libdir}/optee_armtz/ |
57 | install -m 444 ${B}/ta/*/*.ta ${D}${nonarch_base_libdir}/optee_armtz | ||
65 | } | 58 | } |
66 | 59 | ||
67 | do_install () { | 60 | PACKAGE_ARCH = "${MACHINE_ARCH}" |
68 | install -d ${D}${nonarch_base_libdir}/firmware/ | ||
69 | install -m 644 ${B}/core/*.bin ${D}${nonarch_base_libdir}/firmware/ | ||
70 | 61 | ||
71 | # Install embedded TAs | 62 | do_deploy() { |
72 | install -d ${D}${nonarch_base_libdir}/optee_armtz/ | 63 | install -d ${DEPLOYDIR}/${MLPREFIX}optee |
73 | install -m 444 ${B}/ta/*/*.ta ${D}${nonarch_base_libdir}/optee_armtz/ | 64 | install -m 644 ${D}${nonarch_base_libdir}/firmware/* ${DEPLOYDIR}/${MLPREFIX}optee |
74 | 65 | ||
75 | # Install the TA devkit | 66 | install -d ${DEPLOYDIR}/${MLPREFIX}optee/ta |
76 | install -d ${D}${includedir}/optee/export-user_ta_${OPTEE_ARCH}/ | 67 | install -m 644 ${B}/ta/*/*.elf ${DEPLOYDIR}/${MLPREFIX}optee/ta |
77 | cp -aR ${B}/export-ta_${OPTEE_ARCH}/* \ | ||
78 | ${D}${includedir}/optee/export-user_ta_${OPTEE_ARCH}/ | ||
79 | } | 68 | } |
80 | 69 | ||
81 | addtask deploy after do_compile before do_install | 70 | addtask deploy before do_build after do_install |
82 | 71 | ||
83 | FILES:${PN} = "${nonarch_base_libdir}/firmware/ ${nonarch_base_libdir}/optee_armtz/" | 72 | SYSROOT_DIRS += "${nonarch_base_libdir}/firmware" |
84 | FILES:${PN}-staticdev = "${includedir}/optee/" | 73 | |
85 | RDEPENDS:${PN}-dev += "${PN}-staticdev" | 74 | PACKAGES += "${PN}-ta" |
75 | FILES:${PN} = "${nonarch_base_libdir}/firmware/" | ||
76 | FILES:${PN}-ta = "${nonarch_base_libdir}/optee_armtz/*" | ||
77 | |||
78 | |||
79 | # note: "textrel" is not triggered on all archs | ||
80 | INSANE_SKIP:${PN} = "textrel" | ||
81 | # Build paths are currently embedded | ||
82 | INSANE_SKIP:${PN} += "buildpaths" | ||
83 | INSANE_SKIP:${PN}-dev = "staticdev" | ||
84 | INHIBIT_PACKAGE_STRIP = "1" | ||
86 | 85 | ||
87 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||