summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTing Liu <ting.liu@nxp.com>2021-10-14 16:03:50 +0800
committerTing Liu <ting.liu@nxp.com>2021-10-15 22:11:36 +0800
commita17caf57cc1845f4ebfea825f2803dd9cbb50948 (patch)
treecbfd4a66a0cc666fa952442cc6bf047483473476
parent115d33d607bbf3b743a8047861883e0275271222 (diff)
downloadmeta-freescale-a17caf57cc1845f4ebfea825f2803dd9cbb50948.tar.gz
optee-qoriq: upgrade to 3.13
Signed-off-by: Ting Liu <ting.liu@nxp.com>
-rw-r--r--recipes-security/optee/optee-client-qoriq_3.13.0.bb5
-rw-r--r--recipes-security/optee/optee-client-qoriq_3.8.0.bb28
-rw-r--r--recipes-security/optee/optee-client.nxp.inc53
-rw-r--r--recipes-security/optee/optee-client/tee-supplicant.service11
-rw-r--r--recipes-security/optee/optee-os-qoriq/0001-allow-setting-sysroot-for-libgcc-lookup.patch13
-rw-r--r--recipes-security/optee/optee-os-qoriq/0001-arm64-Disable-outline-atomics-when-compiling.patch41
-rw-r--r--recipes-security/optee/optee-os-qoriq_3.13.0.bb28
-rw-r--r--recipes-security/optee/optee-os-qoriq_3.8.0.bb83
-rw-r--r--recipes-security/optee/optee-os.nxp.inc76
-rw-r--r--recipes-security/optee/optee-test-qoriq_3.13.0.bb13
-rw-r--r--recipes-security/optee/optee-test-qoriq_3.8.0.bb47
-rw-r--r--recipes-security/optee/optee-test.nxp.inc61
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 00000000..94123e43
--- /dev/null
+++ b/recipes-security/optee/optee-client-qoriq_3.13.0.bb
@@ -0,0 +1,5 @@
1require optee-client.nxp.inc
2
3PV:append = "+git${SRCPV}"
4
5COMPATIBLE_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 0cd9eeab..00000000
--- a/recipes-security/optee/optee-client-qoriq_3.8.0.bb
+++ /dev/null
@@ -1,28 +0,0 @@
1SUMMARY = "OPTEE Client"
2HOMEPAGE = "https://github.com/OP-TEE/optee_client"
3
4LICENSE = "BSD"
5LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=69663ab153298557a59c67a60a743e5b"
6
7inherit python3native systemd
8
9SRC_URI = "git://github.com/OP-TEE/optee_client;nobranch=1"
10SRCREV = "be4fa2e36f717f03ca46e574aa66f697a897d090"
11
12S = "${WORKDIR}/git"
13
14EXTRA_OEMAKE = "ARCH=arm64"
15
16do_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
28COMPATIBLE_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 00000000..de2ba8ae
--- /dev/null
+++ b/recipes-security/optee/optee-client.nxp.inc
@@ -0,0 +1,53 @@
1# Copyright 2020-2021 NXP
2
3SUMMARY = "OPTEE Client libs"
4HOMEPAGE = "http://www.optee.org/"
5LICENSE = "BSD"
6LIC_FILES_CHKSUM = "file://LICENSE;md5=69663ab153298557a59c67a60a743e5b"
7
8inherit python3native systemd
9
10SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/optee_client.git;nobranch=1"
11SRCREV = "7c9c423d00e96bf51debd5fe10fd70dce83be5cc"
12
13FILESEXTRAPATHS:prepend := "${THISDIR}/optee-client:"
14SRC_URI += "file://tee-supplicant.service"
15
16S = "${WORKDIR}/git"
17B = "${WORKDIR}/build"
18
19OPTEE_ARCH ?= "arm32"
20OPTEE_ARCH_armv7a = "arm32"
21OPTEE_ARCH:aarch64 = "arm64"
22
23EXTRA_OEMAKE = "ARCH=${OPTEE_ARCH} O=${B}"
24
25do_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
48SYSTEMD_SERVICE:${PN} = "tee-supplicant.service"
49
50FILES:${PN} += "${libdir}/* ${includedir}/*"
51
52INSANE_SKIP:${PN} = "ldflags dev-elf"
53INSANE_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 00000000..0e2b4f6b
--- /dev/null
+++ b/recipes-security/optee/optee-client/tee-supplicant.service
@@ -0,0 +1,11 @@
1[Unit]
2Description=TEE Supplicant
3
4[Service]
5User=root
6EnvironmentFile=-/etc/default/tee-supplicant
7ExecStart=/usr/bin/tee-supplicant $OPTARGS
8
9[Install]
10WantedBy=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 17127d0b..00000000
--- a/recipes-security/optee/optee-os-qoriq/0001-allow-setting-sysroot-for-libgcc-lookup.patch
+++ /dev/null
@@ -1,13 +0,0 @@
1diff --git a/mk/gcc.mk b/mk/gcc.mk
2index 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 086d4333..00000000
--- a/recipes-security/optee/optee-os-qoriq/0001-arm64-Disable-outline-atomics-when-compiling.patch
+++ /dev/null
@@ -1,41 +0,0 @@
1From f94d9558d9eae48e92ce8d651539b6cf69eb4394 Mon Sep 17 00:00:00 2001
2From: Joshua Watt <JPEWhacker@gmail.com>
3Date: Mon, 18 May 2020 20:00:00 -0500
4Subject: [PATCH] arm64: Disable outline-atomics when compiling
5
6Disables the automatic detection of LSE (Large System Extension)
7instructions when compiling AArch64 code. GCC 10 implements this
8detection in libgcc using __getauxval(), which optee doesn't implement.
9This requires that the proper -mcpu is passed to GCC so that the code
10can be correctly compiled to use either LSE or load-store-exclusive.
11
12Fixes 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
20Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
21Upstream-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
26diff --git a/core/arch/arm/arm.mk b/core/arch/arm/arm.mk
27index 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--
402.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 00000000..3c3652d3
--- /dev/null
+++ b/recipes-security/optee/optee-os-qoriq_3.13.0.bb
@@ -0,0 +1,28 @@
1require optee-os.nxp.inc
2
3PV:append = "+git${SRCPV}"
4
5PLATFORM_FLAVOR:ls1088ardb-pb = "ls1088ardb"
6PLATFORM_FLAVOR:ls1046afrwy = "ls1046ardb"
7PLATFORM_FLAVOR:lx2162aqds = "lx2160aqds"
8
9EXTRA_OEMAKE += " \
10 PLATFORM=ls \
11 CFG_ARM64_core=y \
12"
13
14do_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
19do_install:append:qoriq() {
20 install -m 644 ${B}/core/tee-raw.bin ${D}${nonarch_base_libdir}/firmware/tee_${MACHINE}.bin
21}
22
23do_install:append:ls1012afrwy() {
24 install -m 644 ${B}/core/tee_512mb.bin ${D}${nonarch_base_libdir}/firmware/tee_${MACHINE}_512mb.bin
25}
26
27INHIBIT_PACKAGE_STRIP = "1"
28COMPATIBLE_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 f5d6d620..00000000
--- a/recipes-security/optee/optee-os-qoriq_3.8.0.bb
+++ /dev/null
@@ -1,83 +0,0 @@
1SUMMARY = "OP-TEE Trusted OS"
2DESCRIPTION = "OPTEE OS"
3
4LICENSE = "BSD"
5LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=c1f21c4f72f372ef38a5a4aee55ec173"
6
7PV = "3.8+git${SRCPV}"
8
9DEPENDS += "python3-pyelftools-native python3-pycryptodome-native python3-pycryptodomex-native dtc-native"
10
11inherit deploy python3native
12
13SRC_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 "
17SRCREV = "0cb01f7f6aee552ead49990c06f69f73f459cc65"
18
19S = "${WORKDIR}/git"
20
21OPTEEMACHINE ?= "${MACHINE}"
22OPTEEMACHINE:ls1088ardb-pb = "ls1088ardb"
23OPTEEMACHINE:ls1046afrwy = "ls1046ardb"
24OPTEEMACHINE:lx2162aqds = "lx2160aqds"
25
26EXTRA_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 "
34EXTRA_OEMAKE:append:lx2162aqds = " CFG_EMBED_DTB_SOURCE_FILE=fsl-lx2160a-qds.dts CFG_EMBED_DT=y"
35
36OPTEE_ARCH:armv7a = "arm32"
37OPTEE_ARCH:aarch64 = "arm64"
38
39do_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
51do_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
66PACKAGE_ARCH = "${MACHINE_ARCH}"
67
68do_deploy() {
69 install -d ${DEPLOYDIR}/optee
70 for f in ${D}/lib/firmware/*; do
71 cp $f ${DEPLOYDIR}/optee/
72 done
73}
74
75addtask deploy before do_build after do_install
76
77FILES:${PN} = "/lib/firmware/"
78FILES:${PN}-dev = "/usr/include/optee"
79
80INSANE_SKIP:${PN}-dev = "staticdev"
81
82INHIBIT_PACKAGE_STRIP = "1"
83COMPATIBLE_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 00000000..f376b3ce
--- /dev/null
+++ b/recipes-security/optee/optee-os.nxp.inc
@@ -0,0 +1,76 @@
1# Copyright 2020-2021 NXP
2
3SUMMARY = "OPTEE OS"
4DESCRIPTION = "OPTEE OS"
5HOMEPAGE = "http://www.optee.org/"
6LICENSE = "BSD"
7LIC_FILES_CHKSUM = "file://LICENSE;md5=c1f21c4f72f372ef38a5a4aee55ec173"
8
9inherit deploy python3native autotools
10DEPENDS = "python3-pycryptodome-native python3-pyelftools-native python3-pycryptodomex-native dtc-native"
11
12SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/optee_os.git;nobranch=1"
13SRCREV = "735d98806dc26fbeeecad7f5e60ffeab8170c67e"
14
15S = "${WORKDIR}/git"
16B = "${WORKDIR}/build.${PLATFORM_FLAVOR}"
17
18PLATFORM_FLAVOR ?= "${MACHINE}"
19
20OPTEE_ARCH ?= "arm64"
21OPTEE_ARCH_armv7a = "arm32"
22OPTEE_ARCH:aarch64 = "arm64"
23
24OPTEE_CORE_LOG_LEVEL ?= "1"
25OPTEE_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
32EXTRA_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
42do_compile() {
43 unset LDFLAGS
44 export CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_HOST}"
45 oe_runmake all
46}
47
48do_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
65do_deploy() {
66 install -d ${DEPLOYDIR}/optee
67 install -m 644 ${D}${nonarch_base_libdir}/firmware/* ${DEPLOYDIR}/optee/
68}
69addtask deploy before do_build after do_install
70
71FILES:${PN} = "${nonarch_base_libdir}/firmware/ ${nonarch_base_libdir}/optee_armtz/"
72FILES:${PN}-staticdev = "/usr/include/optee/"
73RDEPENDS:${PN}-dev += "${PN}-staticdev"
74
75PACKAGE_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 00000000..69ef73d3
--- /dev/null
+++ b/recipes-security/optee/optee-test-qoriq_3.13.0.bb
@@ -0,0 +1,13 @@
1require optee-test.nxp.inc
2
3PV:append = "+git${SRCPV}"
4
5DEPENDS += "optee-client-qoriq optee-os-qoriq"
6
7TEEC_EXPORT = "${STAGING_DIR_HOST}${prefix}"
8
9EXTRA_OEMAKE += " \
10 TEEC_EXPORT=${TEEC_EXPORT} \
11"
12
13COMPATIBLE_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 52cb1bbf..00000000
--- a/recipes-security/optee/optee-test-qoriq_3.8.0.bb
+++ /dev/null
@@ -1,47 +0,0 @@
1SUMMARY = "OP-TEE sanity testsuite"
2HOMEPAGE = "https://github.com/OP-TEE/optee_test"
3
4LICENSE = "BSD & GPLv2"
5LIC_FILES_CHKSUM = "file://${S}/LICENSE.md;md5=daa2bcccc666345ab8940aab1315a4fa"
6
7DEPENDS = "optee-client-qoriq optee-os-qoriq python3-pycryptodome-native python3-pycryptodomex-native"
8
9inherit python3native
10
11SRC_URI = "git://github.com/OP-TEE/optee_test;nobranch=1"
12SRCREV = "30481e381cb4285706e7516853495a7699c93b2c"
13
14S = "${WORKDIR}/git"
15
16OPTEE_CLIENT_EXPORT = "${STAGING_DIR_HOST}${prefix}"
17TEEC_EXPORT = "${STAGING_DIR_HOST}${prefix}"
18TA_DEV_KIT_DIR = "${STAGING_INCDIR}/optee/export-user_ta"
19
20EXTRA_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
28do_compile() {
29 # Top level makefile doesn't seem to handle parallel make gracefully
30 oe_runmake xtest
31 oe_runmake ta
32}
33
34do_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
43FILES:${PN} += "/lib/optee_armtz/"
44
45# Imports machine specific configs from staging to build
46PACKAGE_ARCH = "${MACHINE_ARCH}"
47COMPATIBLE_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 00000000..868776c5
--- /dev/null
+++ b/recipes-security/optee/optee-test.nxp.inc
@@ -0,0 +1,61 @@
1# Copyright 2020-2021 NXP
2
3SUMMARY = "OPTEE test"
4HOMEPAGE = "http://www.optee.org/"
5
6LICENSE = "BSD & GPLv2"
7LIC_FILES_CHKSUM = "file://LICENSE.md;md5=daa2bcccc666345ab8940aab1315a4fa"
8
9DEPENDS = "python3-pycryptodome-native python3-pycryptodomex-native openssl"
10inherit python3native cmake
11
12SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/optee_test.git;nobranch=1"
13SRCREV = "69722dab8c1f2683e30e0ee3b536053367e37aad"
14
15S = "${WORKDIR}/git"
16B = "${WORKDIR}/build"
17
18TA_DEV_KIT_DIR ?= "${STAGING_INCDIR}/optee/export-user_ta"
19OPTEE_CLIENT_EXPORT ?= "${STAGING_DIR_HOST}${prefix}"
20
21EXTRA_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
30EXTRA_OECMAKE = " \
31 -DOPTEE_TEST_SDK=${TA_DEV_KIT_DIR} \
32"
33
34do_compile() {
35 export CXXFLAGS="${CXXFLAGS} --sysroot=${STAGING_DIR_HOST}"
36 oe_runmake xtest
37 oe_runmake ta
38 oe_runmake test_plugin
39}
40
41do_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
56FILES:${PN} += "${nonarch_base_libdir} ${libdir}/tee-supplicant/plugins/"
57
58DEBUG_OPTIMIZATION:append = " -Wno-error=maybe-uninitialized -Wno-deprecated-declarations"
59FULL_OPTIMIZATION:append = " -Wno-error=maybe-uninitialized -Wno-deprecated-declarations"
60
61PACKAGE_ARCH = "${MACHINE_ARCH}"