vc/google/chromeos: Add configurable compression for logo file in cbfs

This patch enables LZMA or LZ4 compression algorithm for the logo cbfs
file based on BMP_LOGO_COMPRESS_LZMA or BMP_LOGO_COMPRESS_LZ4 Kconfig.
Logo cbfs file is compressed based on CBFS_COMPRESS_FLAG, by default.
Based on logo file content and target platform, enabling LZ4 could
save significant boot time, with increase in file size.
For brox:
cb_logo LZ4 is +1265 bytes than LZMA, saves ~0.760ms in decomp.
cb_plus_logo LZ4 is +2011 bytes than LZMA, saves ~0.880ms in decomp.

BUG=b:337330958
TEST=Able to boot brox and verified firmware splash screen display
with LZMA and LZ4 compression.

Change-Id: I57fbd0d3a39eaba3fb9d61e7a3fb5eeb44e3a839
Signed-off-by: Ashish Kumar Mishra <ashish.k.mishra@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/83420
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Ashish Kumar Mishra
2024-07-04 15:37:19 +05:30
committed by Felix Held
parent 203b9fb352
commit ae1cdeafa2

View File

@ -23,12 +23,19 @@ romstage-$(CONFIG_CHROMEOS_DRAM_PART_NUMBER_IN_CBI) += dram_part_num_override.c
ramstage-$(CONFIG_CHROMEOS_FW_SPLASH_SCREEN) += splash.c
# Add logo to the cbfs image
BMP_LOGO_COMPRESS_FLAG := $(CBFS_COMPRESS_FLAG)
ifeq ($(CONFIG_BMP_LOGO_COMPRESS_LZMA),y)
BMP_LOGO_COMPRESS_FLAG := LZMA
else ifeq ($(CONFIG_BMP_LOGO_COMPRESS_LZ4),y)
BMP_LOGO_COMPRESS_FLAG := LZ4
endif
cbfs-files-$(CONFIG_CHROMEOS_FW_SPLASH_SCREEN) += cb_logo.bmp
cb_logo.bmp-file := $(call strip_quotes,$(CONFIG_CHROMEOS_LOGO_PATH))
cb_logo.bmp-type := raw
cb_logo.bmp-compression := $(CBFS_COMPRESS_FLAG)
cb_logo.bmp-compression := $(BMP_LOGO_COMPRESS_FLAG)
cbfs-files-$(CONFIG_CHROMEOS_FW_SPLASH_SCREEN) += cb_plus_logo.bmp
cb_plus_logo.bmp-file := $(call strip_quotes,$(CONFIG_CHROMEBOOK_PLUS_LOGO_PATH))
cb_plus_logo.bmp-type := raw
cb_plus_logo.bmp-compression := $(CBFS_COMPRESS_FLAG)
cb_plus_logo.bmp-compression := $(BMP_LOGO_COMPRESS_FLAG)