A 2 MB region of DDR memory is allocated for U‑Boot SPL, with the
heap starting at address 0x80000000 and the stack at 0x80200000.
However, U‑Boot fails when using OpenSBI v1.8 because OpenSBI begins
execution at 0x80100000, causing an overlap between the SPL stack
and the malloc region.
To resolve this conflict, the SPL heap and stack are moved to
higher memory addresses, and OpenSBI is relocated to 0x80000000.
The SPL heap now starts at 0x8C000000, and the stack is placed
at 0x8F000000. The MB-V requires at least 256MB of DDR to run U-Boot.

        _________________
        |               |0x8FFFFFFF
        |_______________|
        |  SPL- Stack   |0x8F000000
        |               |
        |               |
        |  SPL - Heap   |
        |_______________|0x8C000000
        |               |
        |               |
        | Full U-Boot   |
        |_______________|0x81200000
        |Load FIT Image |
        |_______________|0x80200000
        |   OpenSBI     |
        |_______________|0x80000000

Signed-off-by: Padmarao Begari <[email protected]>
---
 configs/xilinx_mbv32_defconfig       | 4 ++--
 configs/xilinx_mbv32_smode_defconfig | 2 +-
 configs/xilinx_mbv64_smode_defconfig | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/configs/xilinx_mbv32_defconfig b/configs/xilinx_mbv32_defconfig
index 42dc5fb282a..0ca64b22659 100644
--- a/configs/xilinx_mbv32_defconfig
+++ b/configs/xilinx_mbv32_defconfig
@@ -5,7 +5,7 @@ CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x81200000
 CONFIG_ENV_SIZE=0x20000
 CONFIG_DEFAULT_DEVICE_TREE="xilinx-mbv32"
-CONFIG_SPL_STACK=0x80200000
+CONFIG_SPL_STACK=0x8F000000
 CONFIG_SPL_TEXT_BASE=0x0
 CONFIG_SPL_BSS_START_ADDR=0xf000
 CONFIG_SPL_BSS_MAX_SIZE=0x1000
@@ -31,7 +31,7 @@ CONFIG_SPL_MAX_SIZE=0xf000
 CONFIG_SPL_HAVE_INIT_STACK=y
 CONFIG_SPL_SYS_MALLOC=y
 CONFIG_SPL_HAS_CUSTOM_MALLOC_START=y
-CONFIG_SPL_CUSTOM_SYS_MALLOC_ADDR=0x80000000
+CONFIG_SPL_CUSTOM_SYS_MALLOC_ADDR=0x8C000000
 CONFIG_SPL_SYS_MALLOC_SIZE=0x200000
 # CONFIG_CMD_MII is not set
 CONFIG_CMD_SNTP=y
diff --git a/configs/xilinx_mbv32_smode_defconfig 
b/configs/xilinx_mbv32_smode_defconfig
index dd1221a6904..a72f13851ac 100644
--- a/configs/xilinx_mbv32_smode_defconfig
+++ b/configs/xilinx_mbv32_smode_defconfig
@@ -1,5 +1,5 @@
 #include <configs/xilinx_mbv32_defconfig>
 
-CONFIG_SPL_OPENSBI_LOAD_ADDR=0x80100000
+CONFIG_SPL_OPENSBI_LOAD_ADDR=0x80000000
 CONFIG_RISCV_SMODE=y
 CONFIG_SPL_OPENSBI_SCRATCH_OPTIONS=0x2
diff --git a/configs/xilinx_mbv64_smode_defconfig 
b/configs/xilinx_mbv64_smode_defconfig
index 56bf0bdc7e4..d7cf108692d 100644
--- a/configs/xilinx_mbv64_smode_defconfig
+++ b/configs/xilinx_mbv64_smode_defconfig
@@ -1,5 +1,5 @@
 #include <configs/xilinx_mbv64_defconfig>
 
-CONFIG_SPL_OPENSBI_LOAD_ADDR=0x80100000
+CONFIG_SPL_OPENSBI_LOAD_ADDR=0x80000000
 CONFIG_RISCV_SMODE=y
 CONFIG_SPL_OPENSBI_SCRATCH_OPTIONS=0x2
-- 
2.34.1

Reply via email to