From 3f39cd2920ccc3286cda152f7abc08590ae49f66 Mon Sep 17 00:00:00 2001 From: David Hendricks Date: Tue, 30 Apr 2013 16:01:50 -0700 Subject: armv7: invalidate TLB entries as they are added/modified The old approach was to invalidate the entire TLB every time we set up a table entry. This worked because we didn't turn the MMU on until after we had set everything up. This patch uses the TLBIMVAA wrapper to invalidate each entry as it's added/modified. Change-Id: I27654a543a2015574d910e15d48b3d3845fdb6d1 Signed-off-by: David Hendricks Reviewed-on: http://review.coreboot.org/3166 Reviewed-by: Ronald G. Minnich Tested-by: build bot (Jenkins) --- src/arch/armv7/lib/mmu.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/arch') diff --git a/src/arch/armv7/lib/mmu.c b/src/arch/armv7/lib/mmu.c index 82c735818e..d4e08f7050 100644 --- a/src/arch/armv7/lib/mmu.c +++ b/src/arch/armv7/lib/mmu.c @@ -99,11 +99,10 @@ void mmu_config_range(unsigned long start_mb, unsigned long size_mb, printk(BIOS_DEBUG, "Setting dcache policy: 0x%08lx:0x%08lx [%s]\n", start_mb << 20, ((start_mb + size_mb) << 20) - 1, str); - for (i = start_mb; i < start_mb + size_mb; i++) + for (i = start_mb; i < start_mb + size_mb; i++) { ttb_entry[i] = (i << 20) | attr; - - /* TODO: add helper to invalidate TLB by MVA */ - tlb_invalidate_all(); + tlbimvaa(start_mb); + } } void mmu_init(void) -- cgit v1.2.3