aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorJonas Karlman2024-03-02 19:16:14 +0000
committerKever Yang2024-03-14 15:27:29 +0800
commit5e7cd8a119953dc2f466fea81e230d683ee03493 (patch)
treeb689da975f2063dc3a218a810f21755667e92c96 /arch
parentf01a3992035be54ebec950cf4187a052ea0516a1 (diff)
rockchip: Use common bss and stack addresses on RK3399
With the stack and text base used by U-Boot SPL and proper on RK3399 there is a high likelihood of overlapping when U-Boot proper + FDT nears or exceeded 1 MiB in size. Currently the following memory layout is typically used on RK3399: [ 0, 256K) - SPL binary [ 256K, 2M) - TF-A / reserved [ 2M, +X) - U-Boot proper binary (TEXT_BASE) [ -X, 3M) - U-Boot proper pre-reloc stack (CUSTOM_SYS_INIT_SP_ADDR) [ -16K, 3M) - pre-reloc malloc heap (SYS_MALLOC_F_LEN) [ -X, 4M) - SPL pre-reloc stack (SPL_STACK) [ -16K, 4M) - pre-reloc malloc heap (SPL_SYS_MALLOC_F_LEN) [ 4M, +8K) - SPL bss (SPL_BSS_START_ADDR, SPL_BSS_MAX_SIZE) [ -X, 64M) - SPL reloc stack (SPL_STACK_R_ADDR) [ 63M, 64M) - reloc malloc heap (SPL_STACK_R_MALLOC_SIMPLE_LEN) SPL can safely load U-Boot proper + FDT to [2M, 4M-16K) with this layout. However, the stack at [-X, 3M) used during U-Boot proper pre-reloc is restricting the safe size of U-Boot proper + FDT to be less than 1 MiB. Migrate to use common bss, stack and malloc heap size and addresses to fix this restriction and allow for a larger U-Boot proper image size. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-rockchip/rk3399/Kconfig7
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/arm/mach-rockchip/rk3399/Kconfig b/arch/arm/mach-rockchip/rk3399/Kconfig
index d01063ac98b..38904291dfa 100644
--- a/arch/arm/mach-rockchip/rk3399/Kconfig
+++ b/arch/arm/mach-rockchip/rk3399/Kconfig
@@ -138,8 +138,11 @@ config ROCKCHIP_STIMER_BASE
config SYS_SOC
default "rk3399"
+config ROCKCHIP_COMMON_STACK_ADDR
+ default y
+
config SYS_MALLOC_F_LEN
- default 0x4000
+ default 0x4000 if !SPL_SHARES_INIT_SP_ADDR
config SPL_LIBCOMMON_SUPPORT
default y
@@ -157,7 +160,7 @@ config TPL_TEXT_BASE
default 0xff8c2000
config SPL_STACK_R_ADDR
- default 0x04000000
+ default 0x04000000 if !SPL_SHARES_INIT_SP_ADDR
if BOOTCOUNT_LIMIT