]> git.sur5r.net Git - u-boot/commitdiff
Makefile: Change CONFIG_SPL_PAD_TO to image offset
authorBenoît Thébaudeau <benoit.thebaudeau@advansee.com>
Thu, 11 Apr 2013 09:35:49 +0000 (09:35 +0000)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Fri, 12 Apr 2013 05:55:06 +0000 (07:55 +0200)
Change CONFIG_SPL_PAD_TO from a link address to an image offset since this is
more handy and closer to the purpose of this config.

Automatically define CONFIG_SPL_PAD_TO to CONFIG_SPL_MAX_SIZE (or 0 without
CONFIG_SPL_MAX_SIZE).

Test that CONFIG_SPL_PAD_TO >= CONFIG_SPL_MAX_SIZE if CONFIG_SPL_PAD_TO is
non-zero.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Makefile
README
include/config_fallbacks.h
include/configs/MPC8313ERDB.h
include/configs/p1_p2_rdb_pc.h

index 4ede9379d14c97aca2951dd98a61547cb6841a1d..8d0e2b8552f06e84e421f15aa2c07a746fe5dfdf 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -486,9 +486,8 @@ $(obj)u-boot.dis:   $(obj)u-boot
 
 
 $(obj)u-boot-with-spl.bin: $(obj)spl/u-boot-spl.bin $(obj)u-boot.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
+               $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(CONFIG_SPL_PAD_TO) \
+                       -I binary -O binary $< $(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 9285ddda406ebb96e8517dd03904ba63bc28d9f9..6272853993205496cf8cd1a6176e54e48badca21 100644 (file)
--- a/README
+++ b/README
@@ -2908,8 +2908,11 @@ FIT uImage format:
                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.
+               Image offset to which the SPL should be padded before appending
+               the SPL payload. By default, this is defined as
+               CONFIG_SPL_MAX_SIZE, or 0 if CONFIG_SPL_MAX_SIZE is undefined.
+               CONFIG_SPL_PAD_TO must be either 0, meaning to append the SPL
+               payload without any padding, or >= CONFIG_SPL_MAX_SIZE.
 
                CONFIG_SPL_TARGET
                Final target image containing SPL and payload.  Some SPLs
index 9298d0ee970892ed2a5355837a045dadc2f5cfa4..e59ee963f71f49f5b8ef917fc47bb8f0835b12e0 100644 (file)
@@ -9,6 +9,22 @@
 #ifndef __CONFIG_FALLBACKS_H
 #define __CONFIG_FALLBACKS_H
 
+#ifdef CONFIG_SPL
+#ifdef CONFIG_SPL_PAD_TO
+#ifdef CONFIG_SPL_MAX_SIZE
+#if CONFIG_SPL_PAD_TO && CONFIG_SPL_PAD_TO < CONFIG_SPL_MAX_SIZE
+#error CONFIG_SPL_PAD_TO < CONFIG_SPL_MAX_SIZE
+#endif
+#endif
+#else
+#ifdef CONFIG_SPL_MAX_SIZE
+#define CONFIG_SPL_PAD_TO      CONFIG_SPL_MAX_SIZE
+#else
+#define CONFIG_SPL_PAD_TO      0
+#endif
+#endif
+#endif
+
 #ifndef CONFIG_SYS_BAUDRATE_TABLE
 #define CONFIG_SYS_BAUDRATE_TABLE      { 9600, 19200, 38400, 57600, 115200 }
 #endif
index 275d4f2af633558848145fc2455922ee6bef74b9..c28dfe0068ebec732937e618886746362292d93a 100644 (file)
@@ -52,7 +52,7 @@
 #define CONFIG_SYS_TEXT_BASE   0x00100000 /* CONFIG_SYS_NAND_U_BOOT_DST */
 #define CONFIG_SYS_TEXT_BASE_SPL 0xfff00000
 #define CONFIG_SPL_MAX_SIZE    (4 * 1024)
-#define CONFIG_SPL_PAD_TO      0xfff04000
+#define CONFIG_SPL_PAD_TO      0x4000
 
 #define CONFIG_SYS_NAND_U_BOOT_SIZE  (512 << 10)
 #define CONFIG_SYS_NAND_U_BOOT_DST   0x00100000
index 964bfcd440bed222e46e74053a320534b4ffff87..7ed634b701f29541e860ba8459c70b69d418fca9 100644 (file)
 #define CONFIG_SPL_TARGET              "u-boot-with-spl.bin"
 
 #define CONFIG_SPL_TEXT_BASE           0xfffff000
-#define CONFIG_SPL_MAX_SIZE            (4 * 1024)
+#define CONFIG_SPL_MAX_SIZE            4096
 
 #ifdef CONFIG_SYS_INIT_L2_ADDR
 /* We multiply CONFIG_SPL_MAX_SIZE by two to leave some room for BSS. */