conf/machine: pass OPTEEFLAVOR via OPTEEMACHINE as <mach>-<flavor>
PATCH 1/3 conf/machine: pass OPTEEFLAVOR via OPTEEMACHINE as <mach>-<flavor>
From: Denys Dmytriyenko <[email protected]>
Recipe in meta-arm doesn't use OPTEEFLAVOR, but optee-os Makefile can extract it from OPTEEMACHINE.
Keep OPTEEFLAVOR for legacy platforms - used for HS signing in the output name.
--- conf/machine/am437x-hs-evm.conf | 2 +- conf/machine/am57xx-hs-evm.conf | 2 +- conf/machine/dra7xx-hs-evm.conf | 2 +- conf/machine/include/am65xx.inc | 3 +-- conf/machine/include/j7.inc | 3 +-- 5 files changed, 5 insertions(+), 7 deletions(-)
conf/machine/am437x-hs-evm.conf +1 -1
@@ -13,6 +13,6 @@ UBOOT_RD_ENTRYPOINT = "0x84000000" TI_SECURE_DEV_PKG = "${TI_SECURE_DEV_PKG_CAT}/am4x" -OPTEEMACHINE = "ti" +OPTEEMACHINE = "ti-am43xx" OPTEEFLAVOR = "am43xx" OPTEEOUTPUTMACHINE = "ti"
conf/machine/am57xx-hs-evm.conf +1 -1
@@ -13,7 +13,7 @@ UBOOT_RD_ENTRYPOINT = "0x84000000" TI_SECURE_DEV_PKG = "${TI_SECURE_DEV_PKG_AUTO}/am5x" -OPTEEMACHINE = "ti" +OPTEEMACHINE = "ti-am57xx" OPTEEFLAVOR = "am57xx" OPTEEOUTPUTMACHINE = "ti" OPTEEPAGER = "y"
conf/machine/dra7xx-hs-evm.conf +1 -1
@@ -13,7 +13,7 @@ UBOOT_RD_ENTRYPOINT = "0x84000000" TI_SECURE_DEV_PKG = "${TI_SECURE_DEV_PKG_AUTO}/dra7" -OPTEEMACHINE = "ti" +OPTEEMACHINE = "ti-dra7xx" OPTEEFLAVOR = "dra7xx" OPTEEOUTPUTMACHINE = "ti" OPTEEPAGER = "y"
conf/machine/include/am65xx.inc +1 -2
@@ -21,8 +21,7 @@ KERNEL_DEVICETREE = " \ ti/k3-am654-evm-prupwm.dtbo \ " -OPTEEMACHINE = "k3" -OPTEEFLAVOR = "am65x" +OPTEEMACHINE = "k3-am65x" OPTEEOUTPUTMACHINE = "k3" # Set the list of device targets for ti-pdk class recipes
conf/machine/include/j7.inc +1 -2
@@ -1,8 +1,7 @@ require conf/machine/include/k3.inc SOC_FAMILY_append = ":j7" -OPTEEMACHINE = "k3" -OPTEEFLAVOR = "j7" +OPTEEMACHINE = "k3-j7" OPTEEOUTPUTMACHINE = "k3" # Set the list of device targets for ti-pdk class recipes
Signature · 1 line
2.7.4
PATCH 2/3 optee-os: add TI signing calls via TI_SECURE_DEV_PKG
From: Denys Dmytriyenko <[email protected]>
It was originally residing in meta-arago due to earlier dependency on meta-optee layer from meta-linaro. Now optee is in meta-arm and this code can move to meta-ti.
--- recipes-security/optee/optee-os_%.bbappend | 83 ++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 recipes-security/optee/optee-os_%.bbappend
recipes-security/optee/optee-os_%.bbappend new file +83 -0
@@ -0,0 +1,83 @@ +do_compile_prepend_ti-soc() { + export TI_SECURE_DEV_PKG=${TI_SECURE_DEV_PKG} +} + +do_compile_append_k3() { + ( cd out/arm-plat-${OPTEEOUTPUTMACHINE}/core/; \ + cp tee-pager_v2.bin ${B}/bl32.bin; \ + cp tee.elf ${B}/bl32.elf; \ + ) +} + +# Signing procedure for legacy HS devices +optee_sign_legacyhs() { + ( cd out/arm-plat-${OPTEEOUTPUTMACHINE}/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 + rm -rf out/ + oe_runmake all CFG_TEE_TA_LOG_LEVEL=0 CFG_WITH_PAGER=y + ( cd out/arm-plat-${OPTEEOUTPUTMACHINE}/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 +} + +# Signing procedure for K3 HS devices +optee_sign_k3hs() { + ( cd out/arm-plat-${OPTEEOUTPUTMACHINE}/core/; \ + ${TI_SECURE_DEV_PKG}/scripts/secure-binary-image.sh tee-pager_v2.bin tee-pager.bin.signed; \ + mv tee-pager.bin.signed ${B}/bl32.bin; \ + cp tee.elf ${B}/bl32.elf; \ + ) +} + +do_compile_append_ti43x() { + optee_sign_legacyhs +} + +do_compile_append_dra7xx() { + optee_sign_legacyhs +} + +do_compile_append_am65xx-hs-evm() { + optee_sign_k3hs +} + +do_compile_append_j7-hs-evm() { + optee_sign_k3hs +} + +do_install_append_ti-soc() { + 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_dra7xx() { + optee_deploy_legacyhs +} + +do_deploy_append_k3() { + ln -sf optee/bl32.bin ${DEPLOYDIR}/ + ln -sf optee/bl32.elf ${DEPLOYDIR}/ +} + +# This is needed for bl32.elf +INSANE_SKIP_${PN}_append_k3 = " textrel"
Signature · 1 line
2.7.4
PATCH 3/3 u-boot-ti: adjust location of optee binary to align with meta-arm
In reply to Denys DmytriyenkoFrom: Denys Dmytriyenko <[email protected]>
--- recipes-bsp/u-boot/u-boot-ti.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-bsp/u-boot/u-boot-ti.inc +1 -1
@@ -34,7 +34,7 @@ PV_append = "+git${SRCPV}" DEPENDS += "dtc-native bc-native lzop-native flex-native bison-native" PACKAGECONFIG[atf] = "ATF=${STAGING_DIR_HOST}/firmware/bl31.bin,,trusted-firmware-a" -PACKAGECONFIG[optee] = "TEE=${STAGING_DIR_HOST}/boot/bl32.bin,,optee-os" +PACKAGECONFIG[optee] = "TEE=${STAGING_DIR_HOST}${nonarch_base_libdir}/firmware/bl32.bin,,optee-os" PACKAGECONFIG_append_aarch64 = " atf optee"
Signature · 1 line
2.7.4
Denys
Quoted 73 lines · Denys Dmytriyenko
From: Denys Dmytriyenko <[email protected]>
Recipe in meta-arm doesn't use OPTEEFLAVOR, but optee-os
Makefilecan extract it from OPTEEMACHINE.
Keep OPTEEFLAVOR for legacy platforms - used for HS signing in the output name.Signed-off-by Denys Dmytriyenko <[email protected]>--- conf/machine/am437x-hs-evm.conf | 2 +- conf/machine/am57xx-hs-evm.conf | 2 +- conf/machine/dra7xx-hs-evm.conf | 2 +- conf/machine/include/am65xx.inc | 3 +-- conf/machine/include/j7.inc | 3 +-- 5 files changed, 5 insertions(+), 7 deletions(-)conf/machine/am437x-hs-evm.conf +1
-1@@ -13,6 +13,6 @@ UBOOT_RD_ENTRYPOINT = "0x84000000" TI_SECURE_DEV_PKG = "${TI_SECURE_DEV_PKG_CAT}/am4x" -OPTEEMACHINE = "ti" +OPTEEMACHINE = "ti-am43xx" OPTEEFLAVOR = "am43xx" OPTEEOUTPUTMACHINE = "ti"conf/machine/am57xx-hs-evm.conf +1
-1@@ -13,7 +13,7 @@ UBOOT_RD_ENTRYPOINT = "0x84000000" TI_SECURE_DEV_PKG = "${TI_SECURE_DEV_PKG_AUTO}/am5x" -OPTEEMACHINE = "ti" +OPTEEMACHINE = "ti-am57xx" OPTEEFLAVOR = "am57xx" OPTEEOUTPUTMACHINE = "ti" OPTEEPAGER = "y"conf/machine/dra7xx-hs-evm.conf +1
-1@@ -13,7 +13,7 @@ UBOOT_RD_ENTRYPOINT = "0x84000000" TI_SECURE_DEV_PKG = "${TI_SECURE_DEV_PKG_AUTO}/dra7" -OPTEEMACHINE = "ti" +OPTEEMACHINE = "ti-dra7xx" OPTEEFLAVOR = "dra7xx" OPTEEOUTPUTMACHINE = "ti" OPTEEPAGER = "y"conf/machine/include/am65xx.inc +1
-2@@ -21,8 +21,7 @@ KERNEL_DEVICETREE = " \ ti/k3-am654-evm-prupwm.dtbo \ " -OPTEEMACHINE = "k3" -OPTEEFLAVOR = "am65x" +OPTEEMACHINE = "k3-am65x" OPTEEOUTPUTMACHINE = "k3" # Set the list of device targets for ti-pdk class recipesconf/machine/include/j7.inc +0
-0
conf/machine/include/j7.inc line 7
Quoted 9 lines
conf/machine/include/j7.inc +1
-2@@ -1,8 +1,7 @@ require conf/machine/include/k3.inc SOC_FAMILY_append = ":j7" -OPTEEMACHINE = "k3" -OPTEEFLAVOR = "j7" +OPTEEMACHINE = "k3-j7" OPTEEOUTPUTMACHINE = "k3" # Set the list of device targets for ti-pdk class recipes
All 3 applied
Thanks