From 33451fb0e305f4e054896b604b1c0ca03d9b5ec7 Mon Sep 17 00:00:00 2001 From: Max Krummenacher Date: Sat, 2 Oct 2021 16:31:50 +0200 Subject: u-boot: bbappend: add toradex postprocessing Build latest master if use-head-next is in overrides. Verdin iMX8MM: Deploy u-boot-nodtb.bin and fsl-imx8m*-XX.dtb used by imx-boot. Raw NAND based modules: Pad the U-Boot binary to allow for easier flashing into the NAND. Related-to: ELB-4090 Signed-off-by: Max Krummenacher --- recipes-bsp/u-boot/u-boot_%.bbappend | 50 ++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 recipes-bsp/u-boot/u-boot_%.bbappend diff --git a/recipes-bsp/u-boot/u-boot_%.bbappend b/recipes-bsp/u-boot/u-boot_%.bbappend new file mode 100644 index 0000000..dd62328 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot_%.bbappend @@ -0,0 +1,50 @@ +SRCREV:use-head-next = "${AUTOREV}" + +PADDING_DIR = "${B}" +nand_padding () { + # pad the end of U-Boot with 0x00 up to the the end of the CSF area + #PAD_END=$(echo -n "0x"; od -X -j 0x24 -N 4 u-boot.imx | sed -e '/................/!d' -e 's/........\(.*\)/\1/') + #PAD_END=$(( $PAD_END - 0x400 )) + #objcopy -I binary -O binary --pad-to $PAD_END u-boot.imx u-boot.imx.zero-padded + # assume that the above never need more than 10k of padding and skip the + # shell magic to get a correct size. + dd bs=10k count=1 if=/dev/zero | cat ${PADDING_DIR}/u-boot.imx - > ${PADDING_DIR}/u-boot.imx.zero-padded + + # U-Boot is flashed 1k into a NAND block, create a binary which prepends + # U-boot with 1k of zeros to ease flashing + dd bs=1024 count=1 if=/dev/zero | cat - ${PADDING_DIR}/u-boot.imx.zero-padded > ${PADDING_DIR}/u-boot-nand.imx +} + +do_compile:append:colibri-imx6ull () { + nand_padding +} + +do_compile:append:colibri-imx7 () { + nand_padding +} + +do_compile:append:colibri-vf () { + nand_padding +} + +BOOT_TOOLS:mx8m = "imx-boot-tools" +do_deploy:append:mx8m() { + # Deploy u-boot-nodtb.bin and fsl-imx8m*-XX.dtb for mkimage to generate boot binary + if [ -n "${UBOOT_CONFIG}" ] + then + for config in ${UBOOT_MACHINE}; do + i=$(expr $i + 1); + for type in ${UBOOT_CONFIG}; do + j=$(expr $j + 1); + if [ $j -eq $i ] + then + install -d ${DEPLOYDIR}/${BOOT_TOOLS} + install -m 0777 ${B}/${config}/arch/arm/dts/${UBOOT_DTB_NAME} ${DEPLOYDIR}/${BOOT_TOOLS} + install -m 0777 ${B}/${config}/u-boot-nodtb.bin ${DEPLOYDIR}/${BOOT_TOOLS}/u-boot-nodtb.bin-${MACHINE}-${type} + fi + done + unset j + done + unset i + fi +} -- cgit v1.2.3