karo: tx53: improve workaround for i.MX53 ROM code bug tx53-bugfix
authorLothar Waßmann <LW@KARO-electronics.de>
Tue, 16 Sep 2014 08:37:18 +0000 (10:37 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 16 Sep 2014 08:37:18 +0000 (10:37 +0200)
Due to the alignment of the rel_dyn section to 4KiB has the ill side
effect of interpreting uninitialized data from RAM during relocation
when U-Boot is loaded via network. This may crash U-Boot after
displaying the message 'DRAM: ...'.

Create a dummy section placed after the rel_dyn section to provide the
image size alignment without affecting the size of the rel_dyn
partition.

board/karo/tx53/lowlevel_init.S
board/karo/tx53/tx53.c
board/karo/tx53/u-boot.lds

index b547eae..b530fdb 100644 (file)
@@ -372,7 +372,7 @@ app_code_csf:
 boot_data:
        .long   fcb_start
 image_len:
-       .long   __rel_dyn_end - fcb_start
+       .long   __uboot_img_end - fcb_start
 plugin:
        .word   0
 ivt_end:
index 32d541e..df666fc 100644 (file)
@@ -58,6 +58,8 @@ DECLARE_GLOBAL_DATA_PTR;
 #define TX53_SDHC_PAD_CTRL     MUX_PAD_CTRL(PAD_CTL_HYS | PAD_CTL_DSE_HIGH |   \
                                PAD_CTL_SRE_FAST | PAD_CTL_PUS_47K_UP)
 
+char __uboot_img_end[0] __attribute__((section(".__uboot_img_end")));
+
 static iomux_v3_cfg_t tx53_pads[] = {
        /* NAND flash pads are set up in lowlevel_init.S */
 
index 1ce1e2f..9276d3b 100644 (file)
@@ -62,14 +62,19 @@ SECTIONS
                *(.rel*)
        }
 
+       .rel_dyn_end :
+       {
+               *(.__rel_dyn_end)
+       }
+
        /* 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 :
+       .uboot_img_end :
        {
-               *(.__rel_dyn_end)
+               *(.__uboot_img_end)
        }
 
        _end = .;