[U-Boot] [PATCH v7 18/19] imx: Add u-boot-with-spl.imx make target

Benoît Thébaudeau benoit.thebaudeau at advansee.com
Fri Feb 15 21:54:24 CET 2013


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.thebaudeau at advansee.com>
---
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

 Makefile                     |    5 +++++
 arch/arm/imx-common/Makefile |   11 +++++++++++
 2 files changed, 16 insertions(+)

diff --git a/Makefile b/Makefile
index 317dffc..896266f 100644
--- a/Makefile
+++ b/Makefile
@@ -491,6 +491,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
@@ -862,6 +866,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 6309fcd..24bf822 100644
--- a/arch/arm/imx-common/Makefile
+++ b/arch/arm/imx-common/Makefile
@@ -54,6 +54,17 @@ $(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/u-boot-spl.bin $(OBJTREE)/u-boot.bin \
+				$(OBJTREE)/$(patsubst "%",%,$(CONFIG_IMX_CONFIG)).cfgtmp
+	$(OBJCOPY) ${OBJCFLAGS} --pad-to=$(CONFIG_SPL_MAX_SIZE) -I binary \
+		-O binary $< $(OBJTREE)/spl/u-boot-spl-pad.bin
+	$(OBJTREE)/tools/mkimage -n $(filter-out %.bin,$^) -T imximage \
+		-e $(CONFIG_SPL_TEXT_BASE) -d $(OBJTREE)/spl/u-boot-spl-pad.bin \
+		$(OBJTREE)/spl/u-boot-spl-pad.imx
+	rm $(OBJTREE)/spl/u-boot-spl-pad.bin
+	cat $(OBJTREE)/spl/u-boot-spl-pad.imx $(OBJTREE)/u-boot.bin > $@
+	rm $(OBJTREE)/spl/u-boot-spl-pad.imx
+
 
 #########################################################################
 
-- 
1.7.10.4



More information about the U-Boot mailing list