diff options
author | Max Krummenacher <max.krummenacher@toradex.com> | 2023-08-23 16:34:03 +0200 |
---|---|---|
committer | Max Krummenacher <max.krummenacher@toradex.com> | 2023-09-21 08:13:10 -0300 |
commit | 7a2d6ff06fa18d561522b14a937d20b2265067c1 (patch) | |
tree | 154b724988a856f4f219abdab617414a190719e6 /recipes-bsp/u-boot/u-boot-toradex-imx.inc | |
parent | c907c047234f3691fc285f937aed3f4f8bb4af98 (diff) |
u-boot-toradex: split into a release/pinned and latest head recipe
This reduces confusion about the current solution on what version gets
built with use-head-next.
This drops using the `use-head-next` override in favour of having two
recipes. Which recipe is to be built will then be set in the various
<machine.conf> files.
To reduce code duplication split out common code into a inc file and
further split out i.MX and TI specific stuff into two specific inc
files.
Related-to: ELB-5357
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Diffstat (limited to 'recipes-bsp/u-boot/u-boot-toradex-imx.inc')
-rw-r--r-- | recipes-bsp/u-boot/u-boot-toradex-imx.inc | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/recipes-bsp/u-boot/u-boot-toradex-imx.inc b/recipes-bsp/u-boot/u-boot-toradex-imx.inc new file mode 100644 index 0000000..1c01bcf --- /dev/null +++ b/recipes-bsp/u-boot/u-boot-toradex-imx.inc @@ -0,0 +1,47 @@ +PADDING_DIR = "${B}" +nand_padding () { + # pad the end of U-Boot with 0x00 up to 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 needs 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 +} + +# build imx-boot from within U-Boot +inherit ${@oe.utils.ifelse(d.getVar('UBOOT_PROVIDES_BOOT_CONTAINER') == '1', 'imx-boot-container', '')} + +do_compile:append:colibri-imx6ull () { + nand_padding +} + +do_compile:append:colibri-imx7 () { + nand_padding +} + +BOOT_TOOLS = "imx-boot-tools" +do_deploy:append:mx8m-generic-bsp() { + # 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 +} |