lib/cbfs: Optimise LZMA away from romstage

If we have POSTCAR_STAGE there is no need for
romstage to include LZMA decompression code.

Reduces romstage by about 4 kiB on x86.

Change-Id: I4c475986b2a94e5cd540c3eead433ed6c0a815ed
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/26759
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
This commit is contained in:
Kyösti Mälkki 2018-06-01 07:11:25 +03:00 committed by Patrick Georgi
parent 0863f0be89
commit b5211ef2e7
1 changed files with 3 additions and 0 deletions

View File

@ -119,8 +119,11 @@ size_t cbfs_load_and_decompress(const struct region_device *rdev, size_t offset,
return out_size;
case CBFS_COMPRESS_LZMA:
/* We assume here romstage and postcar are never compressed. */
if (ENV_BOOTBLOCK || ENV_VERSTAGE)
return 0;
if (ENV_ROMSTAGE && IS_ENABLED(CONFIG_POSTCAR_STAGE))
return 0;
if ((ENV_ROMSTAGE || ENV_POSTCAR)
&& !IS_ENABLED(CONFIG_COMPRESS_RAMSTAGE))
return 0;