diff options
author | Tom Rini <trini@konsulko.com> | 2019-10-12 10:52:48 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-10-12 10:52:48 -0400 |
commit | 9189d6f1e9c4ae40a14558636ed7b59b53c4c885 (patch) | |
tree | 88cf3ab7d7c967e2de9cdfd9cc9a3e8c99cb64c0 /arch/x86/lib/mrccache.c | |
parent | 0c9cc5155cb5027ae17ace986f349e2f0d1fb9a3 (diff) | |
parent | c443f56cc699f25feb4618791730d11a0eb6280a (diff) |
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-x86
- Remember the device being emulated for Sandbox PCI
- Update Kconfig options for FSP 1.0
- Drop RESET_BASE and RESET_SEG_SIZE that are no longer used
Diffstat (limited to 'arch/x86/lib/mrccache.c')
-rw-r--r-- | arch/x86/lib/mrccache.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/arch/x86/lib/mrccache.c b/arch/x86/lib/mrccache.c index be107627b8..33bb52039b 100644 --- a/arch/x86/lib/mrccache.c +++ b/arch/x86/lib/mrccache.c @@ -17,19 +17,20 @@ DECLARE_GLOBAL_DATA_PTR; +static uint mrc_block_size(uint data_size) +{ + uint mrc_size = sizeof(struct mrc_data_container) + data_size; + + return ALIGN(mrc_size, MRC_DATA_ALIGN); +} + static struct mrc_data_container *next_mrc_block( struct mrc_data_container *cache) { /* MRC data blocks are aligned within the region */ - u32 mrc_size = sizeof(*cache) + cache->data_size; u8 *region_ptr = (u8 *)cache; - if (mrc_size & (MRC_DATA_ALIGN - 1UL)) { - mrc_size &= ~(MRC_DATA_ALIGN - 1UL); - mrc_size += MRC_DATA_ALIGN; - } - - region_ptr += mrc_size; + region_ptr += mrc_block_size(cache->data_size); return (struct mrc_data_container *)region_ptr; } |