9
0
Fork 0

pbl: add lz4 support

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Jean-Christophe PLAGNIOL-VILLARD 2013-07-15 12:20:53 +02:00 committed by Sascha Hauer
parent cdc837f4d9
commit 618d669117
8 changed files with 30 additions and 3 deletions

View File

@ -1,6 +1,7 @@
suffix_$(CONFIG_IMAGE_COMPRESSION_GZIP) = gzip
suffix_$(CONFIG_IMAGE_COMPRESSION_LZO) = lzo
suffix_$(CONFIG_IMAGE_COMPRESSION_LZ4) = lz4
suffix_$(CONFIG_IMAGE_COMPRESSION_NONE) = shipped
OBJCOPYFLAGS_zbarebox.bin = -O binary
@ -10,7 +11,7 @@ targets := zbarebox.lds zbarebox zbarebox.bin zbarebox.S \
$(piggy_o) piggy.$(suffix_y)
# Make sure files are removed during clean
extra-y += piggy.gzip piggy.lzo piggy.lzma piggy.xzkern piggy.shipped zbarebox.map
extra-y += piggy.gzip piggy.lz4 piggy.lzo piggy.lzma piggy.xzkern piggy.shipped zbarebox.map
$(obj)/zbarebox.bin: $(obj)/zbarebox FORCE
$(call if_changed,objcopy)

6
arch/arm/pbl/piggy.lz4.S Normal file
View File

@ -0,0 +1,6 @@
.section .piggydata,#alloc
.globl input_data
input_data:
.incbin "arch/arm/pbl/piggy.lz4"
.globl input_data_end
input_data_end:

View File

@ -1,6 +1,7 @@
suffix_$(CONFIG_IMAGE_COMPRESSION_GZIP) = gzip
suffix_$(CONFIG_IMAGE_COMPRESSION_LZO) = lzo
suffix_$(CONFIG_IMAGE_COMPRESSION_LZ4) = lz4
suffix_$(CONFIG_IMAGE_COMPRESSION_NONE) = shipped
OBJCOPYFLAGS_zbarebox.bin = -O binary
@ -10,7 +11,7 @@ targets := zbarebox.lds zbarebox zbarebox.bin zbarebox.S \
$(piggy_o) piggy.$(suffix_y)
# Make sure files are removed during clean
extra-y += piggy.gzip piggy.lzo piggy.lzma piggy.xzkern piggy.shipped zbarebox.map
extra-y += piggy.gzip piggy.lz4 piggy.lzo piggy.lzma piggy.xzkern piggy.shipped zbarebox.map
$(obj)/zbarebox.bin: $(obj)/zbarebox FORCE
$(call if_changed,objcopy)

View File

@ -0,0 +1,6 @@
#include <asm/asm.h>
.section .data
EXPORT(input_data)
.incbin "arch/mips/pbl/piggy.lz4"
EXPORT(input_data_end)

View File

@ -81,6 +81,7 @@ $(obj)/%.s: $(obj)/% FORCE
suffix_$(CONFIG_IMAGE_COMPRESSION_GZIP) = gzip
suffix_$(CONFIG_IMAGE_COMPRESSION_LZO) = lzo
suffix_$(CONFIG_IMAGE_COMPRESSION_LZ4) = lz4
suffix_$(CONFIG_IMAGE_COMPRESSION_NONE) = shipped
# barebox.z - compressed barebox binary

View File

@ -23,6 +23,10 @@
#include <asm/unaligned.h>
#ifndef STATIC
#define STATIC
#endif
/*
* Note: Uncompressed chunk size is used in the compressor side
* (userspace side for compression).
@ -175,7 +179,7 @@ exit_0:
return ret;
}
int decompress_unlz4(unsigned char *buf, int in_len,
STATIC int decompress_unlz4(unsigned char *buf, int in_len,
int(*fill)(void*, unsigned int),
int(*flush)(void*, unsigned int),
unsigned char *output,

View File

@ -53,6 +53,10 @@ if IMAGE_COMPRESSION
choice
prompt "Compression"
default IMAGE_COMPRESSION_LZO
config IMAGE_COMPRESSION_LZ4
bool "lz4"
config IMAGE_COMPRESSION_LZO
bool "lzo"

View File

@ -10,6 +10,10 @@
#define STATIC static
#ifdef CONFIG_IMAGE_COMPRESSION_LZ4
#include "../../../lib/decompress_unlz4.c"
#endif
#ifdef CONFIG_IMAGE_COMPRESSION_LZO
#include "../../../lib/decompress_unlzo.c"
#endif