[U-Boot] [PATCHv2] Add support for LZ4 decompression algorithm

Simon Glass sjg at chromium.org
Sat Oct 3 18:36:24 CEST 2015


Hi Julius,

On 3 October 2015 at 06:32, Julius Werner <jwerner at chromium.org> wrote:
> This patch adds support for LZ4-compressed FIT image contents. This
> algorithm has a slightly worse compression ration than LZO while being
> nearly twice as fast to decompress. When loading images from a fast
> storage medium this usually results in a boot time win.
>
> Compile-tested only since I don't have a U-Boot development system set
> up right now. The code was imported unchanged from coreboot where it's
> proven to work, though. I'm mostly interested in getting this recognized
> by mkImage for use in a downstream project.
>
> Signed-off-by: Julius Werner <jwerner at chromium.org>
> ---
>  common/bootm.c     |   9 ++
>  common/image.c     |   1 +
>  include/common.h   |   3 +
>  include/image.h    |   1 +
>  lib/Kconfig        |  18 ++++
>  lib/Makefile       |   1 +
>  lib/lz4.c          | 243 +++++++++++++++++++++++++++++++++++++++++++++++++++++
>  lib/lz4_wrapper.c  | 137 ++++++++++++++++++++++++++++++
>  test/Kconfig       |   1 +
>  test/compression.c |  57 +++++++++++++
>  10 files changed, 471 insertions(+)
>  create mode 100644 lib/lz4.c
>  create mode 100644 lib/lz4_wrapper.c

Actually you should enable the option in configs/sandbox_defconfig,
not lib/Kconfig. See the condition used by compression.c:

obj-$(CONFIG_SANDBOX) += compression.o

Also, for me the test fails:

./b/sandbox/u-boot -c "ut_compression"
...
 testing lz4 ...
orig_size:350
compressed_size:276
uncompressed_size:350
compress does not overrun
Failed: ret != 0
 lz4: FAILED
ut_compression FAILED

Regards,
Simon


More information about the U-Boot mailing list