h8300: Add LZO compression
authorYoshinori Sato <ysato@users.sourceforge.jp>
Thu, 3 Dec 2015 16:20:57 +0000 (01:20 +0900)
committerYoshinori Sato <ysato@users.sourceforge.jp>
Wed, 20 Jan 2016 13:44:13 +0000 (22:44 +0900)
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
arch/h8300/Kconfig
arch/h8300/boot/compressed/Makefile
arch/h8300/boot/compressed/misc.c

index 2e20333cbce90b947f13f5a11182bedef82a4d3c..3084e58b46105d4e2887c5ecbc6c9577a70fea61 100644 (file)
@@ -18,6 +18,8 @@ config H8300
        select HAVE_DMA_ATTRS
        select CLKSRC_OF
        select H8300_TMR8
+       select HAVE_KERNEL_GZIP
+       select HAVE_KERNEL_LZO
 
 config RWSEM_GENERIC_SPINLOCK
        def_bool y
index d7bc3fa7f2c6b6b58ff35a5d97f1087d1d2c0b65..7643633f1330fd148b1e702973e15fb166137735 100644 (file)
@@ -28,11 +28,16 @@ $(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
-       $(call if_changed,gzip)
+suffix-$(CONFIG_KERNEL_GZIP)    := gzip
+suffix-$(CONFIG_KERNEL_LZO)     := lzo
+
+$(obj)/vmlinux.bin.$(suffix-y): $(obj)/vmlinux.bin FORCE
+       $(call if_changed,$(suffix-y))
 
 LDFLAGS_piggy.o := -r --format binary --oformat elf32-h8300-linux -T
 OBJCOPYFLAGS := -O binary
 
-$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.gz FORCE
+$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix-y) FORCE
        $(call if_changed,ld)
+
+CFLAGS_misc.o = -O0
index 6029c53518951a1253b498d77e1b4d963b9d36b9..9f64fe8f29ff2dc95d13b6e02746f3333b4d4074 100644 (file)
@@ -32,7 +32,13 @@ extern char output[];
 
 #define HEAP_SIZE             0x10000
 
+#ifdef CONFIG_KERNEL_GZIP
 #include "../../../../lib/decompress_inflate.c"
+#endif
+
+#ifdef CONFIG_KERNEL_LZO
+#include "../../../../lib/decompress_unlzo.c"
+#endif
 
 void *memset(void *s, int c, size_t n)
 {