diff options
author | Paul Mundt <lethal@linux-sh.org> | 2009-07-11 13:21:19 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-07-11 13:21:19 -0400 |
commit | 07e88e1bfc128681a80578724fde6a872f413862 (patch) | |
tree | 7e85e26152bcc277d6e2e288aac155f155ce5c4e /arch | |
parent | df8ce2595fbac8b046322fce9df61ce1cf8ddf62 (diff) |
sh: bzip2/lzma zImage support.
This plugs in bzip2 and lzma support for zImages.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/sh/Kconfig | 2 | ||||
-rw-r--r-- | arch/sh/boot/compressed/.gitignore | 1 | ||||
-rw-r--r-- | arch/sh/boot/compressed/Makefile | 19 | ||||
-rw-r--r-- | arch/sh/boot/compressed/misc_32.c | 14 | ||||
-rw-r--r-- | arch/sh/boot/compressed/misc_64.c | 14 | ||||
-rw-r--r-- | arch/sh/boot/compressed/piggy.S | 8 | ||||
-rw-r--r-- | arch/sh/boot/compressed/vmlinux.scr | 10 |
7 files changed, 55 insertions, 13 deletions
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index 9f531ca3c8ea..c4a955d25451 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig | |||
@@ -18,6 +18,8 @@ config SUPERH | |||
18 | select HAVE_DMA_API_DEBUG | 18 | select HAVE_DMA_API_DEBUG |
19 | select HAVE_PERF_COUNTERS | 19 | select HAVE_PERF_COUNTERS |
20 | select HAVE_KERNEL_GZIP | 20 | select HAVE_KERNEL_GZIP |
21 | select HAVE_KERNEL_BZIP2 | ||
22 | select HAVE_KERNEL_LZMA | ||
21 | select RTC_LIB | 23 | select RTC_LIB |
22 | select GENERIC_ATOMIC64 | 24 | select GENERIC_ATOMIC64 |
23 | help | 25 | help |
diff --git a/arch/sh/boot/compressed/.gitignore b/arch/sh/boot/compressed/.gitignore new file mode 100644 index 000000000000..2374a83d87b2 --- /dev/null +++ b/arch/sh/boot/compressed/.gitignore | |||
@@ -0,0 +1 @@ | |||
vmlinux.bin.* | |||
diff --git a/arch/sh/boot/compressed/Makefile b/arch/sh/boot/compressed/Makefile index 9531bf1b7c2f..0a4e7af8a71b 100644 --- a/arch/sh/boot/compressed/Makefile +++ b/arch/sh/boot/compressed/Makefile | |||
@@ -5,6 +5,7 @@ | |||
5 | # | 5 | # |
6 | 6 | ||
7 | targets := vmlinux vmlinux.bin vmlinux.bin.gz \ | 7 | targets := vmlinux vmlinux.bin vmlinux.bin.gz \ |
8 | vmlinux.bin.bz2 vmlinux.bin.lzma \ | ||
8 | head_$(BITS).o misc_$(BITS).o piggy.o | 9 | head_$(BITS).o misc_$(BITS).o piggy.o |
9 | 10 | ||
10 | OBJECTS = $(obj)/head_$(BITS).o $(obj)/misc_$(BITS).o $(obj)/cache.o | 11 | OBJECTS = $(obj)/head_$(BITS).o $(obj)/misc_$(BITS).o $(obj)/cache.o |
@@ -38,10 +39,22 @@ $(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o $(LIBGCC) FORCE | |||
38 | $(obj)/vmlinux.bin: vmlinux FORCE | 39 | $(obj)/vmlinux.bin: vmlinux FORCE |
39 | $(call if_changed,objcopy) | 40 | $(call if_changed,objcopy) |
40 | 41 | ||
41 | $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE | 42 | vmlinux.bin.all-y := $(obj)/vmlinux.bin |
43 | |||
44 | $(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y) FORCE | ||
42 | $(call if_changed,gzip) | 45 | $(call if_changed,gzip) |
46 | $(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y) FORCE | ||
47 | $(call if_changed,bzip2) | ||
48 | $(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y) FORCE | ||
49 | $(call if_changed,lzma) | ||
50 | |||
51 | suffix-$(CONFIG_KERNEL_GZIP) := gz | ||
52 | suffix-$(CONFIG_KERNEL_BZIP2) := bz2 | ||
53 | suffix-$(CONFIG_KERNEL_LZMA) := lzma | ||
43 | 54 | ||
44 | OBJCOPYFLAGS += -R .empty_zero_page | 55 | OBJCOPYFLAGS += -R .empty_zero_page |
45 | 56 | ||
46 | $(obj)/piggy.o: $(obj)/piggy.S $(obj)/vmlinux.bin.gz FORCE | 57 | LDFLAGS_piggy.o := -r --format binary --oformat $(ld-bfd) -T |
47 | $(call if_changed,as_o_S) | 58 | |
59 | $(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix-y) FORCE | ||
60 | $(call if_changed,ld) | ||
diff --git a/arch/sh/boot/compressed/misc_32.c b/arch/sh/boot/compressed/misc_32.c index 1ab4f49153be..b86e3596918b 100644 --- a/arch/sh/boot/compressed/misc_32.c +++ b/arch/sh/boot/compressed/misc_32.c | |||
@@ -41,12 +41,24 @@ extern int _end; | |||
41 | static unsigned long free_mem_ptr; | 41 | static unsigned long free_mem_ptr; |
42 | static unsigned long free_mem_end_ptr; | 42 | static unsigned long free_mem_end_ptr; |
43 | 43 | ||
44 | #define HEAP_SIZE 0x10000 | 44 | #ifdef CONFIG_HAVE_KERNEL_BZIP2 |
45 | #define HEAP_SIZE 0x400000 | ||
46 | #else | ||
47 | #define HEAP_SIZE 0x10000 | ||
48 | #endif | ||
45 | 49 | ||
46 | #ifdef CONFIG_KERNEL_GZIP | 50 | #ifdef CONFIG_KERNEL_GZIP |
47 | #include "../../../../lib/decompress_inflate.c" | 51 | #include "../../../../lib/decompress_inflate.c" |
48 | #endif | 52 | #endif |
49 | 53 | ||
54 | #ifdef CONFIG_KERNEL_BZIP2 | ||
55 | #include "../../../../lib/decompress_bunzip2.c" | ||
56 | #endif | ||
57 | |||
58 | #ifdef CONFIG_KERNEL_LZMA | ||
59 | #include "../../../../lib/decompress_unlzma.c" | ||
60 | #endif | ||
61 | |||
50 | #ifdef CONFIG_SH_STANDARD_BIOS | 62 | #ifdef CONFIG_SH_STANDARD_BIOS |
51 | size_t strlen(const char *s) | 63 | size_t strlen(const char *s) |
52 | { | 64 | { |
diff --git a/arch/sh/boot/compressed/misc_64.c b/arch/sh/boot/compressed/misc_64.c index 0c6894e37115..09b7b7cd24f9 100644 --- a/arch/sh/boot/compressed/misc_64.c +++ b/arch/sh/boot/compressed/misc_64.c | |||
@@ -40,12 +40,24 @@ extern int _end; | |||
40 | static unsigned long free_mem_ptr; | 40 | static unsigned long free_mem_ptr; |
41 | static unsigned long free_mem_end_ptr; | 41 | static unsigned long free_mem_end_ptr; |
42 | 42 | ||
43 | #define HEAP_SIZE 0x10000 | 43 | #ifdef CONFIG_HAVE_KERNEL_BZIP2 |
44 | #define HEAP_SIZE 0x400000 | ||
45 | #else | ||
46 | #define HEAP_SIZE 0x10000 | ||
47 | #endif | ||
44 | 48 | ||
45 | #ifdef CONFIG_KERNEL_GZIP | 49 | #ifdef CONFIG_KERNEL_GZIP |
46 | #include "../../../../lib/decompress_inflate.c" | 50 | #include "../../../../lib/decompress_inflate.c" |
47 | #endif | 51 | #endif |
48 | 52 | ||
53 | #ifdef CONFIG_KERNEL_BZIP2 | ||
54 | #include "../../../../lib/decompress_bunzip2.c" | ||
55 | #endif | ||
56 | |||
57 | #ifdef CONFIG_KERNEL_LZMA | ||
58 | #include "../../../../lib/decompress_unlzma.c" | ||
59 | #endif | ||
60 | |||
49 | void puts(const char *s) | 61 | void puts(const char *s) |
50 | { | 62 | { |
51 | } | 63 | } |
diff --git a/arch/sh/boot/compressed/piggy.S b/arch/sh/boot/compressed/piggy.S deleted file mode 100644 index 566071926b13..000000000000 --- a/arch/sh/boot/compressed/piggy.S +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | .global input_len, input_data | ||
2 | .data | ||
3 | input_len: | ||
4 | .long input_data_end - input_data | ||
5 | input_data: | ||
6 | .incbin "arch/sh/boot/compressed/vmlinux.bin.gz" | ||
7 | input_data_end: | ||
8 | .end | ||
diff --git a/arch/sh/boot/compressed/vmlinux.scr b/arch/sh/boot/compressed/vmlinux.scr new file mode 100644 index 000000000000..f02382ae5c48 --- /dev/null +++ b/arch/sh/boot/compressed/vmlinux.scr | |||
@@ -0,0 +1,10 @@ | |||
1 | SECTIONS | ||
2 | { | ||
3 | .rodata.compressed : { | ||
4 | input_len = .; | ||
5 | LONG(input_data_end - input_data) input_data = .; | ||
6 | *(.data) | ||
7 | output_len = . - 4; | ||
8 | input_data_end = .; | ||
9 | } | ||
10 | } | ||