[PATCH v3 3/6] rockchip: Use common bss and stack addresses on RK3328
Jonas Karlman
jonas at kwiboo.se
Thu Mar 14 08:08:57 CET 2024
Hi Kever,
On 2024-03-13 11:39, Kever Yang wrote:
> Hi Jonas,
>
> This patch does not able to apply on next, could you help to take a
> look.
>
> And also add document of memory layout in rockchip.rst if possible.
I will send a follow-up patch that adds details about this memory layout
and the new Kconfig option to the rockchip documentation.
Regards,
Jonas
>
>
> Thanks,
>
> - Kever
>
> On 2024/3/3 03:16, Jonas Karlman wrote:
>> With the stack and text base used by U-Boot SPL and proper on RK3328
>> 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 RK3328:
>> [ 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)
>> [ -8K, 3M) - pre-reloc malloc heap (SYS_MALLOC_F_LEN)
>> [ -X, 4M) - SPL pre-reloc stack (SPL_STACK)
>> [ -8K, 4M) - pre-reloc malloc heap (SPL_SYS_MALLOC_F_LEN)
>> [ -X, 6M) - SPL reloc stack (SPL_STACK_R_ADDR)
>> [ 5M, 6M) - reloc malloc heap (SPL_STACK_R_MALLOC_SIMPLE_LEN)
>> [ 32M, +8K) - SPL bss (SPL_BSS_START_ADDR, SPL_BSS_MAX_SIZE)
>>
>> SPL can safely load U-Boot proper + FDT to [2M, 4M-8K) 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 at kwiboo.se>
>> ---
>> arch/arm/mach-rockchip/rk3328/Kconfig | 11 ++++-------
>> configs/evb-rk3328_defconfig | 17 -----------------
>> configs/nanopi-r2c-plus-rk3328_defconfig | 15 ---------------
>> configs/nanopi-r2c-rk3328_defconfig | 15 ---------------
>> configs/nanopi-r2s-rk3328_defconfig | 15 ---------------
>> configs/orangepi-r1-plus-lts-rk3328_defconfig | 15 ---------------
>> configs/orangepi-r1-plus-rk3328_defconfig | 15 ---------------
>> configs/roc-cc-rk3328_defconfig | 15 ---------------
>> configs/rock-pi-e-rk3328_defconfig | 17 -----------------
>> configs/rock64-rk3328_defconfig | 15 ---------------
>> 10 files changed, 4 insertions(+), 146 deletions(-)
>>
[snip]
More information about the U-Boot
mailing list