[U-Boot] [PATCH V3 08/32] imximage: make header variable length

Troy Kisky troy.kisky at boundarydevices.com
Mon Oct 22 23:03:49 CEST 2012


On 10/21/2012 1:35 AM, Stefano Babic wrote:
> Am 21/10/2012 03:31, schrieb Troy Kisky:
>
>> I've tested this patch on a mx51 boards as well and it worked fine there.
> Fine, thanks, this saves me time - I will not test it on that SOC.
>
>> For testing purposes, can you see if this change helps any?
>> Perhaps the rom isn't  loading all the code, and this will load a little
>> more.
> I had the same feeling.
>
> In fact, increasing artificially the size with the zdata1 section helps.
> It boots. There should be an error by computing the total length of the
> image.
>
> Best regards,
> Stefano
>

Oops, my previous test patch was after bss instead of before. With this 
patch

diff --git a/arch/arm/cpu/u-boot.lds b/arch/arm/cpu/u-boot.lds
index e49ca0c..8352c7c 100644
--- a/arch/arm/cpu/u-boot.lds
+++ b/arch/arm/cpu/u-boot.lds
@@ -78,6 +78,12 @@ SECTIONS
         .mmutable : {
                 *(.mmutable)
         }
+       .zdata1 : {
+               . = ALIGN(512);
+               LONG(0xdeadbeef);
+               FILL(0xefbeadde);
+               . = ALIGN(512);
+       }

         .bss __rel_dyn_start (OVERLAY) : {
                 __bss_start = .;



My mx51 board shows

U-Boot > mw.l 97841000 12345678 2000000
U-Boot > reset
resetting ...


U-Boot 2012.10-01232-g2919aa2-dirty (Oct 22 2012 - 13:17:26)

CPU:   Freescale i.MX51 rev3.0 at 800 MHz
Reset cause: WDOG
Board: Nitrogen
dram_init
dram_init exit
DRAM:  256 MiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
SF: Detected SST25VF016B with page size 4 KiB, total 2 MiB
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   FEC
Warning: failed to set MAC address

Hit any key to stop autoboot:  0
U-Boot > md.l 97841000
97841000: deadbeef deadbeef deadbeef deadbeef ................
97841010: deadbeef deadbeef deadbeef deadbeef ................
97841020: deadbeef deadbeef deadbeef deadbeef ................
97841030: deadbeef deadbeef deadbeef deadbeef ................
97841040: deadbeef deadbeef deadbeef deadbeef ................
97841050: deadbeef deadbeef deadbeef deadbeef ................
97841060: deadbeef deadbeef deadbeef deadbeef ................
97841070: deadbeef deadbeef deadbeef deadbeef ................
97841080: deadbeef deadbeef deadbeef deadbeef ................
97841090: deadbeef deadbeef deadbeef deadbeef ................
978410a0: deadbeef deadbeef deadbeef deadbeef ................
978410b0: deadbeef deadbeef deadbeef deadbeef ................
978410c0: deadbeef deadbeef deadbeef deadbeef ................
978410d0: deadbeef deadbeef deadbeef deadbeef ................
978410e0: deadbeef deadbeef deadbeef deadbeef ................
978410f0: deadbeef deadbeef deadbeef deadbeef ................
U-Boot >
97841100: deadbeef deadbeef deadbeef deadbeef ................
97841110: deadbeef deadbeef deadbeef deadbeef ................
97841120: deadbeef deadbeef deadbeef deadbeef ................
97841130: deadbeef deadbeef deadbeef deadbeef ................
97841140: deadbeef deadbeef deadbeef deadbeef ................
97841150: deadbeef deadbeef deadbeef deadbeef ................
97841160: deadbeef deadbeef deadbeef deadbeef ................
97841170: deadbeef deadbeef deadbeef deadbeef ................
97841180: deadbeef deadbeef deadbeef deadbeef ................
97841190: deadbeef deadbeef deadbeef deadbeef ................
978411a0: deadbeef deadbeef deadbeef deadbeef ................
978411b0: deadbeef deadbeef deadbeef deadbeef ................
978411c0: deadbeef deadbeef deadbeef deadbeef ................
978411d0: deadbeef deadbeef deadbeef deadbeef ................
978411e0: deadbeef deadbeef deadbeef deadbeef ................
978411f0: deadbeef deadbeef deadbeef deadbeef ................
U-Boot >
97841200: 12345678 12345678 12345678 12345678 xV4.xV4.xV4.xV4.
97841210: 12345678 12345678 12345678 12345678 xV4.xV4.xV4.xV4.
97841220: 12345678 12345678 12345678 12345678 xV4.xV4.xV4.xV4.
97841230: 12345678 12345678 12345678 12345678 xV4.xV4.xV4.xV4.
97841240: 12345678 12345678 12345678 12345678 xV4.xV4.xV4.xV4.
97841250: 12345678 12345678 12345678 12345678 xV4.xV4.xV4.xV4.
97841260: 12345678 12345678 12345678 12345678 xV4.xV4.xV4.xV4.
97841270: 12345678 12345678 12345678 12345678 xV4.xV4.xV4.xV4.
97841280: 12345678 12345678 12345678 12345678 xV4.xV4.xV4.xV4.
97841290: 12345678 12345678 12345678 12345678 xV4.xV4.xV4.xV4.
978412a0: 12345678 12345678 12345678 12345678 xV4.xV4.xV4.xV4.
978412b0: 12345678 12345678 12345678 12345678 xV4.xV4.xV4.xV4.
978412c0: 12345678 12345678 12345678 12345678 xV4.xV4.xV4.xV4.
978412d0: 12345678 12345678 12345678 12345678 xV4.xV4.xV4.xV4.
978412e0: 12345678 12345678 12345678 12345678 xV4.xV4.xV4.xV4.
978412f0: 12345678 12345678 12345678 12345678 xV4.xV4.xV4.xV4.
U-Boot >

Showing that exactly the correct number of bytes where loaded.


_________________________________________________________
_________________________________________________________

My mx6q board shows

U-Boot > mw.l 1784e000 12345678 2000000
U-Boot > reset
resetting ...


U-Boot 2012.10-01232-g2919aa2-dirty (Oct 22 2012 - 13:45:52)

CPU:   Freescale i.MX6Q rev1.0 at 792 MHz
Reset cause: WDOG
Board: MX6Q-Sabre Lite
DRAM:  1 GiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
SF: Detected SST25VF016B with page size 4 KiB, total 2 MiB
No panel detected: default to HDMI
unsupported panel HDMI
In:    serial
Out:   serial
Err:   serial
Net: FEC
Warning: FEC using MAC address from net device

Hit any key to stop autoboot:  0
U-Boot > md.l 1784e000
1784e000: deadbeef deadbeef deadbeef deadbeef ................
1784e010: deadbeef deadbeef deadbeef deadbeef ................
1784e020: deadbeef deadbeef deadbeef deadbeef ................
1784e030: deadbeef deadbeef deadbeef deadbeef ................
1784e040: deadbeef deadbeef deadbeef deadbeef ................
1784e050: deadbeef deadbeef deadbeef deadbeef ................
1784e060: deadbeef deadbeef deadbeef deadbeef ................
1784e070: deadbeef deadbeef deadbeef deadbeef ................
1784e080: deadbeef deadbeef deadbeef deadbeef ................
1784e090: deadbeef deadbeef deadbeef deadbeef ................
1784e0a0: deadbeef deadbeef deadbeef deadbeef ................
1784e0b0: deadbeef deadbeef deadbeef deadbeef ................
1784e0c0: deadbeef deadbeef deadbeef deadbeef ................
1784e0d0: deadbeef deadbeef deadbeef deadbeef ................
1784e0e0: deadbeef deadbeef deadbeef deadbeef ................
1784e0f0: deadbeef deadbeef deadbeef deadbeef ................
U-Boot >
1784e100: deadbeef deadbeef deadbeef deadbeef ................
1784e110: deadbeef deadbeef deadbeef deadbeef ................
1784e120: deadbeef deadbeef deadbeef deadbeef ................
1784e130: deadbeef deadbeef deadbeef deadbeef ................
1784e140: deadbeef deadbeef deadbeef deadbeef ................
1784e150: deadbeef deadbeef deadbeef deadbeef ................
1784e160: deadbeef deadbeef deadbeef deadbeef ................
1784e170: deadbeef deadbeef deadbeef deadbeef ................
1784e180: deadbeef deadbeef deadbeef deadbeef ................
1784e190: deadbeef deadbeef deadbeef deadbeef ................
1784e1a0: deadbeef deadbeef deadbeef deadbeef ................
1784e1b0: deadbeef deadbeef deadbeef deadbeef ................
1784e1c0: deadbeef deadbeef deadbeef deadbeef ................
1784e1d0: deadbeef deadbeef deadbeef deadbeef ................
1784e1e0: deadbeef deadbeef deadbeef deadbeef ................
1784e1f0: deadbeef deadbeef deadbeef deadbeef ................
U-Boot >
1784e200: 02000000 46200600 00202000 00000000    ...... F. .....
1784e210: 00000010 00004020 00000000 00004222    .... @......"B..
1784e220: 02000000 00000040 00000000 00000000 .... at ...........
1784e230: 00000000 00000400 00020002 00000000 ................
1784e240: 00140000 00000000 00100000 00008080 ................
1784e250: 00100200 00410080 00004020 18000110    ......A. @......
1784e260: 00000000 80000a00 00000000 00000000 ................
1784e270: 00000280 08029980 00000000 00001080 ................
1784e280: 40000000 00800002 02802404 02a00200 ... at .....$......
1784e290: 08002000 00000000 00808400 40200200    . ............ @
1784e2a0: 40000000 00000000 00000000 00000020 ... at ........ ...
1784e2b0: 00000000 00200020 00008000 00000000    .... . .........
1784e2c0: 12345678 12345678 12345678 12345678 xV4.xV4.xV4.xV4.
1784e2d0: 12345678 12345678 12345678 12345678 xV4.xV4.xV4.xV4.
1784e2e0: 00000200 00010001 00000201 10000000 ................
1784e2f0: 14000000 00000000 00000001 08000011 ................
U-Boot >
1784e300: 12345678 12345678 12345678 12345678 xV4.xV4.xV4.xV4.
1784e310: 12345678 12345678 12345678 12345678 xV4.xV4.xV4.xV4.
1784e320: 12345678 12345678 12345678 12345678 xV4.xV4.xV4.xV4.
1784e330: 12345678 12345678 12345678 12345678 xV4.xV4.xV4.xV4.
1784e340: 12345678 12345678 12345678 12345678 xV4.xV4.xV4.xV4.
1784e350: 12345678 12345678 12345678 12345678 xV4.xV4.xV4.xV4.
1784e360: 12345678 12345678 12345678 12345678 xV4.xV4.xV4.xV4.
1784e370: 12345678 12345678 12345678 12345678 xV4.xV4.xV4.xV4.
1784e380: 12345678 12345678 12345678 12345678 xV4.xV4.xV4.xV4.
1784e390: 12345678 12345678 12345678 12345678 xV4.xV4.xV4.xV4.
1784e3a0: 12345678 12345678 12345678 12345678 xV4.xV4.xV4.xV4.
1784e3b0: 12345678 12345678 12345678 12345678 xV4.xV4.xV4.xV4.
1784e3c0: 12345678 12345678 12345678 12345678 xV4.xV4.xV4.xV4.
1784e3d0: 12345678 12345678 12345678 12345678 xV4.xV4.xV4.xV4.
1784e3e0: 12345678 12345678 12345678 12345678 xV4.xV4.xV4.xV4.
1784e3f0: 12345678 12345678 12345678 12345678 xV4.xV4.xV4.xV4.
U-Boot >

Showing that an extra 0x100 bytes were written.

U-Boot > sf probe
SF: Detected SST25VF016B with page size 4 KiB, total 2 MiB
U-Boot > sf read 10800000 400 50000
U-Boot > md.l 1084e334
1084e334: deadbeef deadbeef deadbeef deadbeef ................
1084e344: deadbeef deadbeef deadbeef deadbeef ................
1084e354: deadbeef deadbeef deadbeef deadbeef ................
1084e364: deadbeef deadbeef deadbeef deadbeef ................
1084e374: deadbeef deadbeef deadbeef deadbeef ................
1084e384: deadbeef deadbeef deadbeef deadbeef ................
1084e394: deadbeef deadbeef deadbeef deadbeef ................
1084e3a4: deadbeef deadbeef deadbeef deadbeef ................
1084e3b4: deadbeef deadbeef deadbeef deadbeef ................
1084e3c4: deadbeef deadbeef deadbeef deadbeef ................
1084e3d4: deadbeef deadbeef deadbeef deadbeef ................
1084e3e4: deadbeef deadbeef deadbeef deadbeef ................
1084e3f4: deadbeef deadbeef deadbeef deadbeef ................
1084e404: deadbeef deadbeef deadbeef deadbeef ................
1084e414: deadbeef deadbeef deadbeef deadbeef ................
1084e424: deadbeef deadbeef deadbeef deadbeef ................
U-Boot >
1084e434: deadbeef deadbeef deadbeef deadbeef ................
1084e444: deadbeef deadbeef deadbeef deadbeef ................
1084e454: deadbeef deadbeef deadbeef deadbeef ................
1084e464: deadbeef deadbeef deadbeef deadbeef ................
1084e474: deadbeef deadbeef deadbeef deadbeef ................
1084e484: deadbeef deadbeef deadbeef deadbeef ................
1084e494: deadbeef deadbeef deadbeef deadbeef ................
1084e4a4: deadbeef deadbeef deadbeef deadbeef ................
1084e4b4: deadbeef deadbeef deadbeef deadbeef ................
1084e4c4: deadbeef deadbeef deadbeef deadbeef ................
1084e4d4: deadbeef deadbeef deadbeef deadbeef ................
1084e4e4: deadbeef deadbeef deadbeef deadbeef ................
1084e4f4: deadbeef deadbeef deadbeef deadbeef ................
1084e504: deadbeef deadbeef deadbeef deadbeef ................
1084e514: deadbeef deadbeef deadbeef deadbeef ................
1084e524: deadbeef deadbeef deadbeef deadbeef ................
U-Boot >
1084e534: ffffffff ffffffff ffffffff ffffffff ................
1084e544: ffffffff ffffffff ffffffff ffffffff ................
1084e554: ffffffff ffffffff ffffffff ffffffff ................
1084e564: ffffffff ffffffff ffffffff ffffffff ................
1084e574: ffffffff ffffffff ffffffff ffffffff ................
1084e584: ffffffff ffffffff ffffffff ffffffff ................
1084e594: ffffffff ffffffff ffffffff ffffffff ................
1084e5a4: ffffffff ffffffff ffffffff ffffffff ................
1084e5b4: ffffffff ffffffff ffffffff ffffffff ................
1084e5c4: ffffffff ffffffff ffffffff ffffffff ................
1084e5d4: ffffffff ffffffff ffffffff ffffffff ................
1084e5e4: ffffffff ffffffff ffffffff ffffffff ................
1084e5f4: ffffffff ffffffff ffffffff ffffffff ................
1084e604: ffffffff ffffffff ffffffff ffffffff ................
1084e614: ffffffff ffffffff ffffffff ffffffff ................
1084e624: ffffffff ffffffff ffffffff ffffffff ................

And those extra 0x100 bytes are garbage, not from the eprom.

Troy



More information about the U-Boot mailing list