On boards without TPL, but SPL enabled, xpl_prev_phase() will return never return PHASE_TPL. This the condition is always true. This is a problem for system which use an SDRAM bloblist location and initialize the SDRAM in SPL. Adjust the condition to take this config into account.
Signed-off-by: Alexander Stein <[email protected]> --- There is also another possibility for the check. I'm not sure which one is better or preferred. --- a/lib/fdtdec.c +++ b/lib/fdtdec.c @@ -1829,7 +1829,7 @@ int fdtdec_setup(void) * not whether this phase creates one. */ if (CONFIG_IS_ENABLED(BLOBLIST) && - (xpl_prev_phase() != PHASE_TPL || + (xpl_prev_phase() != PHASE_TPL && IS_ENABLED(CONFIG_TPL_BLOBLIST))) { ret = bloblist_maybe_init(); if (!ret) { lib/fdtdec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/fdtdec.c b/lib/fdtdec.c index c67b6e8c133..3f31f9c2aeb 100644 --- a/lib/fdtdec.c +++ b/lib/fdtdec.c @@ -1829,8 +1829,8 @@ int fdtdec_setup(void) * not whether this phase creates one. */ if (CONFIG_IS_ENABLED(BLOBLIST) && - (xpl_prev_phase() != PHASE_TPL || - IS_ENABLED(CONFIG_TPL_BLOBLIST))) { + !xpl_is_first_phase() && + (IS_ENABLED(CONFIG_TPL_BLOBLIST) || IS_ENABLED(CONFIG_SPL_BLOBLIST))) { ret = bloblist_maybe_init(); if (!ret) { gd->fdt_blob = bloblist_find(BLOBLISTT_CONTROL_FDT, 0); -- 2.43.0

