amdblocks/acpimmio: Unify BIOSRAM usage

All AMD CPU families supported in coreboot have BIOSRAM space. Looking at
the source code, every family could have the same API to save and restore
cbmem top or UMA base and size.

Unify BIOSRAM layout and add implementation for cbmem top and UMA storing.
Also replace the existing implementation of cbmem top and UMA with the
BIOSRAM access.

TEST=boot PC Engines apu1 and apu2

Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Change-Id: I69a03e4f01d7fb2ffc9f8b5af73d7e4e7ec027da
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37402
Reviewed-by: Richard Spiegel <richard.spiegel@silverbackltd.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Michał Żygowski
2019-12-01 18:14:39 +01:00
committed by Kyösti Mälkki
parent 73a544d453
commit f65c1e4088
15 changed files with 72 additions and 198 deletions

View File

@@ -648,27 +648,3 @@ static void set_pci_irqs(void *unused)
* on entry into BS_DEV_ENABLE.
*/
BOOT_STATE_INIT_ENTRY(BS_DEV_ENABLE, BS_ON_ENTRY, set_pci_irqs, NULL);
void save_uma_size(uint32_t size)
{
biosram_write32(BIOSRAM_UMA_SIZE, size);
}
void save_uma_base(uint64_t base)
{
biosram_write32(BIOSRAM_UMA_BASE, (uint32_t) base);
biosram_write32(BIOSRAM_UMA_BASE + 4, (uint32_t) (base >> 32));
}
uint32_t get_uma_size(void)
{
return biosram_read32(BIOSRAM_UMA_SIZE);
}
uint64_t get_uma_base(void)
{
uint64_t base;
base = biosram_read32(BIOSRAM_UMA_BASE);
base |= ((uint64_t)(biosram_read32(BIOSRAM_UMA_BASE + 4)) << 32);
return base;
}