]> Git Repo - u-boot.git/blobdiff - lib/fdtdec.c
efi_loader: Put back copyright message
[u-boot.git] / lib / fdtdec.c
index b2c59ab3818b3235e36b61b054c76a803423de63..5edc8dd2f9f02e47329922bb9eed8b1189ea50bb 100644 (file)
@@ -1182,7 +1182,6 @@ static int uncompress_blob(const void *src, ulong sz_src, void **dstp)
        if (!gzip && !lzo)
                return -EBADMSG;
 
-
        if (CONFIG_IS_ENABLED(MULTI_DTB_FIT_DYN_ALLOC)) {
                dst = malloc(sz_out);
                if (!dst) {
@@ -1669,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);
@@ -1678,6 +1685,7 @@ int fdtdec_setup(void)
                                gd->fdt_src = FDTSRC_BLOBLIST;
                                log_debug("Devicetree is in bloblist at %p\n",
                                          gd->fdt_blob);
+                               ret = 0;
                        } else {
                                log_debug("No FDT found in bloblist\n");
                                ret = -ENOENT;
This page took 0.027767 seconds and 4 git commands to generate.