summaryrefslogtreecommitdiffstats
path: root/recipes-security/optee-qoriq
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-security/optee-qoriq')
-rw-r--r--recipes-security/optee-qoriq/optee-client-qoriq_3.13.0.bb5
-rw-r--r--recipes-security/optee-qoriq/optee-client.nxp.inc53
-rw-r--r--recipes-security/optee-qoriq/optee-client/tee-supplicant.service11
-rw-r--r--recipes-security/optee-qoriq/optee-os-qoriq_3.13.0.bb28
-rw-r--r--recipes-security/optee-qoriq/optee-os.nxp.inc75
-rw-r--r--recipes-security/optee-qoriq/optee-test-qoriq_3.13.0.bb13
-rw-r--r--recipes-security/optee-qoriq/optee-test.nxp.inc61
7 files changed, 246 insertions, 0 deletions
diff --git a/recipes-security/optee-qoriq/optee-client-qoriq_3.13.0.bb b/recipes-security/optee-qoriq/optee-client-qoriq_3.13.0.bb
new file mode 100644
index 00000000..94123e43
--- /dev/null
+++ b/recipes-security/optee-qoriq/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-qoriq/optee-client.nxp.inc b/recipes-security/optee-qoriq/optee-client.nxp.inc
new file mode 100644
index 00000000..fa187e84
--- /dev/null
+++ b/recipes-security/optee-qoriq/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-qoriq/optee-client/tee-supplicant.service b/recipes-security/optee-qoriq/optee-client/tee-supplicant.service
new file mode 100644
index 00000000..0e2b4f6b
--- /dev/null
+++ b/recipes-security/optee-qoriq/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-qoriq/optee-os-qoriq_3.13.0.bb b/recipes-security/optee-qoriq/optee-os-qoriq_3.13.0.bb
new file mode 100644
index 00000000..3c3652d3
--- /dev/null
+++ b/recipes-security/optee-qoriq/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-qoriq/optee-os.nxp.inc b/recipes-security/optee-qoriq/optee-os.nxp.inc
new file mode 100644
index 00000000..72af6ca4
--- /dev/null
+++ b/recipes-security/optee-qoriq/optee-os.nxp.inc
@@ -0,0 +1,75 @@
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}"
diff --git a/recipes-security/optee-qoriq/optee-test-qoriq_3.13.0.bb b/recipes-security/optee-qoriq/optee-test-qoriq_3.13.0.bb
new file mode 100644
index 00000000..69ef73d3
--- /dev/null
+++ b/recipes-security/optee-qoriq/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-qoriq/optee-test.nxp.inc b/recipes-security/optee-qoriq/optee-test.nxp.inc
new file mode 100644
index 00000000..e3ba0c8e
--- /dev/null
+++ b/recipes-security/optee-qoriq/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 & GPL-2.0-only"
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}"