summaryrefslogtreecommitdiff
path: root/boot
diff options
context:
space:
mode:
authorSimon Glass <[email protected]>2025-03-05 17:25:08 -0700
committerTom Rini <[email protected]>2025-03-18 13:12:15 -0600
commit3c7b13b075488ebcff2923b0a7b46cc11f39285e (patch)
treebd84fef0400ed68352f3a244692ca460f0824579 /boot
parent7f10a7fe126dce5644d933af693eda40497d7755 (diff)
boot: Convert IMAGE_FORMAT into an enum
Use an enum so it is clearer that these options are related. Update genimg_get_format(), tidy up the function comment and move it to the header file, since it is exported. Signed-off-by: Simon Glass <[email protected]>
Diffstat (limited to 'boot')
-rw-r--r--boot/image-board.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/boot/image-board.c b/boot/image-board.c
index 514f8e63f9c..addccf87c80 100644
--- a/boot/image-board.c
+++ b/boot/image-board.c
@@ -234,21 +234,7 @@ ulong genimg_get_kernel_addr(char * const img_addr)
&fit_uname_kernel);
}
-/**
- * genimg_get_format - get image format type
- * @img_addr: image start address
- *
- * genimg_get_format() checks whether provided address points to a valid
- * legacy or FIT image.
- *
- * New uImage format and FDT blob are based on a libfdt. FDT blob
- * may be passed directly or embedded in a FIT image. In both situations
- * genimg_get_format() must be able to dectect libfdt header.
- *
- * returns:
- * image format type or IMAGE_FORMAT_INVALID if no image is present
- */
-int genimg_get_format(const void *img_addr)
+enum image_fmt_t genimg_get_format(const void *img_addr)
{
if (CONFIG_IS_ENABLED(LEGACY_IMAGE_FORMAT)) {
const struct legacy_img_hdr *hdr;
@@ -434,6 +420,8 @@ static int select_ramdisk(struct bootm_headers *images, const char *select, u8 a
done = true;
}
break;
+ case IMAGE_FORMAT_INVALID:
+ break;
}
if (!done) {