diff options
Diffstat (limited to 'recipes-security/optee-imx/optee-os-fslc.inc')
| -rw-r--r-- | recipes-security/optee-imx/optee-os-fslc.inc | 110 |
1 files changed, 53 insertions, 57 deletions
diff --git a/recipes-security/optee-imx/optee-os-fslc.inc b/recipes-security/optee-imx/optee-os-fslc.inc index 61906344f..c1f1f48f5 100644 --- a/recipes-security/optee-imx/optee-os-fslc.inc +++ b/recipes-security/optee-imx/optee-os-fslc.inc | |||
| @@ -1,90 +1,86 @@ | |||
| 1 | # Copyright (C) 2017-2021,2024 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 | S = "${WORKDIR}/git" |
| 16 | # as long as the compilers are correctly defined. | 23 | B = "${WORKDIR}/build" |
| 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 | 24 | ||
| 30 | EXTRA_OEMAKE:append:imx8mq-lpddr4-wevk = " \ | 25 | EXTRA_OEMAKE += " \ |
| 31 | CFG_CORE_LARGE_PHYS_ADDR=y \ | 26 | PLATFORM=${OPTEEMACHINE} \ |
| 32 | CFG_CORE_ARM64_PA_BITS=36 \ | 27 | CFG_${OPTEE_CORE}_core=y \ |
| 33 | CFG_DDR_SIZE=0x100000000 \ | 28 | CROSS_COMPILE_core=${HOST_PREFIX} \ |
| 34 | CFG_TZDRAM_START=0xfe000000 \ | 29 | CROSS_COMPILE_ta_${OPTEE_ARCH}=${HOST_PREFIX} \ |
| 30 | NOWERROR=1 \ | ||
| 31 | ta-targets=ta_${OPTEE_ARCH} \ | ||
| 32 | O=${B} \ | ||
| 35 | " | 33 | " |
| 34 | EXTRA_OEMAKE += " HOST_PREFIX=${HOST_PREFIX}" | ||
| 35 | EXTRA_OEMAKE += " CROSS_COMPILE64=${HOST_PREFIX}" | ||
| 36 | 36 | ||
| 37 | LDFLAGS[unexport] = "1" | 37 | LDFLAGS[unexport] = "1" |
| 38 | CPPFLAGS[unexport] = "1" | 38 | CPPFLAGS[unexport] = "1" |
| 39 | AS[unexport] = "1" | 39 | AS[unexport] = "1" |
| 40 | LD[unexport] = "1" | 40 | LD[unexport] = "1" |
| 41 | 41 | ||
| 42 | do_configure[noexec] = "1" | ||
| 43 | |||
| 44 | do_compile:prepend() { | 42 | do_compile:prepend() { |
| 45 | PLAT_LIBGCC_PATH=$(${CC} -print-libgcc-file-name) | 43 | PLAT_LIBGCC_PATH=$(${CC} -print-libgcc-file-name) |
| 46 | } | ||
| 47 | |||
| 48 | do_compile:arm () { | ||
| 49 | oe_runmake all uTee | ||
| 50 | } | 44 | } |
| 51 | 45 | ||
| 52 | do_compile:aarch64 () { | 46 | do_compile() { |
| 53 | oe_runmake all | 47 | oe_runmake -C ${S} all |
| 54 | } | 48 | } |
| 55 | do_compile[cleandirs] = "${B}" | 49 | do_compile[cleandirs] = "${B}" |
| 56 | 50 | ||
| 57 | do_deploy () { | 51 | do_install() { |
| 58 | install -d ${DEPLOYDIR} | 52 | #install core in firmware |
| 59 | cp ${B}/core/tee-raw.bin ${DEPLOYDIR}/tee.${PLATFORM_FLAVOR}.bin | 53 | install -d ${D}${nonarch_base_libdir}/firmware/ |
| 60 | ln -sf tee.${PLATFORM_FLAVOR}.bin ${DEPLOYDIR}/tee.bin | 54 | install -m 644 ${B}/core/*.bin ${B}/core/tee.elf ${D}${nonarch_base_libdir}/firmware/ |
| 61 | } | ||
| 62 | 55 | ||
| 63 | do_deploy:append:arm () { | 56 | #install tas in optee_armtz |
| 64 | cp ${B}/core/uTee ${DEPLOYDIR}/uTee-${OPTEE_BIN_EXT} | 57 | install -d ${D}${nonarch_base_libdir}/optee_armtz/ |
| 58 | install -m 444 ${B}/ta/*/*.ta ${D}${nonarch_base_libdir}/optee_armtz | ||
| 65 | } | 59 | } |
| 66 | 60 | ||
| 67 | do_install () { | 61 | 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 | 62 | ||
| 71 | # Install embedded TAs | 63 | do_deploy() { |
| 72 | install -d ${D}${nonarch_base_libdir}/optee_armtz/ | 64 | install -d ${DEPLOYDIR}/${MLPREFIX}optee |
| 73 | install -m 444 ${B}/ta/*/*.ta ${D}${nonarch_base_libdir}/optee_armtz/ | 65 | install -m 644 ${D}${nonarch_base_libdir}/firmware/* ${DEPLOYDIR}/${MLPREFIX}optee |
| 74 | 66 | ||
| 75 | # Install the TA devkit | 67 | install -d ${DEPLOYDIR}/${MLPREFIX}optee/ta |
| 76 | install -d ${D}${includedir}/optee/export-user_ta_${OPTEE_ARCH}/ | 68 | 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 | } | 69 | } |
| 80 | 70 | ||
| 81 | addtask deploy after do_compile before do_install | 71 | addtask deploy before do_build after do_install |
| 82 | 72 | ||
| 83 | FILES:${PN} = "${nonarch_base_libdir}/firmware/ ${nonarch_base_libdir}/optee_armtz/" | 73 | SYSROOT_DIRS += "${nonarch_base_libdir}/firmware" |
| 84 | FILES:${PN}-staticdev = "${includedir}/optee/" | ||
| 85 | RDEPENDS:${PN}-dev += "${PN}-staticdev" | ||
| 86 | 74 | ||
| 87 | # FIXME: Build paths are currently embedded | 75 | PACKAGES += "${PN}-ta" |
| 88 | INSANE_SKIP:${PN}-staticdev += "buildpaths" | 76 | FILES:${PN} = "${nonarch_base_libdir}/firmware/" |
| 77 | FILES:${PN}-ta = "${nonarch_base_libdir}/optee_armtz/*" | ||
| 78 | |||
| 79 | |||
| 80 | # note: "textrel" is not triggered on all archs | ||
| 81 | INSANE_SKIP:${PN} = "textrel" | ||
| 82 | # Build paths are currently embedded | ||
| 83 | INSANE_SKIP:${PN} += "buildpaths" | ||
| 84 | INSANE_SKIP:${PN}-dev = "staticdev" | ||
| 85 | INHIBIT_PACKAGE_STRIP = "1" | ||
| 89 | 86 | ||
| 90 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
