cbfs: Don't compile LZMA code into romstage if it is not needed

16K of BSS scratchpad buffer is no pocket change for some platforms that
really need to count every kilobyte in their SRAM stages. This patch
makes sure we don't compile LZMA code into the romstage if we don't need
it because the ramstage is not compressed anyway.

BRANCH=None
BUG=None
TEST=Booted Pinky and Blaze. Confirmed that romstage memsz on Pinky is
way smaller than before.

Change-Id: Icf04971b8ddafa76052135cd0e44977d44d69486
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/234539
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
Julius Werner 2014-12-10 18:18:35 -08:00 committed by chrome-internal-fetch
commit 1511699b84
2 changed files with 4 additions and 3 deletions

View file

@ -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

View file

@ -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 <lib.h>