PowerPC: Stop re-using CONFIG_SPL_TEXT_BASE for TPL
Subsystems (13)
PATCH 1/3 PowerPC: Stop re-using CONFIG_SPL_TEXT_BASE for TPL
Rather than checking for CONFIG_TPL_BUILD and then re-defining CONFIG_SPL_TEXT_BASE make use of CONFIG_TPL_TEXT_BASE directly.
--- arch/powerpc/cpu/mpc85xx/u-boot-spl.lds | 4 ++++ include/configs/C29XPCIE.h | 6 ++++-- include/configs/P1010RDB.h | 6 ++++-- include/configs/P1022DS.h | 6 ++++-- include/configs/p1_p2_rdb_pc.h | 6 ++++-- scripts/Makefile.spl | 7 +------ 6 files changed, 21 insertions(+), 14 deletions(-)
arch/powerpc/cpu/mpc85xx/u-boot-spl.lds +4 -0
@@ -18,7 +18,11 @@ PHDRS #endif SECTIONS { +#ifdef CONFIG_TPL_BUILD + . = CONFIG_TPL_TEXT_BASE; +#else . = CONFIG_SPL_TEXT_BASE; +#endif .text : { *(.text*) }
include/configs/C29XPCIE.h +4 -2
@@ -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 */
include/configs/P1010RDB.h +4 -2
@@ -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 */
include/configs/P1022DS.h +4 -2
@@ -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 */
include/configs/p1_p2_rdb_pc.h +4 -2
@@ -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 */
scripts/Makefile.spl +1 -6
@@ -318,14 +318,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
Signature · 1 line
2.7.4
PATCH 1/3 PowerPC: Stop re-using CONFIG_SPL_TEXT_BASE for TPL
Quoted 8 lines · Tom Rini
Rather than checking for
CONFIG_TPL_BUILDand then re-definingCONFIG_SPL_TEXT_BASEmake use ofCONFIG_TPL_TEXT_BASEdirectly.Cc York Sun <[email protected]>Cc Po Liu <[email protected]>Cc Qiang Zhao <[email protected]>Cc Timur Tabi <[email protected]>Signed-off-by Tom Rini <[email protected]>
After some ugly hacks to buildman to save off linker scripts so I could diff before/after:
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190128/35ec1979/attachment.sig>
PATCH 2/3 rockchip: Add TPL_MAX_SIZE for RK3288
In reply to Tom RiniPer Kever Yang, 32768 is a reasonable max size for TPL on RK3288.
--- arch/arm/mach-rockchip/Kconfig | 3 +++ 1 file changed, 3 insertions(+)
arch/arm/mach-rockchip/Kconfig +3 -0
@@ -81,6 +81,9 @@ config TPL_LDSCRIPT config TPL_TEXT_BASE default 0xff704000 +config TPL_MAX_SIZE + default 32768 + endif config ROCKCHIP_RK3328
Signature · 1 line
2.7.4
PATCH 2/3 rockchip: Add TPL_MAX_SIZE for RK3288【请注意,邮件由[email protected]代发】
Hi Tom,
Quoted 5 lines · Tom Rini
Per Kever Yang, 32768 is a reasonable max size for TPL on RK3288.
Cc Kever Yang <[email protected]>Cc Philipp Tomsich <[email protected]>Signed-off-by Tom Rini <[email protected]>
Quoted 18 lines
--- arch/arm/mach-rockchip/Kconfig | 3 +++ 1 file changed, 3 insertions(+)arch/arm/mach-rockchip/Kconfig +3
-0@@ -81,6 +81,9 @@ config TPL_LDSCRIPT config TPL_TEXT_BASE default 0xff704000 +config TPL_MAX_SIZE + default 32768 + endif config ROCKCHIP_RK3328
PATCH 2/3 rockchip: Add TPL_MAX_SIZE for RK3288
In reply to Tom RiniQuoted 6 lines · Tom Rini
Per Kever Yang, 32768 is a reasonable max size for TPL on RK3288.
Cc Kever Yang <[email protected]>Cc Philipp Tomsich <[email protected]>Signed-off-by Tom Rini <[email protected]>Reviewed-by Kever Yang <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190128/d492100e/attachment.sig>
PATCH 3/3 linker: Modify linker scripts to be more generic
In reply to Tom RiniMake use of "IMAGE_MAX_SIZE" and "IMAGE_TEXT_BASE" rather than CONFIG_SPL_MAX_SIZE and CONFIG_SPL_TEXT_BASE. This lets us re-use the same script for both SPL and TPL. Add logic to scripts/Makefile.spl to pass in the right value when preprocessing the script.
--- arch/arm/cpu/arm1136/u-boot-spl.lds | 4 ++-- arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds | 2 +- arch/arm/cpu/arm926ejs/orion5x/u-boot-spl.lds | 4 ++-- arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds | 4 ++-- arch/arm/cpu/armv7/sunxi/u-boot-spl.lds | 4 ++-- arch/arm/cpu/armv8/u-boot-spl.lds | 4 ++-- arch/arm/cpu/u-boot-spl.lds | 4 ++-- arch/arm/mach-at91/arm926ejs/u-boot-spl.lds | 8 ++++---- arch/arm/mach-at91/armv7/u-boot-spl.lds | 4 ++-- arch/arm/mach-omap2/u-boot-spl.lds | 4 ++-- arch/arm/mach-rockchip/Kconfig | 6 ------ arch/arm/mach-rockchip/rk3288/u-boot-tpl.lds | 9 --------- arch/arm/mach-rockchip/rk3368/u-boot-tpl.lds | 12 ------------ arch/arm/mach-zynq/u-boot-spl.lds | 4 ++-- arch/mips/cpu/u-boot-spl.lds | 4 ++-- arch/powerpc/cpu/mpc85xx/u-boot-spl.lds | 6 +----- arch/x86/cpu/u-boot-spl.lds | 2 +- board/Barix/ipam390/u-boot-spl-ipam390.lds | 2 +- board/davinci/da8xxevm/u-boot-spl-da850evm.lds | 2 +- board/samsung/common/exynos-uboot-spl.lds | 2 +- common/spl/Kconfig | 2 ++ scripts/Makefile.spl | 9 +++++++++ 22 files changed, 41 insertions(+), 61 deletions(-) delete mode 100644 arch/arm/mach-rockchip/rk3288/u-boot-tpl.lds delete mode 100644 arch/arm/mach-rockchip/rk3368/u-boot-tpl.lds
arch/arm/cpu/arm1136/u-boot-spl.lds +2 -2
@@ -8,8 +8,8 @@ * Aneesh V <[email protected]> */ -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 }
arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds +1 -1
@@ -15,7 +15,7 @@ OUTPUT_ARCH(arm) ENTRY(_start) SECTIONS { - . = CONFIG_SPL_TEXT_BASE; + . = IMAGE_TEXT_BASE; . = ALIGN(4); .text :
arch/arm/cpu/arm926ejs/orion5x/u-boot-spl.lds +2 -2
@@ -16,8 +16,8 @@ * Texas Instruments, <www.ti.com> * Aneesh V <[email protected]> */ -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 }
arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds +2 -2
@@ -12,8 +12,8 @@ * Gary Jennejohn, DENX Software Engineering, <[email protected]> */ -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)
arch/arm/cpu/armv7/sunxi/u-boot-spl.lds +2 -2
@@ -13,8 +13,8 @@ * Texas Instruments, <www.ti.com> * Aneesh V <[email protected]> */ -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 }
arch/arm/cpu/armv8/u-boot-spl.lds +2 -2
@@ -11,8 +11,8 @@ * Aneesh V <[email protected]> */ -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 }
arch/arm/cpu/u-boot-spl.lds +2 -2
@@ -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
arch/arm/mach-at91/arm926ejs/u-boot-spl.lds +4 -4
@@ -4,8 +4,8 @@ * Bo Shen <[email protected]> */ -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
arch/arm/mach-at91/armv7/u-boot-spl.lds +2 -2
@@ -11,8 +11,8 @@ * Bo Shen <[email protected]> */ -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 }
arch/arm/mach-omap2/u-boot-spl.lds +2 -2
@@ -8,8 +8,8 @@ * Aneesh V <[email protected]> */ -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 }
arch/arm/mach-rockchip/Kconfig +0 -6
@@ -75,9 +75,6 @@ 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
@@ -120,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
arch/arm/mach-rockchip/rk3288/u-boot-tpl.lds deleted +0 -9
@@ -1,9 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ */ -/* - * Copyright (C) 2018 Jagan Teki <[email protected]> - */ - -#undef CONFIG_SPL_TEXT_BASE -#define CONFIG_SPL_TEXT_BASE CONFIG_TPL_TEXT_BASE - -#include "../../cpu/u-boot-spl.lds"
arch/arm/mach-rockchip/rk3368/u-boot-tpl.lds deleted +0 -12
@@ -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"
arch/arm/mach-zynq/u-boot-spl.lds +2 -2
@@ -7,8 +7,8 @@ * Gary Jennejohn, DENX Software Engineering, <[email protected]> */ -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 }
arch/mips/cpu/u-boot-spl.lds +2 -2
@@ -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 }
arch/powerpc/cpu/mpc85xx/u-boot-spl.lds +1 -5
@@ -18,11 +18,7 @@ PHDRS #endif SECTIONS { -#ifdef CONFIG_TPL_BUILD - . = CONFIG_TPL_TEXT_BASE; -#else - . = CONFIG_SPL_TEXT_BASE; -#endif + . = IMAGE_TEXT_BASE; .text : { *(.text*) }
arch/x86/cpu/u-boot-spl.lds +1 -1
@@ -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*); }
board/Barix/ipam390/u-boot-spl-ipam390.lds +1 -1
@@ -7,7 +7,7 @@ * Guennadi Liakhovetki, DENX Software Engineering, <[email protected]> */ -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")
board/davinci/da8xxevm/u-boot-spl-da850evm.lds +1 -1
@@ -7,7 +7,7 @@ * Guennadi Liakhovetki, DENX Software Engineering, <[email protected]> */ -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")
board/samsung/common/exynos-uboot-spl.lds +1 -1
@@ -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")
common/spl/Kconfig +2 -0
@@ -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
scripts/Makefile.spl +9 -0
@@ -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 $@
Signature · 1 line
2.7.4
PATCH 3/3 linker: Modify linker scripts to be more generic
Am 22.01.19 um 23:09 schrieb Tom Rini:
Quoted 36 lines
Make use of "
IMAGE_MAX_SIZE" and "IMAGE_TEXT_BASE" rather thanCONFIG_SPL_MAX_SIZEandCONFIG_SPL_TEXT_BASE. This lets us re-use the same script for both SPL and TPL. Add logic toscripts/Makefile.splto pass in the right value when preprocessing the script.Cc Stefano Babic <[email protected]>Cc Fabio Estevam <[email protected]>Cc Jagan Teki <[email protected]>Cc Maxime Ripard <[email protected]>Cc Andreas Bießmann <[email protected]>Cc Philipp Tomsich <[email protected]>Cc Michal Simek <[email protected]>Cc Daniel Schwierzeck <[email protected]>Cc York Sun <[email protected]>Cc Bin Meng <[email protected]>Cc Heiko Schocher <[email protected]>Cc Adam Ford <[email protected]>Signed-off-by Tom Rini <[email protected]>--- arch/arm/cpu/arm1136/u-boot-spl.lds | 4 ++-- arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds | 2 +- arch/arm/cpu/arm926ejs/orion5x/u-boot-spl.lds | 4 ++-- arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds | 4 ++-- arch/arm/cpu/armv7/sunxi/u-boot-spl.lds | 4 ++-- arch/arm/cpu/armv8/u-boot-spl.lds | 4 ++-- arch/arm/cpu/u-boot-spl.lds | 4 ++-- arch/arm/mach-at91/arm926ejs/u-boot-spl.lds | 8 ++++---- arch/arm/mach-at91/armv7/u-boot-spl.lds | 4 ++-- arch/arm/mach-omap2/u-boot-spl.lds | 4 ++-- arch/arm/mach-rockchip/Kconfig | 6 ------ arch/arm/mach-rockchip/rk3288/u-boot-tpl.lds | 9 --------- arch/arm/mach-rockchip/rk3368/u-boot-tpl.lds | 12 ------------ arch/arm/mach-zynq/u-boot-spl.lds | 4 ++-- arch/mips/cpu/u-boot-spl.lds | 4 ++-- arch/powerpc/cpu/mpc85xx/u-boot-spl.lds | 6 +----- arch/x86/cpu/u-boot-spl.lds | 2 +-
Quoted 9 lines
board/Barix/ipam390/u-boot-spl-ipam390.lds | 2 +- board/davinci/da8xxevm/u-boot-spl-da850evm.lds | 2 +- board/samsung/common/exynos-uboot-spl.lds | 2 +- common/spl/Kconfig | 2 ++ scripts/Makefile.spl | 9 +++++++++ 22 files changed, 41 insertions(+), 61 deletions(-) delete mode 100644 arch/arm/mach-rockchip/rk3288/u-boot-tpl.lds delete mode 100644 arch/arm/mach-rockchip/rk3368/u-boot-tpl.lds
for MIPS:
Signature · 1 line
- Daniel
PATCH 3/3 linker: Modify linker scripts to be more generic
In reply to Tom RiniQuoted 5 lines · Tom Rini
Make use of "
IMAGE_MAX_SIZE" and "IMAGE_TEXT_BASE" rather thanCONFIG_SPL_MAX_SIZEandCONFIG_SPL_TEXT_BASE. This lets us re-use the same script for both SPL and TPL. Add logic toscripts/Makefile.splto pass in the right value when preprocessing the script.
Anytime we can re-use, I am happy. :-)
Quoted 13 lines
Cc Stefano Babic <[email protected]>Cc Fabio Estevam <[email protected]>Cc Jagan Teki <[email protected]>Cc Maxime Ripard <[email protected]>Cc Andreas Bießmann <[email protected]>Cc Philipp Tomsich <[email protected]>Cc Michal Simek <[email protected]>Cc Daniel Schwierzeck <[email protected]>Cc York Sun <[email protected]>Cc Bin Meng <[email protected]>Cc Heiko Schocher <[email protected]>Cc Adam Ford <[email protected]>
Quoted 378 lines
Signed-off-by Tom Rini <[email protected]>--- arch/arm/cpu/arm1136/u-boot-spl.lds | 4 ++-- arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds | 2 +- arch/arm/cpu/arm926ejs/orion5x/u-boot-spl.lds | 4 ++-- arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds | 4 ++-- arch/arm/cpu/armv7/sunxi/u-boot-spl.lds | 4 ++-- arch/arm/cpu/armv8/u-boot-spl.lds | 4 ++-- arch/arm/cpu/u-boot-spl.lds | 4 ++-- arch/arm/mach-at91/arm926ejs/u-boot-spl.lds | 8 ++++---- arch/arm/mach-at91/armv7/u-boot-spl.lds | 4 ++-- arch/arm/mach-omap2/u-boot-spl.lds | 4 ++-- arch/arm/mach-rockchip/Kconfig | 6 ------ arch/arm/mach-rockchip/rk3288/u-boot-tpl.lds | 9 --------- arch/arm/mach-rockchip/rk3368/u-boot-tpl.lds | 12 ------------ arch/arm/mach-zynq/u-boot-spl.lds | 4 ++-- arch/mips/cpu/u-boot-spl.lds | 4 ++-- arch/powerpc/cpu/mpc85xx/u-boot-spl.lds | 6 +----- arch/x86/cpu/u-boot-spl.lds | 2 +- board/Barix/ipam390/u-boot-spl-ipam390.lds | 2 +- board/davinci/da8xxevm/u-boot-spl-da850evm.lds | 2 +- board/samsung/common/exynos-uboot-spl.lds | 2 +- common/spl/Kconfig | 2 ++ scripts/Makefile.spl | 9 +++++++++ 22 files changed, 41 insertions(+), 61 deletions(-) delete mode 100644 arch/arm/mach-rockchip/rk3288/u-boot-tpl.lds delete mode 100644 arch/arm/mach-rockchip/rk3368/u-boot-tpl.ldsarch/arm/cpu/arm1136/u-boot-spl.lds +2
-2@@ -8,8 +8,8 @@ * Aneesh V <[email protected]> */ -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 }arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds +1
-1@@ -15,7 +15,7 @@ OUTPUT_ARCH(arm) ENTRY(_start) SECTIONS { - . = CONFIG_SPL_TEXT_BASE; + . = IMAGE_TEXT_BASE; . = ALIGN(4); .text :arch/arm/cpu/arm926ejs/orion5x/u-boot-spl.lds +2
-2@@ -16,8 +16,8 @@ * Texas Instruments, <www.ti.com> * Aneesh V <[email protected]> */ -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 }arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds +2
-2@@ -12,8 +12,8 @@ * Gary Jennejohn, DENX Software Engineering, <[email protected]> */ -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)arch/arm/cpu/armv7/sunxi/u-boot-spl.lds +2
-2@@ -13,8 +13,8 @@ * Texas Instruments, <www.ti.com> * Aneesh V <[email protected]> */ -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 }arch/arm/cpu/armv8/u-boot-spl.lds +2
-2@@ -11,8 +11,8 @@ * Aneesh V <[email protected]> */ -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 }arch/arm/cpu/u-boot-spl.lds +2
-2@@ -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"); #endifarch/arm/mach-at91/arm926ejs/u-boot-spl.lds +4
-4@@ -4,8 +4,8 @@ * Bo Shen <[email protected]> */ -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"); #endifarch/arm/mach-at91/armv7/u-boot-spl.lds +2
-2@@ -11,8 +11,8 @@ * Bo Shen <[email protected]> */ -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 }arch/arm/mach-omap2/u-boot-spl.lds +2
-2@@ -8,8 +8,8 @@ * Aneesh V <[email protected]> */ -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 }arch/arm/mach-rockchip/Kconfig +0
-6@@ -75,9 +75,6 @@ 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@@ -120,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 0xff8c1000arch/arm/mach-rockchip/rk3288/u-boot-tpl.lds deleted +0
-9@@ -1,9 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ */ -/* - * Copyright (C) 2018 Jagan Teki <[email protected]> - */ - -#undef CONFIG_SPL_TEXT_BASE -#define CONFIG_SPL_TEXT_BASE CONFIG_TPL_TEXT_BASE - -#include "../../cpu/u-boot-spl.lds"arch/arm/mach-rockchip/rk3368/u-boot-tpl.lds deleted +0
-12@@ -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"arch/arm/mach-zynq/u-boot-spl.lds +2
-2@@ -7,8 +7,8 @@ * Gary Jennejohn, DENX Software Engineering, <[email protected]> */ -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 }arch/mips/cpu/u-boot-spl.lds +2
-2@@ -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 }arch/powerpc/cpu/mpc85xx/u-boot-spl.lds +1
-5@@ -18,11 +18,7 @@ PHDRS #endif SECTIONS { -#ifdef CONFIG_TPL_BUILD - . = CONFIG_TPL_TEXT_BASE; -#else - . = CONFIG_SPL_TEXT_BASE; -#endif + . = IMAGE_TEXT_BASE; .text : { *(.text*) }arch/x86/cpu/u-boot-spl.lds +1
-1@@ -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*); }board/Barix/ipam390/u-boot-spl-ipam390.lds +1
-1@@ -7,7 +7,7 @@ * Guennadi Liakhovetki, DENX Software Engineering, <[email protected]> */ -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")board/davinci/da8xxevm/u-boot-spl-da850evm.lds +1
-1@@ -7,7 +7,7 @@ * Guennadi Liakhovetki, DENX Software Engineering, <[email protected]> */ -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")board/samsung/common/exynos-uboot-spl.lds +1
-1@@ -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")common/spl/Kconfig +2
-0@@ -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 regularscripts/Makefile.spl +9
-1@@ -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 $@ --2.7.4
PATCH 3/3 linker: Modify linker scripts to be more generic
In reply to Tom RiniQuoted 6 lines · Tom Rini
Make use of "
IMAGE_MAX_SIZE" and "IMAGE_TEXT_BASE" rather thanCONFIG_SPL_MAX_SIZEandCONFIG_SPL_TEXT_BASE. This lets us re-use the same script for both SPL and TPL. Add logic toscripts/Makefile.splto pass in the right value when preprocessing the script.
Quoted 13 lines
Cc Stefano Babic <[email protected]>Cc Fabio Estevam <[email protected]>Cc Jagan Teki <[email protected]>Cc Maxime Ripard <[email protected]>Cc Andreas Bießmann <[email protected]>Cc Philipp Tomsich <[email protected]>Cc Michal Simek <[email protected]>Cc Daniel Schwierzeck <[email protected]>Cc York Sun <[email protected]>Cc Bin Meng <[email protected]>Cc Heiko Schocher <[email protected]>Cc Adam Ford <[email protected]>Signed-off-by Tom Rini <[email protected]>
However, given that it's now "not allowed" to use OF_EMBED, how useful is the current size check? Because if done in the linker, it does not include the DTB.
I think we might need to move the MAX_SIZE check into the Makefile, much like CONFIG_BOARD_SIZE_LIMIT.
Regards,
Simon
Quoted 381 lines
--- arch/arm/cpu/arm1136/u-boot-spl.lds | 4 ++-- arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds | 2 +- arch/arm/cpu/arm926ejs/orion5x/u-boot-spl.lds | 4 ++-- arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds | 4 ++-- arch/arm/cpu/armv7/sunxi/u-boot-spl.lds | 4 ++-- arch/arm/cpu/armv8/u-boot-spl.lds | 4 ++-- arch/arm/cpu/u-boot-spl.lds | 4 ++-- arch/arm/mach-at91/arm926ejs/u-boot-spl.lds | 8 ++++---- arch/arm/mach-at91/armv7/u-boot-spl.lds | 4 ++-- arch/arm/mach-omap2/u-boot-spl.lds | 4 ++-- arch/arm/mach-rockchip/Kconfig | 6 ------ arch/arm/mach-rockchip/rk3288/u-boot-tpl.lds | 9 --------- arch/arm/mach-rockchip/rk3368/u-boot-tpl.lds | 12 ------------ arch/arm/mach-zynq/u-boot-spl.lds | 4 ++-- arch/mips/cpu/u-boot-spl.lds | 4 ++-- arch/powerpc/cpu/mpc85xx/u-boot-spl.lds | 6 +----- arch/x86/cpu/u-boot-spl.lds | 2 +- board/Barix/ipam390/u-boot-spl-ipam390.lds | 2 +- board/davinci/da8xxevm/u-boot-spl-da850evm.lds | 2 +- board/samsung/common/exynos-uboot-spl.lds | 2 +- common/spl/Kconfig | 2 ++ scripts/Makefile.spl | 9 +++++++++ 22 files changed, 41 insertions(+), 61 deletions(-) delete mode 100644 arch/arm/mach-rockchip/rk3288/u-boot-tpl.lds delete mode 100644 arch/arm/mach-rockchip/rk3368/u-boot-tpl.ldsarch/arm/cpu/arm1136/u-boot-spl.lds +2
-2@@ -8,8 +8,8 @@ * Aneesh V <[email protected]> */ -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 }arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds +1
-1@@ -15,7 +15,7 @@ OUTPUT_ARCH(arm) ENTRY(_start) SECTIONS { - . = CONFIG_SPL_TEXT_BASE; + . = IMAGE_TEXT_BASE; . = ALIGN(4); .text :arch/arm/cpu/arm926ejs/orion5x/u-boot-spl.lds +2
-2@@ -16,8 +16,8 @@ * Texas Instruments, <www.ti.com> * Aneesh V <[email protected]> */ -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 }arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds +2
-2@@ -12,8 +12,8 @@ * Gary Jennejohn, DENX Software Engineering, <[email protected]> */ -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)arch/arm/cpu/armv7/sunxi/u-boot-spl.lds +2
-2@@ -13,8 +13,8 @@ * Texas Instruments, <www.ti.com> * Aneesh V <[email protected]> */ -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 }arch/arm/cpu/armv8/u-boot-spl.lds +2
-2@@ -11,8 +11,8 @@ * Aneesh V <[email protected]> */ -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 }arch/arm/cpu/u-boot-spl.lds +2
-2@@ -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"); #endifarch/arm/mach-at91/arm926ejs/u-boot-spl.lds +4
-4@@ -4,8 +4,8 @@ * Bo Shen <[email protected]> */ -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"); #endifarch/arm/mach-at91/armv7/u-boot-spl.lds +2
-2@@ -11,8 +11,8 @@ * Bo Shen <[email protected]> */ -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 }arch/arm/mach-omap2/u-boot-spl.lds +2
-2@@ -8,8 +8,8 @@ * Aneesh V <[email protected]> */ -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 }arch/arm/mach-rockchip/Kconfig +0
-6@@ -75,9 +75,6 @@ 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@@ -120,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 0xff8c1000arch/arm/mach-rockchip/rk3288/u-boot-tpl.lds deleted +0
-9@@ -1,9 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ */ -/* - * Copyright (C) 2018 Jagan Teki <[email protected]> - */ - -#undef CONFIG_SPL_TEXT_BASE -#define CONFIG_SPL_TEXT_BASE CONFIG_TPL_TEXT_BASE - -#include "../../cpu/u-boot-spl.lds"arch/arm/mach-rockchip/rk3368/u-boot-tpl.lds deleted +0
-12@@ -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"arch/arm/mach-zynq/u-boot-spl.lds +2
-2@@ -7,8 +7,8 @@ * Gary Jennejohn, DENX Software Engineering, <[email protected]> */ -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 }arch/mips/cpu/u-boot-spl.lds +2
-2@@ -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 }arch/powerpc/cpu/mpc85xx/u-boot-spl.lds +1
-5@@ -18,11 +18,7 @@ PHDRS #endif SECTIONS { -#ifdef CONFIG_TPL_BUILD - . = CONFIG_TPL_TEXT_BASE; -#else - . = CONFIG_SPL_TEXT_BASE; -#endif + . = IMAGE_TEXT_BASE; .text : { *(.text*) }arch/x86/cpu/u-boot-spl.lds +1
-1@@ -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*); }board/Barix/ipam390/u-boot-spl-ipam390.lds +1
-1@@ -7,7 +7,7 @@ * Guennadi Liakhovetki, DENX Software Engineering, <[email protected]> */ -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")board/davinci/da8xxevm/u-boot-spl-da850evm.lds +1
-1@@ -7,7 +7,7 @@ * Guennadi Liakhovetki, DENX Software Engineering, <[email protected]> */ -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")board/samsung/common/exynos-uboot-spl.lds +1
-1@@ -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")common/spl/Kconfig +2
-0@@ -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 regularscripts/Makefile.spl +9
-1@@ -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 $@ --2.7.4
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot
PATCH 3/3 linker: Modify linker scripts to be more generic
Quoted 21 lines · Simon Goldschmidt
Quoted 6 lines · Tom Rini
Make use of "
IMAGE_MAX_SIZE" and "IMAGE_TEXT_BASE" rather thanCONFIG_SPL_MAX_SIZEandCONFIG_SPL_TEXT_BASE. This lets us re-use the same script for both SPL and TPL. Add logic toscripts/Makefile.splto pass in the right value when preprocessing the script.Quoted 13 lines
Cc Stefano Babic <[email protected]>Cc Fabio Estevam <[email protected]>Cc Jagan Teki <[email protected]>Cc Maxime Ripard <[email protected]>Cc Andreas Bießmann <[email protected]>Cc Philipp Tomsich <[email protected]>Cc Michal Simek <[email protected]>Cc Daniel Schwierzeck <[email protected]>Cc York Sun <[email protected]>Cc Bin Meng <[email protected]>Cc Heiko Schocher <[email protected]>Cc Adam Ford <[email protected]>Signed-off-by Tom Rini <[email protected]>
Quoted 8 lines
Reviewed-by Simon Goldschmidt <[email protected]>However, given that it's now "not allowed" to use
OF_EMBED, how useful is the current size check? Because if done in the linker, it does not include the DTB.I think we might need to move the
MAX_SIZEcheck into theMakefile, much likeCONFIG_BOARD_SIZE_LIMIT.
I was thinking about that too at one point and yes, there is follow-up work to move that BOARD_SIZE_LIMIT code such that we don't have multiple copies of it and hook more platforms into it.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190124/eeb5fe0b/attachment.sig>
PATCH 3/3 linker: Modify linker scripts to be more generic
In reply to Tom RiniQuoted 14 lines · Tom Rini
Make use of "
IMAGE_MAX_SIZE" and "IMAGE_TEXT_BASE" rather thanCONFIG_SPL_MAX_SIZEandCONFIG_SPL_TEXT_BASE. This lets us re-use the same script for both SPL and TPL. Add logic toscripts/Makefile.splto pass in the right value when preprocessing the script.Cc Stefano Babic <[email protected]>Cc Fabio Estevam <[email protected]>Cc Jagan Teki <[email protected]>Cc Maxime Ripard <[email protected]>Cc Andreas Bießmann <[email protected]>Cc Philipp Tomsich <[email protected]>Cc Michal Simek <[email protected]>Cc Daniel Schwierzeck <[email protected]>Cc York Sun <[email protected]>
Quoted 8 lines
Cc Bin Meng <[email protected]>Cc Heiko Schocher <[email protected]>Cc Adam Ford <[email protected]>Signed-off-by Tom Rini <[email protected]>Reviewed-by Daniel Schwierzeck <[email protected]>Tested-by Daniel Schwierzeck <[email protected]>Reviewed-by Simon Goldschmidt <[email protected]>
After some ugly hacks to buildman to save off linker scripts so I could diff before/after:
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190128/ea0d3a51/attachment.sig>