summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Kconfig6
-rw-r--r--src/lib/cbfs.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/src/lib/Kconfig b/src/lib/Kconfig
index 0f651b346a..41a23b27c0 100644
--- a/src/lib/Kconfig
+++ b/src/lib/Kconfig
@@ -99,6 +99,12 @@ config NO_CBFS_MCACHE
lookup must re-read the same CBFS directory entries from flash to find
the respective file.
+config CBFS_CACHE_ALIGN
+ int
+ default 8
+ help
+ Sets the alignment of the buffers returned by the cbfs_cache.
+
config PAYLOAD_PRELOAD
bool
depends on COOP_MULTITASKING
diff --git a/src/lib/cbfs.c b/src/lib/cbfs.c
index 7633fdff03..1c79b65d6b 100644
--- a/src/lib/cbfs.c
+++ b/src/lib/cbfs.c
@@ -20,7 +20,7 @@
#if ENV_STAGE_HAS_DATA_SECTION
struct mem_pool cbfs_cache =
- MEM_POOL_INIT(_cbfs_cache, REGION_SIZE(cbfs_cache), sizeof(uint64_t));
+ MEM_POOL_INIT(_cbfs_cache, REGION_SIZE(cbfs_cache), CONFIG_CBFS_CACHE_ALIGN);
#else
struct mem_pool cbfs_cache = MEM_POOL_INIT(NULL, 0, 0);
#endif
@@ -29,7 +29,7 @@ static void switch_to_postram_cache(int unused)
{
if (_preram_cbfs_cache != _postram_cbfs_cache)
mem_pool_init(&cbfs_cache, _postram_cbfs_cache, REGION_SIZE(postram_cbfs_cache),
- sizeof(uint64_t));
+ CONFIG_CBFS_CACHE_ALIGN);
}
ROMSTAGE_CBMEM_INIT_HOOK(switch_to_postram_cache);