common/board_init: setup early malloc during crt0
Currently the early malloc initialisation is done partially in
board_init_f_init_reserve(), which configures gd->malloc_base. But it
isn't actually usable until initf_malloc() is called which doesn't
happen until after fdtdec_setup().
This causes an issue when using MULTI_DTB_FIT, as it expects a working
malloc().
The existence of initf_malloc() seems to be a legacy from when this was
less standardised, but nowadays all it does is set gd->malloc_limit and
malloc_ptr, both of which we could just assign directly from
board_init_f_init_reserve().
Make this change so that malloc() will work in fdtdec_setup() and
simplify this early bootflow.
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
4 files changed