diff options
author | Raul E Rangel <rrangel@chromium.org> | 2021-07-23 16:43:18 -0600 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2021-11-04 10:34:19 +0000 |
commit | 6938f353cac958c82311f4fb126895cf3d7c519d (patch) | |
tree | abb4f69c9901e57845af16dc078097c88371fdeb /src/lib/cbfs.c | |
parent | 5ac82dcc20678629f2dd5497d9b657bcfa7acdf2 (diff) | |
download | coreboot-6938f353cac958c82311f4fb126895cf3d7c519d.tar.gz coreboot-6938f353cac958c82311f4fb126895cf3d7c519d.tar.bz2 coreboot-6938f353cac958c82311f4fb126895cf3d7c519d.zip |
lib/cbfs: Add CBFS_CACHE_ALIGN Kconfig option
This option will allow platforms to set the alignment of the cbfs_cache
buffers.
BUG=b:179699789
TEST=gdb -ex 'p cbfs_cache' /tmp/coreboot/guybrush/cbfs/fallback/ramstage.debug
$1 = {buf = 0x0, size = 0, alignment = 8, last_alloc = 0x0, second_to_last_alloc = 0x0, free_offset = 0}
Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: I74598d4bcbca9a01cc8c65012d7e4ae341d052b1
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58706
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'src/lib/cbfs.c')
-rw-r--r-- | src/lib/cbfs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/cbfs.c b/src/lib/cbfs.c index 7633fdff03c0..1c79b65d6b7c 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); |