]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
rockchip: Use common bss and stack addresses on RK3308
authorJonas Karlman <jonas@kwiboo.se>
Sat, 2 Mar 2024 19:16:12 +0000 (19:16 +0000)
committerKever Yang <kever.yang@rock-chips.com>
Thu, 14 Mar 2024 07:27:28 +0000 (15:27 +0800)
Currently the following memory layout is typically used on RK3308:
[    0, 256K) - SPL binary
[ 256K,   2M) - TF-A / reserved
[   -X,   4M) - SPL pre-reloc stack (SPL_STACK)
[  -8K,   4M)   - pre-reloc malloc heap (SPL_SYS_MALLOC_F_LEN)
[   4M,  +8K) - SPL bss (SPL_BSS_START_ADDR, SPL_BSS_MAX_SIZE)
[   6M,   +X) - U-Boot proper binary (TEXT_BASE)
[   -X,   8M) - U-Boot proper pre-reloc stack (CUSTOM_SYS_INIT_SP_ADDR)
[  -8K,   8M)   - pre-reloc malloc heap (SYS_MALLOC_F_LEN)
[   -X,  12M) - SPL reloc stack (SPL_STACK_R_ADDR)
[  11M,  12M)   - reloc malloc heap (SPL_STACK_R_MALLOC_SIMPLE_LEN)

SPL can safely load U-Boot proper + FDT to [6M, 8M-8K) with this layout.

Migrate to use common bss, stack and malloc heap size and addresses to
remove this size limitation and extend the malloc heap size being used.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Kconfig
arch/arm/mach-rockchip/rk3308/Kconfig
configs/evb-rk3308_defconfig
configs/roc-cc-rk3308_defconfig
configs/rock-pi-s-rk3308_defconfig

diff --git a/Kconfig b/Kconfig
index 5710934000f636c864f27d0e4bc5427f1cbe086e..75f9563ce6c617ac3ded956f347e49a2ad0abceb 100644 (file)
--- a/Kconfig
+++ b/Kconfig
@@ -265,7 +265,7 @@ config SYS_MALLOC_F_LEN
        hex "Size of malloc() pool before relocation"
        depends on SYS_MALLOC_F
        default 0x400 if M68K || PPC || ROCKCHIP_PX30 || ROCKCHIP_RK3036 || \
-                        ROCKCHIP_RK3308 || ROCKCHIP_RV1108
+                        ROCKCHIP_RV1108
        default 0x600 if ARCH_ZYNQMP_R5 || ARCH_ZYNQMP
        default 0x800 if ARCH_ZYNQ || ROCKCHIP_RK3128 || ROCKCHIP_RK3188 || \
                         ROCKCHIP_RK322X || X86
index 194353e4cd9a4d3b1db523b90d19b1c536ea22fd..749e9995d91fda76d2c116cf390607d0c5c7099a 100644 (file)
@@ -17,8 +17,11 @@ config ROCKCHIP_STIMER_BASE
 config SYS_SOC
        default "rk3308"
 
-config SYS_MALLOC_F_LEN
-       default 0x400
+config ROCKCHIP_COMMON_STACK_ADDR
+       default y
+
+config TEXT_BASE
+       default 0x00600000
 
 config SPL_SERIAL
        default y
index 2729060d6e9110476089e06f8807a3a4d0bee786..d57b2f6b8e55677d9ea89312f06402415e41b3c7 100644 (file)
@@ -2,19 +2,11 @@ CONFIG_ARM=y
 CONFIG_SKIP_LOWLEVEL_INIT=y
 CONFIG_COUNTER_FREQUENCY=24000000
 CONFIG_ARCH_ROCKCHIP=y
-CONFIG_TEXT_BASE=0x00600000
-CONFIG_SYS_MALLOC_F_LEN=0x2000
-CONFIG_SPL_LIBCOMMON_SUPPORT=y
-CONFIG_SPL_LIBGENERIC_SUPPORT=y
-CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
-CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x800000
 CONFIG_DEFAULT_DEVICE_TREE="rk3308-evb"
 CONFIG_DM_RESET=y
 CONFIG_ROCKCHIP_RK3308=y
 CONFIG_SPL_DRIVERS_MISC=y
 CONFIG_TARGET_EVB_RK3308=y
-CONFIG_SPL_STACK_R_ADDR=0xc00000
-CONFIG_SPL_STACK=0x400000
 CONFIG_DEBUG_UART_BASE=0xFF0C0000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_SYS_LOAD_ADDR=0xc00800
@@ -28,11 +20,6 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_SPL_MAX_SIZE=0x20000
 CONFIG_SPL_PAD_TO=0x7f8000
-CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
-CONFIG_SPL_BSS_START_ADDR=0x400000
-CONFIG_SPL_BSS_MAX_SIZE=0x2000
-# CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
-CONFIG_SPL_STACK_R=y
 # CONFIG_CMD_BDI is not set
 # CONFIG_CMD_CONSOLE is not set
 # CONFIG_CMD_ELF is not set
index 7502da5b1e7a85e8991975ceeb6045aed5e92664..5e8f51ec01e33b39e6f2bfe3443dcea2cb720be0 100644 (file)
@@ -2,19 +2,11 @@ CONFIG_ARM=y
 CONFIG_SKIP_LOWLEVEL_INIT=y
 CONFIG_COUNTER_FREQUENCY=24000000
 CONFIG_ARCH_ROCKCHIP=y
-CONFIG_TEXT_BASE=0x00600000
-CONFIG_SYS_MALLOC_F_LEN=0x2000
-CONFIG_SPL_LIBCOMMON_SUPPORT=y
-CONFIG_SPL_LIBGENERIC_SUPPORT=y
-CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
-CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x800000
 CONFIG_DEFAULT_DEVICE_TREE="rk3308-roc-cc"
 CONFIG_DM_RESET=y
 CONFIG_ROCKCHIP_RK3308=y
 CONFIG_SPL_DRIVERS_MISC=y
 CONFIG_TARGET_ROC_RK3308_CC=y
-CONFIG_SPL_STACK_R_ADDR=0xc00000
-CONFIG_SPL_STACK=0x400000
 CONFIG_DEBUG_UART_BASE=0xFF0C0000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_SYS_LOAD_ADDR=0xc00800
@@ -28,11 +20,6 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_SPL_MAX_SIZE=0x20000
 CONFIG_SPL_PAD_TO=0x7f8000
-CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
-CONFIG_SPL_BSS_START_ADDR=0x400000
-CONFIG_SPL_BSS_MAX_SIZE=0x2000
-# CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
-CONFIG_SPL_STACK_R=y
 # CONFIG_CMD_BDI is not set
 # CONFIG_CMD_CONSOLE is not set
 # CONFIG_CMD_ELF is not set
index 9908a4b4f457024860feb5a4308df245fba9c079..1e9cd2c0fc7e3b4b884aaba0da20bff6f2520c86 100644 (file)
@@ -2,20 +2,12 @@ CONFIG_ARM=y
 CONFIG_SKIP_LOWLEVEL_INIT=y
 CONFIG_COUNTER_FREQUENCY=24000000
 CONFIG_ARCH_ROCKCHIP=y
-CONFIG_TEXT_BASE=0x00600000
-CONFIG_SYS_MALLOC_F_LEN=0x2000
-CONFIG_SPL_LIBCOMMON_SUPPORT=y
-CONFIG_SPL_LIBGENERIC_SUPPORT=y
-CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
-CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x800000
 CONFIG_DEFAULT_DEVICE_TREE="rk3308-rock-pi-s"
 CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_DM_RESET=y
 CONFIG_ROCKCHIP_RK3308=y
 CONFIG_SPL_DRIVERS_MISC=y
 CONFIG_TARGET_EVB_RK3308=y
-CONFIG_SPL_STACK_R_ADDR=0xc00000
-CONFIG_SPL_STACK=0x400000
 CONFIG_DEBUG_UART_BASE=0xFF0A0000
 CONFIG_DEBUG_UART_CLOCK=24000000
 # CONFIG_DEBUG_UART_BOARD_INIT is not set
@@ -29,11 +21,6 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_SPL_MAX_SIZE=0x20000
 CONFIG_SPL_PAD_TO=0x7f8000
-CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
-CONFIG_SPL_BSS_START_ADDR=0x400000
-CONFIG_SPL_BSS_MAX_SIZE=0x2000
-# CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
-CONFIG_SPL_STACK_R=y
 # CONFIG_CMD_BDI is not set
 # CONFIG_CMD_CONSOLE is not set
 # CONFIG_CMD_ELF is not set