]> git.dujemihanovic.xyz Git - u-boot.git/commit
rockchip: Use common bss and stack addresses on RK3399
authorJonas Karlman <jonas@kwiboo.se>
Sat, 2 Mar 2024 19:16:14 +0000 (19:16 +0000)
committerKever Yang <kever.yang@rock-chips.com>
Thu, 14 Mar 2024 07:27:29 +0000 (15:27 +0800)
commit5e7cd8a119953dc2f466fea81e230d683ee03493
treeb689da975f2063dc3a218a810f21755667e92c96
parentf01a3992035be54ebec950cf4187a052ea0516a1
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>
26 files changed:
arch/arm/mach-rockchip/rk3399/Kconfig
configs/eaidk-610-rk3399_defconfig
configs/evb-rk3399_defconfig
configs/firefly-rk3399_defconfig
configs/khadas-edge-captain-rk3399_defconfig
configs/khadas-edge-rk3399_defconfig
configs/khadas-edge-v-rk3399_defconfig
configs/leez-rk3399_defconfig
configs/nanopc-t4-rk3399_defconfig
configs/nanopi-m4-2gb-rk3399_defconfig
configs/nanopi-m4-rk3399_defconfig
configs/nanopi-m4b-rk3399_defconfig
configs/nanopi-neo4-rk3399_defconfig
configs/nanopi-r4s-rk3399_defconfig
configs/orangepi-rk3399_defconfig
configs/pinebook-pro-rk3399_defconfig
configs/pinephone-pro-rk3399_defconfig
configs/roc-pc-mezzanine-rk3399_defconfig
configs/roc-pc-rk3399_defconfig
configs/rock-4c-plus-rk3399_defconfig
configs/rock-4se-rk3399_defconfig
configs/rock-pi-4-rk3399_defconfig
configs/rock-pi-4c-rk3399_defconfig
configs/rock-pi-n10-rk3399pro_defconfig
configs/rock960-rk3399_defconfig
configs/rockpro64-rk3399_defconfig