[U-Boot] [PATCH 1/7] spl: pbl: Add new SPL image for pblimage tool

Alison Wang
2014-09-18T05:47:13Z

For the pblimage tool, the SPL image is splitted into 64 byte chunks,
and PBL needs a command for each piece. In current pblimage structure,
the size of the SPL image should be a fixed value. Well, for LS102xA
and some other ARM platforms, the size of the SPL image is changeable.
So a new image spl/u-boot-spl-pbl-pad.bin is built, and the size of
it is a fixed value "CONFIG_SPL_MAX_SIZE". Use it instead of
spl/u-boot-spl.bin for LS102xA.

CONFIG_SPL_PBL_PAD is used to enable this function.

Signed-off-by: Alison Wang <alison.wang@freescale.com>
---
Makefile | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 1fccd0b..6af424e 100644
--- a/Makefile
+++ b/Makefile
@@ -730,6 +730,7 @@ ALL-y += u-boot.srec u-boot.bin System.map binary_size_check
ALL-$(CONFIG_ONENAND_U_BOOT) += u-boot-onenand.bin
ifeq ($(CONFIG_SPL_FSL_PBL),y)
ALL-$(CONFIG_RAMBOOT_PBL) += u-boot-with-spl-pbl.bin
+ALL-$(CONFIG_SPL_PBL_PAD) += spl/u-boot-spl-pbl-pad.bin
else
ALL-$(CONFIG_RAMBOOT_PBL) += u-boot.pbl
endif
@@ -774,6 +775,8 @@ cmd_cat = cat $(filter-out $(PHONY), $^) > $@

append = cat $(filter-out $< $(PHONY), $^) >> $@

+cmd_pad = $(cmd_objcopy)
+
quiet_cmd_pad_cat = CAT $@
cmd_pad_cat = $(cmd_objcopy) && $(append) || rm -f $@

@@ -962,15 +965,27 @@ endif
u-boot-img.bin: spl/u-boot-spl.bin u-boot.img FORCE
$(call if_changed,cat)

+ifdef CONFIG_SPL_PBL_PAD
+SPLPBL_BINLOAD := spl/u-boot-spl-pbl-pad.bin
+else
+SPLPBL_BINLOAD := spl/u-boot-spl.bin
+endif
+
#Add a target to create boot binary having SPL binary in PBI format
#concatenated with u-boot binary. It is need by PowerPC SoC having
#internal SRAM <= 512KB.
MKIMAGEFLAGS_u-boot-spl.pbl = -n $(srctree)/$(CONFIG_SYS_FSL_PBL_RCW:"%"=%) \
-R $(srctree)/$(CONFIG_SYS_FSL_PBL_PBI:"%"=%) -T pblimage

-spl/u-boot-spl.pbl: spl/u-boot-spl.bin FORCE
+spl/u-boot-spl.pbl: $(SPLPBL_BINLOAD) FORCE
$(call if_changed,mkimage)

+OBJCOPYFLAGS_u-boot-spl-pbl-pad.bin = -I binary -O binary --pad-to=$(CONFIG_SPL_MAX_SIZE) \
+ --gap-fill=0xff
+
+spl/u-boot-spl-pbl-pad.bin: spl/u-boot-spl.bin FORCE
+ $(call if_changed,pad)
+
OBJCOPYFLAGS_u-boot-with-spl-pbl.bin = -I binary -O binary --pad-to=$(CONFIG_SPL_PAD_TO) \
--gap-fill=0xff

--
1.8.0