u-boot-brain/common/spl
Eddie Cai 340f418acd spl: Add spl_early_init()
At present malloc_base/_limit/_ptr are not initialised in spl_init() when
we call spl_init() in board_init_f(). This is due to a recent change aimed
at avoiding overwriting the malloc area set up on some boards by
spl_relocate_stack_gd().

However if CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN is not defined, we now
skip setting up the memory area in spl_init() which is obviously wrong.

To fix this, add a new function spl_early_init() which can be called in
board_init_f().

Fixes: b3d2861e (spl: Remove overwrite of relocated malloc limit)
Signed-off-by: Eddie Cai <eddie.cai.linux@gmail.com>
Rewrote spl_{,early_}init() to avoid duplicate code:
Rewrite/expand commit message:
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Eddie Cai <eddie.cai.linux@gmail.com>
2017-03-16 16:03:43 -06:00
..
Kconfig SPL: Move SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION to Kconfig 2017-02-17 14:15:15 -05:00
Makefile spl: move RAM boot support in separate file 2017-01-14 16:46:26 -05:00
spl_dfu.c spl: dfu: adding dfu support functions for SPL-DFU 2016-09-27 23:30:19 +02:00
spl_ext.c spl: Remove inline ifdef check for EXT and FAT support 2017-01-20 15:37:59 -05:00
spl_fat.c spl: Remove inline ifdef check for EXT and FAT support 2017-01-20 15:37:59 -05:00
spl_fit.c spl: Update spl_load_simple_fit() to take an spl_image param 2016-10-06 15:08:54 -04:00
spl_mmc.c SPL: Move SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION to Kconfig 2017-02-17 14:15:15 -05:00
spl_nand.c spl: Add a name to the SPL load-image methods 2016-12-09 08:40:13 -05:00
spl_net.c spl: Add a name to the SPL load-image methods 2016-12-09 08:40:13 -05:00
spl_nor.c spl: Add a name to the SPL load-image methods 2016-12-09 08:40:13 -05:00
spl_onenand.c spl: Add a name to the SPL load-image methods 2016-12-09 08:40:13 -05:00
spl_ram.c spl: move RAM boot support in separate file 2017-01-14 16:46:26 -05:00
spl_sata.c spl: Add a name to the SPL load-image methods 2016-12-09 08:40:13 -05:00
spl_spi.c spl: spi: Add a debug message if loading fails 2017-02-06 11:38:46 +08:00
spl_ubi.c spl: Add a name to the SPL load-image methods 2016-12-09 08:40:13 -05:00
spl_usb.c spl: Add a name to the SPL load-image methods 2016-12-09 08:40:13 -05:00
spl_ymodem.c spl: Add a name to the SPL load-image methods 2016-12-09 08:40:13 -05:00
spl.c spl: Add spl_early_init() 2017-03-16 16:03:43 -06:00