diff --git a/src/lib/Makefile.inc b/src/lib/Makefile.inc index da822192e5..29e2aa885b 100644 --- a/src/lib/Makefile.inc +++ b/src/lib/Makefile.inc @@ -52,7 +52,7 @@ verstage-$(CONFIG_GENERIC_GPIO_LIB) += gpio.c romstage-y += delay.c romstage-y += cbfs.c romstage-$(CONFIG_COMMON_CBFS_SPI_WRAPPER) += cbfs_spi.c -romstage-y += lzma.c +romstage-$(CONFIG_COMPRESS_RAMSTAGE) += lzma.c #romstage-y += lzmadecode.c romstage-$(CONFIG_PRIMITIVE_MEMTEST) += primitive_memtest.c ramstage-$(CONFIG_PRIMITIVE_MEMTEST) += primitive_memtest.c diff --git a/src/lib/cbfs.c b/src/lib/cbfs.c index 4c6425f692..244ecffa25 100644 --- a/src/lib/cbfs.c +++ b/src/lib/cbfs.c @@ -27,8 +27,9 @@ # define CBFS_MINI_BUILD #elif defined(__SMM__) # define CBFS_MINI_BUILD -#elif defined(__PRE_RAM__) && !defined(__ROMSTAGE__) - /* No LZMA in boot block. */ +#elif defined(__PRE_RAM__) && \ + (!defined(__ROMSTAGE__) || !IS_ENABLED(CONFIG_COMPRESS_RAMSTAGE)) + /* No LZMA before romstage, and not even there without ramstage compression */ #else # define CBFS_CORE_WITH_LZMA # include