summaryrefslogtreecommitdiff
path: root/src/arch/armv7/lib/cache.c
diff options
context:
space:
mode:
authorDavid Hendricks <dhendrix@chromium.org>2013-03-21 21:58:50 -0700
committerRonald G. Minnich <rminnich@gmail.com>2013-03-26 00:10:31 +0100
commitf9be756b559ccc567e5412c85b5ded98f19617e7 (patch)
tree753c8f5d36b7023766ae9f11561ce86183a13e13 /src/arch/armv7/lib/cache.c
parent04d352db41522b3c7aec2ce574ff90484bc0ad8a (diff)
armv7: add new dcache and MMU setup functions
This adds new MMU setup code. Most notably, this version uses cbmem_add() to determine the translation table base address, which in turn is necessary to ensure payloads which wipe memory can tell which regions to wipe out. TODOs: - Finish cleaning up references to old cache/MMU stuff - Add L2 setup (from exynos_cache.c) - Set up ranges dynamically rather than in ramstage's main(). Change-Id: Iba5295a801e8058a3694e4ec5b94bbe9a69d3ee6 Signed-off-by: David Hendricks <dhendrix@chromium.org> Reviewed-on: http://review.coreboot.org/2877 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Diffstat (limited to 'src/arch/armv7/lib/cache.c')
-rw-r--r--src/arch/armv7/lib/cache.c29
1 files changed, 22 insertions, 7 deletions
diff --git a/src/arch/armv7/lib/cache.c b/src/arch/armv7/lib/cache.c
index 63e406c03f..2686db7cf9 100644
--- a/src/arch/armv7/lib/cache.c
+++ b/src/arch/armv7/lib/cache.c
@@ -204,6 +204,28 @@ void dcache_clean_invalidate_by_mva(unsigned long addr, unsigned long len)
dcache_op_mva(addr, len, OP_DCCIMVAC);
}
+
+void dcache_mmu_disable(void)
+{
+ uint32_t sctlr;
+
+ sctlr = read_sctlr();
+ dcache_clean_invalidate_all();
+ sctlr &= ~(SCTLR_C | SCTLR_M);
+ write_sctlr(sctlr);
+}
+
+
+void dcache_mmu_enable(void)
+{
+ uint32_t sctlr;
+
+ sctlr = read_sctlr();
+ dcache_clean_invalidate_all();
+ sctlr |= SCTLR_C | SCTLR_M;
+ write_sctlr(sctlr);
+}
+
void armv7_invalidate_caches(void)
{
uint32_t clidr;
@@ -252,10 +274,3 @@ void armv7_invalidate_caches(void)
/* Invalidate TLB */
tlb_invalidate_all();
}
-
-/* FIXME: wrapper around imported mmu_setup() for now */
-extern void mmu_setup(unsigned long start, unsigned long size);
-void mmu_setup_by_mva(unsigned long start, unsigned long size)
-{
- mmu_setup(start, size);
-}