From 9a793e8cdc48b0277ec3e767241ea47a6642e870 Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Sat, 11 Jul 2009 13:21:19 -0400 Subject: [PATCH] --- yaml --- r: 163323 b: refs/heads/master c: 07e88e1bfc128681a80578724fde6a872f413862 h: refs/heads/master i: 163321: 2a0e6a2a7cf9504e73872a3d731d47cea2e3a4b2 163319: db45f917a2bbf225b4e5f91d129ec3b80d50b70b v: v3 --- [refs] | 2 +- trunk/arch/sh/Kconfig | 2 ++ trunk/arch/sh/boot/compressed/.gitignore | 1 + trunk/arch/sh/boot/compressed/Makefile | 19 ++++++++++++++++--- trunk/arch/sh/boot/compressed/misc_32.c | 14 +++++++++++++- trunk/arch/sh/boot/compressed/misc_64.c | 14 +++++++++++++- trunk/arch/sh/boot/compressed/piggy.S | 8 -------- trunk/arch/sh/boot/compressed/vmlinux.scr | 10 ++++++++++ 8 files changed, 56 insertions(+), 14 deletions(-) create mode 100644 trunk/arch/sh/boot/compressed/.gitignore delete mode 100644 trunk/arch/sh/boot/compressed/piggy.S create mode 100644 trunk/arch/sh/boot/compressed/vmlinux.scr diff --git a/[refs] b/[refs] index ab8f60ffc45d..5c4b507346ab 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: df8ce2595fbac8b046322fce9df61ce1cf8ddf62 +refs/heads/master: 07e88e1bfc128681a80578724fde6a872f413862 diff --git a/trunk/arch/sh/Kconfig b/trunk/arch/sh/Kconfig index 9f531ca3c8ea..c4a955d25451 100644 --- a/trunk/arch/sh/Kconfig +++ b/trunk/arch/sh/Kconfig @@ -18,6 +18,8 @@ config SUPERH select HAVE_DMA_API_DEBUG select HAVE_PERF_COUNTERS select HAVE_KERNEL_GZIP + select HAVE_KERNEL_BZIP2 + select HAVE_KERNEL_LZMA select RTC_LIB select GENERIC_ATOMIC64 help diff --git a/trunk/arch/sh/boot/compressed/.gitignore b/trunk/arch/sh/boot/compressed/.gitignore new file mode 100644 index 000000000000..2374a83d87b2 --- /dev/null +++ b/trunk/arch/sh/boot/compressed/.gitignore @@ -0,0 +1 @@ +vmlinux.bin.* diff --git a/trunk/arch/sh/boot/compressed/Makefile b/trunk/arch/sh/boot/compressed/Makefile index 9531bf1b7c2f..0a4e7af8a71b 100644 --- a/trunk/arch/sh/boot/compressed/Makefile +++ b/trunk/arch/sh/boot/compressed/Makefile @@ -5,6 +5,7 @@ # targets := vmlinux vmlinux.bin vmlinux.bin.gz \ + vmlinux.bin.bz2 vmlinux.bin.lzma \ head_$(BITS).o misc_$(BITS).o piggy.o OBJECTS = $(obj)/head_$(BITS).o $(obj)/misc_$(BITS).o $(obj)/cache.o @@ -38,10 +39,22 @@ $(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o $(LIBGCC) FORCE $(obj)/vmlinux.bin: vmlinux FORCE $(call if_changed,objcopy) -$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE +vmlinux.bin.all-y := $(obj)/vmlinux.bin + +$(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y) FORCE $(call if_changed,gzip) +$(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y) FORCE + $(call if_changed,bzip2) +$(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y) FORCE + $(call if_changed,lzma) + +suffix-$(CONFIG_KERNEL_GZIP) := gz +suffix-$(CONFIG_KERNEL_BZIP2) := bz2 +suffix-$(CONFIG_KERNEL_LZMA) := lzma OBJCOPYFLAGS += -R .empty_zero_page -$(obj)/piggy.o: $(obj)/piggy.S $(obj)/vmlinux.bin.gz FORCE - $(call if_changed,as_o_S) +LDFLAGS_piggy.o := -r --format binary --oformat $(ld-bfd) -T + +$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix-y) FORCE + $(call if_changed,ld) diff --git a/trunk/arch/sh/boot/compressed/misc_32.c b/trunk/arch/sh/boot/compressed/misc_32.c index 1ab4f49153be..b86e3596918b 100644 --- a/trunk/arch/sh/boot/compressed/misc_32.c +++ b/trunk/arch/sh/boot/compressed/misc_32.c @@ -41,12 +41,24 @@ extern int _end; static unsigned long free_mem_ptr; static unsigned long free_mem_end_ptr; -#define HEAP_SIZE 0x10000 +#ifdef CONFIG_HAVE_KERNEL_BZIP2 +#define HEAP_SIZE 0x400000 +#else +#define HEAP_SIZE 0x10000 +#endif #ifdef CONFIG_KERNEL_GZIP #include "../../../../lib/decompress_inflate.c" #endif +#ifdef CONFIG_KERNEL_BZIP2 +#include "../../../../lib/decompress_bunzip2.c" +#endif + +#ifdef CONFIG_KERNEL_LZMA +#include "../../../../lib/decompress_unlzma.c" +#endif + #ifdef CONFIG_SH_STANDARD_BIOS size_t strlen(const char *s) { diff --git a/trunk/arch/sh/boot/compressed/misc_64.c b/trunk/arch/sh/boot/compressed/misc_64.c index 0c6894e37115..09b7b7cd24f9 100644 --- a/trunk/arch/sh/boot/compressed/misc_64.c +++ b/trunk/arch/sh/boot/compressed/misc_64.c @@ -40,12 +40,24 @@ extern int _end; static unsigned long free_mem_ptr; static unsigned long free_mem_end_ptr; -#define HEAP_SIZE 0x10000 +#ifdef CONFIG_HAVE_KERNEL_BZIP2 +#define HEAP_SIZE 0x400000 +#else +#define HEAP_SIZE 0x10000 +#endif #ifdef CONFIG_KERNEL_GZIP #include "../../../../lib/decompress_inflate.c" #endif +#ifdef CONFIG_KERNEL_BZIP2 +#include "../../../../lib/decompress_bunzip2.c" +#endif + +#ifdef CONFIG_KERNEL_LZMA +#include "../../../../lib/decompress_unlzma.c" +#endif + void puts(const char *s) { } diff --git a/trunk/arch/sh/boot/compressed/piggy.S b/trunk/arch/sh/boot/compressed/piggy.S deleted file mode 100644 index 566071926b13..000000000000 --- a/trunk/arch/sh/boot/compressed/piggy.S +++ /dev/null @@ -1,8 +0,0 @@ - .global input_len, input_data - .data -input_len: - .long input_data_end - input_data -input_data: - .incbin "arch/sh/boot/compressed/vmlinux.bin.gz" -input_data_end: - .end diff --git a/trunk/arch/sh/boot/compressed/vmlinux.scr b/trunk/arch/sh/boot/compressed/vmlinux.scr new file mode 100644 index 000000000000..f02382ae5c48 --- /dev/null +++ b/trunk/arch/sh/boot/compressed/vmlinux.scr @@ -0,0 +1,10 @@ +SECTIONS +{ + .rodata.compressed : { + input_len = .; + LONG(input_data_end - input_data) input_data = .; + *(.data) + output_len = . - 4; + input_data_end = .; + } +}