diff mbox series

[v3,5/6] image-fit: Accept IH_TYPE_FIRMWARE in fit_image_load() as valid

Message ID 20210401182531.2147653-6-mr.nuke.me@gmail.com
State Accepted
Commit 47b6f7f8451117546dd12af3eccd58961a9f7f05
Delegated to: Tom Rini
Headers show
Series SPL: FIT: Fix some omissions of SPL_LOAD_FIT_FULL and bootm | expand

Commit Message

Alexandru Gagniuc April 1, 2021, 6:25 p.m. UTC
Consider the following FIT:

	images {
		whipple {};
	};
	configurations {
		conf-1 {
			firmware = "whipple";
		};
	};

Getting the 'firmware' image with fit_image_load() is not possible, as
it doesn't understand 'firmware =' properties. Although one could pass
IH_TYPE_FIRMWARE for 'image_type', this needs to be converted to a
"firmware" string for FDT lookup -- exactly what this change does.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---
 common/image-fit.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Tom Rini April 16, 2021, 12:26 p.m. UTC | #1
On Thu, Apr 01, 2021 at 01:25:30PM -0500, Alexandru Gagniuc wrote:

> Consider the following FIT:
> 
> 	images {
> 		whipple {};
> 	};
> 	configurations {
> 		conf-1 {
> 			firmware = "whipple";
> 		};
> 	};
> 
> Getting the 'firmware' image with fit_image_load() is not possible, as
> it doesn't understand 'firmware =' properties. Although one could pass
> IH_TYPE_FIRMWARE for 'image_type', this needs to be converted to a
> "firmware" string for FDT lookup -- exactly what this change does.
> 
> Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/common/image-fit.c b/common/image-fit.c
index 94501b1071..970e3f89da 100644
--- a/common/image-fit.c
+++ b/common/image-fit.c
@@ -1955,6 +1955,8 @@  static const char *fit_get_image_type_property(int type)
 		return FIT_FDT_PROP;
 	case IH_TYPE_KERNEL:
 		return FIT_KERNEL_PROP;
+	case IH_TYPE_FIRMWARE:
+		return FIT_FIRMWARE_PROP;
 	case IH_TYPE_RAMDISK:
 		return FIT_RAMDISK_PROP;
 	case IH_TYPE_X86_SETUP: