imx-image: handle i.MX35 special case
From the i.MX35 user manual :
Since MLC NAND Flash devices do not guarantee error-free boot blocks,
the i.MX35 boot code requires that the first 4 Kbytes of boot code be
duplicated in a subsequent block to serve as a second copy option.

Actually imx-image puts the image at 4k but it seems that the i.MX35
bootrom copies only from 8k as it expects that there is a copy of the
first 0-4k in 4k-8k (and is supposed to use this copy if there is an
ECC error in the first 4k) as we can see in the following lines :

barebox@Eukrea CPUIMX35:/  md -s /dev/nand0 0x0
00000000: ea0003fe eafffffe eafffffe eafffffe                ................
00000010: eafffffe eafffffe eafffffe eafffffe                ................
00000020: 65726162 00786f62 00000000 00000000
barebox.........

=-> header is @ 0 in flash

barebox@Eukrea CPUIMX35:/  md -s /dev/nand0 0x1000
00001000: 56341200 00000000 0001eda1 00000000                ..4V............
00001010: 00000000 00000000 00000000
00000000                ................

=-> so we have data @ 0x1000 in flash

barebox@Eukrea CPUIMX35:/  md 0x87f00000
87f00000: 00000000 00000000 00000000 00000000                ................
87f00010: 00000000 00000000 00000000
00000000                ................

=-> but we don't find this data in RAM

barebox@Eukrea CPUIMX35:/  md -s /dev/nand0 0x2000
00002000: ea000012 eafffffe eafffffe eafffffe                ................
00002010: eafffffe eafffffe eafffffe eafffffe                ................
00002020: 65726162 00786f62 00000000 00034272
barebox.....rB..

=-> so we have the image @ 0x2000 in flash

barebox@Eukrea CPUIMX35:/  md 0x87f01000
87f01000: ea000871 eafffffe eafffffe eafffffe                q...............
87f01010: eafffffe eafffffe eafffffe eafffffe                ................
87f01020: 65726162 00786f62 87f02000 0003b520                barebox.. .. ...

=-> and we find it in RAM

Signed-off-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent 6deac63 commit 690e3920274769cb4f00154c8f7cbac555994905
@Eric Bénard Eric Bénard authored on 24 Sep 2014
Sascha Hauer committed on 25 Sep 2014
Showing 1 changed file
View
scripts/imx/imx-image.c