armv8: allow custom MMU setup routines on ARMv8
authorStephen Warren <swarren@nvidia.com>
Mon, 5 Oct 2015 18:09:00 +0000 (12:09 -0600)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Tue, 10 Nov 2015 17:03:41 +0000 (18:03 +0100)
In order for noncached_init() to operate correctly, SoCs must set up a
custom page table with fine-grained (2MiB) sections, which can be
configured from noncached_init().

This is currently performed by arch/arm/cpu/armv8/{fsl-lsch3,zynqmp}/cpu.c
by cut/pasting and re-implementing mmu_setup, enable_caches(), etc. There
are some other reasons for the duplication there though, such as enabling
icache early, and enabling dcaching earlier with a different configuration.

This change makes mmu_setup() a weak implementation, so that the MMU setup
code can be replaced without having to duplicate other code that calls it.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
arch/arm/cpu/armv8/cache_v8.c

index b1ea822..1ece6a2 100644 (file)
@@ -32,7 +32,7 @@ inline void set_pgtable_table(u64 *page_table, u64 index, u64 *table_addr)
 }
 
 /* to activate the MMU we need to set up virtual memory */
-static void mmu_setup(void)
+__weak void mmu_setup(void)
 {
        bd_t *bd = gd->bd;
        u64 *page_table = (u64 *)gd->arch.tlb_addr, i, j;