Skip to contentSkip to conversation

common: spl_fit: Allow firmware image if no loadables

PATCH Superseded Abel Vesa 2 participants 2 messages Mar 6, 2019 – Mar 7, 2019

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Abel Vesa

author
#0 lore raw

PATCH 1/1 common: spl_fit: Allow firmware image if no loadables

If CONFIG_SPL_OS_BOOT and FIT_IMAGE_TINY are enabled, the os will not be set to anything and therefore will remain as IH_OS_INVALID. What's needed here is to have IH_OS_U_BOOT as default. And since using the mkimage oneline command (that is, no its file), the loadables can't be specified, so we allow firmware as a fallback.

---
 common/spl/spl_fit.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
common/spl/spl_fit.c +5 -2
index db43626..d5aa792 100644
@@ -478,11 +478,14 @@ int spl_load_simple_fit(struct spl_image_info *spl_image,
 
 	/* Now check if there are more images for us to load */
 	for (; ; index++) {
-		uint8_t os_type = IH_OS_INVALID;
+		uint8_t os_type = IH_OS_U_BOOT;
 
 		node = spl_fit_get_image_node(fit, images, "loadables", index);
 		if (node < 0)
-			break;
+			node = spl_fit_get_image_node(fit, images,
+						      "firmware", index);
+			if (node < 0)
+				break;
 
 		ret = spl_load_fit_image(info, sector, fit, base_offset, node,
 					 &image_info);
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 common: spl_fit: Allow firmware image if no loadables

Hi Abel,

Quoted 10 lines · Abel Vesa

If CONFIG_SPL_OS_BOOT and FIT_IMAGE_TINY are enabled, the os will not be set to anything and therefore will remain as IH_OS_INVALID. What's needed here is to have IH_OS_U_BOOT as default. And since using the mkimage oneline command (that is, no its file), the loadables can't be specified, so we allow firmware as a fallback.

This patch causes the following build warning:

CC spl/common/spl/spl_fit.o
common/spl/spl_fit.c: In function ‘spl_load_simple_fit’:
common/spl/spl_fit.c:484:3: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
if (node < 0)
^~
common/spl/spl_fit.c:487:4: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’

    if (node < 0)
    ^~

This fixes the boot on mx6sabresd. With the build warning fixed you can add: