From patchwork Sun Jul 22 13:19:02 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Christophe PLAGNIOL-VILLARD X-Patchwork-Id: 1224521 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id D1739E0039 for ; Sun, 22 Jul 2012 13:28:43 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Ssw7i-00066o-17; Sun, 22 Jul 2012 13:23:02 +0000 Received: from 13.mo1.mail-out.ovh.net ([178.33.253.128] helo=mo1.mail-out.ovh.net) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Ssw3X-0005ju-VZ for linux-arm-kernel@lists.infradead.org; Sun, 22 Jul 2012 13:18:51 +0000 Received: from mail94.ha.ovh.net (b7.ovh.net [213.186.33.57]) by mo1.mail-out.ovh.net (Postfix) with SMTP id BFB95FF93A5 for ; Sun, 22 Jul 2012 15:24:06 +0200 (CEST) Received: from b0.ovh.net (HELO queueout) (213.186.33.50) by b0.ovh.net with SMTP; 22 Jul 2012 15:18:26 +0200 Received: from ns32433.ovh.net (HELO localhost) (plagnioj%jcrosoft.com@213.251.161.87) by ns0.ovh.net with SMTP; 22 Jul 2012 15:18:25 +0200 From: Jean-Christophe PLAGNIOL-VILLARD To: linux-arm-kernel@lists.infradead.org X-Ovh-Mailout: 178.32.228.1 (mo1.mail-out.ovh.net) Subject: [PATCH 7/7] compressed image: add gzip support Date: Sun, 22 Jul 2012 15:19:02 +0200 Message-Id: <1342963142-30339-7-git-send-email-plagnioj@jcrosoft.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1342963142-30339-1-git-send-email-plagnioj@jcrosoft.com> References: <20120722130301.GI22657@game.jcrosoft.org> <1342963142-30339-1-git-send-email-plagnioj@jcrosoft.com> X-Ovh-Tracer-Id: 18275888763742104573 X-Ovh-Remote: 213.251.161.87 (ns32433.ovh.net) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-OVH-SPAMSTATE: OK X-OVH-SPAMSCORE: 0 X-OVH-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeegkedrkeehucetufdoteggodetrfdofgetucfrrhhofhhilhgvmecuqfggjfenuceurghilhhouhhtmecufedttdenucenucfhrhhomheplfgvrghnqdevhhhrihhsthhophhhvgcurffntefipffkqffnqdggkffnnfettfffuceophhlrghgnhhiohhjsehjtghrohhsohhfthdrtghomheqnecuffhomhgrihhnpehgiihiphdrshgsnecujfgurhephffvufffkffojghfsedttdertdertddt X-Spam-Check: DONE|U 0.5/N X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeegkedrkeehucetufdoteggodetrfdofgetucfrrhhofhhilhgvmecuqfggjfenuceurghilhhouhhtmecufedttdenucenucfhrhhomheplfgvrghnqdevhhhrihhsthhophhhvgcurffntefipffkqffnqdggkffnnfettfffuceophhlrghgnhhiohhjsehjtghrohhsohhfthdrtghomheqnecuffhomhgrihhnpehgiihiphdrshgsnecujfgurhephffvufffkffojghfsedttdertdertddt X-Spam-Note: CRM114 invocation failed X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [178.33.253.128 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Jean-Christophe PLAGNIOL-VILLARD X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- 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 diff --git a/Makefile b/Makefile index d6a3ae5..1003786 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c index 8ab6fdc..8e63523 100644 --- a/arch/arm/cpu/start.c +++ b/arch/arm/cpu/start.c @@ -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); 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 #include "zlib_inflate/inftrees.c" #include "zlib_inflate/inffast.c" diff --git a/piggy.gzip.S b/piggy.gzip.S new file mode 100644 index 0000000..2ca7d78 --- /dev/null +++ b/piggy.gzip.S @@ -0,0 +1,6 @@ + .section .piggydata,#alloc + .globl input_data +input_data: + .incbin "barebox-uncompressed.bin.gzip" + .globl input_data_end +input_data_end: