1
0
mirror of https://git.yoctoproject.org/meta-ti synced 2026-01-12 01:20:20 +00:00
Files
meta-ti/meta-ti-bsp/recipes-security/optee/optee-os-ti-overrides.inc
Andrew Davis 3a9e75ebba meta-ti/all: Make DRA7xx support a subset of AM57xx support
As AM57xx already defined both "dra7xx" and "am57xx" as SOC_FAMILY the
AM57xx was effectively a superset MACHINE. Although not all features of
AM57xx are needed for DRA7xx, make DRA7xx-EVM use the AM57xx definition.
This allows us to still support DRA7xx as the only differences that
impact device function are the selection of U-Boot defconfig, DTBs, and
OPTEE, all handled by the MACHINE conf file which is left unchanged.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Denys Dmytriyenko <denys@konsulko.com>
Signed-off-by: Ryan Eatmon <reatmon@ti.com>
2025-12-19 09:57:39 -06:00

90 lines
2.7 KiB
PHP

# Use TI SECDEV for signing
inherit ti-secdev
FILESEXTRAPATHS:prepend := "${THISDIR}/optee-os:"
EXTRA_OEMAKE:remove = "CFG_MAP_EXT_DT_SECURE=y"
EXTRA_OEMAKE:append:k3 = " ${@ 'CFG_CONSOLE_UART='+ d.getVar('OPTEE_K3_USART') if d.getVar('OPTEE_K3_USART') else ''}"
EXTRA_OEMAKE:append:k3 = " ${@ 'CFG_TZDRAM_START='+ d.getVar('OPTEE_K3_TZDRAM_START') if d.getVar('OPTEE_K3_TZDRAM_START') else ''}"
EXTRA_OEMAKE:append:am62xx = " CFG_TEE_CORE_LOG_LEVEL=1"
EXTRA_OEMAKE:append:am62lxx = " CFG_TEE_CORE_LOG_LEVEL=1"
EXTRA_OEMAKE:append:am62pxx = " CFG_TEE_CORE_LOG_LEVEL=1"
EXTRA_OEMAKE:append:am62axx = " CFG_TEE_CORE_LOG_LEVEL=1"
EXTRA_OEMAKE:append:am62dxx = " CFG_TEE_CORE_LOG_LEVEL=1"
EXTRA_OEMAKE:append:j722s = " CFG_TEE_CORE_LOG_LEVEL=1"
do_compile:append:k3() {
cp ${B}/core/tee-pager_v2.bin ${B}/bl32.bin
cp ${B}/core/tee.elf ${B}/bl32.elf
}
# Signing procedure for legacy HS devices
optee_sign_legacyhs() {
( cd ${B}/core/; \
${TI_SECURE_DEV_PKG}/scripts/secure-binary-image.sh tee.bin tee.bin.signed; \
normfl=`echo ${OPTEEFLAVOR} | tr "_" "-"`
mv tee.bin.signed ${B}/$normfl.optee; \
)
if [ "${OPTEEPAGER}" = "y" ]; then
oe_runmake -C ${S} clean
oe_runmake -C ${S} all CFG_TEE_TA_LOG_LEVEL=0 CFG_WITH_PAGER=y
( cd ${B}/core/; \
${TI_SECURE_DEV_PKG}/scripts/secure-binary-image.sh tee.bin tee.bin.signed; \
normfl=`echo ${OPTEEFLAVOR} | tr "_" "-"`
mv tee.bin.signed ${B}/$normfl-pager.optee; \
)
fi
}
do_compile:append:ti43x() {
optee_sign_legacyhs
}
do_compile:append:am57xx() {
optee_sign_legacyhs
}
do_install:append() {
install -m 644 ${B}/*.optee ${D}${nonarch_base_libdir}/firmware/ || true
install -m 644 ${B}/bl32.bin ${D}${nonarch_base_libdir}/firmware/ || true
install -m 644 ${B}/bl32.elf ${D}${nonarch_base_libdir}/firmware/ || true
}
optee_deploy_legacyhs() {
cd ${DEPLOYDIR}/
for f in optee/*.optee; do
ln -sf $f ${DEPLOYDIR}/
done
}
do_deploy:append:ti43x() {
optee_deploy_legacyhs
}
do_deploy:append:am57xx() {
optee_deploy_legacyhs
}
do_deploy:append:k3() {
ln -sf optee/bl32.bin ${DEPLOYDIR}/
ln -sf optee/bl32.elf ${DEPLOYDIR}/
}
# Make the OS depend on embedded TAs
RDEPENDS:${PN} += "${PN}-ta"
# This is needed for bl32.elf
INSANE_SKIP:${PN}:append:k3 = " textrel"
# LPM support patch for Jacinto platforms (J7200, J742S2, J784S4)
OPTEE_JACINTO_LPM_PATCHES = " \
file://0001-plat-k3-drivers-Open-TRNG-firewall-for-TIFS-on-all-k.patch \
"
SRC_URI:append:j7200 = " ${OPTEE_JACINTO_LPM_PATCHES}"
SRC_URI:append:j742s2 = " ${OPTEE_JACINTO_LPM_PATCHES}"
SRC_URI:append:j784s4 = " ${OPTEE_JACINTO_LPM_PATCHES}"