blob: fca6d9d3c9acb8641a046722f24f0b824029449b [file] [log] [blame]
Brad Bishopbec4ebc2022-08-03 09:55:16 -04001SUMMARY = "Trusted Services secure partitions"
2HOMEPAGE = "https://trusted-services.readthedocs.io/en/latest/index.html"
3
4COMPATIBLE_MACHINE ?= "invalid"
5
6PACKAGE_ARCH = "${MACHINE_ARCH}"
7
8require secure-partitions.inc
9
10SRCREV_FORMAT = "ts"
11PV = "0.0+git${SRCPV}"
12
13# Which environment to create the secure partions for (opteesp or shim)
14TS_ENVIRONMENT ?= "opteesp"
15
16inherit deploy python3native
17
18DEPENDS = "python3-pycryptodome-native python3-pycryptodomex-native \
19 python3-pyelftools-native python3-grpcio-tools-native \
20 python3-protobuf-native protobuf-native cmake-native \
21 "
22
23DEPENDS:append = " ${@bb.utils.contains('TS_ENVIRONMENT', 'opteesp', 'optee-spdevkit', '', d)}"
24
25export CROSS_COMPILE="${TARGET_PREFIX}"
26
27CFLAGS[unexport] = "1"
28CPPFLAGS[unexport] = "1"
29AS[unexport] = "1"
30LD[unexport] = "1"
31
32# only used if TS_ENVIRONMENT is opteesp
33SP_DEV_KIT_DIR = "${@bb.utils.contains('TS_ENVIRONMENT', 'opteesp', '${STAGING_INCDIR}/optee/export-user_sp', '', d)}"
34
35# SP images are embedded into optee os image
36SP_PACKAGING_METHOD ?= "embedded"
37
38do_configure() {
39 for TS_DEPLOYMENT in ${TS_DEPLOYMENTS}; do
40 cmake \
41 -DCMAKE_INSTALL_PREFIX=${D}/firmware/sp \
42 -DSP_DEV_KIT_DIR=${SP_DEV_KIT_DIR} \
43 -DSP_PACKAGING_METHOD=${SP_PACKAGING_METHOD} \
44 -DTS_PLATFORM="${TS_PLATFORM}" \
45 -S ${S}/$TS_DEPLOYMENT -B "${B}/$TS_DEPLOYMENT"
46 done
47}
48
49do_compile() {
50 for TS_DEPLOYMENT in ${TS_DEPLOYMENTS}; do
51 cmake --build "${B}/$TS_DEPLOYMENT"
52 done
53}
54
55do_install () {
56 if [ "${TS_ENVIRONMENT}" = "opteesp" ]; then
57 for TS_DEPLOYMENT in ${TS_DEPLOYMENTS}; do
58 cmake --install "${B}/$TS_DEPLOYMENT"
59 done
60 fi
61}
62
63SYSROOT_DIRS = "/firmware"
64
65do_deploy() {
66 cp -rf ${D}/firmware/* ${DEPLOYDIR}/
67}
68addtask deploy after do_install
69
70FILES:${PN} = "/firmware/sp/opteesp*"
71
72# Build paths are currently embedded
73INSANE_SKIP:${PN} += "buildpaths"
74INSANE_SKIP:${PN}-dbg += "buildpaths"