Patchwork [U-Boot,1/3] spl: Change PAD_TO to CONFIG_SPL_PAD_TO

login
register
mail settings
Submitter Scott Wood
Date Dec. 6, 2012, 11:33 p.m.
Message ID <1354836798-17441-1-git-send-email-scottwood@freescale.com>
Download mbox | patch
Permalink /patch/204345/
State Accepted
Delegated to: Kim Phillips
Headers show

Comments

Scott Wood - Dec. 6, 2012, 11:33 p.m.
This was already used by some SPL targets, and allows the pad amount to
be specified by board config headers rather than only in makefile
fragments.

Also supply a pad-to of zero if the variable is undefined.  It works
without this, but this avoids relying on undocumented behavior.

Signed-off-by: Scott Wood <scottwood@freescale.com>
---
 Makefile                        |    6 +++++-
 README                          |    4 ++++
 board/ait/cam_enc_4xx/config.mk |    2 +-
 3 files changed, 10 insertions(+), 2 deletions(-)
Kim Phillips - Dec. 19, 2012, 11:52 p.m.
On Thu, 6 Dec 2012 17:33:16 -0600
Scott Wood <scottwood@freescale.com> wrote:

> This was already used by some SPL targets, and allows the pad amount to
> be specified by board config headers rather than only in makefile
> fragments.
> 
> Also supply a pad-to of zero if the variable is undefined.  It works
> without this, but this avoids relying on undocumented behavior.
> 
> Signed-off-by: Scott Wood <scottwood@freescale.com>
> ---
>  Makefile                        |    6 +++++-
>  README                          |    4 ++++
>  board/ait/cam_enc_4xx/config.mk |    2 +-
>  3 files changed, 10 insertions(+), 2 deletions(-)

Despite this first patch falling outside of my domain, I
applied all 3 patches to u-boot-mpc83xx/next.

Thanks,

Kim

Patch

diff --git a/Makefile b/Makefile
index 2132ebf..090e3ff 100644
--- a/Makefile
+++ b/Makefile
@@ -485,8 +485,12 @@  $(obj)u-boot.sha1:	$(obj)u-boot.bin
 $(obj)u-boot.dis:	$(obj)u-boot
 		$(OBJDUMP) -d $< > $@
 
+
+
 $(obj)u-boot-with-spl.bin: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
-		$(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $(obj)spl/u-boot-spl $(obj)spl/u-boot-spl-pad.bin
+		$(OBJCOPY) ${OBJCFLAGS} --pad-to=$(or $(CONFIG_SPL_PAD_TO),0) \
+			-O binary $(obj)spl/u-boot-spl \
+			$(obj)spl/u-boot-spl-pad.bin
 		cat $(obj)spl/u-boot-spl-pad.bin $(obj)u-boot.bin > $@
 		rm $(obj)spl/u-boot-spl-pad.bin
 
diff --git a/README b/README
index ed7d270..3c3de4f 100644
--- a/README
+++ b/README
@@ -2784,6 +2784,10 @@  FIT uImage format:
 		CONFIG_SPL_LIBGENERIC_SUPPORT
 		Support for lib/libgeneric.o in SPL binary
 
+		CONFIG_SPL_PAD_TO
+		Linker address to which the SPL should be padded before
+		appending the SPL payload.
+
 		CONFIG_SPL_TARGET
 		Final target image containing SPL and payload.  Some SPLs
 		use an arch-specific makefile fragment instead, for
diff --git a/board/ait/cam_enc_4xx/config.mk b/board/ait/cam_enc_4xx/config.mk
index 744b927..c280029 100644
--- a/board/ait/cam_enc_4xx/config.mk
+++ b/board/ait/cam_enc_4xx/config.mk
@@ -8,7 +8,7 @@ 
 #
 
 #Provide at least 16MB spacing between us and the Linux Kernel image
-PAD_TO	:= 12320
+CONFIG_SPL_PAD_TO := 12320
 UBL_CONFIG = $(SRCTREE)/board/$(BOARDDIR)/ublimage.cfg
 ifndef CONFIG_SPL_BUILD
 ALL-y += $(obj)u-boot.ubl