diff options
Diffstat (limited to 'recipes-security/optee-qoriq')
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 @@ | |||
1 | require optee-client.nxp.inc | ||
2 | |||
3 | PV:append = "+git${SRCPV}" | ||
4 | |||
5 | COMPATIBLE_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 | |||
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-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] | ||
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-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 @@ | |||
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-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 | |||
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}" | ||
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 @@ | |||
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-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 | |||
3 | SUMMARY = "OPTEE test" | ||
4 | HOMEPAGE = "http://www.optee.org/" | ||
5 | |||
6 | LICENSE = "BSD & GPL-2.0-only" | ||
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}" | ||