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>
diff --git a/include/spl.h b/include/spl.h
index 7155e9c..850c64d 100644
--- a/include/spl.h
+++ b/include/spl.h
@@ -345,7 +345,7 @@
* @priv: Private data for the device
* @bl_len: Block length for reading in bytes
* @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 {
spl_load_reader read;
@@ -355,7 +355,7 @@
#endif
#if CONFIG_IS_ENABLED(BOOTMETH_VBE)
u8 phase;
- u8 fit_loaded;
+ u8 fdt_update;
#endif
};
@@ -395,12 +395,20 @@
#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)
- 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
- return false;
+ return true;
#endif
}
@@ -415,6 +423,7 @@
load->priv = priv;
spl_set_bl_len(load, bl_len);
xpl_set_phase(load, IH_PHASE_NONE);
+ xpl_set_fdt_update(load, true);
}
/*