This image combines the SPL with the i.MX header and U-Boot. This is a
convenient way of having a single image to program on some boot devices.

The i.MX header has to be added to the SPL before appending U-Boot, so that the
boot ROM loads only the SPL.

Signed-off-by: Benoît Thébaudeau <benoit.thebaud...@advansee.com>
---
Changes in v12: None
Changes in v11: None
Changes in v10: None
Changes in v9: None
Changes in v8:
 - Use CONFIG_SPL_PAD_TO instead of CONFIG_SPL_MAX_SIZE for padding, which
   allows to pad the SPL after adding the i.MX header, which may save time when
   the boot ROM loads the SPL.
 - Add /u-boot-with-spl.imx to .gitignore.

Changes in v7:
 - New patch.

Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 .gitignore                   |    1 +
 Makefile                     |    5 +++++
 arch/arm/imx-common/Makefile |    6 ++++++
 3 files changed, 12 insertions(+)

diff --git a/.gitignore b/.gitignore
index bff721e..e42d837 100644
--- a/.gitignore
+++ b/.gitignore
@@ -30,6 +30,7 @@
 /u-boot
 /u-boot.hex
 /u-boot.imx
+/u-boot-with-spl.imx
 /u-boot.map
 /u-boot.srec
 /u-boot.ldr
diff --git a/Makefile b/Makefile
index caca851..e22faa5 100644
--- a/Makefile
+++ b/Makefile
@@ -486,6 +486,10 @@ $(obj)u-boot-with-spl.bin: $(obj)spl/u-boot-spl.bin 
$(obj)u-boot.bin
                cat $(obj)spl/u-boot-spl-pad.bin $(obj)u-boot.bin > $@
                rm $(obj)spl/u-boot-spl-pad.bin
 
+$(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.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
@@ -850,6 +854,7 @@ clobber:    tidy
        @rm -f $(obj)u-boot.kwb
        @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.ubl
        @rm -f $(obj)u-boot.ais
        @rm -f $(obj)u-boot.dtb
diff --git a/arch/arm/imx-common/Makefile b/arch/arm/imx-common/Makefile
index 428a57e..f59ae6f 100644
--- a/arch/arm/imx-common/Makefile
+++ b/arch/arm/imx-common/Makefile
@@ -55,6 +55,12 @@ $(OBJTREE)/SPL: $(OBJTREE)/spl/u-boot-spl.bin 
$(OBJTREE)/$(patsubst "%",%,$(CONF
        $(OBJTREE)/tools/mkimage -n $(filter-out %.bin,$^) -T imximage \
        -e $(CONFIG_SPL_TEXT_BASE) -d $< $@
 
+$(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
+
 
 #########################################################################
 
-- 
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