The U-Boot SPL can parse the uImage format and gather information from
it about the payload. Make use of this and wrap u-boot.bin into uImage
format. The benefit is the SPL will know the size of the payload
instead of using fixed size of the payload defined at compile time.

Signed-off-by: Marek Vasut <ma...@denx.de>
Cc: Albert ARIBAUD <albert.u.b...@aribaud.net>
Cc: Benoît Thébaudeau <benoit.thebaud...@advansee.com>
Cc: Fabio Estevam <fabio.este...@freescale.com>
Cc: Scott Wood <scottw...@freescale.com>
Cc: Stefano Babic <sba...@denx.de>
Cc: Tom Rini <tr...@ti.com>
---
 arch/arm/imx-common/Makefile |   14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

V2: Extend uImage usage to u-boot-with-spl.imx target

diff --git a/arch/arm/imx-common/Makefile b/arch/arm/imx-common/Makefile
index 44b6822..bff1e67 100644
--- a/arch/arm/imx-common/Makefile
+++ b/arch/arm/imx-common/Makefile
@@ -58,8 +58,11 @@ $(OBJTREE)/SPL: $(OBJTREE)/spl/u-boot-spl.bin 
$(OBJTREE)/$(patsubst "%",%,$(CONF
 $(OBJTREE)/u-boot-with-spl.imx: $(OBJTREE)/SPL $(OBJTREE)/u-boot.bin
        $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(CONFIG_SPL_PAD_TO) \
                -I binary -O binary $< $(OBJTREE)/spl/u-boot-spl-pad.imx
-       cat $(OBJTREE)/spl/u-boot-spl-pad.imx $(OBJTREE)/u-boot.bin > $@
-       rm $(OBJTREE)/spl/u-boot-spl-pad.imx
+       $(OBJTREE)/tools/mkimage -A arm -O U-Boot -a $(CONFIG_SYS_TEXT_BASE) \
+               -e $(CONFIG_SYS_TEXT_BASE) -C none -d $(OBJTREE)/u-boot.bin \
+               $(OBJTREE)/u-boot.uim
+       cat $(OBJTREE)/spl/u-boot-spl-pad.imx $(OBJTREE)/u-boot.uim > $@
+       rm $(OBJTREE)/spl/u-boot-spl-pad.imx $(OBJTREE)/u-boot.uim
 
 $(OBJTREE)/u-boot-with-nand-spl.imx: $(OBJTREE)/SPL $(OBJTREE)/u-boot.bin
        (echo -ne '\x00\x00\x00\x00\x46\x43\x42\x20\x01' && \
@@ -69,8 +72,11 @@ $(OBJTREE)/u-boot-with-nand-spl.imx: $(OBJTREE)/SPL 
$(OBJTREE)/u-boot.bin
                -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
+       $(OBJTREE)/tools/mkimage -A arm -O U-Boot -a $(CONFIG_SYS_TEXT_BASE) \
+               -e $(CONFIG_SYS_TEXT_BASE) -C none -d $(OBJTREE)/u-boot.bin \
+               $(OBJTREE)/u-boot.uim
+       cat $(OBJTREE)/spl/u-boot-nand-spl-pad.imx $(OBJTREE)/u-boot.uim > $@
+       rm $(OBJTREE)/spl/u-boot-nand-spl-pad.imx $(OBJTREE)/u-boot.uim
 
 
 #########################################################################
-- 
1.7.10.4

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to