diff options
| author | Ting Liu <ting.liu@nxp.com> | 2021-10-14 16:03:50 +0800 |
|---|---|---|
| committer | Ting Liu <ting.liu@nxp.com> | 2021-10-15 22:11:36 +0800 |
| commit | a17caf57cc1845f4ebfea825f2803dd9cbb50948 (patch) | |
| tree | cbfd4a66a0cc666fa952442cc6bf047483473476 | |
| parent | 115d33d607bbf3b743a8047861883e0275271222 (diff) | |
| download | meta-freescale-a17caf57cc1845f4ebfea825f2803dd9cbb50948.tar.gz | |
optee-qoriq: upgrade to 3.13
Signed-off-by: Ting Liu <ting.liu@nxp.com>
12 files changed, 247 insertions, 212 deletions
diff --git a/recipes-security/optee/optee-client-qoriq_3.13.0.bb b/recipes-security/optee/optee-client-qoriq_3.13.0.bb new file mode 100644 index 000000000..94123e435 --- /dev/null +++ b/recipes-security/optee/optee-client-qoriq_3.13.0.bb | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | require optee-client.nxp.inc | ||
| 2 | |||
| 3 | PV:append = "+git${SRCPV}" | ||
| 4 | |||
| 5 | COMPATIBLE_MACHINE = "(qoriq-arm64)" | ||
diff --git a/recipes-security/optee/optee-client-qoriq_3.8.0.bb b/recipes-security/optee/optee-client-qoriq_3.8.0.bb deleted file mode 100644 index 0cd9eeabf..000000000 --- a/recipes-security/optee/optee-client-qoriq_3.8.0.bb +++ /dev/null | |||
| @@ -1,28 +0,0 @@ | |||
| 1 | SUMMARY = "OPTEE Client" | ||
| 2 | HOMEPAGE = "https://github.com/OP-TEE/optee_client" | ||
| 3 | |||
| 4 | LICENSE = "BSD" | ||
| 5 | LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=69663ab153298557a59c67a60a743e5b" | ||
| 6 | |||
| 7 | inherit python3native systemd | ||
| 8 | |||
| 9 | SRC_URI = "git://github.com/OP-TEE/optee_client;nobranch=1" | ||
| 10 | SRCREV = "be4fa2e36f717f03ca46e574aa66f697a897d090" | ||
| 11 | |||
| 12 | S = "${WORKDIR}/git" | ||
| 13 | |||
| 14 | EXTRA_OEMAKE = "ARCH=arm64" | ||
| 15 | |||
| 16 | do_install() { | ||
| 17 | oe_runmake install | ||
| 18 | |||
| 19 | install -D -p -m0755 ${S}/out/export/usr/sbin/tee-supplicant ${D}${bindir}/tee-supplicant | ||
| 20 | install -D -p -m0755 ${S}/out/export/usr/lib/libteec.so.1.0.0 ${D}${libdir}/libteec.so.1.0.0 | ||
| 21 | ln -sf libteec.so.1.0.0 ${D}${libdir}/libteec.so.1.0 | ||
| 22 | ln -sf libteec.so.1.0.0 ${D}${libdir}/libteec.so.1 | ||
| 23 | ln -sf libteec.so.1 ${D}${libdir}/libteec.so | ||
| 24 | |||
| 25 | cp -a ${S}/out/export/usr/include ${D}/usr/ | ||
| 26 | } | ||
| 27 | |||
| 28 | COMPATIBLE_MACHINE = "(qoriq-arm64)" | ||
diff --git a/recipes-security/optee/optee-client.nxp.inc b/recipes-security/optee/optee-client.nxp.inc new file mode 100644 index 000000000..de2ba8ae3 --- /dev/null +++ b/recipes-security/optee/optee-client.nxp.inc | |||
| @@ -0,0 +1,53 @@ | |||
| 1 | # Copyright 2020-2021 NXP | ||
| 2 | |||
| 3 | SUMMARY = "OPTEE Client libs" | ||
| 4 | HOMEPAGE = "http://www.optee.org/" | ||
| 5 | LICENSE = "BSD" | ||
| 6 | LIC_FILES_CHKSUM = "file://LICENSE;md5=69663ab153298557a59c67a60a743e5b" | ||
| 7 | |||
| 8 | inherit python3native systemd | ||
| 9 | |||
| 10 | SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/optee_client.git;nobranch=1" | ||
| 11 | SRCREV = "7c9c423d00e96bf51debd5fe10fd70dce83be5cc" | ||
| 12 | |||
| 13 | FILESEXTRAPATHS:prepend := "${THISDIR}/optee-client:" | ||
| 14 | SRC_URI += "file://tee-supplicant.service" | ||
| 15 | |||
| 16 | S = "${WORKDIR}/git" | ||
| 17 | B = "${WORKDIR}/build" | ||
| 18 | |||
| 19 | OPTEE_ARCH ?= "arm32" | ||
| 20 | OPTEE_ARCH_armv7a = "arm32" | ||
| 21 | OPTEE_ARCH:aarch64 = "arm64" | ||
| 22 | |||
| 23 | EXTRA_OEMAKE = "ARCH=${OPTEE_ARCH} O=${B}" | ||
| 24 | |||
| 25 | do_install () { | ||
| 26 | oe_runmake -C ${S} install | ||
| 27 | |||
| 28 | install -d ${D}${libdir}/ | ||
| 29 | install -p -m0644 ${B}/export${libdir}/libteec.so.1.0.0 ${D}${libdir}/ | ||
| 30 | ln -sf libteec.so.1.0.0 ${D}${libdir}/libteec.so.1.0 | ||
| 31 | ln -sf libteec.so.1.0.0 ${D}${libdir}/libteec.so.1 | ||
| 32 | ln -sf libteec.so.1 ${D}${libdir}/libteec.so | ||
| 33 | |||
| 34 | install -D -p -m0644 ${B}/export/usr/lib/libckteec.so.0.1.0 ${D}${libdir}/libckteec.so.0.1.0 | ||
| 35 | ln -sf libckteec.so.0.1.0 ${D}${libdir}/libckteec.so.0.1 | ||
| 36 | ln -sf libckteec.so.0.1.0 ${D}${libdir}/libckteec.so.0 | ||
| 37 | ln -sf libckteec.so.0.1.0 ${D}${libdir}/libckteec.so | ||
| 38 | |||
| 39 | install -D -p -m0755 ${B}/export/usr/sbin/tee-supplicant ${D}${bindir}/tee-supplicant | ||
| 40 | |||
| 41 | cp -a ${B}/export/usr/include ${D}${includedir} | ||
| 42 | |||
| 43 | install -d ${D}${systemd_system_unitdir}/ | ||
| 44 | install -m0644 ${WORKDIR}/tee-supplicant.service ${D}${systemd_system_unitdir}/ | ||
| 45 | sed -i -e s:/etc:${sysconfdir}:g -e s:/usr/bin:${bindir}:g ${D}${systemd_system_unitdir}/tee-supplicant.service | ||
| 46 | } | ||
| 47 | |||
| 48 | SYSTEMD_SERVICE:${PN} = "tee-supplicant.service" | ||
| 49 | |||
| 50 | FILES:${PN} += "${libdir}/* ${includedir}/*" | ||
| 51 | |||
| 52 | INSANE_SKIP:${PN} = "ldflags dev-elf" | ||
| 53 | INSANE_SKIP:${PN}-dev = "ldflags dev-elf" | ||
diff --git a/recipes-security/optee/optee-client/tee-supplicant.service b/recipes-security/optee/optee-client/tee-supplicant.service new file mode 100644 index 000000000..0e2b4f6ba --- /dev/null +++ b/recipes-security/optee/optee-client/tee-supplicant.service | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | [Unit] | ||
| 2 | Description=TEE Supplicant | ||
| 3 | |||
| 4 | [Service] | ||
| 5 | User=root | ||
| 6 | EnvironmentFile=-/etc/default/tee-supplicant | ||
| 7 | ExecStart=/usr/bin/tee-supplicant $OPTARGS | ||
| 8 | |||
| 9 | [Install] | ||
| 10 | WantedBy=basic.target | ||
| 11 | |||
diff --git a/recipes-security/optee/optee-os-qoriq/0001-allow-setting-sysroot-for-libgcc-lookup.patch b/recipes-security/optee/optee-os-qoriq/0001-allow-setting-sysroot-for-libgcc-lookup.patch deleted file mode 100644 index 17127d0b0..000000000 --- a/recipes-security/optee/optee-os-qoriq/0001-allow-setting-sysroot-for-libgcc-lookup.patch +++ /dev/null | |||
| @@ -1,13 +0,0 @@ | |||
| 1 | diff --git a/mk/gcc.mk b/mk/gcc.mk | ||
| 2 | index fc38c4d..77b8d74 100644 | ||
| 3 | --- a/mk/gcc.mk | ||
| 4 | +++ b/mk/gcc.mk | ||
| 5 | @@ -12,7 +12,7 @@ nostdinc$(sm) := -nostdinc -isystem $(shell $(CC$(sm)) \ | ||
| 6 | -print-file-name=include 2> /dev/null) | ||
| 7 | |||
| 8 | # Get location of libgcc from gcc | ||
| 9 | -libgcc$(sm) := $(shell $(CC$(sm)) $(CFLAGS$(arch-bits-$(sm))) $(comp-cflags$(sm)) \ | ||
| 10 | +libgcc$(sm) := $(shell $(CC$(sm)) $(LIBGCC_LOCATE_CFLAGS) $(CFLAGS$(arch-bits-$(sm))) $(comp-cflags$(sm)) \ | ||
| 11 | -print-libgcc-file-name 2> /dev/null) | ||
| 12 | |||
| 13 | # Define these to something to discover accidental use | ||
diff --git a/recipes-security/optee/optee-os-qoriq/0001-arm64-Disable-outline-atomics-when-compiling.patch b/recipes-security/optee/optee-os-qoriq/0001-arm64-Disable-outline-atomics-when-compiling.patch deleted file mode 100644 index 086d4333a..000000000 --- a/recipes-security/optee/optee-os-qoriq/0001-arm64-Disable-outline-atomics-when-compiling.patch +++ /dev/null | |||
| @@ -1,41 +0,0 @@ | |||
| 1 | From f94d9558d9eae48e92ce8d651539b6cf69eb4394 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Joshua Watt <JPEWhacker@gmail.com> | ||
| 3 | Date: Mon, 18 May 2020 20:00:00 -0500 | ||
| 4 | Subject: [PATCH] arm64: Disable outline-atomics when compiling | ||
| 5 | |||
| 6 | Disables the automatic detection of LSE (Large System Extension) | ||
| 7 | instructions when compiling AArch64 code. GCC 10 implements this | ||
| 8 | detection in libgcc using __getauxval(), which optee doesn't implement. | ||
| 9 | This requires that the proper -mcpu is passed to GCC so that the code | ||
| 10 | can be correctly compiled to use either LSE or load-store-exclusive. | ||
| 11 | |||
| 12 | Fixes linker errors like the following when compiling with GCC 10: | ||
| 13 | |||
| 14 | aarch64-linux-ld.bfd: libgcc.a(lse-init.o): | ||
| 15 | in function `init_have_lse_atomics': | ||
| 16 | lse-init.c:44: undefined reference to `__getauxval' | ||
| 17 | core/arch/arm/kernel/link.mk:38: | ||
| 18 | recipe for target 'build/core/all_objs.o' failed | ||
| 19 | |||
| 20 | Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> | ||
| 21 | Upstream-Status: Submitted [https://github.com/OP-TEE/optee_os/pull/3874] | ||
| 22 | --- | ||
| 23 | core/arch/arm/arm.mk | 2 +- | ||
| 24 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 25 | |||
| 26 | diff --git a/core/arch/arm/arm.mk b/core/arch/arm/arm.mk | ||
| 27 | index a18eda3b..07069c66 100644 | ||
| 28 | --- a/core/arch/arm/arm.mk | ||
| 29 | +++ b/core/arch/arm/arm.mk | ||
| 30 | @@ -115,7 +115,7 @@ arm32-platform-aflags-no-hard-float ?= | ||
| 31 | |||
| 32 | arm64-platform-cflags-no-hard-float ?= -mgeneral-regs-only | ||
| 33 | arm64-platform-cflags-hard-float ?= | ||
| 34 | -arm64-platform-cflags-generic ?= -mstrict-align | ||
| 35 | +arm64-platform-cflags-generic ?= -mstrict-align $(call cc-option,-mno-outline-atomics,) | ||
| 36 | |||
| 37 | ifeq ($(DEBUG),1) | ||
| 38 | # For backwards compatibility | ||
| 39 | -- | ||
| 40 | 2.17.1 | ||
| 41 | |||
diff --git a/recipes-security/optee/optee-os-qoriq_3.13.0.bb b/recipes-security/optee/optee-os-qoriq_3.13.0.bb new file mode 100644 index 000000000..3c3652d3d --- /dev/null +++ b/recipes-security/optee/optee-os-qoriq_3.13.0.bb | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | require optee-os.nxp.inc | ||
| 2 | |||
| 3 | PV:append = "+git${SRCPV}" | ||
| 4 | |||
| 5 | PLATFORM_FLAVOR:ls1088ardb-pb = "ls1088ardb" | ||
| 6 | PLATFORM_FLAVOR:ls1046afrwy = "ls1046ardb" | ||
| 7 | PLATFORM_FLAVOR:lx2162aqds = "lx2160aqds" | ||
| 8 | |||
| 9 | EXTRA_OEMAKE += " \ | ||
| 10 | PLATFORM=ls \ | ||
| 11 | CFG_ARM64_core=y \ | ||
| 12 | " | ||
| 13 | |||
| 14 | do_compile:append:ls1012afrwy() { | ||
| 15 | mv ${B}/core/tee-raw.bin ${B}/core/tee_512mb.bin | ||
| 16 | oe_runmake CFG_DRAM0_SIZE=0x40000000 all | ||
| 17 | } | ||
| 18 | |||
| 19 | do_install:append:qoriq() { | ||
| 20 | install -m 644 ${B}/core/tee-raw.bin ${D}${nonarch_base_libdir}/firmware/tee_${MACHINE}.bin | ||
| 21 | } | ||
| 22 | |||
| 23 | do_install:append:ls1012afrwy() { | ||
| 24 | install -m 644 ${B}/core/tee_512mb.bin ${D}${nonarch_base_libdir}/firmware/tee_${MACHINE}_512mb.bin | ||
| 25 | } | ||
| 26 | |||
| 27 | INHIBIT_PACKAGE_STRIP = "1" | ||
| 28 | COMPATIBLE_MACHINE = "(qoriq-arm64)" | ||
diff --git a/recipes-security/optee/optee-os-qoriq_3.8.0.bb b/recipes-security/optee/optee-os-qoriq_3.8.0.bb deleted file mode 100644 index f5d6d620e..000000000 --- a/recipes-security/optee/optee-os-qoriq_3.8.0.bb +++ /dev/null | |||
| @@ -1,83 +0,0 @@ | |||
| 1 | SUMMARY = "OP-TEE Trusted OS" | ||
| 2 | DESCRIPTION = "OPTEE OS" | ||
| 3 | |||
| 4 | LICENSE = "BSD" | ||
| 5 | LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=c1f21c4f72f372ef38a5a4aee55ec173" | ||
| 6 | |||
| 7 | PV = "3.8+git${SRCPV}" | ||
| 8 | |||
| 9 | DEPENDS += "python3-pyelftools-native python3-pycryptodome-native python3-pycryptodomex-native dtc-native" | ||
| 10 | |||
| 11 | inherit deploy python3native | ||
| 12 | |||
| 13 | SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/optee_os;nobranch=1 \ | ||
| 14 | file://0001-allow-setting-sysroot-for-libgcc-lookup.patch \ | ||
| 15 | file://0001-arm64-Disable-outline-atomics-when-compiling.patch \ | ||
| 16 | " | ||
| 17 | SRCREV = "0cb01f7f6aee552ead49990c06f69f73f459cc65" | ||
| 18 | |||
| 19 | S = "${WORKDIR}/git" | ||
| 20 | |||
| 21 | OPTEEMACHINE ?= "${MACHINE}" | ||
| 22 | OPTEEMACHINE:ls1088ardb-pb = "ls1088ardb" | ||
| 23 | OPTEEMACHINE:ls1046afrwy = "ls1046ardb" | ||
| 24 | OPTEEMACHINE:lx2162aqds = "lx2160aqds" | ||
| 25 | |||
| 26 | EXTRA_OEMAKE = "PLATFORM=ls-${OPTEEMACHINE} CFG_ARM64_core=y \ | ||
| 27 | ARCH=arm \ | ||
| 28 | CROSS_COMPILE_core=${HOST_PREFIX} \ | ||
| 29 | CROSS_COMPILE_ta_arm64=${HOST_PREFIX} \ | ||
| 30 | NOWERROR=1 \ | ||
| 31 | LDFLAGS= \ | ||
| 32 | LIBGCC_LOCATE_CFLAGS=--sysroot=${STAGING_DIR_HOST} \ | ||
| 33 | " | ||
| 34 | EXTRA_OEMAKE:append:lx2162aqds = " CFG_EMBED_DTB_SOURCE_FILE=fsl-lx2160a-qds.dts CFG_EMBED_DT=y" | ||
| 35 | |||
| 36 | OPTEE_ARCH:armv7a = "arm32" | ||
| 37 | OPTEE_ARCH:aarch64 = "arm64" | ||
| 38 | |||
| 39 | do_compile() { | ||
| 40 | unset LDFLAGS | ||
| 41 | oe_runmake all CFG_TEE_TA_LOG_LEVEL=0 | ||
| 42 | ${OBJCOPY} -v -O binary ${B}/out/arm-plat-ls/core/tee.elf ${B}/out/arm-plat-ls/core/tee.bin | ||
| 43 | |||
| 44 | if [ ${MACHINE} = ls1012afrwy ]; then | ||
| 45 | mv ${B}/out/arm-plat-ls/core/tee.bin ${B}/out/arm-plat-ls/core/tee_512mb.bin | ||
| 46 | oe_runmake CFG_DRAM0_SIZE=0x40000000 all CFG_TEE_TA_LOG_LEVEL=0 | ||
| 47 | ${OBJCOPY} -v -O binary ${B}/out/arm-plat-ls/core/tee.elf ${B}/out/arm-plat-ls/core/tee.bin | ||
| 48 | fi | ||
| 49 | } | ||
| 50 | |||
| 51 | do_install() { | ||
| 52 | #install core on boot directory | ||
| 53 | install -d ${D}/lib/firmware/ | ||
| 54 | if [ ${MACHINE} = ls1012afrwy ]; then | ||
| 55 | install -m 644 ${B}/out/arm-plat-ls/core/tee_512mb.bin ${D}/lib/firmware/tee_${MACHINE}_512mb.bin | ||
| 56 | fi | ||
| 57 | install -m 644 ${B}/out/arm-plat-ls/core/tee.bin ${D}/lib/firmware/tee_${MACHINE}.bin | ||
| 58 | #install TA devkit | ||
| 59 | install -d ${D}/usr/include/optee/export-user_ta/ | ||
| 60 | |||
| 61 | for f in ${B}/out/arm-plat-ls/export-ta_${OPTEE_ARCH}/* ; do | ||
| 62 | cp -aR $f ${D}/usr/include/optee/export-user_ta/ | ||
| 63 | done | ||
| 64 | } | ||
| 65 | |||
| 66 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
| 67 | |||
| 68 | do_deploy() { | ||
| 69 | install -d ${DEPLOYDIR}/optee | ||
| 70 | for f in ${D}/lib/firmware/*; do | ||
| 71 | cp $f ${DEPLOYDIR}/optee/ | ||
| 72 | done | ||
| 73 | } | ||
| 74 | |||
| 75 | addtask deploy before do_build after do_install | ||
| 76 | |||
| 77 | FILES:${PN} = "/lib/firmware/" | ||
| 78 | FILES:${PN}-dev = "/usr/include/optee" | ||
| 79 | |||
| 80 | INSANE_SKIP:${PN}-dev = "staticdev" | ||
| 81 | |||
| 82 | INHIBIT_PACKAGE_STRIP = "1" | ||
| 83 | COMPATIBLE_MACHINE = "(qoriq-arm64)" | ||
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 | |||
diff --git a/recipes-security/optee/optee-test-qoriq_3.13.0.bb b/recipes-security/optee/optee-test-qoriq_3.13.0.bb new file mode 100644 index 000000000..69ef73d3a --- /dev/null +++ b/recipes-security/optee/optee-test-qoriq_3.13.0.bb | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | require optee-test.nxp.inc | ||
| 2 | |||
| 3 | PV:append = "+git${SRCPV}" | ||
| 4 | |||
| 5 | DEPENDS += "optee-client-qoriq optee-os-qoriq" | ||
| 6 | |||
| 7 | TEEC_EXPORT = "${STAGING_DIR_HOST}${prefix}" | ||
| 8 | |||
| 9 | EXTRA_OEMAKE += " \ | ||
| 10 | TEEC_EXPORT=${TEEC_EXPORT} \ | ||
| 11 | " | ||
| 12 | |||
| 13 | COMPATIBLE_MACHINE = "(qoriq-arm64)" | ||
diff --git a/recipes-security/optee/optee-test-qoriq_3.8.0.bb b/recipes-security/optee/optee-test-qoriq_3.8.0.bb deleted file mode 100644 index 52cb1bbf9..000000000 --- a/recipes-security/optee/optee-test-qoriq_3.8.0.bb +++ /dev/null | |||
| @@ -1,47 +0,0 @@ | |||
| 1 | SUMMARY = "OP-TEE sanity testsuite" | ||
| 2 | HOMEPAGE = "https://github.com/OP-TEE/optee_test" | ||
| 3 | |||
| 4 | LICENSE = "BSD & GPLv2" | ||
| 5 | LIC_FILES_CHKSUM = "file://${S}/LICENSE.md;md5=daa2bcccc666345ab8940aab1315a4fa" | ||
| 6 | |||
| 7 | DEPENDS = "optee-client-qoriq optee-os-qoriq python3-pycryptodome-native python3-pycryptodomex-native" | ||
| 8 | |||
| 9 | inherit python3native | ||
| 10 | |||
| 11 | SRC_URI = "git://github.com/OP-TEE/optee_test;nobranch=1" | ||
| 12 | SRCREV = "30481e381cb4285706e7516853495a7699c93b2c" | ||
| 13 | |||
| 14 | S = "${WORKDIR}/git" | ||
| 15 | |||
| 16 | OPTEE_CLIENT_EXPORT = "${STAGING_DIR_HOST}${prefix}" | ||
| 17 | TEEC_EXPORT = "${STAGING_DIR_HOST}${prefix}" | ||
| 18 | TA_DEV_KIT_DIR = "${STAGING_INCDIR}/optee/export-user_ta" | ||
| 19 | |||
| 20 | EXTRA_OEMAKE = " TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \ | ||
| 21 | OPTEE_CLIENT_EXPORT=${OPTEE_CLIENT_EXPORT} \ | ||
| 22 | CFG_ARM64=y \ | ||
| 23 | CROSS_COMPILE_HOST=${TARGET_PREFIX} \ | ||
| 24 | CROSS_COMPILE_TA=${TARGET_PREFIX} \ | ||
| 25 | V=1 \ | ||
| 26 | " | ||
| 27 | |||
| 28 | do_compile() { | ||
| 29 | # Top level makefile doesn't seem to handle parallel make gracefully | ||
| 30 | oe_runmake xtest | ||
| 31 | oe_runmake ta | ||
| 32 | } | ||
| 33 | |||
| 34 | do_install () { | ||
| 35 | install -D -p -m0755 ${S}/out/xtest/xtest ${D}${bindir}/xtest | ||
| 36 | |||
| 37 | # install path should match the value set in optee-client/tee-supplicant | ||
| 38 | # default TEEC_LOAD_PATH is /lib | ||
| 39 | mkdir -p ${D}/lib/optee_armtz/ | ||
| 40 | install -D -p -m0444 ${S}/out/ta/*/*.ta ${D}/lib/optee_armtz/ | ||
| 41 | } | ||
| 42 | |||
| 43 | FILES:${PN} += "/lib/optee_armtz/" | ||
| 44 | |||
| 45 | # Imports machine specific configs from staging to build | ||
| 46 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
| 47 | COMPATIBLE_MACHINE = "(qoriq-arm64)" | ||
diff --git a/recipes-security/optee/optee-test.nxp.inc b/recipes-security/optee/optee-test.nxp.inc new file mode 100644 index 000000000..868776c54 --- /dev/null +++ b/recipes-security/optee/optee-test.nxp.inc | |||
| @@ -0,0 +1,61 @@ | |||
| 1 | # Copyright 2020-2021 NXP | ||
| 2 | |||
| 3 | SUMMARY = "OPTEE test" | ||
| 4 | HOMEPAGE = "http://www.optee.org/" | ||
| 5 | |||
| 6 | LICENSE = "BSD & GPLv2" | ||
| 7 | LIC_FILES_CHKSUM = "file://LICENSE.md;md5=daa2bcccc666345ab8940aab1315a4fa" | ||
| 8 | |||
| 9 | DEPENDS = "python3-pycryptodome-native python3-pycryptodomex-native openssl" | ||
| 10 | inherit python3native cmake | ||
| 11 | |||
| 12 | SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/optee_test.git;nobranch=1" | ||
| 13 | SRCREV = "69722dab8c1f2683e30e0ee3b536053367e37aad" | ||
| 14 | |||
| 15 | S = "${WORKDIR}/git" | ||
| 16 | B = "${WORKDIR}/build" | ||
| 17 | |||
| 18 | TA_DEV_KIT_DIR ?= "${STAGING_INCDIR}/optee/export-user_ta" | ||
| 19 | OPTEE_CLIENT_EXPORT ?= "${STAGING_DIR_HOST}${prefix}" | ||
| 20 | |||
| 21 | EXTRA_OEMAKE = " \ | ||
| 22 | TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \ | ||
| 23 | OPTEE_CLIENT_EXPORT=${OPTEE_CLIENT_EXPORT} \ | ||
| 24 | CROSS_COMPILE_HOST=${HOST_PREFIX} \ | ||
| 25 | CROSS_COMPILE_TA=${HOST_PREFIX} \ | ||
| 26 | OPTEE_OPENSSL_EXPORT=${STAGING_INCDIR}/ \ | ||
| 27 | -C ${S} O=${B} \ | ||
| 28 | " | ||
| 29 | |||
| 30 | EXTRA_OECMAKE = " \ | ||
| 31 | -DOPTEE_TEST_SDK=${TA_DEV_KIT_DIR} \ | ||
| 32 | " | ||
| 33 | |||
| 34 | do_compile() { | ||
| 35 | export CXXFLAGS="${CXXFLAGS} --sysroot=${STAGING_DIR_HOST}" | ||
| 36 | oe_runmake xtest | ||
| 37 | oe_runmake ta | ||
| 38 | oe_runmake test_plugin | ||
| 39 | } | ||
| 40 | |||
| 41 | do_install() { | ||
| 42 | install -d ${D}${bindir}/ | ||
| 43 | install ${B}/xtest/xtest ${D}${bindir}/ | ||
| 44 | |||
| 45 | install -d ${D}${nonarch_base_libdir}/optee_armtz | ||
| 46 | find ${B}/ta -name '*.ta' | while read name; do | ||
| 47 | install -m 444 $name ${D}${nonarch_base_libdir}/optee_armtz/ | ||
| 48 | done | ||
| 49 | |||
| 50 | install -d ${D}${libdir}/tee-supplicant/plugins/ | ||
| 51 | find ${B}/supp_plugin -name '*.plugin' | while read name; do | ||
| 52 | install -m 755 $name ${D}${libdir}/tee-supplicant/plugins/ | ||
| 53 | done | ||
| 54 | } | ||
| 55 | |||
| 56 | FILES:${PN} += "${nonarch_base_libdir} ${libdir}/tee-supplicant/plugins/" | ||
| 57 | |||
| 58 | DEBUG_OPTIMIZATION:append = " -Wno-error=maybe-uninitialized -Wno-deprecated-declarations" | ||
| 59 | FULL_OPTIMIZATION:append = " -Wno-error=maybe-uninitialized -Wno-deprecated-declarations" | ||
| 60 | |||
| 61 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
