Skip to content

Commit a7f464f

Browse files
kalozRussell King
authored andcommitted
ARM: 7001/2: Wire up support for the XZ decompressor
Wire up support for the XZ decompressor Signed-off-by: Imre Kaloz <[email protected]> Signed-off-by: Russell King <[email protected]>
1 parent f5f5195 commit a7f464f

File tree

5 files changed

+27
-3
lines changed

5 files changed

+27
-3
lines changed

arch/arm/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ config ARM
2121
select HAVE_KERNEL_GZIP
2222
select HAVE_KERNEL_LZO
2323
select HAVE_KERNEL_LZMA
24+
select HAVE_KERNEL_XZ
2425
select HAVE_IRQ_WORK
2526
select HAVE_PERF_EVENTS
2627
select PERF_USE_VMALLOC

arch/arm/boot/compressed/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
ashldi3.S
12
font.c
23
lib1funcs.S
34
piggy.gzip
45
piggy.lzo
56
piggy.lzma
7+
piggy.xzkern
68
vmlinux
79
vmlinux.lds
810

arch/arm/boot/compressed/Makefile

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ SEDFLAGS = s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/
9292
suffix_$(CONFIG_KERNEL_GZIP) = gzip
9393
suffix_$(CONFIG_KERNEL_LZO) = lzo
9494
suffix_$(CONFIG_KERNEL_LZMA) = lzma
95+
suffix_$(CONFIG_KERNEL_XZ) = xzkern
9596

9697
# Borrowed libfdt files for the ATAG compatibility mode
9798

@@ -112,10 +113,12 @@ endif
112113

113114
targets := vmlinux vmlinux.lds \
114115
piggy.$(suffix_y) piggy.$(suffix_y).o \
115-
lib1funcs.o lib1funcs.S font.o font.c head.o misc.o $(OBJS)
116+
lib1funcs.o lib1funcs.S ashldi3.o ashldi3.S \
117+
font.o font.c head.o misc.o $(OBJS)
116118

117119
# Make sure files are removed during clean
118-
extra-y += piggy.gzip piggy.lzo piggy.lzma lib1funcs.S $(libfdt) $(libfdt_hdrs)
120+
extra-y += piggy.gzip piggy.lzo piggy.lzma piggy.xzkern \
121+
lib1funcs.S ashldi3.S $(libfdt) $(libfdt_hdrs)
119122

120123
ifeq ($(CONFIG_FUNCTION_TRACER),y)
121124
ORIG_CFLAGS := $(KBUILD_CFLAGS)
@@ -151,6 +154,12 @@ lib1funcs = $(obj)/lib1funcs.o
151154
$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S
152155
$(call cmd,shipped)
153156

157+
# For __aeabi_llsl
158+
ashldi3 = $(obj)/ashldi3.o
159+
160+
$(obj)/ashldi3.S: $(srctree)/arch/$(SRCARCH)/lib/ashldi3.S
161+
$(call cmd,shipped)
162+
154163
# We need to prevent any GOTOFF relocs being used with references
155164
# to symbols in the .bss section since we cannot relocate them
156165
# independently from the rest at run time. This can be achieved by
@@ -172,7 +181,7 @@ if [ $(words $(ZRELADDR)) -gt 1 -a "$(CONFIG_AUTO_ZRELADDR)" = "" ]; then \
172181
fi
173182

174183
$(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/$(HEAD) $(obj)/piggy.$(suffix_y).o \
175-
$(addprefix $(obj)/, $(OBJS)) $(lib1funcs) FORCE
184+
$(addprefix $(obj)/, $(OBJS)) $(lib1funcs) $(ashldi3) FORCE
176185
@$(check_for_multiple_zreladdr)
177186
$(call if_changed,ld)
178187
@$(check_for_bad_syms)

arch/arm/boot/compressed/decompress.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ extern void error(char *);
4444
#include "../../../../lib/decompress_unlzma.c"
4545
#endif
4646

47+
#ifdef CONFIG_KERNEL_XZ
48+
#define memmove memmove
49+
#define memcpy memcpy
50+
#include "../../../../lib/decompress_unxz.c"
51+
#endif
52+
4753
int do_decompress(u8 *input, int len, u8 *output, void (*error)(char *x))
4854
{
4955
return decompress(input, len, NULL, NULL, output, NULL, error);
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.section .piggydata,#alloc
2+
.globl input_data
3+
input_data:
4+
.incbin "arch/arm/boot/compressed/piggy.xzkern"
5+
.globl input_data_end
6+
input_data_end:

0 commit comments

Comments
 (0)