aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKyungsik Lee <kyungsik.lee@lge.com>2013-07-08 19:01:48 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-09 13:33:30 -0400
commitf9b493ac9b833fd9dd3bbd50460adb33f29e1238 (patch)
treeda0a287ecbfe40796443a4209bb4e4261d6b84ea
parente76e1fdfa8f8dc1ea6699923cf5d92b5bee9c936 (diff)
arm: add support for LZ4-compressed kernel
Integrates the LZ4 decompression code to the arm pre-boot code. Signed-off-by: Kyungsik Lee <kyungsik.lee@lge.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Russell King <rmk@arm.linux.org.uk> Cc: Borislav Petkov <bp@alien8.de> Cc: Florian Fainelli <florian@openwrt.org> Cc: Yann Collet <yann.collet.73@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--Documentation/x86/boot.txt7
-rw-r--r--arch/arm/Kconfig1
-rw-r--r--arch/arm/boot/compressed/.gitignore1
-rw-r--r--arch/arm/boot/compressed/Makefile3
-rw-r--r--arch/arm/boot/compressed/decompress.c4
-rw-r--r--arch/arm/boot/compressed/piggy.lz4.S6
-rw-r--r--arch/x86/Kconfig1
-rw-r--r--arch/x86/boot/compressed/Makefile6
-rw-r--r--arch/x86/boot/compressed/misc.c4
9 files changed, 28 insertions, 5 deletions
diff --git a/Documentation/x86/boot.txt b/Documentation/x86/boot.txt
index 3840b6f28afb..fc66d42422ee 100644
--- a/Documentation/x86/boot.txt
+++ b/Documentation/x86/boot.txt
@@ -657,9 +657,10 @@ Protocol: 2.08+
657 uncompressed data should be determined using the standard magic 657 uncompressed data should be determined using the standard magic
658 numbers. The currently supported compression formats are gzip 658 numbers. The currently supported compression formats are gzip
659 (magic numbers 1F 8B or 1F 9E), bzip2 (magic number 42 5A), LZMA 659 (magic numbers 1F 8B or 1F 9E), bzip2 (magic number 42 5A), LZMA
660 (magic number 5D 00), and XZ (magic number FD 37). The uncompressed 660 (magic number 5D 00), XZ (magic number FD 37), and LZ4 (magic number
661 payload is currently always ELF (magic number 7F 45 4C 46). 661 02 21). The uncompressed payload is currently always ELF (magic
662 662 number 7F 45 4C 46).
663
663Field name: payload_length 664Field name: payload_length
664Type: read 665Type: read
665Offset/size: 0x24c/4 666Offset/size: 0x24c/4
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 5ef7af01373a..0ac9be677ebb 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -41,6 +41,7 @@ config ARM
41 select HAVE_IDE if PCI || ISA || PCMCIA 41 select HAVE_IDE if PCI || ISA || PCMCIA
42 select HAVE_IRQ_TIME_ACCOUNTING 42 select HAVE_IRQ_TIME_ACCOUNTING
43 select HAVE_KERNEL_GZIP 43 select HAVE_KERNEL_GZIP
44 select HAVE_KERNEL_LZ4
44 select HAVE_KERNEL_LZMA 45 select HAVE_KERNEL_LZMA
45 select HAVE_KERNEL_LZO 46 select HAVE_KERNEL_LZO
46 select HAVE_KERNEL_XZ 47 select HAVE_KERNEL_XZ
diff --git a/arch/arm/boot/compressed/.gitignore b/arch/arm/boot/compressed/.gitignore
index f79a08efe000..47279aa96a6a 100644
--- a/arch/arm/boot/compressed/.gitignore
+++ b/arch/arm/boot/compressed/.gitignore
@@ -6,6 +6,7 @@ piggy.gzip
6piggy.lzo 6piggy.lzo
7piggy.lzma 7piggy.lzma
8piggy.xzkern 8piggy.xzkern
9piggy.lz4
9vmlinux 10vmlinux
10vmlinux.lds 11vmlinux.lds
11 12
diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
index 48d0a44270bd..7ac1610252ba 100644
--- a/arch/arm/boot/compressed/Makefile
+++ b/arch/arm/boot/compressed/Makefile
@@ -91,6 +91,7 @@ suffix_$(CONFIG_KERNEL_GZIP) = gzip
91suffix_$(CONFIG_KERNEL_LZO) = lzo 91suffix_$(CONFIG_KERNEL_LZO) = lzo
92suffix_$(CONFIG_KERNEL_LZMA) = lzma 92suffix_$(CONFIG_KERNEL_LZMA) = lzma
93suffix_$(CONFIG_KERNEL_XZ) = xzkern 93suffix_$(CONFIG_KERNEL_XZ) = xzkern
94suffix_$(CONFIG_KERNEL_LZ4) = lz4
94 95
95# Borrowed libfdt files for the ATAG compatibility mode 96# Borrowed libfdt files for the ATAG compatibility mode
96 97
@@ -115,7 +116,7 @@ targets := vmlinux vmlinux.lds \
115 font.o font.c head.o misc.o $(OBJS) 116 font.o font.c head.o misc.o $(OBJS)
116 117
117# Make sure files are removed during clean 118# Make sure files are removed during clean
118extra-y += piggy.gzip piggy.lzo piggy.lzma piggy.xzkern \ 119extra-y += piggy.gzip piggy.lzo piggy.lzma piggy.xzkern piggy.lz4 \
119 lib1funcs.S ashldi3.S $(libfdt) $(libfdt_hdrs) \ 120 lib1funcs.S ashldi3.S $(libfdt) $(libfdt_hdrs) \
120 hyp-stub.S 121 hyp-stub.S
121 122
diff --git a/arch/arm/boot/compressed/decompress.c b/arch/arm/boot/compressed/decompress.c
index 24b0475cb8bf..bd245d34952d 100644
--- a/arch/arm/boot/compressed/decompress.c
+++ b/arch/arm/boot/compressed/decompress.c
@@ -51,6 +51,10 @@ extern char * strstr(const char * s1, const char *s2);
51#include "../../../../lib/decompress_unxz.c" 51#include "../../../../lib/decompress_unxz.c"
52#endif 52#endif
53 53
54#ifdef CONFIG_KERNEL_LZ4
55#include "../../../../lib/decompress_unlz4.c"
56#endif
57
54int do_decompress(u8 *input, int len, u8 *output, void (*error)(char *x)) 58int do_decompress(u8 *input, int len, u8 *output, void (*error)(char *x))
55{ 59{
56 return decompress(input, len, NULL, NULL, output, NULL, error); 60 return decompress(input, len, NULL, NULL, output, NULL, error);
diff --git a/arch/arm/boot/compressed/piggy.lz4.S b/arch/arm/boot/compressed/piggy.lz4.S
new file mode 100644
index 000000000000..3d9a575618a3
--- /dev/null
+++ b/arch/arm/boot/compressed/piggy.lz4.S
@@ -0,0 +1,6 @@
1 .section .piggydata,#alloc
2 .globl input_data
3input_data:
4 .incbin "arch/arm/boot/compressed/piggy.lz4"
5 .globl input_data_end
6input_data_end:
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 265c672a2f40..b32ebf92b0ce 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -65,6 +65,7 @@ config X86
65 select HAVE_KERNEL_LZMA 65 select HAVE_KERNEL_LZMA
66 select HAVE_KERNEL_XZ 66 select HAVE_KERNEL_XZ
67 select HAVE_KERNEL_LZO 67 select HAVE_KERNEL_LZO
68 select HAVE_KERNEL_LZ4
68 select HAVE_HW_BREAKPOINT 69 select HAVE_HW_BREAKPOINT
69 select HAVE_MIXED_BREAKPOINTS_REGS 70 select HAVE_MIXED_BREAKPOINTS_REGS
70 select PERF_EVENTS 71 select PERF_EVENTS
diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
index 5ef205c5f37b..dcd90df10ab4 100644
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
@@ -4,7 +4,8 @@
4# create a compressed vmlinux image from the original vmlinux 4# create a compressed vmlinux image from the original vmlinux
5# 5#
6 6
7targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma vmlinux.bin.xz vmlinux.bin.lzo 7targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma \
8 vmlinux.bin.xz vmlinux.bin.lzo vmlinux.bin.lz4
8 9
9KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ $(LINUX_INCLUDE) -O2 10KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ $(LINUX_INCLUDE) -O2
10KBUILD_CFLAGS += -fno-strict-aliasing -fPIC 11KBUILD_CFLAGS += -fno-strict-aliasing -fPIC
@@ -63,12 +64,15 @@ $(obj)/vmlinux.bin.xz: $(vmlinux.bin.all-y) FORCE
63 $(call if_changed,xzkern) 64 $(call if_changed,xzkern)
64$(obj)/vmlinux.bin.lzo: $(vmlinux.bin.all-y) FORCE 65$(obj)/vmlinux.bin.lzo: $(vmlinux.bin.all-y) FORCE
65 $(call if_changed,lzo) 66 $(call if_changed,lzo)
67$(obj)/vmlinux.bin.lz4: $(vmlinux.bin.all-y) FORCE
68 $(call if_changed,lz4)
66 69
67suffix-$(CONFIG_KERNEL_GZIP) := gz 70suffix-$(CONFIG_KERNEL_GZIP) := gz
68suffix-$(CONFIG_KERNEL_BZIP2) := bz2 71suffix-$(CONFIG_KERNEL_BZIP2) := bz2
69suffix-$(CONFIG_KERNEL_LZMA) := lzma 72suffix-$(CONFIG_KERNEL_LZMA) := lzma
70suffix-$(CONFIG_KERNEL_XZ) := xz 73suffix-$(CONFIG_KERNEL_XZ) := xz
71suffix-$(CONFIG_KERNEL_LZO) := lzo 74suffix-$(CONFIG_KERNEL_LZO) := lzo
75suffix-$(CONFIG_KERNEL_LZ4) := lz4
72 76
73quiet_cmd_mkpiggy = MKPIGGY $@ 77quiet_cmd_mkpiggy = MKPIGGY $@
74 cmd_mkpiggy = $(obj)/mkpiggy $< > $@ || ( rm -f $@ ; false ) 78 cmd_mkpiggy = $(obj)/mkpiggy $< > $@ || ( rm -f $@ ; false )
diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c
index 7cb56c6ca351..0319c88290a5 100644
--- a/arch/x86/boot/compressed/misc.c
+++ b/arch/x86/boot/compressed/misc.c
@@ -145,6 +145,10 @@ static int lines, cols;
145#include "../../../../lib/decompress_unlzo.c" 145#include "../../../../lib/decompress_unlzo.c"
146#endif 146#endif
147 147
148#ifdef CONFIG_KERNEL_LZ4
149#include "../../../../lib/decompress_unlz4.c"
150#endif
151
148static void scroll(void) 152static void scroll(void)
149{ 153{
150 int i; 154 int i;