diff options
Diffstat (limited to 'recipes-security/optee/optee-os.nxp.inc')
| -rw-r--r-- | recipes-security/optee/optee-os.nxp.inc | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/recipes-security/optee/optee-os.nxp.inc b/recipes-security/optee/optee-os.nxp.inc new file mode 100644 index 000000000..f376b3ce2 --- /dev/null +++ b/recipes-security/optee/optee-os.nxp.inc | |||
| @@ -0,0 +1,76 @@ | |||
| 1 | # Copyright 2020-2021 NXP | ||
| 2 | |||
| 3 | SUMMARY = "OPTEE OS" | ||
| 4 | DESCRIPTION = "OPTEE OS" | ||
| 5 | HOMEPAGE = "http://www.optee.org/" | ||
| 6 | LICENSE = "BSD" | ||
| 7 | LIC_FILES_CHKSUM = "file://LICENSE;md5=c1f21c4f72f372ef38a5a4aee55ec173" | ||
| 8 | |||
| 9 | inherit deploy python3native autotools | ||
| 10 | DEPENDS = "python3-pycryptodome-native python3-pyelftools-native python3-pycryptodomex-native dtc-native" | ||
| 11 | |||
| 12 | SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/optee_os.git;nobranch=1" | ||
| 13 | SRCREV = "735d98806dc26fbeeecad7f5e60ffeab8170c67e" | ||
| 14 | |||
| 15 | S = "${WORKDIR}/git" | ||
| 16 | B = "${WORKDIR}/build.${PLATFORM_FLAVOR}" | ||
| 17 | |||
| 18 | PLATFORM_FLAVOR ?= "${MACHINE}" | ||
| 19 | |||
| 20 | OPTEE_ARCH ?= "arm64" | ||
| 21 | OPTEE_ARCH_armv7a = "arm32" | ||
| 22 | OPTEE_ARCH:aarch64 = "arm64" | ||
| 23 | |||
| 24 | OPTEE_CORE_LOG_LEVEL ?= "1" | ||
| 25 | OPTEE_TA_LOG_LEVEL ?= "0" | ||
| 26 | |||
| 27 | # Optee-os can be built for 32 bits and 64 bits at the same time | ||
| 28 | # as long as the compilers are correctly defined. | ||
| 29 | # For 64bits, CROSS_COMPILE64 must be set | ||
| 30 | # When defining CROSS_COMPILE and CROSS_COMPILE64, we assure that | ||
| 31 | # any 32 or 64 bits builds will pass | ||
| 32 | EXTRA_OEMAKE = " \ | ||
| 33 | -C ${S} O=${B} \ | ||
| 34 | PLATFORM_FLAVOR=${PLATFORM_FLAVOR} \ | ||
| 35 | CROSS_COMPILE=${HOST_PREFIX} \ | ||
| 36 | CROSS_COMPILE64=${HOST_PREFIX} \ | ||
| 37 | CFG_WERROR=y \ | ||
| 38 | CFG_TEE_CORE_LOG_LEVEL=${OPTEE_CORE_LOG_LEVEL} \ | ||
| 39 | CFG_TEE_TA_LOG_LEVEL=${OPTEE_TA_LOG_LEVEL} \ | ||
| 40 | " | ||
| 41 | |||
| 42 | do_compile() { | ||
| 43 | unset LDFLAGS | ||
| 44 | export CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_HOST}" | ||
| 45 | oe_runmake all | ||
| 46 | } | ||
| 47 | |||
| 48 | do_install() { | ||
| 49 | install -d ${D}${nonarch_base_libdir}/firmware/ | ||
| 50 | install -m 644 ${B}/core/*.bin ${D}${nonarch_base_libdir}/firmware/ | ||
| 51 | |||
| 52 | # Install the TA devkit | ||
| 53 | install -d ${D}${includedir}/optee/export-user_ta/ | ||
| 54 | |||
| 55 | for f in ${B}/export-ta_${OPTEE_ARCH}/*; do | ||
| 56 | cp -aR $f ${D}${includedir}/optee/export-user_ta/ | ||
| 57 | done | ||
| 58 | |||
| 59 | install -d ${D}${nonarch_base_libdir}/optee_armtz | ||
| 60 | find ${B}/export-ta_${OPTEE_ARCH}/ta -name '*.ta' | while read name; do | ||
| 61 | install -m 444 $name ${D}${nonarch_base_libdir}/optee_armtz/ | ||
| 62 | done | ||
| 63 | } | ||
| 64 | |||
| 65 | do_deploy() { | ||
| 66 | install -d ${DEPLOYDIR}/optee | ||
| 67 | install -m 644 ${D}${nonarch_base_libdir}/firmware/* ${DEPLOYDIR}/optee/ | ||
| 68 | } | ||
| 69 | addtask deploy before do_build after do_install | ||
| 70 | |||
| 71 | FILES:${PN} = "${nonarch_base_libdir}/firmware/ ${nonarch_base_libdir}/optee_armtz/" | ||
| 72 | FILES:${PN}-staticdev = "/usr/include/optee/" | ||
| 73 | RDEPENDS:${PN}-dev += "${PN}-staticdev" | ||
| 74 | |||
| 75 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
| 76 | |||
