Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagn...@jcrosoft.com>
---
 arch/arm/compressed/Makefile     |    1 +
 arch/arm/compressed/piggy.gzip.S |    6 ++++++
 arch/arm/cpu/start.c             |    4 ++++
 common/Kconfig                   |    3 +++
 lib/decompress_inflate.c         |    1 +
 5 files changed, 15 insertions(+)
 create mode 100644 arch/arm/compressed/piggy.gzip.S

diff --git a/arch/arm/compressed/Makefile b/arch/arm/compressed/Makefile
index 627a411..59e7d59 100644
--- a/arch/arm/compressed/Makefile
+++ b/arch/arm/compressed/Makefile
@@ -1,4 +1,5 @@
 
+suffix_$(CONFIG_IMAGE_COMPRESSION_GZIP) = gzip
 suffix_$(CONFIG_IMAGE_COMPRESSION_LZO) = lzo
 
 OBJCOPYFLAGS_zbarebox.bin = -O binary
diff --git a/arch/arm/compressed/piggy.gzip.S b/arch/arm/compressed/piggy.gzip.S
new file mode 100644
index 0000000..ef3dd77
--- /dev/null
+++ b/arch/arm/compressed/piggy.gzip.S
@@ -0,0 +1,6 @@
+       .section .piggydata,#alloc
+       .globl  input_data
+input_data:
+       .incbin "arch/arm/compressed/piggy.gzip"
+       .globl  input_data_end
+input_data_end:
diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c
index 6c745f7..5503552 100644
--- a/arch/arm/cpu/start.c
+++ b/arch/arm/cpu/start.c
@@ -110,6 +110,10 @@ extern void *input_data_end;
 #include "../../../lib/decompress_unlzo.c"
 #endif
 
+#ifdef CONFIG_IMAGE_COMPRESSION_GZIP
+#include "../../../../lib/decompress_inflate.c"
+#endif
+
 void barebox_uncompress(void *compressed_start, unsigned int len)
 {
        void (*barebox)(void);
diff --git a/common/Kconfig b/common/Kconfig
index 8437e1c..702a0bd 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -110,6 +110,9 @@ choice
 config IMAGE_COMPRESSION_LZO
        bool "lzo"
 
+config IMAGE_COMPRESSION_GZIP
+       bool "gzip"
+
 endchoice
 
 endif
diff --git a/lib/decompress_inflate.c b/lib/decompress_inflate.c
index 526d6a1..5c1ebb6 100644
--- a/lib/decompress_inflate.c
+++ b/lib/decompress_inflate.c
@@ -4,6 +4,7 @@
 /* prevent inclusion of _LINUX_KERNEL_H in pre-boot environment: lots
  * errors about console_printk etc... on ARM */
 #define _LINUX_KERNEL_H
+#include <linux/decompress/mm.h>
 
 #include "zlib_inflate/inftrees.c"
 #include "zlib_inflate/inffast.c"
-- 
1.7.10


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

Reply via email to