From: Lothar Waßmann Date: Tue, 16 Sep 2014 08:37:18 +0000 (+0200) Subject: karo: tx53: improve workaround for i.MX53 ROM code bug X-Git-Tag: KARO-TX-2014-11-10~8^2 X-Git-Url: https://git.kernelconcepts.de/?p=karo-tx-uboot.git;a=commitdiff_plain;h=952daf5c5d9e0c67e0ae22cf124b008cb0d90bed karo: tx53: improve workaround for i.MX53 ROM code bug 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. --- diff --git a/board/karo/tx53/lowlevel_init.S b/board/karo/tx53/lowlevel_init.S index b547eae9e0..b530fdb91d 100644 --- a/board/karo/tx53/lowlevel_init.S +++ b/board/karo/tx53/lowlevel_init.S @@ -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: diff --git a/board/karo/tx53/tx53.c b/board/karo/tx53/tx53.c index 32d541e765..df666fcfa1 100644 --- a/board/karo/tx53/tx53.c +++ b/board/karo/tx53/tx53.c @@ -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 */ diff --git a/board/karo/tx53/u-boot.lds b/board/karo/tx53/u-boot.lds index 1ce1e2ff87..9276d3b130 100644 --- a/board/karo/tx53/u-boot.lds +++ b/board/karo/tx53/u-boot.lds @@ -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 = .;