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

login
register
mail settings
Submitter Prabhakar Kushwaha
Date Oct. 25, 2013, 4:39 a.m.
Message ID <1382675948-24849-1-git-send-email-prabhakar@freescale.com>
Download mbox | patch
Permalink /patch/286077/
State Changes Requested
Delegated to: York Sun
Headers show

Comments

Prabhakar Kushwaha - Oct. 25, 2013, 4:39 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

 Changes for v2: Sending as it is

 Makefile     |    7 +++++++
 spl/Makefile |    9 +++++++++
 2 files changed, 16 insertions(+)
Scott Wood - Nov. 6, 2013, 1:38 a.m.
On Fri, 2013-10-25 at 10:09 +0530, Prabhakar Kushwaha wrote:
> +ifdef CONFIG_PBLPBI_CONFIG
> +ALL-y	+= $(obj)$(SPL_BIN).pbl
> +endif

I realize this symbol has already been introduced, but it's not
documented and would be better called something like
CONFIG_SYS_FSL_PBL_PBI (and likewise CONFIG_SYS_FSL_PBL_RCW).

>  all:	$(ALL-y)
>  
>  ifdef CONFIG_SAMSUNG
> @@ -192,6 +196,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 $< $@

This could be moved to rules.mk as a pattern rule for turning any .bin
into .pbl (and thus avoid duplication between spl and the main
makefile).

-Scott

Patch

diff --git a/Makefile b/Makefile
index 2d18d27..565aa7a 100644
--- a/Makefile
+++ b/Makefile
@@ -497,6 +497,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))
 
@@ -624,6 +627,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
 
@@ -918,6 +924,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 b366ac2..6d1ec47 100644
--- a/spl/Makefile
+++ b/spl/Makefile
@@ -181,6 +181,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
@@ -192,6 +196,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) \