image-fit: Accept IH_TYPE_FIRMWARE in fit_image_load() as valid
authorAlexandru Gagniuc <mr.nuke.me@gmail.com>
Thu, 1 Apr 2021 18:25:30 +0000 (13:25 -0500)
committerTom Rini <trini@konsulko.com>
Wed, 14 Apr 2021 20:02:43 +0000 (16:02 -0400)
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

index b972042..4e033e1 100644 (file)
@@ -1959,6 +1959,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: