Skip to contentSkip to conversation

common: spl_fit: Default to IH_OS_U_BOOT if FIT_IMAGE_TINY enabled

PATCH Superseded Abel Vesa 3 participants 4 messages Mar 11, 2019 – Mar 22, 2019

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Abel Vesa

author
#0 lore raw

PATCH 1/2 common: spl_fit: Default to IH_OS_U_BOOT if FIT_IMAGE_TINY enabled

If FIT_IMAGE_TINY is enabled, spl_fit_image_get_os returns -ENOTSUPP. In this case, we should default to IH_OS_U_BOOT not to IH_OS_INVALID.

---
 common/spl/spl_fit.c | 2 ++
 1 file changed, 2 insertions(+)
common/spl/spl_fit.c +2 -0
index db43626..b190612 100644
@@ -491,6 +491,8 @@ int spl_load_simple_fit(struct spl_image_info *spl_image,
 
 		if (!spl_fit_image_get_os(fit, node, &os_type))
 			debug("Loadable is %s\n", genimg_get_os_name(os_type));
+		else
+			os_type = IH_OS_U_BOOT;
 
 		if (os_type == IH_OS_U_BOOT) {
 			spl_fit_append_fdt(&image_info, info, sector,
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH 2/2 tools: fit_image: Add the loadable property to configs

When running mkimage with "-f auto", the loadable property needs to be set in order to allow SPL FIT support to boot.

---
 tools/fit_image.c | 1 +
 1 file changed, 1 insertion(+)
tools/fit_image.c +1 -0
index 4b62635..3b867e0 100644
@@ -298,6 +298,7 @@ static void fit_write_configs(struct image_tool_params *params, char *fdt)
 		typename = genimg_get_type_short_name(params->fit_image_type);
 		snprintf(str, sizeof(str), "%s-1", typename);
 		fdt_property_string(fdt, typename, str);
+		fdt_property_string(fdt, FIT_LOADABLE_PROP, str);
 
 		if (params->fit_ramdisk)
 			fdt_property_string(fdt, FIT_RAMDISK_PROP,
Signature · 1 line
2.7.4
#3 lore raw

PATCH 1/2 common: spl_fit: Default to IH_OS_U_BOOT if FIT_IMAGE_TINY enabled

In reply to Abel Vesa
Quoted 13 lines · Abel Vesa

If FIT_IMAGE_TINY is enabled, spl_fit_image_get_os returns -ENOTSUPP. In this case, we should default to IH_OS_U_BOOT not to IH_OS_INVALID.

---
 common/spl/spl_fit.c | 2 ++
 1 file changed, 2 insertions(+)
common/spl/spl_fit.c +0 -0
index db43626..b190612 100644

common/spl/spl_fit.c int spl_load_simple_fit(struct spl_image_info *spl_image, · line 495

Quoted 5 lines
common/spl/spl_fit.c +2 -0
@@ -491,6 +491,8 @@ int spl_load_simple_fit(struct spl_image_info *spl_image,
 
 		if (!spl_fit_image_get_os(fit, node, &os_type))
 			debug("Loadable is %s\n", genimg_get_os_name(os_type));
+		else
+			os_type = IH_OS_U_BOOT;

Don't you need if CONFIG_IS_ENABLED(FIT_IMAGE_TINY) around this new code ?

Quoted 3 lines
common/spl/spl_fit.c +0 -0
 		if (os_type == IH_OS_U_BOOT) {
 			spl_fit_append_fdt(&image_info, info, sector,
 
Signature · 2 lines
Best regards,
Marek Vasut