[PATCH v3 01/11] spl: Use FIT data address as fallback when 'load' property is absent
Beleswar Padhi
b-padhi at ti.com
Wed Dec 31 18:36:11 CET 2025
In cases where the 'load' property is not defined in a FIT image node,
fallback to using the data address returned by `fit_image_get_data()`.
This enables FIT images to omit the 'load' property during FIT creation.
Signed-off-by: Beleswar Padhi <b-padhi at ti.com>
---
Cc: Simon Glass <sjg at chromium.org>
v3: Changelog:
1. None
Link to v2:
https://lore.kernel.org/all/20250506104202.16741-3-b-padhi@ti.com/
v2: Changelog:
1. New patch. Add support to load images without 'load' property.
common/spl/spl_fit.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
index a588d13eb40..c18c98b2959 100644
--- a/common/spl/spl_fit.c
+++ b/common/spl/spl_fit.c
@@ -803,6 +803,8 @@ int spl_load_simple_fit(struct spl_image_info *spl_image,
{
struct spl_image_info image_info;
struct spl_fit_info ctx;
+ const void *fit_image_loadaddr;
+ size_t fit_image_size;
int node = -1;
int ret;
int index = 0;
@@ -893,7 +895,19 @@ int spl_load_simple_fit(struct spl_image_info *spl_image,
if (firmware_node == node)
continue;
- image_info.load_addr = 0;
+ /*
+ * If the 'load' property is not present in the image node,
+ * use the FIT image's data address as the fallback load
+ * address. This allows flexibility in omitting the load address
+ * during FIT creation time.
+ */
+ ret = fit_image_get_data(ctx.fit, node,
+ &fit_image_loadaddr, &fit_image_size);
+ if (ret < 0)
+ panic("Error accessing node = %d in FIT (%d)\n", node,
+ ret);
+
+ image_info.load_addr = (ulong)fit_image_loadaddr;
ret = load_simple_fit(info, offset, &ctx, node, &image_info);
if (ret < 0 && ret != -EBADSLT) {
printf("%s: can't load image loadables index %d (ret = %d)\n",
--
2.34.1
More information about the U-Boot
mailing list