MIPS: ZBOOT: Support LZ4 compression scheme
authorFlorian Fainelli <f.fainelli@gmail.com>
Mon, 16 Sep 2013 15:55:20 +0000 (16:55 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Tue, 29 Oct 2013 20:24:34 +0000 (21:24 +0100)
Add support for the LZ4 compression scheme in the ZBOOT decompression
stub, in order to support it we need to:

- select the "lz4" compression tool to compress the vmlinux.bin
  payload
- memcpy() is also required for decompress_unlz4.c so we share the
  implementation between GZIP, XZ and now LZ4

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Cc: linux-mips@linux-mips.org
Cc: blogic@openwrt.org
Cc: james.hogan@imgtec.com
Patchwork: https://patchwork.linux-mips.org/patch/5829/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/Kconfig
arch/mips/boot/compressed/Makefile
arch/mips/boot/compressed/decompress.c

index a749defb1582982ed6be7454817fc2b8fe15f3cf..0cff92315ac42f98ef76f78a91fc61d3c2b174ea 100644 (file)
@@ -1489,6 +1489,7 @@ config SYS_SUPPORTS_ZBOOT
        bool
        select HAVE_KERNEL_GZIP
        select HAVE_KERNEL_BZIP2
        bool
        select HAVE_KERNEL_GZIP
        select HAVE_KERNEL_BZIP2
+       select HAVE_KERNEL_LZ4
        select HAVE_KERNEL_LZMA
        select HAVE_KERNEL_LZO
        select HAVE_KERNEL_XZ
        select HAVE_KERNEL_LZMA
        select HAVE_KERNEL_LZO
        select HAVE_KERNEL_XZ
index c1f8f0753cc801f5c1cf392945b1205d0b2a7c34..ca0c343c9ea5ed024b87a5e314b4118d9ecff04e 100644 (file)
@@ -48,6 +48,7 @@ $(obj)/vmlinux.bin: $(KBUILD_IMAGE) FORCE
 
 tool_$(CONFIG_KERNEL_GZIP)    = gzip
 tool_$(CONFIG_KERNEL_BZIP2)   = bzip2
 
 tool_$(CONFIG_KERNEL_GZIP)    = gzip
 tool_$(CONFIG_KERNEL_BZIP2)   = bzip2
+tool_$(CONFIG_KERNEL_LZ4)     = lz4
 tool_$(CONFIG_KERNEL_LZMA)    = lzma
 tool_$(CONFIG_KERNEL_LZO)     = lzo
 tool_$(CONFIG_KERNEL_XZ)      = xzkern
 tool_$(CONFIG_KERNEL_LZMA)    = lzma
 tool_$(CONFIG_KERNEL_LZO)     = lzo
 tool_$(CONFIG_KERNEL_XZ)      = xzkern
index cff7b7d1ff4505b02e49c047b19dd555ee01e35c..a8c6fd6a440667cf58c35d4655862783de7d271f 100644 (file)
@@ -43,7 +43,8 @@ void error(char *x)
 /* activate the code for pre-boot environment */
 #define STATIC static
 
 /* activate the code for pre-boot environment */
 #define STATIC static
 
-#if defined(CONFIG_KERNEL_GZIP) || defined(CONFIG_KERNEL_XZ)
+#if defined(CONFIG_KERNEL_GZIP) || defined(CONFIG_KERNEL_XZ) || \
+       defined(CONFIG_KERNEL_LZ4)
 void *memcpy(void *dest, const void *src, size_t n)
 {
        int i;
 void *memcpy(void *dest, const void *src, size_t n)
 {
        int i;
@@ -72,6 +73,10 @@ void *memset(void *s, int c, size_t n)
 #include "../../../../lib/decompress_bunzip2.c"
 #endif
 
 #include "../../../../lib/decompress_bunzip2.c"
 #endif
 
+#ifdef CONFIG_KERNEL_LZ4
+#include "../../../../lib/decompress_unlz4.c"
+#endif
+
 #ifdef CONFIG_KERNEL_LZMA
 #include "../../../../lib/decompress_unlzma.c"
 #endif
 #ifdef CONFIG_KERNEL_LZMA
 #include "../../../../lib/decompress_unlzma.c"
 #endif