Patchwork [U-Boot,v6,13/17] Makefile: u-boot-with-spl.bin: Fix SPL padding

login
register
mail settings
Submitter Benoît Thébaudeau
Date Feb. 14, 2013, 9:14 p.m.
Message ID <1360876483-31688-13-git-send-email-benoit.thebaudeau@advansee.com>
Download mbox | patch
Permalink /patch/220511/
State Changes Requested
Delegated to: Stefano Babic
Headers show

Comments

Benoît Thébaudeau - Feb. 14, 2013, 9:14 p.m.
PAD_TO is not a generic SPL configuration option, so use CONFIG_SPL_MAX_SIZE
instead.

We want to use --pad-to with a size, but this option expects an address, so make
addresses start at 0 with --change-addresses. This does not affect the binary
image.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
---
Changes in v6:
 - Fix size passed to --pad-to thanks to --change-addresses.

Changes in v5: None
Changes in v4:
 - New patch.

Changes in v3: None
Changes in v2: None

 Makefile |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Patch

diff --git a/Makefile b/Makefile
index a8c7b7b..b277be8 100644
--- a/Makefile
+++ b/Makefile
@@ -486,7 +486,9 @@  $(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=$(CONFIG_SPL_MAX_SIZE) \
+			--change-addresses=-$(CONFIG_SPL_TEXT_BASE) -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