imx: Add u-boot-with-nand-spl.imx make target
authorBenoît Thébaudeau <benoit.thebaudeau@advansee.com>
Thu, 11 Apr 2013 09:35:57 +0000 (09:35 +0000)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Fri, 12 Apr 2013 05:55:08 +0000 (07:55 +0200)
This image combines the SPL with the i.MX header, the FCB and U-Boot.

For i.MX25/35/51, the FCB is ignored by the boot ROM, so this image is just
useful because it can be programmed on a NAND Flash page boundary.

For i.MX53, the FCB is required by the boot ROM.

This does not support i.MX6 so far because its FCB is more complicated.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
.gitignore
Makefile
arch/arm/imx-common/Makefile

index e42d837993cff4bc1bc4ff1d1089fac3b90daed7..ed212032b4dd7ef53eac57f5b208fc6153c73fbe 100644 (file)
@@ -31,6 +31,7 @@
 /u-boot.hex
 /u-boot.imx
 /u-boot-with-spl.imx
+/u-boot-with-nand-spl.imx
 /u-boot.map
 /u-boot.srec
 /u-boot.ldr
index e22faa5d471959fc3ae6c7fb2e2e4098c4976584..df03974605c19535c626385654b7da3dcb2a00ec 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -490,6 +490,10 @@ $(obj)u-boot-with-spl.imx: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
                $(MAKE) -C $(SRCTREE)/arch/arm/imx-common \
                        $(OBJTREE)/u-boot-with-spl.imx
 
+$(obj)u-boot-with-nand-spl.imx: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
+               $(MAKE) -C $(SRCTREE)/arch/arm/imx-common \
+                       $(OBJTREE)/u-boot-with-nand-spl.imx
+
 $(obj)u-boot.ubl:       $(obj)u-boot-with-spl.bin
                $(obj)tools/mkimage -n $(UBL_CONFIG) -T ublimage \
                -e $(CONFIG_SYS_TEXT_BASE) -d $< $(obj)u-boot.ubl
@@ -855,6 +859,7 @@ clobber:    tidy
        @rm -f $(obj)u-boot.pbl
        @rm -f $(obj)u-boot.imx
        @rm -f $(obj)u-boot-with-spl.imx
+       @rm -f $(obj)u-boot-with-nand-spl.imx
        @rm -f $(obj)u-boot.ubl
        @rm -f $(obj)u-boot.ais
        @rm -f $(obj)u-boot.dtb
index f59ae6fca55deeb3ad75eee775067912509b41fd..44b68228057d800e02eea66024a076f2aa52d2aa 100644 (file)
@@ -61,6 +61,17 @@ $(OBJTREE)/u-boot-with-spl.imx: $(OBJTREE)/SPL $(OBJTREE)/u-boot.bin
        cat $(OBJTREE)/spl/u-boot-spl-pad.imx $(OBJTREE)/u-boot.bin > $@
        rm $(OBJTREE)/spl/u-boot-spl-pad.imx
 
+$(OBJTREE)/u-boot-with-nand-spl.imx: $(OBJTREE)/SPL $(OBJTREE)/u-boot.bin
+       (echo -ne '\x00\x00\x00\x00\x46\x43\x42\x20\x01' && \
+                       dd bs=1015 count=1 if=/dev/zero 2>/dev/null) | \
+               cat - $< > $(OBJTREE)/spl/u-boot-nand-spl.imx
+       $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(CONFIG_SPL_PAD_TO) \
+               -I binary -O binary $(OBJTREE)/spl/u-boot-nand-spl.imx \
+               $(OBJTREE)/spl/u-boot-nand-spl-pad.imx
+       rm $(OBJTREE)/spl/u-boot-nand-spl.imx
+       cat $(OBJTREE)/spl/u-boot-nand-spl-pad.imx $(OBJTREE)/u-boot.bin > $@
+       rm $(OBJTREE)/spl/u-boot-nand-spl-pad.imx
+
 
 #########################################################################