vbe: Allow VBE to disable adding loadables to the FDT

When VBE operates within VPL it does not want the FDT to be changed.
Provide a way to disable this feature.

Move the FIT_IMAGE_TINY condition out of spl_fit_record_loadable() so
that both conditions are together. This makes the code easier to
understand.

Replace the existing fit_loaded member, which is no-longer used.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2025-01-26 11:43:28 -07:00
committed by Tom Rini
parent 39a9b033ce
commit f4415f2a37
3 changed files with 17 additions and 9 deletions

View File

@@ -208,6 +208,7 @@ int vbe_read_fit(struct udevice *blk, ulong area_offset, ulong area_size,
struct spl_load_info info; struct spl_load_info info;
spl_load_init(&info, h_vbe_load_read, desc, desc->blksz); spl_load_init(&info, h_vbe_load_read, desc, desc->blksz);
xpl_set_fdt_update(&info, false);
xpl_set_phase(&info, IH_PHASE_U_BOOT); xpl_set_phase(&info, IH_PHASE_U_BOOT);
log_debug("doing SPL from %s blksz %lx log2blksz %x area_offset %lx + fdt_size %lx\n", log_debug("doing SPL from %s blksz %lx log2blksz %x area_offset %lx + fdt_size %lx\n",
blk->name, desc->blksz, desc->log2blksz, area_offset, ALIGN(size, 4)); blk->name, desc->blksz, desc->log2blksz, area_offset, ALIGN(size, 4));

View File

@@ -515,9 +515,6 @@ static int spl_fit_record_loadable(const struct spl_fit_info *ctx, int index,
const char *name; const char *name;
int node; int node;
if (CONFIG_IS_ENABLED(FIT_IMAGE_TINY))
return 0;
ret = spl_fit_get_image_name(ctx, "loadables", index, &name); ret = spl_fit_get_image_name(ctx, "loadables", index, &name);
if (ret < 0) if (ret < 0)
return ret; return ret;
@@ -863,7 +860,8 @@ int spl_load_simple_fit(struct spl_image_info *spl_image,
spl_image->entry_point = image_info.entry_point; spl_image->entry_point = image_info.entry_point;
/* Record our loadables into the FDT */ /* Record our loadables into the FDT */
if (spl_image->fdt_addr) if (!CONFIG_IS_ENABLED(FIT_IMAGE_TINY) &&
xpl_get_fdt_update(info) && spl_image->fdt_addr)
spl_fit_record_loadable(&ctx, index, spl_fit_record_loadable(&ctx, index,
spl_image->fdt_addr, spl_image->fdt_addr,
&image_info); &image_info);

View File

@@ -345,7 +345,7 @@ typedef ulong (*spl_load_reader)(struct spl_load_info *load, ulong sector,
* @priv: Private data for the device * @priv: Private data for the device
* @bl_len: Block length for reading in bytes * @bl_len: Block length for reading in bytes
* @phase: Image phase to load * @phase: Image phase to load
* @fit_loaded: true if the FIT has been loaded, except for external data * @no_fdt_update: true to update the FDT with any loadables that are loaded
*/ */
struct spl_load_info { struct spl_load_info {
spl_load_reader read; spl_load_reader read;
@@ -355,7 +355,7 @@ struct spl_load_info {
#endif #endif
#if CONFIG_IS_ENABLED(BOOTMETH_VBE) #if CONFIG_IS_ENABLED(BOOTMETH_VBE)
u8 phase; u8 phase;
u8 fit_loaded; u8 fdt_update;
#endif #endif
}; };
@@ -395,12 +395,20 @@ static inline enum image_phase_t xpl_get_phase(struct spl_load_info *info)
#endif #endif
} }
static inline bool xpl_get_fit_loaded(struct spl_load_info *info) static inline void xpl_set_fdt_update(struct spl_load_info *info,
bool fdt_update)
{ {
#if CONFIG_IS_ENABLED(BOOTMETH_VBE) #if CONFIG_IS_ENABLED(BOOTMETH_VBE)
return info->fit_loaded; info->fdt_update = fdt_update;
#endif
}
static inline enum image_phase_t xpl_get_fdt_update(struct spl_load_info *info)
{
#if CONFIG_IS_ENABLED(BOOTMETH_VBE)
return info->fdt_update;
#else #else
return false; return true;
#endif #endif
} }
@@ -415,6 +423,7 @@ static inline void spl_load_init(struct spl_load_info *load,
load->priv = priv; load->priv = priv;
spl_set_bl_len(load, bl_len); spl_set_bl_len(load, bl_len);
xpl_set_phase(load, IH_PHASE_NONE); xpl_set_phase(load, IH_PHASE_NONE);
xpl_set_fdt_update(load, true);
} }
/* /*