diff options
author | Julius Werner <jwerner@chromium.org> | 2015-10-06 20:03:53 -0700 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2015-10-11 17:12:10 -0400 |
commit | 027b728d4aafb5cf97abc804944a77b837b0f07f (patch) | |
tree | e7078c28ab243f5397584eba3aace01fbdd0d208 /include | |
parent | b6b5e394db62ac17e496dce9e6e9451435c8be62 (diff) | |
download | u-boot-imx-027b728d4aafb5cf97abc804944a77b837b0f07f.zip u-boot-imx-027b728d4aafb5cf97abc804944a77b837b0f07f.tar.gz u-boot-imx-027b728d4aafb5cf97abc804944a77b837b0f07f.tar.bz2 |
Add support for LZ4 decompression algorithm
This patch adds support for LZ4-compressed FIT image contents. This
algorithm has a slightly worse compression ration than LZO while being
nearly twice as fast to decompress. When loading images from a fast
storage medium this usually results in a boot time win.
Sandbox-tested only since I don't have a U-Boot development system set
up right now. The code was imported unchanged from coreboot where it's
proven to work, though. I'm mostly interested in getting this recognized
by mkImage for use in a downstream project.
Signed-off-by: Julius Werner <jwerner@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/common.h | 3 | ||||
-rw-r--r-- | include/image.h | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/include/common.h b/include/common.h index 68b24d0..ecb1f06 100644 --- a/include/common.h +++ b/include/common.h @@ -826,6 +826,9 @@ int gzwrite(unsigned char *src, int len, u64 startoffs, u64 szexpected); +/* lib/lz4_wrapper.c */ +int ulz4fn(const void *src, size_t srcn, void *dst, size_t *dstn); + /* lib/qsort.c */ void qsort(void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *)); diff --git a/include/image.h b/include/image.h index 8a864ae..08ae24a 100644 --- a/include/image.h +++ b/include/image.h @@ -259,6 +259,7 @@ struct lmb; #define IH_COMP_BZIP2 2 /* bzip2 Compression Used */ #define IH_COMP_LZMA 3 /* lzma Compression Used */ #define IH_COMP_LZO 4 /* lzo Compression Used */ +#define IH_COMP_LZ4 5 /* lz4 Compression Used */ #define IH_MAGIC 0x27051956 /* Image Magic Number */ #define IH_NMLEN 32 /* Image Name Length */ |