]> git.sur5r.net Git - u-boot/commit
spl: Add spl_early_init()
authorEddie Cai <eddie.cai.linux@gmail.com>
Wed, 15 Mar 2017 14:43:28 +0000 (08:43 -0600)
committerSimon Glass <sjg@chromium.org>
Thu, 16 Mar 2017 22:03:43 +0000 (16:03 -0600)
commit340f418acd1159588b2f0fb50561053212c4247d
tree2dfbc0fa0fad4407c0b619793820de83e4e522a4
parent2808576491ae36b6ea96743005058f370d936beb
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>
common/spl/spl.c
include/asm-generic/global_data.h
include/spl.h