summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2024-07-31 08:49:05 -0600
committerTom Rini <trini@konsulko.com>2024-08-05 12:15:29 -0600
commitcafde93ec02d654a092ee5b3fd0ed706347a9744 (patch)
tree702658d634d679425ef115a096ebe21e92790916 /lib
parentcbf3d274cf3b5f4623f73a784337ab4f50b3a10b (diff)
fdt: Correct condition for bloblist existing
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> Acked-by: Raymond Mao <raymond.mao@linaro.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/fdtdec.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 5b3b26df968..6865f78c70d 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -1668,8 +1668,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. There was discussion about
+ * adding an OF_BLOBLIST Kconfig, but this was rejected.
+ *
+ * The necessary test is whether the previous phase passed a bloblist,
+ * not whether this phase creates one.
+ */
+ if (CONFIG_IS_ENABLED(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);