From 36db2a0f05f8dab8c8c38e47b5112dbb89a47781 Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Mon, 28 Jan 2013 10:26:10 +0100 Subject: pbl: move configs to pbl/Kconfig so it more easy to add new entry and to maintain Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD Signed-off-by: Sascha Hauer --- pbl/Kconfig | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 pbl/Kconfig (limited to 'pbl') diff --git a/pbl/Kconfig b/pbl/Kconfig new file mode 100644 index 0000000000..fbf0b1b4d0 --- /dev/null +++ b/pbl/Kconfig @@ -0,0 +1,41 @@ +config HAVE_PBL_IMAGE + bool + +config HAVE_IMAGE_COMPRESSION + bool + +config PBL_IMAGE + bool "Pre-Bootloader image" + depends on HAVE_PBL_IMAGE + +config PBL_FORCE_PIGGYDATA_COPY + bool + help + In some case we need to copy the PIGGYDATA as the link address + as example we run from SRAM and shutdown the SDRAM/DDR for + reconfiguration but most of the time we just need to copy the + executable code. + +if PBL_IMAGE + +config IMAGE_COMPRESSION + bool + depends on HAVE_IMAGE_COMPRESSION + default y + +if IMAGE_COMPRESSION + +choice + prompt "Compression" + +config IMAGE_COMPRESSION_LZO + bool "lzo" + +config IMAGE_COMPRESSION_GZIP + bool "gzip" + +endchoice + +endif + +endif -- cgit v1.2.1 From f73a37aa7845cdf7e2bf7aba0184e065dca78198 Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Mon, 28 Jan 2013 10:26:11 +0100 Subject: pbl: factorise decompressor Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD Signed-off-by: Sascha Hauer --- pbl/Makefile | 1 + pbl/decomp.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 pbl/decomp.c (limited to 'pbl') diff --git a/pbl/Makefile b/pbl/Makefile index 7169c6c72a..a2d7468687 100644 --- a/pbl/Makefile +++ b/pbl/Makefile @@ -3,3 +3,4 @@ # pbl-y += misc.o pbl-y += string.o +pbl-y += decomp.o diff --git a/pbl/decomp.c b/pbl/decomp.c new file mode 100644 index 0000000000..bd67ed81e1 --- /dev/null +++ b/pbl/decomp.c @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2010-2012 Sascha Hauer , Pengutronix + * Copyright (c) 2012 Jean-Christophe PLAGNIOL-VILLARD + * + * Under GPLv2 only + */ + +#include +#include + +#define STATIC static + +#ifdef CONFIG_IMAGE_COMPRESSION_LZO +#include "../../../lib/decompress_unlzo.c" +#endif + +#ifdef CONFIG_IMAGE_COMPRESSION_GZIP +#include "../../../lib/decompress_inflate.c" +#endif + +static void noinline errorfn(char *error) +{ + while (1); +} + +void pbl_barebox_uncompress(void *dest, void *compressed_start, unsigned int len) +{ + decompress((void *)compressed_start, + len, + NULL, NULL, + dest, NULL, errorfn); +} -- cgit v1.2.1 From 08147d427f9ee4723a6ba8525a2f85b2123f840e Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Mon, 28 Jan 2013 10:26:12 +0100 Subject: pbl: add none compression support Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD Signed-off-by: Sascha Hauer --- pbl/Kconfig | 3 +++ pbl/decomp.c | 12 ++++++++++++ 2 files changed, 15 insertions(+) (limited to 'pbl') diff --git a/pbl/Kconfig b/pbl/Kconfig index fbf0b1b4d0..39752cc6f9 100644 --- a/pbl/Kconfig +++ b/pbl/Kconfig @@ -34,6 +34,9 @@ config IMAGE_COMPRESSION_LZO config IMAGE_COMPRESSION_GZIP bool "gzip" +config IMAGE_COMPRESSION_NONE + bool "none" + endchoice endif diff --git a/pbl/decomp.c b/pbl/decomp.c index bd67ed81e1..aa6a31e9da 100644 --- a/pbl/decomp.c +++ b/pbl/decomp.c @@ -18,6 +18,18 @@ #include "../../../lib/decompress_inflate.c" #endif +#ifdef CONFIG_IMAGE_COMPRESSION_NONE +STATIC int decompress(u8 *input, int in_len, + int (*fill) (void *, unsigned int), + int (*flush) (void *, unsigned int), + u8 *output, int *posp, + void (*error) (char *x)) +{ + memcpy(output, input, in_len); + return 0; +} +#endif + static void noinline errorfn(char *error) { while (1); -- cgit v1.2.1