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:33:52 +0000 |
commit | 5ac82dcc20678629f2dd5497d9b657bcfa7acdf2 (patch) | |
tree | 2e3b37072907c6683f732f22ecfe8f50bebed378 /src/lib | |
parent | 533fc4dfb155bb45e8da279e1b85b676e3f6c58c (diff) |
commonlib/mem_pool: Allow configuring the alignment
AMD platforms require the destination to be 64 byte aligned in order to
use the SPI DMA controller. This is enforced by the destination address
register because the first 6 bits are marked as reserved.
This change adds an option to the mem_pool so the alignment can be
configured.
BUG=b:179699789
TEST=Boot guybrush to OS
Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: I8d77ffe4411f86c54450305320c9f52ab41a3075
Reviewed-on: https://review.coreboot.org/c/coreboot/+/56580
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/cbfs.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/cbfs.c b/src/lib/cbfs.c index 322f161a0e..7633fdff03 100644 --- a/src/lib/cbfs.c +++ b/src/lib/cbfs.c @@ -19,16 +19,17 @@ #include <timestamp.h> #if ENV_STAGE_HAS_DATA_SECTION -struct mem_pool cbfs_cache = MEM_POOL_INIT(_cbfs_cache, REGION_SIZE(cbfs_cache)); +struct mem_pool cbfs_cache = + MEM_POOL_INIT(_cbfs_cache, REGION_SIZE(cbfs_cache), sizeof(uint64_t)); #else -struct mem_pool cbfs_cache = MEM_POOL_INIT(NULL, 0); +struct mem_pool cbfs_cache = MEM_POOL_INIT(NULL, 0, 0); #endif 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)); + mem_pool_init(&cbfs_cache, _postram_cbfs_cache, REGION_SIZE(postram_cbfs_cache), + sizeof(uint64_t)); } ROMSTAGE_CBMEM_INIT_HOOK(switch_to_postram_cache); |