summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/cbfs.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/lib/cbfs.c b/src/lib/cbfs.c
index e05ea801c8..ec5156c09c 100644
--- a/src/lib/cbfs.c
+++ b/src/lib/cbfs.c
@@ -91,8 +91,19 @@ int cbfs_locate_file_in_region(struct cbfsf *fh, const char *region_name,
return ret;
}
+static inline bool fsps_env(void)
+{
+ /* FSP-S is assumed to be loaded in ramstage. */
+ if (ENV_RAMSTAGE)
+ return true;
+ return false;
+}
+
static inline bool cbfs_lz4_enabled(void)
{
+ if (fsps_env() && CONFIG(FSP_COMPRESS_FSP_S_LZ4))
+ return true;
+
if ((ENV_BOOTBLOCK || ENV_SEPARATE_VERSTAGE) && !CONFIG(COMPRESS_PRERAM_STAGES))
return false;
@@ -101,6 +112,8 @@ static inline bool cbfs_lz4_enabled(void)
static inline bool cbfs_lzma_enabled(void)
{
+ if (fsps_env() && CONFIG(FSP_COMPRESS_FSP_S_LZMA))
+ return true;
/* We assume here romstage and postcar are never compressed. */
if (ENV_BOOTBLOCK || ENV_SEPARATE_VERSTAGE)
return false;