diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2013-09-11 06:51:41 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2013-10-29 16:24:28 -0400 |
commit | 4e23eb631c84090d2122a0f8c4a331b8e0ba0d99 (patch) | |
tree | 0ed81e2bca50f3badeadefb2f4352f1dfcffc13e /arch/mips | |
parent | 26fca83a22f66e2ea0339e6b1ee1bdc628c1508b (diff) |
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')
-rw-r--r-- | arch/mips/Kconfig | 1 | ||||
-rw-r--r-- | arch/mips/boot/compressed/Makefile | 5 | ||||
-rw-r--r-- | arch/mips/boot/compressed/decompress.c | 8 |
3 files changed, 13 insertions, 1 deletions
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index c35603bb6ace..a749defb1582 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig | |||
@@ -1491,6 +1491,7 @@ config SYS_SUPPORTS_ZBOOT | |||
1491 | select HAVE_KERNEL_BZIP2 | 1491 | select HAVE_KERNEL_BZIP2 |
1492 | select HAVE_KERNEL_LZMA | 1492 | select HAVE_KERNEL_LZMA |
1493 | select HAVE_KERNEL_LZO | 1493 | select HAVE_KERNEL_LZO |
1494 | select HAVE_KERNEL_XZ | ||
1494 | 1495 | ||
1495 | config SYS_SUPPORTS_ZBOOT_UART16550 | 1496 | config SYS_SUPPORTS_ZBOOT_UART16550 |
1496 | bool | 1497 | bool |
diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile index 0048c0897896..c1f8f0753cc8 100644 --- a/arch/mips/boot/compressed/Makefile +++ b/arch/mips/boot/compressed/Makefile | |||
@@ -37,6 +37,10 @@ vmlinuzobjs-$(CONFIG_SYS_SUPPORTS_ZBOOT_UART16550) += $(obj)/uart-16550.o | |||
37 | vmlinuzobjs-$(CONFIG_MIPS_ALCHEMY) += $(obj)/uart-alchemy.o | 37 | vmlinuzobjs-$(CONFIG_MIPS_ALCHEMY) += $(obj)/uart-alchemy.o |
38 | endif | 38 | endif |
39 | 39 | ||
40 | ifdef CONFIG_KERNEL_XZ | ||
41 | vmlinuzobjs-y += $(obj)/../../lib/ashldi3.o | ||
42 | endif | ||
43 | |||
40 | targets += vmlinux.bin | 44 | targets += vmlinux.bin |
41 | OBJCOPYFLAGS_vmlinux.bin := $(OBJCOPYFLAGS) -O binary -R .comment -S | 45 | OBJCOPYFLAGS_vmlinux.bin := $(OBJCOPYFLAGS) -O binary -R .comment -S |
42 | $(obj)/vmlinux.bin: $(KBUILD_IMAGE) FORCE | 46 | $(obj)/vmlinux.bin: $(KBUILD_IMAGE) FORCE |
@@ -46,6 +50,7 @@ tool_$(CONFIG_KERNEL_GZIP) = gzip | |||
46 | tool_$(CONFIG_KERNEL_BZIP2) = bzip2 | 50 | tool_$(CONFIG_KERNEL_BZIP2) = bzip2 |
47 | tool_$(CONFIG_KERNEL_LZMA) = lzma | 51 | tool_$(CONFIG_KERNEL_LZMA) = lzma |
48 | tool_$(CONFIG_KERNEL_LZO) = lzo | 52 | tool_$(CONFIG_KERNEL_LZO) = lzo |
53 | tool_$(CONFIG_KERNEL_XZ) = xzkern | ||
49 | 54 | ||
50 | targets += vmlinux.bin.z | 55 | targets += vmlinux.bin.z |
51 | $(obj)/vmlinux.bin.z: $(obj)/vmlinux.bin FORCE | 56 | $(obj)/vmlinux.bin.z: $(obj)/vmlinux.bin FORCE |
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) | |||
43 | /* activate the code for pre-boot environment */ | 43 | /* activate the code for pre-boot environment */ |
44 | #define STATIC static | 44 | #define STATIC static |
45 | 45 | ||
46 | #ifdef CONFIG_KERNEL_GZIP | 46 | #if defined(CONFIG_KERNEL_GZIP) || defined(CONFIG_KERNEL_XZ) |
47 | void *memcpy(void *dest, const void *src, size_t n) | 47 | void *memcpy(void *dest, const void *src, size_t n) |
48 | { | 48 | { |
49 | int i; | 49 | int i; |
@@ -54,6 +54,8 @@ void *memcpy(void *dest, const void *src, size_t n) | |||
54 | d[i] = s[i]; | 54 | d[i] = s[i]; |
55 | return dest; | 55 | return dest; |
56 | } | 56 | } |
57 | #endif | ||
58 | #ifdef CONFIG_KERNEL_GZIP | ||
57 | #include "../../../../lib/decompress_inflate.c" | 59 | #include "../../../../lib/decompress_inflate.c" |
58 | #endif | 60 | #endif |
59 | 61 | ||
@@ -78,6 +80,10 @@ void *memset(void *s, int c, size_t n) | |||
78 | #include "../../../../lib/decompress_unlzo.c" | 80 | #include "../../../../lib/decompress_unlzo.c" |
79 | #endif | 81 | #endif |
80 | 82 | ||
83 | #ifdef CONFIG_KERNEL_XZ | ||
84 | #include "../../../../lib/decompress_unxz.c" | ||
85 | #endif | ||
86 | |||
81 | void decompress_kernel(unsigned long boot_heap_start) | 87 | void decompress_kernel(unsigned long boot_heap_start) |
82 | { | 88 | { |
83 | unsigned long zimage_start, zimage_size; | 89 | unsigned long zimage_start, zimage_size; |