@@ -1669,8 +1669,16 @@ int fdtdec_setup(void)
{
int ret = -ENOENT;
- /* If allowing a bloblist, check that first */
- if (CONFIG_IS_ENABLED(BLOBLIST)) {
+ /*
+ * If allowing a bloblist, check that first. This would be better
+ * handled with an OF_BLOBLIST Kconfig, but that caused far too much
+ * argument, so add a hack here, used e.g. by chromebook_coral
+ * The necessary test is whether the previous phase passed a bloblist,
+ * not whether this phase creates one.
+ */
+ if (CONFIG_IS_ENABLED(OF_BLOBLIST) &&
+ (spl_prev_phase() != PHASE_TPL ||
+ !IS_ENABLED(CONFIG_TPL_BLOBLIST))) {
ret = bloblist_maybe_init();
if (!ret) {
gd->fdt_blob = bloblist_find(BLOBLISTT_CONTROL_FDT, 0);
On some boards, the bloblist is created in SPL once SDRAM is ready. It cannot be accessed until that point, so is not available early in SPL. Add a condition to avoid a hang in this case. This fixes a hang in chromebook_coral Fixes: 70fe2385943 ("fdt: Allow the devicetree to come from a bloblist") Signed-off-by: Simon Glass <sjg@chromium.org> --- Changes in v2: - Use 'phase' instead of 'stage' lib/fdtdec.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)