[U-Boot] [PATCH V2 3/6] arm: imx: Pack u-boot.bin into uImage for SPL

Marek Vasut marex at denx.de
Sun Apr 21 17:52:24 CEST 2013


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 <marex at denx.de>
Cc: Albert ARIBAUD <albert.u.boot at aribaud.net>
Cc: Benoît Thébaudeau <benoit.thebaudeau at advansee.com>
Cc: Fabio Estevam <fabio.estevam at freescale.com>
Cc: Scott Wood <scottwood at freescale.com>
Cc: Stefano Babic <sbabic at denx.de>
Cc: Tom Rini <trini at 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



More information about the U-Boot mailing list