]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
board_init_f_mem(): Don't create an unused early malloc() area
authorSimon Glass <sjg@chromium.org>
Mon, 19 Oct 2015 12:49:58 +0000 (06:49 -0600)
committerTom Rini <trini@konsulko.com>
Sat, 24 Oct 2015 17:50:35 +0000 (13:50 -0400)
Change the #ifdef so that the early malloc() area is not set up in SPL if
CONFIG_SYS_SPL_MALLOC_START is defined. In that case it would never actually
be used, and just chews up stack space.

Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Masahiro Yamada <yamada.masahiro@socionext.com>
common/init/board_init.c

index 1c6126d8ce55a08c85f8e0d576672fdf7f16f8bf..e74b63b8a8717cffe052a0a8bf393c1b2855c45e 100644 (file)
@@ -50,7 +50,8 @@ ulong board_init_f_mem(ulong top)
 #endif
        arch_setup_gd(gd_ptr);
 
-#if defined(CONFIG_SYS_MALLOC_F)
+#if defined(CONFIG_SYS_MALLOC_F) && \
+       (!defined(CONFIG_SPL_BUILD) || !defined(CONFIG_SYS_SPL_MALLOC_START))
        top -= CONFIG_SYS_MALLOC_F_LEN;
        gd->malloc_base = top;
 #endif