forked from ilbers/isar
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The TA dev kit is used to build trusted applications, details refer to [1]. A typical use case of this devkit is a firmware TPM reference implementation, see [2]. 1. https://optee.readthedocs.io/en/3.21.0/building/trusted_applications.html 2. https://github.com/microsoft/ms-tpm-20-ref This brings the .inc for customization, and also an example for stm32mp15x. Signed-off-by: Baocheng Su <baocheng.su@siemens.com>
- Loading branch information
1 parent
a3bf550
commit f5abd17
Showing
7 changed files
with
94 additions
and
50 deletions.
There are no files selected for viewing
25 changes: 2 additions & 23 deletions
25
meta-isar/recipes-bsp/optee-os/optee-os-stm32mp15x_3.21.0.bb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,8 @@ | ||
# | ||
# Copyright (c) Siemens AG, 2020 | ||
# Copyright (c) Siemens AG, 2020-2023 | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
require recipes-bsp/optee-os/optee-os-custom.inc | ||
require optee-os-stm32mp15x_${PV}.inc | ||
|
||
SRC_URI += "https://github.com/OP-TEE/optee_os/archive/${PV}.tar.gz" | ||
SRC_URI[sha256sum] = "92a16e841b0bdb4bfcb1c20b6a1bd3309092203d534ed167dfdb5a5f395bf60b" | ||
|
||
S = "${WORKDIR}/optee_os-${PV}" | ||
|
||
DEBIAN_BUILD_DEPENDS += ", device-tree-compiler, python3-cryptography:native" | ||
|
||
OPTEE_PLATFORM = "stm32mp1" | ||
OPTEE_EXTRA_BUILDARGS = " \ | ||
ARCH=arm CFG_EMBED_DTB_SOURCE_FILE=stm32mp157c-ev1.dts \ | ||
CFG_TEE_CORE_LOG_LEVEL=2" | ||
OPTEE_BINARIES = "tee-header_v2.stm32 tee-pageable_v2.stm32 tee-pager_v2.stm32" | ||
|
||
# Set version manually to PV, the tarball does not contain any hint. | ||
# Alternative: pull from git and add git as build dependency. | ||
dpkg_runbuild:prepend() { | ||
grep -q "^export TEE_IMPL_VERSION" ${S}/debian/rules || | ||
cat << EOF >> ${S}/debian/rules | ||
|
||
export TEE_IMPL_VERSION=${PV} | ||
EOF | ||
} |
18 changes: 18 additions & 0 deletions
18
meta-isar/recipes-bsp/optee-os/optee-os-stm32mp15x_3.21.0.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# | ||
# Copyright (c) Siemens AG, 2020-2023 | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
SRC_URI += "https://github.com/OP-TEE/optee_os/archive/${PV}.tar.gz;downloadfilename=optee_os-${PV}.tar.gz" | ||
SRC_URI[sha256sum] = "92a16e841b0bdb4bfcb1c20b6a1bd3309092203d534ed167dfdb5a5f395bf60b" | ||
|
||
S = "${WORKDIR}/optee_os-${PV}" | ||
|
||
DEBIAN_BUILD_DEPENDS += ", device-tree-compiler, python3-cryptography:native" | ||
|
||
OPTEE_PLATFORM = "stm32mp1" | ||
OPTEE_EXTRA_BUILDARGS = " \ | ||
TEE_IMPL_VERSION=${PV} \ | ||
ARCH=arm CFG_EMBED_DTB_SOURCE_FILE=stm32mp157c-ev1.dts \ | ||
CFG_TEE_CORE_LOG_LEVEL=2" | ||
OPTEE_BINARIES = "tee-header_v2.stm32 tee-pageable_v2.stm32 tee-pager_v2.stm32" |
7 changes: 7 additions & 0 deletions
7
meta-isar/recipes-bsp/optee-os/optee-os-tadevkit-stm32mp15x_3.21.0.bb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# | ||
# Copyright (c) Siemens AG, 2023 | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
require recipes-bsp/optee-os/optee-os-tadevkit-custom.inc | ||
require optee-os-stm32mp15x_${PV}.inc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Custom OP-TEE OS build for TA devkit | ||
# | ||
# This software is a part of ISAR. | ||
# Copyright (c) Siemens AG, 2023 | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
require optee-os.inc | ||
|
||
DEBIAN_PACKAGE_NAME = "optee-os-tadevkit-${OPTEE_NAME}" | ||
DESCRIPTION:append = ", trust application development kit." | ||
|
||
PROVIDES += "${DEBIAN_PACKAGE_NAME}" | ||
|
||
do_prepare_build:append() { | ||
if [ "${DISTRO_ARCH}" = "arm64" ]; then | ||
TADEVKIT_DIR="export-ta_arm64" | ||
elif [ "${DISTRO_ARCH}" = "armhf" ]; then | ||
TADEVKIT_DIR="export-ta_arm32" | ||
else | ||
bbfatal "${DISTRO_ARCH} does not have a compat arch for optee TA devkit!" | ||
fi | ||
|
||
echo "out/arm-plat-${OPTEE_PLATFORM_BASE}/${TADEVKIT_DIR} /usr/lib/optee-os/${OPTEE_NAME}/" > \ | ||
${S}/debian/optee-os-tadevkit-${OPTEE_NAME}.install | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Custom OP-TEE OS build | ||
# | ||
# This software is a part of ISAR. | ||
# Copyright (c) Siemens AG, 2020-2023 | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
inherit dpkg | ||
|
||
FILESEXTRAPATHS:prepend := "${FILE_DIRNAME}/files:" | ||
|
||
SRC_URI += "file://debian/" | ||
|
||
DESCRIPTION ?= "Custom OP-TEE OS" | ||
|
||
OPTEE_NAME ?= "${MACHINE}" | ||
OPTEE_PLATFORM ?= "unknown" | ||
OPTEE_EXTRA_BUILDARGS ?= "" | ||
OPTEE_BINARIES ?= "tee-pager_v2.bin" | ||
|
||
DEBIAN_PACKAGE_NAME ?= "optee-os-${OPTEE_NAME}" | ||
|
||
DEBIAN_BUILD_DEPENDS ?= "python3-pycryptodome:native, python3-pyelftools" | ||
|
||
TEMPLATE_FILES = "debian/control.tmpl debian/rules.tmpl" | ||
TEMPLATE_VARS += "DEBIAN_PACKAGE_NAME OPTEE_NAME DEBIAN_BUILD_DEPENDS OPTEE_PLATFORM OPTEE_EXTRA_BUILDARGS" | ||
|
||
# split strip platform flavor, if any, from the specified platform string | ||
OPTEE_PLATFORM_BASE = "${@d.getVar('OPTEE_PLATFORM').split('-')[0]}" | ||
|
||
do_prepare_build() { | ||
cp -r ${WORKDIR}/debian ${S}/ | ||
|
||
deb_add_changelog | ||
} |