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

login
register
mail settings
Submitter Marek Vasut
Date April 21, 2013, 3:52 p.m.
Message ID <1366559547-9063-3-git-send-email-marex@denx.de>
Download mbox | patch
Permalink /patch/238222/
State Awaiting Upstream
Delegated to: Stefano Babic
Headers show

Comments

Marek Vasut - April 21, 2013, 3:52 p.m.
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@denx.de>
Cc: Albert ARIBAUD <albert.u.boot@aribaud.net>
Cc: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Cc: Scott Wood <scottwood@freescale.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Tom Rini <trini@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

Patch

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
 
 
 #########################################################################