summaryrefslogtreecommitdiff
path: root/recipes-bsp/u-boot
diff options
context:
space:
mode:
authorMax Krummenacher <max.krummenacher@toradex.com>2020-08-18 14:55:05 +0200
committerMax Krummenacher <max.krummenacher@toradex.com>2020-08-20 18:27:45 +0200
commite43684e7ca50e46f5cbb75ec6dbe8258e793d5f3 (patch)
treea378f85101a2eea7f1ce4bc7c08e1d96df495573 /recipes-bsp/u-boot
parent68166fc25e16c6abdf711e7e949178211a0ce8e9 (diff)
u-boot-toradex: add csf padding at the end of the binary
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Diffstat (limited to 'recipes-bsp/u-boot')
-rw-r--r--recipes-bsp/u-boot/u-boot-toradex_2020.07.bb14
1 files changed, 11 insertions, 3 deletions
diff --git a/recipes-bsp/u-boot/u-boot-toradex_2020.07.bb b/recipes-bsp/u-boot/u-boot-toradex_2020.07.bb
index b61ad37..10b4e58 100644
--- a/recipes-bsp/u-boot/u-boot-toradex_2020.07.bb
+++ b/recipes-bsp/u-boot/u-boot-toradex_2020.07.bb
@@ -9,11 +9,19 @@ DEPENDS += "bc-native dtc-native"
BOOT_TOOLS = "imx-boot-tools"
-# U-Boot is flashed 1k into a NAND block, create a binary which prepends
-# U-boot with 1k of zeros to ease flashing
nand_padding () {
- dd bs=1024 count=1 if=/dev/zero | cat - u-boot.imx > u-boot-nand.imx
+ # 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 u-boot.imx - > 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 - u-boot.imx.zero-padded > u-boot-nand.imx
}
do_compile_append_colibri-imx6ull () {