blob: 89d3f96519d91bc56f06a386e73ffd9b9ac9c967 [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001inherit workonsrc
2inherit deploy
3inherit optee-build
4DEPENDS = "python-pycrypto-native"
5
6inherit pythonnative
7
8DESCRIPTION = "OPTEE TESTSUITE"
9LICENSE = "BSD-2-Clause & GPL-2.0"
10PLATFORM_TYPE = "${@d.getVar('TARGET_PLATFORM', True)[0:3]+'xxx'}"
11OVERRIDES_append = ":${PLATFORM_TYPE}"
12TZ_SRC = "${TOPDIR}/../src/bsp/trustzone"
13WORKONSRC = "${TZ_SRC}/optee/3.2.0/source/optee_test"
14WORKONSRC_mt2xxx = "${TZ_SRC}/optee/optee_test/mt2xxx"
15WORKONSRC_BUILD = "${TZ_SRC}/optee/3.2.0/source/optee_test"
16WORKONSRC_BUILD_mt2xxx = "${TZ_SRC}/optee/optee_test/mt2xxx"
17LIC_FILES_CHKSUM = "file://${S}/LICENSE.md;md5=daa2bcccc666345ab8940aab1315a4fa"
18DEPENDS += "optee-client openssl"
19DEPENDS_append_mt2xxx = " optee-os "
20DEPENDS_append_mt8xxx = " lib64-optee-os "
21OPTEE_CLIENT_EXPORT = "${STAGING_DIR_HOST}${prefix}"
22OPTEE_OPENSSL_EXPORT = "${STAGING_INCDIR}"
23TEEC_EXPORT = "${STAGING_DIR_HOST}${prefix}"
24TA_DEV_KIT_DIR_mt2xxx = "${STAGING_INCDIR}/optee/export-user_ta"
25
26OPTEE_ARCH = "${TEE_ARCH}"
27TEE_TOOLCHAIN_mt2xxx = "${TARGET_PREFIX}"
28DEPENDS += "virtual/${TARGET_PREFIX}gcc"
29
30EXTRA_OEMAKE = " TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \
31 OPTEE_CLIENT_EXPORT=${OPTEE_CLIENT_EXPORT} \
32 OPTEE_OPENSSL_EXPORT=${OPTEE_OPENSSL_EXPORT} \
33 TEEC_EXPORT=${TEEC_EXPORT} \
34 CROSS_COMPILE_HOST=${TARGET_PREFIX} \
35 CROSS_COMPILE_TA=${TEE_TOOLCHAIN} \
36 V=1 \
37 O=${WORKDIR}/out \
38 COMPILE_NS_USER=32 \
39 "
40
41do_compile() {
42 # Top level makefile doesn't seem to handle parallel make gracefully
43if ${@bb.utils.contains('PLATFORM_TYPE','mt2xxx','false','true',d)}; then
44 export LD_LIBRARY_PATH=${OPTEE_LIB64}:${LD_LIBRARY_PATH}
45 export PATH=${OPTEE_BULID_SA}:${PATH}
46fi
47 oe_runmake xtest
48 oe_runmake ta
49}
50
51do_install () {
52 install -D -p -m0755 ${WORKDIR}/out/xtest/xtest ${D}${bindir}/xtest
53
54 # install path should match the value set in optee-client/tee-supplicant
55 # default TEEC_LOAD_PATH is /lib
56 mkdir -p ${D}${nonarch_base_libdir}/optee_armtz/
57 install -D -p -m0444 ${WORKDIR}/out/ta/*/*.ta ${D}${nonarch_base_libdir}/optee_armtz/
58}
59
60FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/"
61
62# Imports machine specific configs from staging to build
63PACKAGE_ARCH = "${MACHINE_ARCH}"