coreboot/src/lib
Julius Werner 09f2921b5d cbfs: Add LZ4 in-place decompression support for pre-RAM stages
This patch ports the LZ4 decompression code that debuted in libpayload
last year to coreboot for use in CBFS stages (upgrading the base
algorithm to LZ4's dev branch to access the new in-place decompression
checks). This is especially useful for pre-RAM stages in constrained
SRAM-based systems, which previously could not be compressed due to
the size requirements of the LZMA scratchpad and bounce buffer. The
LZ4 algorithm offers a very lean decompressor function and in-place
decompression support to achieve roughly the same boot speed gains
(trading compression ratio for decompression time) with nearly no
memory overhead.

For now we only activate it for the stages that had previously not been
compressed at all on non-XIP (read: non-x86) boards. In the future we
may also consider replacing LZMA completely for certain boards, since
which algorithm wins out on boot speed depends on board-specific
parameters (architecture, processor speed, SPI transfer rate, etc.).

BRANCH=None
BUG=None
TEST=Built and booted Oak, Jerry, Nyan and Falco. Measured boot time on
Oak to be about ~20ms faster (cutting load times for affected stages
almost in half).

Change-Id: Iec256c0e6d585d1b69985461939884a54e3ab900
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/13638
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-02-22 21:38:37 +01:00
..
b64_decode.c lib: add base64 decoder 2015-04-22 08:50:54 +02:00
boot_device.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
bootblock.c timestamp: Remove HAS_PRECBMEM_TIMESTAMP_REGION Kconfig 2016-02-12 21:54:52 +01:00
bootmem.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
bootmode.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
cbfs.c cbfs: Add LZ4 in-place decompression support for pre-RAM stages 2016-02-22 21:38:37 +01:00
cbfs_spi.c memlayout: Fix unified CBFS_CACHE macro 2016-01-21 09:05:06 +01:00
cbmem_common.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
cbmem_console.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
cbmem_stage_cache.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
compute_ip_checksum.c
coreboot_table.c lib/coreboot_table: add function to allow arch code to add records 2016-02-19 19:21:15 +01:00
debug.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
delay.c
edid.c edid: Don't half parse (and wrongly print) more detailed timings 2015-11-19 21:37:42 +01:00
ext_stage_cache.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
fallback_boot.c drivers/pc80: Rework normal / fallback selector code 2015-11-03 21:55:20 +01:00
fmap.c FMAP: Clean up debug output 2016-02-13 20:03:14 +01:00
gcc.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
gcov-glue.c lib/gcov-glue.c: Remove trailing number from COVERAGE_MAGIC macro 2016-02-02 01:39:28 +01:00
gcov-io.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
gcov-io.h tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
gcov-iov.h
generic_dump_spd.c misc: Drop print_ implementation from non-romcc boards 2015-01-09 06:12:22 +01:00
generic_sdram.c misc: Drop print_ implementation from non-romcc boards 2015-01-09 06:12:22 +01:00
gpio.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
halt.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
hardwaremain.c lib: Add Kconfig to toggle boot state debugging 2016-02-18 00:01:14 +01:00
hexdump.c lib/hexdump: Refactor to skip lines with all ones as well 2016-01-22 14:10:28 +01:00
imd.c Correct some common spelling mistakes 2016-01-07 22:57:02 +01:00
imd_cbmem.c cbmem: add coreboot table records for each cbmem entry 2015-11-03 00:19:46 +01:00
jpeg.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
jpeg.h tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
libgcc.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
libgcov.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
lzma.c cbfs: Add LZ4 in-place decompression support for pre-RAM stages 2016-02-22 21:38:37 +01:00
lzmadecode.c lzma: Port size-checking ulzman() version to coreboot 2016-02-12 22:00:55 +01:00
lzmadecode.h
Makefile.inc lib: add bootmode.c to verstage 2016-02-04 17:36:07 +01:00
malloc.c Remove leftover smi_get_tseg_base 2015-05-29 07:06:37 +02:00
memchr.c
memcmp.c
memcpy.c
memmove.c
memrange.c lib/memrange: allow stack allocated free list 2016-01-23 18:25:26 +01:00
memset.c
mocked_tlcl.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
nhlt.c nhlt: add api to override oem_id and oem_table_id of acpi_header_t 2016-02-09 13:21:39 +01:00
primitive_memtest.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
prog_loaders.c lib/prog_loaders.c: remove arch/stages.h include 2016-02-11 23:12:12 +01:00
prog_ops.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
program.ld Provide a gcc-safe zero pointer 2016-01-28 23:25:53 +01:00
ramtest.c misc: Drop print_ implementation from non-romcc boards 2015-01-09 06:12:22 +01:00
reg_script.c fsp_baytrail: Add full support for iosf access in reg_script 2016-02-22 19:25:28 +01:00
rmodule.c cbfs: Add LZ4 in-place decompression support for pre-RAM stages 2016-02-22 21:38:37 +01:00
rmodule.ld rmodule: use program.ld for linking 2015-09-09 19:35:30 +00:00
selfboot.c cbfs: Add LZ4 in-place decompression support for pre-RAM stages 2016-02-22 21:38:37 +01:00
stack.c lib/stack: Add stack overrun detection 2015-10-24 05:57:33 +02:00
thread.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
timer.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
timer_queue.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
timestamp.c timestamp: Remove HAS_PRECBMEM_TIMESTAMP_REGION Kconfig 2016-02-12 21:54:52 +01:00
tlcl.c chromeos: vboot2: Add TPM PCR extension support 2015-04-20 17:06:28 +02:00
tlcl_internal.h vboot2: read secdata and nvdata 2015-03-23 19:51:47 +01:00
tlcl_structures.h vboot2: copy tlcl from vboot_reference as a preparation for vboot2 integration 2015-01-27 01:43:57 +01:00
tpm_error_messages.h TPM: Fix whitespace 2015-02-06 00:25:59 +01:00
trace.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
version.c build.h: remove variable for the builduser, -hostname and -domain 2015-03-09 17:53:16 +01:00