From c3de76272c3db540d1c4e45c3bc908673d81f07e Mon Sep 17 00:00:00 2001 From: Tom Hochstein Date: Wed, 11 Sep 2024 09:46:22 -0700 Subject: boot: Fix UUU tagging, extend to fslc Using the UUU-tagged bootloader image directly with UUU can cause UUU to hang. The bootloader image is split on a certain transmit size, and the hang occurs if the tag does not fit with the final bytes of the bootloader image and must be split into a new transmit package. The UUU tag is needed by UUU only in the SD Card image file itself so that UUU can find the end of the boot partition. Rework the design so the default bootloader and the default imx-boot binaries are not tagged. Also, extend the UUU tagging to fslc so it can gain the same benefit. Fixes: https://github.com/Freescale/meta-freescale/pull/1762 Fixes: https://github.com/nxp-imx/mfgtools/issues/416 Co-authored-by: Otavio Salvador Signed-off-by: Tom Hochstein --- classes/imx-boot-container.bbclass | 2 +- classes/uuu_bootloader_tag.bbclass | 24 ++++++++++++++++-------- 2 files changed, 17 insertions(+), 9 deletions(-) (limited to 'classes') diff --git a/classes/imx-boot-container.bbclass b/classes/imx-boot-container.bbclass index 8ba32cac7..b0d3dc1fb 100644 --- a/classes/imx-boot-container.bbclass +++ b/classes/imx-boot-container.bbclass @@ -96,7 +96,7 @@ do_deploy:append() { if [ ! -f "${DEPLOYDIR}/imx-boot" ]; then ln -sf flash.bin-${MACHINE}-${type} flash.bin ln -sf flash.bin-${MACHINE}-${type} imx-boot - + ln -sf flash.bin.tagged imx-boot.tagged else bbwarn "Use custom wks.in for $UBOOT_CONFIG = $type" fi diff --git a/classes/uuu_bootloader_tag.bbclass b/classes/uuu_bootloader_tag.bbclass index 87745660c..b41d22a92 100644 --- a/classes/uuu_bootloader_tag.bbclass +++ b/classes/uuu_bootloader_tag.bbclass @@ -1,12 +1,20 @@ -# Append a tag to the bootloader image used in the SD card image. The tag -# contains the size of the bootloader image so UUU can easily find the end of -# the bootloader in the SD card image. +# Create a tagged boot partition file for the SD card image file. The tag +# contains the size of the boot partition image so UUU can easily find +# the end of it in the SD card image file. +# +# IMPORTANT: The tagged boot partition file should never be used directly with +# UUU, as it can cause UUU to hang. + +UUU_BOOTLOADER = "${UBOOT_BINARY}" +UUU_BOOTLOADER:mx8-generic-bsp = "${@d.getVar('UBOOT_PROVIDES_BOOT_CONTAINER') == '0' and 'imx-boot' or 'flash.bin'}" +UUU_BOOTLOADER:mx9-generic-bsp = "${@d.getVar('UBOOT_PROVIDES_BOOT_CONTAINER') == '0' and 'imx-boot' or 'flash.bin'}" + do_deploy:append() { if [ "${UUU_BOOTLOADER}" != "" ]; then - cp ${DEPLOYDIR}/${UUU_BOOTLOADER} ${DEPLOYDIR}/${UUU_BOOTLOADER_TAGGED} - cp ${DEPLOYDIR}/${UUU_BOOTLOADER} ${DEPLOYDIR}/${UUU_BOOTLOADER_UNTAGGED} - ln -sf ${UUU_BOOTLOADER_TAGGED} ${DEPLOYDIR}/${UUU_BOOTLOADER} - stat -L -cUUUBURNXXOEUZX7+A-XY5601QQWWZ%sEND ${DEPLOYDIR}/${UUU_BOOTLOADER_TAGGED} \ - >> ${DEPLOYDIR}/${UUU_BOOTLOADER_TAGGED} + cp ${DEPLOYDIR}/${UUU_BOOTLOADER} \ + ${DEPLOYDIR}/${UUU_BOOTLOADER}.tagged + stat -L -cUUUBURNXXOEUZX7+A-XY5601QQWWZ%sEND \ + ${DEPLOYDIR}/${UUU_BOOTLOADER}.tagged \ + >> ${DEPLOYDIR}/${UUU_BOOTLOADER}.tagged fi } -- cgit v1.2.3-54-g00ecf