sunxi calls spl_init() from board_init_f(), before the optional SPL
stack relocation has happened. This is too early for the full SPL init
path when SPL_STACK_R and SPL_SYS_MALLOC_SIMPLE are enabled, since
spl_init() assumes the relocated malloc area is already available in that
case.

Use spl_early_init() instead, matching the SPL helper intended for
board_init_f(). The SPL core still calls spl_init() later from
board_init_r() if full SPL init has not already completed.

Signed-off-by: James Hilliard <[email protected]>
---
 arch/arm/mach-sunxi/board.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-sunxi/board.c b/arch/arm/mach-sunxi/board.c
index 378d4706c82..9522fd3e43f 100644
--- a/arch/arm/mach-sunxi/board.c
+++ b/arch/arm/mach-sunxi/board.c
@@ -500,7 +500,7 @@ void board_init_f(ulong dummy)
        clock_init();
        gpio_init();
 
-       spl_init();
+       spl_early_init();
        preloader_console_init();
 
 #if CONFIG_IS_ENABLED(I2C) && CONFIG_IS_ENABLED(SYS_I2C_LEGACY)
-- 
2.53.0

Reply via email to