summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/arm/cpu/arm1136/u-boot-spl.lds4
-rw-r--r--arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds2
-rw-r--r--arch/arm/cpu/arm926ejs/orion5x/u-boot-spl.lds4
-rw-r--r--arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds4
-rw-r--r--arch/arm/cpu/armv7/sunxi/u-boot-spl.lds4
-rw-r--r--arch/arm/cpu/armv8/u-boot-spl.lds4
-rw-r--r--arch/arm/cpu/u-boot-spl.lds4
-rw-r--r--arch/arm/mach-at91/arm926ejs/u-boot-spl.lds8
-rw-r--r--arch/arm/mach-at91/armv7/u-boot-spl.lds4
-rw-r--r--arch/arm/mach-omap2/u-boot-spl.lds4
-rw-r--r--arch/arm/mach-rockchip/Kconfig9
-rw-r--r--arch/arm/mach-rockchip/rk3288/u-boot-tpl.lds9
-rw-r--r--arch/arm/mach-rockchip/rk3368/u-boot-tpl.lds12
-rw-r--r--arch/arm/mach-zynq/u-boot-spl.lds4
-rw-r--r--arch/mips/cpu/u-boot-spl.lds4
-rw-r--r--arch/powerpc/cpu/mpc85xx/u-boot-spl.lds2
-rw-r--r--arch/x86/cpu/u-boot-spl.lds2
-rw-r--r--board/Barix/ipam390/u-boot-spl-ipam390.lds2
-rw-r--r--board/davinci/da8xxevm/u-boot-spl-da850evm.lds2
-rw-r--r--board/samsung/common/exynos-uboot-spl.lds2
-rw-r--r--common/spl/Kconfig2
-rw-r--r--include/configs/C29XPCIE.h6
-rw-r--r--include/configs/P1010RDB.h6
-rw-r--r--include/configs/P1022DS.h6
-rw-r--r--include/configs/p1_p2_rdb_pc.h6
-rw-r--r--scripts/Makefile.spl16
26 files changed, 61 insertions, 71 deletions
diff --git a/arch/arm/cpu/arm1136/u-boot-spl.lds b/arch/arm/cpu/arm1136/u-boot-spl.lds
index 881275adef..f83988fd7e 100644
--- a/arch/arm/cpu/arm1136/u-boot-spl.lds
+++ b/arch/arm/cpu/arm1136/u-boot-spl.lds
@@ -8,8 +8,8 @@
* Aneesh V <aneesh@ti.com>
*/
-MEMORY { .sram : ORIGIN = CONFIG_SPL_TEXT_BASE,\
- LENGTH = CONFIG_SPL_MAX_SIZE }
+MEMORY { .sram : ORIGIN = IMAGE_TEXT_BASE,\
+ LENGTH = IMAGE_MAX_SIZE }
MEMORY { .sdram : ORIGIN = CONFIG_SPL_BSS_START_ADDR, \
LENGTH = CONFIG_SPL_BSS_MAX_SIZE }
diff --git a/arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds b/arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds
index ffc70ce86b..7e20448f81 100644
--- a/arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds
+++ b/arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds
@@ -15,7 +15,7 @@ OUTPUT_ARCH(arm)
ENTRY(_start)
SECTIONS
{
- . = CONFIG_SPL_TEXT_BASE;
+ . = IMAGE_TEXT_BASE;
. = ALIGN(4);
.text :
diff --git a/arch/arm/cpu/arm926ejs/orion5x/u-boot-spl.lds b/arch/arm/cpu/arm926ejs/orion5x/u-boot-spl.lds
index fbdb1d7e77..a537fe0295 100644
--- a/arch/arm/cpu/arm926ejs/orion5x/u-boot-spl.lds
+++ b/arch/arm/cpu/arm926ejs/orion5x/u-boot-spl.lds
@@ -16,8 +16,8 @@
* Texas Instruments, <www.ti.com>
* Aneesh V <aneesh@ti.com>
*/
-MEMORY { .nor : ORIGIN = CONFIG_SPL_TEXT_BASE,\
- LENGTH = CONFIG_SPL_MAX_SIZE }
+MEMORY { .nor : ORIGIN = IMAGE_TEXT_BASE,\
+ LENGTH = IMAGE_MAX_SIZE }
MEMORY { .bss : ORIGIN = CONFIG_SPL_BSS_START_ADDR, \
LENGTH = CONFIG_SPL_BSS_MAX_SIZE }
diff --git a/arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds b/arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds
index 569704c317..0964a9742e 100644
--- a/arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds
+++ b/arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds
@@ -12,8 +12,8 @@
* Gary Jennejohn, DENX Software Engineering, <garyj@denx.de>
*/
-MEMORY { .sram : ORIGIN = CONFIG_SPL_TEXT_BASE,\
- LENGTH = CONFIG_SPL_MAX_SIZE }
+MEMORY { .sram : ORIGIN = IMAGE_TEXT_BASE,\
+ LENGTH = IMAGE_MAX_SIZE }
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
diff --git a/arch/arm/cpu/armv7/sunxi/u-boot-spl.lds b/arch/arm/cpu/armv7/sunxi/u-boot-spl.lds
index 5d7f3f578b..942c29fc95 100644
--- a/arch/arm/cpu/armv7/sunxi/u-boot-spl.lds
+++ b/arch/arm/cpu/armv7/sunxi/u-boot-spl.lds
@@ -13,8 +13,8 @@
* Texas Instruments, <www.ti.com>
* Aneesh V <aneesh@ti.com>
*/
-MEMORY { .sram : ORIGIN = CONFIG_SPL_TEXT_BASE,\
- LENGTH = CONFIG_SPL_MAX_SIZE }
+MEMORY { .sram : ORIGIN = IMAGE_TEXT_BASE,\
+ LENGTH = IMAGE_MAX_SIZE }
MEMORY { .sdram : ORIGIN = CONFIG_SPL_BSS_START_ADDR, \
LENGTH = CONFIG_SPL_BSS_MAX_SIZE }
diff --git a/arch/arm/cpu/armv8/u-boot-spl.lds b/arch/arm/cpu/armv8/u-boot-spl.lds
index 4e48da56be..ccbf359bd1 100644
--- a/arch/arm/cpu/armv8/u-boot-spl.lds
+++ b/arch/arm/cpu/armv8/u-boot-spl.lds
@@ -11,8 +11,8 @@
* Aneesh V <aneesh@ti.com>
*/
-MEMORY { .sram : ORIGIN = CONFIG_SPL_TEXT_BASE,
- LENGTH = CONFIG_SPL_MAX_SIZE }
+MEMORY { .sram : ORIGIN = IMAGE_TEXT_BASE,
+ LENGTH = IMAGE_MAX_SIZE }
MEMORY { .sdram : ORIGIN = CONFIG_SPL_BSS_START_ADDR,
LENGTH = CONFIG_SPL_BSS_MAX_SIZE }
diff --git a/arch/arm/cpu/u-boot-spl.lds b/arch/arm/cpu/u-boot-spl.lds
index 9d1333176b..a2aa93a735 100644
--- a/arch/arm/cpu/u-boot-spl.lds
+++ b/arch/arm/cpu/u-boot-spl.lds
@@ -78,8 +78,8 @@ SECTIONS
.ARM.exidx : { *(.ARM.exidx*) }
}
-#if defined(CONFIG_SPL_MAX_SIZE)
-ASSERT(__image_copy_end - __image_copy_start < (CONFIG_SPL_MAX_SIZE), \
+#if defined(IMAGE_MAX_SIZE)
+ASSERT(__image_copy_end - __image_copy_start < (IMAGE_MAX_SIZE), \
"SPL image too big");
#endif
diff --git a/arch/arm/mach-at91/arm926ejs/u-boot-spl.lds b/arch/arm/mach-at91/arm926ejs/u-boot-spl.lds
index b714e93b3b..f18b17dc93 100644
--- a/arch/arm/mach-at91/arm926ejs/u-boot-spl.lds
+++ b/arch/arm/mach-at91/arm926ejs/u-boot-spl.lds
@@ -4,8 +4,8 @@
* Bo Shen <voice.shen@atmel.com>
*/
-MEMORY { .sram : ORIGIN = CONFIG_SPL_TEXT_BASE, \
- LENGTH = CONFIG_SPL_MAX_SIZE }
+MEMORY { .sram : ORIGIN = IMAGE_TEXT_BASE, \
+ LENGTH = IMAGE_MAX_SIZE }
MEMORY { .sdram : ORIGIN = CONFIG_SPL_BSS_START_ADDR, \
LENGTH = CONFIG_SPL_BSS_MAX_SIZE }
@@ -49,8 +49,8 @@ SECTIONS
} >.sdram
}
-#if defined(CONFIG_SPL_MAX_SIZE)
-ASSERT(__image_copy_end - __start < (CONFIG_SPL_MAX_SIZE), \
+#if defined(IMAGE_MAX_SIZE)
+ASSERT(__image_copy_end - __start < (IMAGE_MAX_SIZE), \
"SPL image too big");
#endif
diff --git a/arch/arm/mach-at91/armv7/u-boot-spl.lds b/arch/arm/mach-at91/armv7/u-boot-spl.lds
index 22237cffc9..950ea55d7c 100644
--- a/arch/arm/mach-at91/armv7/u-boot-spl.lds
+++ b/arch/arm/mach-at91/armv7/u-boot-spl.lds
@@ -11,8 +11,8 @@
* Bo Shen <voice.shen@atmel.com>
*/
-MEMORY { .sram : ORIGIN = CONFIG_SPL_TEXT_BASE, \
- LENGTH = CONFIG_SPL_MAX_SIZE }
+MEMORY { .sram : ORIGIN = IMAGE_TEXT_BASE, \
+ LENGTH = IMAGE_MAX_SIZE }
MEMORY { .sdram : ORIGIN = CONFIG_SPL_BSS_START_ADDR, \
LENGTH = CONFIG_SPL_BSS_MAX_SIZE }
diff --git a/arch/arm/mach-omap2/u-boot-spl.lds b/arch/arm/mach-omap2/u-boot-spl.lds
index a1289f6a74..88d81f9b98 100644
--- a/arch/arm/mach-omap2/u-boot-spl.lds
+++ b/arch/arm/mach-omap2/u-boot-spl.lds
@@ -8,8 +8,8 @@
* Aneesh V <aneesh@ti.com>
*/
-MEMORY { .sram : ORIGIN = CONFIG_SPL_TEXT_BASE,\
- LENGTH = CONFIG_SPL_MAX_SIZE }
+MEMORY { .sram : ORIGIN = IMAGE_TEXT_BASE,\
+ LENGTH = IMAGE_MAX_SIZE }
MEMORY { .sdram : ORIGIN = CONFIG_SPL_BSS_START_ADDR, \
LENGTH = CONFIG_SPL_BSS_MAX_SIZE }
diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
index 6dc8e3a017..8e9d88c3f9 100644
--- a/arch/arm/mach-rockchip/Kconfig
+++ b/arch/arm/mach-rockchip/Kconfig
@@ -75,12 +75,12 @@ config ROCKCHIP_RK3288
if ROCKCHIP_RK3288
-config TPL_LDSCRIPT
- default "arch/arm/mach-rockchip/rk3288/u-boot-tpl.lds"
-
config TPL_TEXT_BASE
default 0xff704000
+config TPL_MAX_SIZE
+ default 32768
+
endif
config ROCKCHIP_RK3328
@@ -117,9 +117,6 @@ config ROCKCHIP_RK3368
if ROCKCHIP_RK3368
-config TPL_LDSCRIPT
- default "arch/arm/mach-rockchip/rk3368/u-boot-tpl.lds"
-
config TPL_TEXT_BASE
default 0xff8c1000
diff --git a/arch/arm/mach-rockchip/rk3288/u-boot-tpl.lds b/arch/arm/mach-rockchip/rk3288/u-boot-tpl.lds
deleted file mode 100644
index 2e559890ab..0000000000
--- a/arch/arm/mach-rockchip/rk3288/u-boot-tpl.lds
+++ /dev/null
@@ -1,9 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * Copyright (C) 2018 Jagan Teki <jagan@amarulasolutions.com>
- */
-
-#undef CONFIG_SPL_TEXT_BASE
-#define CONFIG_SPL_TEXT_BASE CONFIG_TPL_TEXT_BASE
-
-#include "../../cpu/u-boot-spl.lds"
diff --git a/arch/arm/mach-rockchip/rk3368/u-boot-tpl.lds b/arch/arm/mach-rockchip/rk3368/u-boot-tpl.lds
deleted file mode 100644
index 7ba35b6c94..0000000000
--- a/arch/arm/mach-rockchip/rk3368/u-boot-tpl.lds
+++ /dev/null
@@ -1,12 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * (C) Copyright 2017 Theobroma Systems Design und Consulting GmbH
- */
-
-#undef CONFIG_SPL_TEXT_BASE
-#define CONFIG_SPL_TEXT_BASE CONFIG_TPL_TEXT_BASE
-
-#undef CONFIG_SPL_MAX_SIZE
-#define CONFIG_SPL_MAX_SIZE CONFIG_TPL_MAX_SIZE
-
-#include "../../cpu/armv8/u-boot-spl.lds"
diff --git a/arch/arm/mach-zynq/u-boot-spl.lds b/arch/arm/mach-zynq/u-boot-spl.lds
index 080c6bf06d..106d2e390b 100644
--- a/arch/arm/mach-zynq/u-boot-spl.lds
+++ b/arch/arm/mach-zynq/u-boot-spl.lds
@@ -7,8 +7,8 @@
* Gary Jennejohn, DENX Software Engineering, <garyj@denx.de>
*/
-MEMORY { .sram : ORIGIN = CONFIG_SPL_TEXT_BASE,\
- LENGTH = CONFIG_SPL_MAX_SIZE }
+MEMORY { .sram : ORIGIN = IMAGE_TEXT_BASE,\
+ LENGTH = IMAGE_MAX_SIZE }
MEMORY { .sdram : ORIGIN = CONFIG_SPL_BSS_START_ADDR, \
LENGTH = CONFIG_SPL_BSS_MAX_SIZE }
diff --git a/arch/mips/cpu/u-boot-spl.lds b/arch/mips/cpu/u-boot-spl.lds
index be194d314b..d08d6222c4 100644
--- a/arch/mips/cpu/u-boot-spl.lds
+++ b/arch/mips/cpu/u-boot-spl.lds
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0+ */
-MEMORY { .spl_mem : ORIGIN = CONFIG_SPL_TEXT_BASE, \
- LENGTH = CONFIG_SPL_MAX_SIZE }
+MEMORY { .spl_mem : ORIGIN = IMAGE_TEXT_BASE, \
+ LENGTH = IMAGE_MAX_SIZE }
MEMORY { .bss_mem : ORIGIN = CONFIG_SPL_BSS_START_ADDR, \
LENGTH = CONFIG_SPL_BSS_MAX_SIZE }
diff --git a/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds b/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds
index 6dc8d9913b..27a5fe6306 100644
--- a/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds
+++ b/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds
@@ -18,7 +18,7 @@ PHDRS
#endif
SECTIONS
{
- . = CONFIG_SPL_TEXT_BASE;
+ . = IMAGE_TEXT_BASE;
.text : {
*(.text*)
}
diff --git a/arch/x86/cpu/u-boot-spl.lds b/arch/x86/cpu/u-boot-spl.lds
index 574d992aaa..4e656dc4e5 100644
--- a/arch/x86/cpu/u-boot-spl.lds
+++ b/arch/x86/cpu/u-boot-spl.lds
@@ -15,7 +15,7 @@ SECTIONS
/DISCARD/ : { *(.u_boot_list_2_cmd_*) }
#endif
- . = CONFIG_SPL_TEXT_BASE; /* Location of bootcode in flash */
+ . = IMAGE_TEXT_BASE; /* Location of bootcode in flash */
__text_start = .;
.text : { *(.text*); }
diff --git a/board/Barix/ipam390/u-boot-spl-ipam390.lds b/board/Barix/ipam390/u-boot-spl-ipam390.lds
index cf13e0a41c..06ed3fa89f 100644
--- a/board/Barix/ipam390/u-boot-spl-ipam390.lds
+++ b/board/Barix/ipam390/u-boot-spl-ipam390.lds
@@ -7,7 +7,7 @@
* Guennadi Liakhovetki, DENX Software Engineering, <lg@denx.de>
*/
-MEMORY { .sram : ORIGIN = CONFIG_SPL_TEXT_BASE,\
+MEMORY { .sram : ORIGIN = IMAGE_TEXT_BASE,\
LENGTH = CONFIG_SPL_MAX_FOOTPRINT }
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
diff --git a/board/davinci/da8xxevm/u-boot-spl-da850evm.lds b/board/davinci/da8xxevm/u-boot-spl-da850evm.lds
index f5462f88b1..7b5fab7756 100644
--- a/board/davinci/da8xxevm/u-boot-spl-da850evm.lds
+++ b/board/davinci/da8xxevm/u-boot-spl-da850evm.lds
@@ -7,7 +7,7 @@
* Guennadi Liakhovetki, DENX Software Engineering, <lg@denx.de>
*/
-MEMORY { .sram : ORIGIN = CONFIG_SPL_TEXT_BASE,\
+MEMORY { .sram : ORIGIN = IMAGE_TEXT_BASE,\
LENGTH = CONFIG_SPL_MAX_FOOTPRINT }
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
diff --git a/board/samsung/common/exynos-uboot-spl.lds b/board/samsung/common/exynos-uboot-spl.lds
index 0d4be426b6..5b32f7feb8 100644
--- a/board/samsung/common/exynos-uboot-spl.lds
+++ b/board/samsung/common/exynos-uboot-spl.lds
@@ -8,7 +8,7 @@
* Based on arch/arm/cpu/armv7/omap-common/u-boot-spl.lds
*/
-MEMORY { .sram : ORIGIN = CONFIG_SPL_TEXT_BASE, \
+MEMORY { .sram : ORIGIN = IMAGE_TEXT_BASE, \
LENGTH = CONFIG_SPL_MAX_FOOTPRINT }
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index aa24b6653f..54b0dc34f5 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -911,6 +911,8 @@ config TPL_BOARD_INIT
config TPL_LDSCRIPT
string "Linker script for the TPL stage"
depends on TPL
+ default "arch/arm/cpu/armv8/u-boot-spl.lds" if ARM64
+ default "arch/$(ARCH)/cpu/u-boot-spl.lds"
help
The TPL stage will usually require a different linker-script
(as it runs from a different memory region) than the regular
diff --git a/include/configs/C29XPCIE.h b/include/configs/C29XPCIE.h
index caeb34cf0a..ebf44b5529 100644
--- a/include/configs/C29XPCIE.h
+++ b/include/configs/C29XPCIE.h
@@ -23,7 +23,7 @@
#define CONFIG_TPL_DRIVERS_MISC_SUPPORT
#define CONFIG_SPL_COMMON_INIT_DDR
#define CONFIG_SPL_MAX_SIZE (128 << 10)
-#define CONFIG_SPL_TEXT_BASE 0xf8f81000
+#define CONFIG_TPL_TEXT_BASE 0xf8f81000
#define CONFIG_SYS_MPC85XX_NO_RESETVEC
#define CONFIG_SYS_NAND_U_BOOT_SIZE (832 << 10)
#define CONFIG_SYS_NAND_U_BOOT_DST (0x11000000)
@@ -50,7 +50,9 @@
#define CONFIG_RESET_VECTOR_ADDRESS 0xeffffffc
#endif
-#ifdef CONFIG_SPL_BUILD
+#ifdef CONFIG_TPL_BUILD
+#define CONFIG_SYS_MONITOR_BASE CONFIG_TPL_TEXT_BASE
+#elif defined(CONFIG_SPL_BUILD)
#define CONFIG_SYS_MONITOR_BASE CONFIG_SPL_TEXT_BASE
#else
#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE /* start of monitor */
diff --git a/include/configs/P1010RDB.h b/include/configs/P1010RDB.h
index 18f70f04af..134ffe5271 100644
--- a/include/configs/P1010RDB.h
+++ b/include/configs/P1010RDB.h
@@ -78,7 +78,7 @@
#define CONFIG_SPL_NAND_INIT
#define CONFIG_SPL_COMMON_INIT_DDR
#define CONFIG_SPL_MAX_SIZE (128 << 10)
-#define CONFIG_SPL_TEXT_BASE 0xD0001000
+#define CONFIG_TPL_TEXT_BASE 0xD0001000
#define CONFIG_SYS_MPC85XX_NO_RESETVEC
#define CONFIG_SYS_NAND_U_BOOT_SIZE (576 << 10)
#define CONFIG_SYS_NAND_U_BOOT_DST (0x11000000)
@@ -111,7 +111,9 @@
#define CONFIG_RESET_VECTOR_ADDRESS 0xeffffffc
#endif
-#ifdef CONFIG_SPL_BUILD
+#ifdef CONFIG_TPL_BUILD
+#define CONFIG_SYS_MONITOR_BASE CONFIG_TPL_TEXT_BASE
+#elif defined(CONFIG_SPL_BUILD)
#define CONFIG_SYS_MONITOR_BASE CONFIG_SPL_TEXT_BASE
#else
#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE /* start of monitor */
diff --git a/include/configs/P1022DS.h b/include/configs/P1022DS.h
index eeb19a9fa6..3ccfeca890 100644
--- a/include/configs/P1022DS.h
+++ b/include/configs/P1022DS.h
@@ -58,7 +58,7 @@
#define CONFIG_SPL_NAND_INIT
#define CONFIG_SPL_COMMON_INIT_DDR
#define CONFIG_SPL_MAX_SIZE (128 << 10)
-#define CONFIG_SPL_TEXT_BASE 0xf8f81000
+#define CONFIG_TPL_TEXT_BASE 0xf8f81000
#define CONFIG_SYS_MPC85XX_NO_RESETVEC
#define CONFIG_SYS_NAND_U_BOOT_SIZE (832 << 10)
#define CONFIG_SYS_NAND_U_BOOT_DST (0x11000000)
@@ -213,7 +213,9 @@
#define CONFIG_SYS_MAX_FLASH_SECT 1024
#ifndef CONFIG_SYS_MONITOR_BASE
-#ifdef CONFIG_SPL_BUILD
+#ifdef CONFIG_TPL_BUILD
+#define CONFIG_SYS_MONITOR_BASE CONFIG_TPL_TEXT_BASE
+#elif defined(CONFIG_SPL_BUILD)
#define CONFIG_SYS_MONITOR_BASE CONFIG_SPL_TEXT_BASE
#else
#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE /* start of monitor */
diff --git a/include/configs/p1_p2_rdb_pc.h b/include/configs/p1_p2_rdb_pc.h
index 459ecf328f..0e1f9836a6 100644
--- a/include/configs/p1_p2_rdb_pc.h
+++ b/include/configs/p1_p2_rdb_pc.h
@@ -178,7 +178,7 @@
#define CONFIG_SPL_NAND_INIT
#define CONFIG_SPL_COMMON_INIT_DDR
#define CONFIG_SPL_MAX_SIZE (128 << 10)
-#define CONFIG_SPL_TEXT_BASE 0xf8f81000
+#define CONFIG_TPL_TEXT_BASE 0xf8f81000
#define CONFIG_SYS_MPC85XX_NO_RESETVEC
#define CONFIG_SYS_NAND_U_BOOT_SIZE (832 << 10)
#define CONFIG_SYS_NAND_U_BOOT_DST (0x11000000)
@@ -207,7 +207,9 @@
#endif
#ifndef CONFIG_SYS_MONITOR_BASE
-#ifdef CONFIG_SPL_BUILD
+#ifdef CONFIG_TPL_BUILD
+#define CONFIG_SYS_MONITOR_BASE CONFIG_TPL_TEXT_BASE
+#elif defined(CONFIG_SPL_BUILD)
#define CONFIG_SYS_MONITOR_BASE CONFIG_SPL_TEXT_BASE
#else
#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE /* start of monitor */
diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
index e5b604e2d2..9d5921606e 100644
--- a/scripts/Makefile.spl
+++ b/scripts/Makefile.spl
@@ -147,6 +147,15 @@ LDPPFLAGS += \
$(shell $(LD) --version | \
sed -ne 's/GNU ld version \([0-9][0-9]*\)\.\([0-9][0-9]*\).*/-DLD_MAJOR=\1 -DLD_MINOR=\2/p')
+# Turn various CONFIG symbols into IMAGE symbols for easy reuse of
+# the scripts between SPL and TPL.
+ifneq ($(CONFIG_$(SPL_TPL_)MAX_SIZE),)
+LDPPFLAGS += -DIMAGE_MAX_SIZE=$(CONFIG_$(SPL_TPL_)MAX_SIZE)
+endif
+ifneq ($(CONFIG_$(SPL_TPL_)TEXT_BASE),)
+LDPPFLAGS += -DIMAGE_TEXT_BASE=$(CONFIG_$(SPL_TPL_)TEXT_BASE)
+endif
+
MKIMAGEOUTPUT ?= /dev/null
quiet_cmd_mkimage = MKIMAGE $@
@@ -321,14 +330,9 @@ LDFLAGS_$(SPL_BIN) += -T u-boot-spl.lds $(LDFLAGS_FINAL)
# Avoid 'Not enough room for program headers' error on binutils 2.28 onwards.
LDFLAGS_$(SPL_BIN) += $(call ld-option, --no-dynamic-linker)
-# First try the best-match (i.e. SPL_TEXT_BASE for SPL, TPL_TEXT_BASE for TPL)
+# Pick the best-match (i.e. SPL_TEXT_BASE for SPL, TPL_TEXT_BASE for TPL)
ifneq ($(CONFIG_$(SPL_TPL_)TEXT_BASE),)
LDFLAGS_$(SPL_BIN) += -Ttext $(CONFIG_$(SPL_TPL_)TEXT_BASE)
-else
-# And then fall back to just testing for SPL_TEXT_BASE, even if in TPL mode
-ifneq ($(CONFIG_SPL_TEXT_BASE),)
-LDFLAGS_$(SPL_BIN) += -Ttext $(CONFIG_SPL_TEXT_BASE)
-endif
endif
ifdef CONFIG_TARGET_SOCFPGA_ARRIA10