Lean Sheng Tan has submitted this change. ( https://review.coreboot.org/c/coreboot/+/85147?usp=email )
Change subject: mb/emulation/qemu-sbsa: Configure flash region for MMU ......................................................................
mb/emulation/qemu-sbsa: Configure flash region for MMU
Since QEMU commit 728b923f548d ("target/arm: Do memory type alignment check when translation enabled") alignment is checked for device memory. That causes exceptions during bootup of coreboot trying to load things (e.g. stages) from the memory mapped flash.
To fix it the memory mapped flash region will be marked as MA_MEM (normal memory) instead of MA_DEV (device memory). Technically that isn't 100% correct, but avoids having to write a custom memory mapped flash driver that checks for alignment on all accesses. Since it is emulation and therefore always normal memory anyway, there shouldn't be any side effects.
Signed-off-by: Maximilian Brune maximilian.brune@9elements.com Change-Id: I98bd1a18495e3d153ce53abec8686c7871ee12c5 Reviewed-on: https://review.coreboot.org/c/coreboot/+/85147 Reviewed-by: David Milosevic David.Milosevic@9elements.com Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Lean Sheng Tan sheng.tan@9elements.com --- M src/mainboard/emulation/qemu-sbsa/bootblock.c 1 file changed, 3 insertions(+), 0 deletions(-)
Approvals: David Milosevic: Looks good to me, but someone else must approve build bot (Jenkins): Verified Lean Sheng Tan: Looks good to me, approved
diff --git a/src/mainboard/emulation/qemu-sbsa/bootblock.c b/src/mainboard/emulation/qemu-sbsa/bootblock.c index b38df6e..53eb9af 100644 --- a/src/mainboard/emulation/qemu-sbsa/bootblock.c +++ b/src/mainboard/emulation/qemu-sbsa/bootblock.c @@ -4,6 +4,7 @@ #include <bootblock_common.h> #include <symbols.h>
+DECLARE_REGION(flash); void bootblock_mainboard_init(void) { mmu_init(); @@ -13,6 +14,8 @@ /* Set a dummy value for DRAM. ramstage should update the mapping. */ mmu_config_range(_dram, ((size_t) CONFIG_DRAM_SIZE_MB) * MiB, MA_MEM | MA_RW);
+ mmu_config_range(_flash, REGION_SIZE(flash), MA_MEM | MA_RO | MA_MEM_NC); + mmu_config_range(_ttb, REGION_SIZE(ttb), MA_MEM | MA_S | MA_RW); mmu_config_range(_bootblock, REGION_SIZE(bootblock), MA_MEM | MA_S | MA_RW); mmu_config_range(_ramstage, REGION_SIZE(ramstage), MA_MEM | MA_S | MA_RW);