configs: migrate CONFIG_SYS_MTDPARTS_RUNTIME to defconfigs
[oweals/u-boot.git] / include / image.h
index 2388c1f2044742b08fde276df0858413171b3c1b..de55b2fb573eb6a9f2a6da2523ebd990bb7f4142 100644 (file)
@@ -452,6 +452,15 @@ typedef struct table_entry {
        char    *lname;         /* long (output) name to print for messages */
 } table_entry_t;
 
+/*
+ * Compression type and magic number mapping table.
+ */
+struct comp_magic_map {
+       int             comp_id;
+       const char      *name;
+       unsigned char   magic[2];
+};
+
 /*
  * get_table_entry_id() scans the translation table trying to find an
  * entry that matches the given short name. If a matching entry is
@@ -868,6 +877,18 @@ static inline int image_check_target_arch(const image_header_t *hdr)
 }
 #endif /* USE_HOSTCC */
 
+/**
+ * image_decomp_type() - Find out compression type of an image
+ *
+ * @buf:       Address in U-Boot memory where image is loaded.
+ * @len:       Length of the compressed image.
+ * @return     compression type or IH_COMP_NONE if not compressed.
+ *
+ * Note: Only following compression types are supported now.
+ * lzo, lzma, gzip, bzip2
+ */
+int image_decomp_type(const unsigned char *buf, ulong len);
+
 /**
  * image_decomp() - decompress an image
  *