optee-os: Fix tee build for cockpit [LF-8727]

The build is creating the same tee.bin for a72 and a53. The problem is
that the base recipe sets PLATFORM=imx-mx8qmmek, so both builds are
generating for this PLATFORM. Override PLATFORM instead of
PLATFORM_FLAVOR to fix this.

The deploy folder file tee.bin is linked to the poorly named
tee.mx8qmmek.bin. Fix this by overriding PLATFORM_FLAVOR with the platform
for the a72.

Also replace objcopy with a simply copy of tee-raw.bin.

This commit is cherry-picked from 6.1 release and is adjusted because
the 5.15 release does not use meta-arm for optee.

Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
(cherry picked from commit ab1bf86d8b)
This commit is contained in:
Tom Hochstein 2023-05-25 21:38:08 -05:00 committed by Jun Zhu
parent b68ce6b22c
commit fa43bac5ed

View File

@ -1,13 +1,13 @@
PLATFORM_FLAVOR:imx8qm-cockpit = "mx8qmmekcockpita72"
do_compile:append:imx8qm-cockpit () {
do_compile:imx8qm-cockpit () {
unset LDFLAGS
export CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_HOST}"
oe_runmake clean
oe_runmake -C ${S} PLATFORM_FLAVOR=mx8qmmekcockpita53
${TARGET_PREFIX}objcopy -O binary ${B}/core/tee.elf ${B}/core/tee-a53.bin
oe_runmake clean
oe_runmake -C ${S} PLATFORM_FLAVOR=mx8qmmekcockpita72
${TARGET_PREFIX}objcopy -O binary ${B}/core/tee.elf ${B}/core/tee-a72.bin
oe_runmake -C ${S} PLATFORM=imx-mx8qmmekcockpita53
cp ${B}/core/tee-raw.bin ${B}/core/tee-a53.bin
oe_runmake -C ${S} clean
oe_runmake -C ${S} PLATFORM=imx-mx8qmmekcockpita72
cp ${B}/core/tee-raw.bin ${B}/core/tee-a72.bin
}
do_deploy:append:imx8qm-cockpit () {