Patchwork [U-Boot,4/6] Makefile:Add u-boot-with-spl-pbl.bin target for SPL

login
register
mail settings
Submitter Prabhakar Kushwaha
Date Oct. 1, 2013, 8:27 a.m.
Message ID <1380616069-11230-1-git-send-email-prabhakar@freescale.com>
Download mbox | patch
Permalink /patch/279371/
State Superseded
Delegated to: York Sun
Headers show

Comments

Prabhakar Kushwaha - Oct. 1, 2013, 8:27 a.m.
This image combines the pbl format of SPL with and U-Boot. This is a
convenient way of having a single image to program on indirect boot source.

Corenet platforms like T4240, P4080 etc have PBL hardware which read data
in PBL format and copy to internal SRAM for further execution.
This image configures DDR, copy u-boot to DDR and transfer the control.

Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
---
 Based upon  git://git.denx.de/u-boot-mpc85xx.git branch next

 Makefile     |    7 +++++++
 spl/Makefile |    9 +++++++++
 2 files changed, 16 insertions(+)

Patch

diff --git a/Makefile b/Makefile
index 6f8f2f1..260bb65 100644
--- a/Makefile
+++ b/Makefile
@@ -496,6 +496,9 @@  endif
 $(obj)u-boot-with-spl.bin: $(obj)spl/u-boot-spl.bin $(SPL_PAYLOAD)
 		$(call SPL_PAD_APPEND,$<,$(SPL_PAYLOAD),spl/u-boot-spl-pad.bin,$(CONFIG_SPL_PAD_TO))
 
+$(obj)u-boot-with-spl-pbl.bin: $(obj)spl/u-boot-spl.pbl $(SPL_PAYLOAD)
+		$(call SPL_PAD_APPEND,$<,$(SPL_PAYLOAD),spl/u-boot-spl-pad.bin,$(CONFIG_SPL_PAD_TO))
+
 $(obj)tpl/u-boot-with-tpl.bin: $(obj)tpl/u-boot-tpl.bin $(obj)u-boot.bin
 		$(call SPL_PAD_APPEND,$<,$(obj)u-boot.bin,tpl/u-boot-tpl-pad.bin,$(CONFIG_TPL_PAD_TO))
 
@@ -623,6 +626,9 @@  $(obj)u-boot-nand.bin:	nand_spl $(obj)u-boot.bin
 $(obj)spl/u-boot-spl.bin:	$(SUBDIR_TOOLS) depend
 		$(MAKE) -C spl all
 
+$(obj)spl/u-boot-spl.pbl:	$(SUBDIR_TOOLS) depend
+		$(MAKE) -C spl all
+
 $(obj)tpl/u-boot-tpl.bin:	$(SUBDIR_TOOLS) depend
 		$(MAKE) -C spl all CONFIG_TPL_BUILD=y
 
@@ -917,6 +923,7 @@  clobber:	tidy
 	@rm -f $(obj)nand_spl/{u-boot.{lds,lst},System.map}
 	@rm -f $(obj)nand_spl/{u-boot-nand_spl.lds,u-boot-spl,u-boot-spl.map}
 	@rm -f $(obj)spl/{u-boot-spl,u-boot-spl.bin,u-boot-spl.map}
+	@rm -f $(obj)spl/u-boot-spl.pbl
 	@rm -f $(obj)spl/u-boot-spl.lds
 	@rm -f $(obj)tpl/{u-boot-tpl,u-boot-tpl.bin,u-boot-tpl.map}
 	@rm -f $(obj)tpl/u-boot-spl.lds
diff --git a/spl/Makefile b/spl/Makefile
index 174d0a7..919f97e 100644
--- a/spl/Makefile
+++ b/spl/Makefile
@@ -180,6 +180,10 @@  ifdef CONFIG_SAMSUNG
 ALL-y	+= $(obj)$(BOARD)-spl.bin
 endif
 
+ifdef CONFIG_PBLPBI_CONFIG
+ALL-y	+= $(obj)$(SPL_BIN).pbl
+endif
+
 all:	$(ALL-y)
 
 ifdef CONFIG_SAMSUNG
@@ -191,6 +195,11 @@  endif
 $(obj)$(SPL_BIN).bin:	$(obj)$(SPL_BIN)
 	$(OBJCOPY) $(OBJCFLAGS) -O binary $< $@
 
+$(obj)$(SPL_BIN).pbl:	$(obj)$(SPL_BIN).bin
+		$(obj)../tools/mkimage -n $(CONFIG_PBLRCW_CONFIG) \
+		-R $(CONFIG_PBLPBI_CONFIG) -T pblimage \
+		-d $< $@
+
 GEN_UBOOT = \
 	cd $(obj) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) $(__START) \
 		--start-group $(__LIBS) --end-group $(PLATFORM_LIBS) \