summaryrefslogtreecommitdiffstats
path: root/arch/arm/cpu/start-pbl.c
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2013-01-28 10:26:11 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2013-01-30 22:32:13 +0100
commitf73a37aa7845cdf7e2bf7aba0184e065dca78198 (patch)
tree55c18f6090f0086b4fe05ed98a9edac6cdf71f1b /arch/arm/cpu/start-pbl.c
parent36db2a0f05f8dab8c8c38e47b5112dbb89a47781 (diff)
downloadbarebox-f73a37aa7845cdf7e2bf7aba0184e065dca78198.tar.gz
barebox-f73a37aa7845cdf7e2bf7aba0184e065dca78198.tar.xz
pbl: factorise decompressor
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/cpu/start-pbl.c')
-rw-r--r--arch/arm/cpu/start-pbl.c21
1 files changed, 2 insertions, 19 deletions
diff --git a/arch/arm/cpu/start-pbl.c b/arch/arm/cpu/start-pbl.c
index c5f9705318..f506792f6b 100644
--- a/arch/arm/cpu/start-pbl.c
+++ b/arch/arm/cpu/start-pbl.c
@@ -24,6 +24,7 @@
#include <common.h>
#include <init.h>
#include <sizes.h>
+#include <pbl.h>
#include <asm/barebox-arm.h>
#include <asm/barebox-arm-head.h>
#include <asm-generic/memory_layout.h>
@@ -59,16 +60,6 @@ void __naked __bare_init reset(void)
extern void *input_data;
extern void *input_data_end;
-#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 unsigned long *ttb;
static void create_sections(unsigned long addr, int size_m, unsigned int flags)
@@ -127,11 +118,6 @@ static void mmu_disable(void)
__mmu_cache_off();
}
-static void noinline errorfn(char *error)
-{
- while (1);
-}
-
static void barebox_uncompress(void *compressed_start, unsigned int len)
{
void (*barebox)(void);
@@ -155,10 +141,7 @@ static void barebox_uncompress(void *compressed_start, unsigned int len)
else
barebox = (void *)TEXT_BASE;
- decompress((void *)compressed_start,
- len,
- NULL, NULL,
- (void *)TEXT_BASE, NULL, errorfn);
+ pbl_barebox_uncompress((void*)TEXT_BASE, compressed_start, len);
if (use_mmu)
mmu_disable();