spl: Allow spl_load() to be controlled in any xPL phase

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>
This commit is contained in:
Simon Glass 2025-01-26 11:43:19 -07:00 committed by Tom Rini
parent 5fb647c83e
commit fe71ebbea9

View 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) &&