From 5b9d44df2307fc882b2ae666fd28fb2c7c2d5b11 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Tue, 23 Jun 2015 15:38:25 -0600 Subject: mkimage: Display a better list of available image types Offer to display the available image types in help. Also, rather than hacking the genimg_get_type_id() function to display a list of types, do this in the tool. Also, sort the list. The list of image types is quite long, and hard to discover. Print it out when we show help information. Signed-off-by: Simon Glass --- include/image.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/image.h') diff --git a/include/image.h b/include/image.h index b6eb57e..63c3d37 100644 --- a/include/image.h +++ b/include/image.h @@ -246,6 +246,8 @@ struct lmb; #define IH_TYPE_LPC32XXIMAGE 21 /* x86 setup.bin Image */ #define IH_TYPE_LOADABLE 22 /* A list of typeless images */ +#define IH_TYPE_COUNT 23 /* Number of image types */ + /* * Compression Types */ @@ -411,6 +413,15 @@ char *get_table_entry_name(const table_entry_t *table, char *msg, int id); const char *genimg_get_os_name(uint8_t os); const char *genimg_get_arch_name(uint8_t arch); const char *genimg_get_type_name(uint8_t type); + +/** + * genimg_get_type_short_name() - get the short name for an image type + * + * @param type Image type (IH_TYPE_...) + * @return image short name, or "unknown" if unknown + */ +const char *genimg_get_type_short_name(uint8_t type); + const char *genimg_get_comp_name(uint8_t comp); int genimg_get_os_id(const char *name); int genimg_get_arch_id(const char *name); -- cgit v1.1