Currently booting from NAND will fail, if the u-boot partition
contains any bad block, since the image_len in the IVT is set to the
u-boot partition size. Apparently the ROM code has a bug and does not
load the last block of a flash image when the block does not end on a
4KiB boundary. This leads to boot failures or random U-Boot crashes,
because the relocation table is most affected by this bug.
Workaround this by padding the image_len stored in the IVT to the next
4KiB boundary.
.org 0x68
.word 0x0 /* primary image starting page number */
.word 0x0 /* secondary image starting page number */
- .word 0x6b
- .word 0x6b
+ .org 0x78
.word 0x0 /* DBBT start page (0 == NO DBBT) */
.word 0 /* Bad block marker offset in main area (unused) */
.org 0xac
boot_data:
.long fcb_start
image_len:
- .long CONFIG_U_BOOT_IMG_SIZE
+ .long __rel_dyn_end - fcb_start
plugin:
.word 0
ivt_end:
*(.rel*)
}
+ /* Workaround for an apparent bug in i.MX53 ROM Code,
+ * that skips loading the last block if it doesn't
+ * end on a 4KiB boundary.
+ */
+ . = ALIGN(4096);
.rel_dyn_end :
{
*(.__rel_dyn_end)