summaryrefslogtreecommitdiff
path: root/arch/mips/boot/compressed/decompress.c
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2013-09-11 11:51:41 +0100
committerRalf Baechle <ralf@linux-mips.org>2013-10-29 21:24:28 +0100
commit4e23eb631c84090d2122a0f8c4a331b8e0ba0d99 (patch)
tree0ed81e2bca50f3badeadefb2f4352f1dfcffc13e /arch/mips/boot/compressed/decompress.c
parent26fca83a22f66e2ea0339e6b1ee1bdc628c1508b (diff)
downloadlwn-4e23eb631c84090d2122a0f8c4a331b8e0ba0d99.tar.gz
lwn-4e23eb631c84090d2122a0f8c4a331b8e0ba0d99.zip
MIPS: ZBOOT: Support XZ compression scheme
Add support for the XZ compression scheme in the ZBOOT decompression stub, in order to support it we need to: - select the "xzkern" compression tool to compress the vmlinux.bin payload - link with ashldi3.o for xz_dec_run() to work - memcpy() is also required for decompress_unxz.c so we share the implementation between GZIP and XZ 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/5818/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/boot/compressed/decompress.c')
-rw-r--r--arch/mips/boot/compressed/decompress.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/mips/boot/compressed/decompress.c b/arch/mips/boot/compressed/decompress.c
index 2c9573098c0d..cff7b7d1ff45 100644
--- a/arch/mips/boot/compressed/decompress.c
+++ b/arch/mips/boot/compressed/decompress.c
@@ -43,7 +43,7 @@ void error(char *x)
/* activate the code for pre-boot environment */
#define STATIC static
-#ifdef CONFIG_KERNEL_GZIP
+#if defined(CONFIG_KERNEL_GZIP) || defined(CONFIG_KERNEL_XZ)
void *memcpy(void *dest, const void *src, size_t n)
{
int i;
@@ -54,6 +54,8 @@ void *memcpy(void *dest, const void *src, size_t n)
d[i] = s[i];
return dest;
}
+#endif
+#ifdef CONFIG_KERNEL_GZIP
#include "../../../../lib/decompress_inflate.c"
#endif
@@ -78,6 +80,10 @@ void *memset(void *s, int c, size_t n)
#include "../../../../lib/decompress_unlzo.c"
#endif
+#ifdef CONFIG_KERNEL_XZ
+#include "../../../../lib/decompress_unxz.c"
+#endif
+
void decompress_kernel(unsigned long boot_heap_start)
{
unsigned long zimage_start, zimage_size;