From: T Karthik Reddy Date: Wed, 12 May 2021 05:39:16 +0000 (-0600) Subject: xilinx: versal: Enable CONFIG_POSITION_INDEPENDENT X-Git-Tag: v2021.10~176^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2a6e6c81f454d44c940203051f72991eece5bf51;p=platform%2Fkernel%2Fu-boot.git xilinx: versal: Enable CONFIG_POSITION_INDEPENDENT U-Boot expects to be linked to a specific hard-coded address and to be loaded to and run from that address. CONFIG_POSITION_INDEPENDENT config lifts that restriction & allowing the code to be loaded to and executed from almost any address. As we enabled CONFIG_POSITION_INDEPENDENT, CONFIG_INIT_SP_RELATIVE is enabled by default, where it will set the early stack pointer at runtime by adding an offset value to &_bss_start. The offset value is taken from SYS_INIT_SP_BSS_OFFSET. SYS_INIT_SP_BSS_OFFSET offset should be large enough so that the early malloc region, global data (gd), and early stack should fit. With commit d8fabcc424bd ("arm64: versal: Increase SYS_MALLOC_F_LEN") SYS_MALLOC_F_LEN is increased from 32KB to 1MB, so we need to accommodate this space with SYS_INIT_SP_BSS_OFFSET. Hence increasing SYS_INIT_SP_BSS_OFFSET to 1.5MB. Signed-off-by: T Karthik Reddy Acked-by: Ashok Reddy Soma Signed-off-by: Michal Simek --- diff --git a/configs/xilinx_versal_virt_defconfig b/configs/xilinx_versal_virt_defconfig index 7076937..f4e9a80 100644 --- a/configs/xilinx_versal_virt_defconfig +++ b/configs/xilinx_versal_virt_defconfig @@ -1,5 +1,6 @@ CONFIG_ARM=y CONFIG_POSITION_INDEPENDENT=y +CONFIG_SYS_INIT_SP_BSS_OFFSET=1572864 CONFIG_ARCH_VERSAL=y CONFIG_SYS_TEXT_BASE=0x8000000 CONFIG_SYS_MALLOC_F_LEN=0x100000