Skip to content

Commit

Permalink
arm: Add support for LZ4-compressed kernel
Browse files Browse the repository at this point in the history
Date	Tue, 26 Feb 2013 15:24:29 +0900

This patch integrates the LZ4 decompression code to the arm pre-boot code.
And it depends on two patchs below

lib: Add support for LZ4-compressed kernel
decompressor: Add LZ4 decompressor module

Signed-off-by: Kyungsik Lee <kyungsik.lee@lge.com>

v2:
- Apply CFLAGS, -Os to decompress.o to improve decompress
  performance during boot-up process

Signed-off-by: Paul Reioux <reioux@gmail.com>

Conflicts:
	arch/arm/boot/compressed/Makefile
  • Loading branch information
faux123 authored and Metallice committed Oct 6, 2013
1 parent 812e730 commit 5f017eb
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions arch/arm/Kconfig
Expand Up @@ -19,6 +19,7 @@ config ARM
select HAVE_GENERIC_DMA_COHERENT
select HAVE_KERNEL_GZIP
select HAVE_KERNEL_LZO
select HAVE_KERNEL_LZ4
select HAVE_KERNEL_LZMA
select HAVE_IRQ_WORK
select HAVE_PERF_EVENTS
Expand Down
7 changes: 6 additions & 1 deletion arch/arm/boot/compressed/Makefile
Expand Up @@ -32,6 +32,10 @@ MISC = misc.o
AFLAGS_decompress.o += -Wa,-march=armv7-a$(plus_sec)
DECOMPRESS = decompress.o

ifeq ($(CONFIG_KERNEL_LZ4),y)
CFLAGS_decompress.o := -Os
endif

FONTC = $(srctree)/drivers/video/console/font_acorn_8x8.c

#
Expand Down Expand Up @@ -96,13 +100,14 @@ SEDFLAGS = s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/
suffix_$(CONFIG_KERNEL_GZIP) = gzip
suffix_$(CONFIG_KERNEL_LZO) = lzo
suffix_$(CONFIG_KERNEL_LZMA) = lzma
suffix_$(CONFIG_KERNEL_LZ4) = lz4

targets := vmlinux vmlinux.lds \
piggy.$(suffix_y) piggy.$(suffix_y).o \
font.o font.c head.o misc.o decompress.o $(OBJS)

# Make sure files are removed during clean
extra-y += piggy.gzip piggy.lzo piggy.lzma lib1funcs.S
extra-y += piggy.gzip piggy.lzo piggy.lzma piggy.lz4 lib1funcs.S

ifeq ($(CONFIG_FUNCTION_TRACER),y)
ORIG_CFLAGS := $(KBUILD_CFLAGS)
Expand Down
4 changes: 4 additions & 0 deletions arch/arm/boot/compressed/decompress.c
Expand Up @@ -44,6 +44,10 @@ extern void error(char *);
#include "../../../../lib/decompress_unlzma.c"
#endif

#ifdef CONFIG_KERNEL_LZ4
#include "../../../../lib/decompress_unlz4.c"
#endif

int do_decompress(u8 *input, int len, u8 *output, void (*error)(char *x))
{
return decompress(input, len, NULL, NULL, output, NULL, error);
Expand Down
6 changes: 6 additions & 0 deletions arch/arm/boot/compressed/piggy.lz4.S
@@ -0,0 +1,6 @@
.section .piggydata,#alloc
.globl input_data
input_data:
.incbin "arch/arm/boot/compressed/piggy.lz4"
.globl input_data_end
input_data_end:

0 comments on commit 5f017eb

Please sign in to comment.