x86: Add pre-memory stages CBFS cache scratchpad support
Having a CBFS cache scratchpad offers a generic way to decompress CBFS
files through the cbfs_map() function without having to reserve a
per-file specific memory region.
This commit introduces the x86 `PRERAM_CBFS_CACHE_SIZE' Kconfig to set
the pre-memory stages CBFS cache size. A cache size of zero disables
the CBFS cache feature. The default value is 16 KB which seems a
reasonable minimal value enough to satisfy basic needs such as the
decompression of a small configuration file. This setting can be
adjusted depending on the platform needs and capabilities.
We have set this size to zero for all the platforms without enough
space in Cache-As-RAM to accommodate the default size.
TEST=Decompression of vbt.bin in romstage on rex using cbfs_map()
Change-Id: Iee493f9947fddcc57576f04c3d6a2d58c7368e09
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/77290
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
diff --git a/src/cpu/intel/slot_1/Kconfig b/src/cpu/intel/slot_1/Kconfig
index 4ba8747..fffca39 100644
--- a/src/cpu/intel/slot_1/Kconfig
+++ b/src/cpu/intel/slot_1/Kconfig
@@ -24,6 +24,9 @@
hex
default 0x02000
+config PRERAM_CBFS_CACHE_SIZE
+ default 0x0
+
config DCACHE_BSP_STACK_SIZE
hex
default 0x1000
diff --git a/src/cpu/intel/socket_441/Kconfig b/src/cpu/intel/socket_441/Kconfig
index 1a549ac..381b72b 100644
--- a/src/cpu/intel/socket_441/Kconfig
+++ b/src/cpu/intel/socket_441/Kconfig
@@ -13,6 +13,9 @@
hex
default 0x8000
+config PRERAM_CBFS_CACHE_SIZE
+ default 0x0
+
config DCACHE_BSP_STACK_SIZE
hex
default 0x2000
diff --git a/src/cpu/intel/socket_BGA956/Kconfig b/src/cpu/intel/socket_BGA956/Kconfig
index 7c42722..9197faa 100644
--- a/src/cpu/intel/socket_BGA956/Kconfig
+++ b/src/cpu/intel/socket_BGA956/Kconfig
@@ -12,6 +12,9 @@
hex
default 0x10000
+config PRERAM_CBFS_CACHE_SIZE
+ default 0x0
+
config DCACHE_BSP_STACK_SIZE
hex
default 0x2000
diff --git a/src/cpu/intel/socket_FCBGA559/Kconfig b/src/cpu/intel/socket_FCBGA559/Kconfig
index 223f80d..95099c5 100644
--- a/src/cpu/intel/socket_FCBGA559/Kconfig
+++ b/src/cpu/intel/socket_FCBGA559/Kconfig
@@ -15,6 +15,9 @@
hex
default 0x8000
+config PRERAM_CBFS_CACHE_SIZE
+ default 0x0
+
config DCACHE_BSP_STACK_SIZE
hex
default 0x2000
diff --git a/src/cpu/intel/socket_LGA775/Kconfig b/src/cpu/intel/socket_LGA775/Kconfig
index 63d6250..870fd78 100644
--- a/src/cpu/intel/socket_LGA775/Kconfig
+++ b/src/cpu/intel/socket_LGA775/Kconfig
@@ -12,6 +12,9 @@
hex
default 0x8000 # 32 kB
+config PRERAM_CBFS_CACHE_SIZE
+ default 0x0
+
config DCACHE_BSP_STACK_SIZE
hex
default 0x2000
diff --git a/src/cpu/intel/socket_m/Kconfig b/src/cpu/intel/socket_m/Kconfig
index 2e653e9..2e6d432 100644
--- a/src/cpu/intel/socket_m/Kconfig
+++ b/src/cpu/intel/socket_m/Kconfig
@@ -13,6 +13,9 @@
hex
default 0x8000
+config PRERAM_CBFS_CACHE_SIZE
+ default 0x0
+
config DCACHE_BSP_STACK_SIZE
hex
default 0x2000
diff --git a/src/cpu/intel/socket_mPGA604/Kconfig b/src/cpu/intel/socket_mPGA604/Kconfig
index 8f28670..92a0b43 100644
--- a/src/cpu/intel/socket_mPGA604/Kconfig
+++ b/src/cpu/intel/socket_mPGA604/Kconfig
@@ -17,6 +17,9 @@
hex
default 0x4000
+config PRERAM_CBFS_CACHE_SIZE
+ default 0x0
+
config DCACHE_BSP_STACK_SIZE
hex
default 0x2000