@@ -719,8 +719,13 @@ barebox-uncompressed: $(barebox-lds) $(barebox-head) $(barebox-common) $(kallsym
barebox-uncompressed.bin: barebox-uncompressed
$(call if_changed,objcopy)
+suffix_$(CONFIG_IMAGE_COMPRESSION_GZIP) = gzip
suffix_$(CONFIG_IMAGE_COMPRESSION_LZO) = lzo
+barebox-uncompressed.bin.gzip: barebox-uncompressed.bin
+ @echo " GZIP " $@
+ $(Q)gzip -n -9 -c barebox-uncompressed.bin > $@
+
barebox-uncompressed.bin.lzo: barebox-uncompressed.bin
@echo " LZO " $@
$(Q)lzop -f -9 -o $@ barebox-uncompressed.bin
@@ -1039,7 +1044,7 @@ CLEAN_FILES += barebox System.map include/generated/barebox_default_env.h \
.tmp_kallsyms* barebox_default_env* barebox.ldr \
scripts/bareboxenv-target \
Doxyfile.version barebox.srec barebox.s5p \
- barebox-uncompressed barebox-uncompressed.bin barebox-uncompressed.bin.lzo
+ barebox-uncompressed barebox-uncompressed.bin*
# Directories & files removed with 'make mrproper'
MRPROPER_DIRS += include/config include2 usr/include
@@ -109,6 +109,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);
@@ -110,6 +110,9 @@ choice
config IMAGE_COMPRESSION_LZO
bool "lzo"
+config IMAGE_COMPRESSION_GZIP
+ bool "gzip"
+
endchoice
endif
@@ -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"
new file mode 100644
@@ -0,0 +1,6 @@
+ .section .piggydata,#alloc
+ .globl input_data
+input_data:
+ .incbin "barebox-uncompressed.bin.gzip"
+ .globl input_data_end
+input_data_end:
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> --- Makefile | 7 ++++++- arch/arm/cpu/start.c | 4 ++++ common/Kconfig | 3 +++ lib/decompress_inflate.c | 1 + piggy.gzip.S | 6 ++++++ 5 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 piggy.gzip.S