diff options
author | Stephen Warren <swarren@nvidia.com> | 2013-12-05 14:24:53 -0700 |
---|---|---|
committer | Stephen Warren <swarren@nvidia.com> | 2013-12-06 13:00:21 -0700 |
commit | cce543ffb088c2017a39933735ee6f27419d371f (patch) | |
tree | dc88cbe471378f61341c1e96fe419e2c096828e6 | |
parent | 8d8cb33a09635dc40770e2823f5913654ea30f6c (diff) | |
download | tegra-uboot-flasher-scripts-cce543ffb088c2017a39933735ee6f27419d371f.tar.gz |
Increase padding between U-Boot binary and flash image
The flasher currently places the flash image in RAM almost directly above
the initial U-Boot binary location, with just a little padding/alignment
in between. This is also where U-Boot's BSS is located, prior to U-Boot
relocating itself to the top of RAM. Hence, if U-Boot touches its BSS, it
will corrupt the flash image. Increase the padding between U-Boot/DT and
the flash image to avoid this. U-Boot's BSS is roughly 300K at present.
Make the pad size 1M to allow plenty of room for growth.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Thierry Reding <treding@nvidia.com>
-rwxr-xr-x | tegra-uboot-flasher | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tegra-uboot-flasher b/tegra-uboot-flasher index 3c696c2..3f79c8c 100755 --- a/tegra-uboot-flasher +++ b/tegra-uboot-flasher @@ -146,9 +146,9 @@ def func_flash(): if args.debug: print 'u_boot_plus_dtb_size %d 0x%x' % (u_boot_plus_dtb_size, u_boot_plus_dtb_size) - # Add 32k in case size changes due to fdtput + # Add 1024k to avoid U-Boot's BSS, and in case the DT size changes due to fdtput # Align to 4k, so flash writes don't need a bounce buffer for DMA - padded_size = (u_boot_plus_dtb_size + (32 * 1024) + (4 * 1024) - 1) & ~((4 * 1024) - 1) + padded_size = (u_boot_plus_dtb_size + (1024 * 1024) + (4 * 1024) - 1) & ~((4 * 1024) - 1) if args.debug: print 'padded_size %d 0x%x' % (padded_size, padded_size) |