lib/cbfs: Don't include unused LZ4 code to shrink postcar stage

When ramstage is not LZ4 compressed then don't include the LZ4
decompressor into postcar stage.

TEST=Reduces postcar size on Lenovo x220 by 1224 bytes.

Change-Id: I51e25d94213b42474c8cedd9e7bae9e81568566d
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/91385
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
This commit is contained in:
Patrick Rudolph 2026-02-22 16:40:28 +01:00 committed by Matt DeVillier
commit f12d2997fc

View file

@ -137,6 +137,9 @@ static inline bool cbfs_lz4_enabled(void)
if (ENV_SMM)
return false;
if (ENV_RAMSTAGE_LOADER && !CONFIG(COMPRESS_RAMSTAGE_LZ4))
return false;
return true;
}