spl: Allow spl_load() to be controlled in any xPL phase
authorSimon Glass <sjg@chromium.org>
Sun, 26 Jan 2025 18:43:19 +0000 (11:43 -0700)
committerTom Rini <trini@konsulko.com>
Mon, 3 Feb 2025 22:01:36 +0000 (16:01 -0600)
Some phases may wish to use full FIT-loading and others not, so allow
this to be controlled.

Add some debugging while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
include/spl_load.h

index 935f7d3..525e0c9 100644 (file)
@@ -20,13 +20,15 @@ static inline int _spl_load(struct spl_image_info *spl_image,
        ulong base_offset, image_offset, overhead;
        int read, ret;
 
+       log_debug("\nloading hdr from %lx to %p\n", (ulong)offset, header);
        read = info->read(info, offset, ALIGN(sizeof(*header),
                                              spl_get_bl_len(info)), header);
        if (read < (int)sizeof(*header))
                return -EIO;
 
        if (image_get_magic(header) == FDT_MAGIC) {
-               if (IS_ENABLED(CONFIG_SPL_LOAD_FIT_FULL)) {
+               log_debug("Found FIT\n");
+               if (CONFIG_IS_ENABLED(LOAD_FIT_FULL)) {
                        void *buf;
 
                        /*
@@ -48,9 +50,12 @@ static inline int _spl_load(struct spl_image_info *spl_image,
                        return spl_parse_image_header(spl_image, bootdev, buf);
                }
 
-               if (IS_ENABLED(CONFIG_SPL_LOAD_FIT))
+               if (CONFIG_IS_ENABLED(LOAD_FIT)) {
+                       log_debug("Simple loading\n");
                        return spl_load_simple_fit(spl_image, info, offset,
                                                   header);
+               }
+               log_debug("No FIT support\n");
        }
 
        if (IS_ENABLED(CONFIG_SPL_LOAD_IMX_CONTAINER) &&