Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 1 | SUMMARY = "Trusted Services secure partitions" |
| 2 | HOMEPAGE = "https://trusted-services.readthedocs.io/en/latest/index.html" |
| 3 | |
| 4 | COMPATIBLE_MACHINE ?= "invalid" |
| 5 | |
| 6 | PACKAGE_ARCH = "${MACHINE_ARCH}" |
| 7 | |
| 8 | require secure-partitions.inc |
| 9 | |
| 10 | SRCREV_FORMAT = "ts" |
| 11 | PV = "0.0+git${SRCPV}" |
| 12 | |
| 13 | # Which environment to create the secure partions for (opteesp or shim) |
| 14 | TS_ENVIRONMENT ?= "opteesp" |
| 15 | |
| 16 | inherit deploy python3native |
| 17 | |
| 18 | DEPENDS = "python3-pycryptodome-native python3-pycryptodomex-native \ |
| 19 | python3-pyelftools-native python3-grpcio-tools-native \ |
| 20 | python3-protobuf-native protobuf-native cmake-native \ |
| 21 | " |
| 22 | |
| 23 | DEPENDS:append = " ${@bb.utils.contains('TS_ENVIRONMENT', 'opteesp', 'optee-spdevkit', '', d)}" |
| 24 | |
| 25 | export CROSS_COMPILE="${TARGET_PREFIX}" |
| 26 | |
| 27 | CFLAGS[unexport] = "1" |
| 28 | CPPFLAGS[unexport] = "1" |
| 29 | AS[unexport] = "1" |
| 30 | LD[unexport] = "1" |
| 31 | |
| 32 | # only used if TS_ENVIRONMENT is opteesp |
| 33 | SP_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 |
| 36 | SP_PACKAGING_METHOD ?= "embedded" |
| 37 | |
| 38 | do_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 | |
| 49 | do_compile() { |
| 50 | for TS_DEPLOYMENT in ${TS_DEPLOYMENTS}; do |
| 51 | cmake --build "${B}/$TS_DEPLOYMENT" |
| 52 | done |
| 53 | } |
| 54 | |
| 55 | do_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 | |
| 63 | SYSROOT_DIRS = "/firmware" |
| 64 | |
| 65 | do_deploy() { |
| 66 | cp -rf ${D}/firmware/* ${DEPLOYDIR}/ |
| 67 | } |
| 68 | addtask deploy after do_install |
| 69 | |
| 70 | FILES:${PN} = "/firmware/sp/opteesp*" |
| 71 | |
| 72 | # Build paths are currently embedded |
| 73 | INSANE_SKIP:${PN} += "buildpaths" |
| 74 | INSANE_SKIP:${PN}-dbg += "buildpaths" |