boot: Support compressed booti images in bootm

A compressed booti image relies on the compression-format's header at
the start to indicate which compression algorithm is used.

We don't support this elsewhere in U-Boot, so assume that a compressed
file is always a booti file. Once it is compressed, a check is made to
make sure that it actually is.

Simplify the implementation by adding a new function which returns the
booti image-type if compression is detected.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2025-03-05 17:25:11 -07:00
committed by Tom Rini
parent d6bb0ea535
commit ecd50bb464
3 changed files with 53 additions and 8 deletions

View File

@@ -648,6 +648,17 @@ ulong genimg_get_kernel_addr(char * const img_addr);
*/
enum image_fmt_t genimg_get_format(const void *img_addr);
/**
* genimg_get_format_comp() - Like genimg_get_format() but adds compressed booti
*
* If a compressed file is detected (with image_decomp_type()) and
* CONFIG_CMD_BOOTI is enabled, then this returns IMAGE_FORMAT_BOOTI
*
* @img_addr: image start address
* Return: image format type or IMAGE_FORMAT_INVALID if no image is present
*/
enum image_fmt_t genimg_get_format_comp(const void *img_addr);
int genimg_has_config(struct bootm_headers *images);
/**