ARM: mpu: Complete initialisation of the MPU after reaching the C-world
authorJonathan Austin <jonathan.austin@arm.com>
Thu, 28 Feb 2013 17:51:05 +0000 (17:51 +0000)
committerJonathan Austin <jonathan.austin@arm.com>
Fri, 7 Jun 2013 16:02:53 +0000 (17:02 +0100)
Much like with the MMU, MPU initialisation is performed in two stages; the
first in the pre-C world and the 'real' initialisation during arch setup.

This patch wires in previously added MPU initialisation functions so that
the whole of memory is mapped with the appropriate region properties for
'normal' RAM (the appropriate properties depend on whether the system is
SMP).

Stub initialisation functions are added for the case that there MPU support
is not configured in to the kernel.

Signed-off-by: Jonathan Austin <jonathan.austin@arm.com>
Reviewed-by: Will Deacon <will.deacon@arm.com>
CC: Hyok S. Choi <hyok.choi@samsung.com>
arch/arm/mm/nommu.c

index 0897d6bd9c2d30e0629f2e45ab89b51a7ed64804..c1b494d43ed15a38b164b2f61537b959475424b6 100644 (file)
@@ -265,6 +265,9 @@ void __init mpu_setup(void)
                        mpu_max_regions());
        }
 }
+#else
+static void sanity_check_meminfo_mpu(void) {}
+static void __init mpu_setup(void) {}
 #endif /* CONFIG_ARM_MPU */
 
 void __init arm_mm_memblock_reserve(void)
@@ -286,7 +289,9 @@ void __init arm_mm_memblock_reserve(void)
 
 void __init sanity_check_meminfo(void)
 {
-       phys_addr_t end = bank_phys_end(&meminfo.bank[meminfo.nr_banks - 1]);
+       phys_addr_t end;
+       sanity_check_meminfo_mpu();
+       end = bank_phys_end(&meminfo.bank[meminfo.nr_banks - 1]);
        high_memory = __va(end - 1) + 1;
 }
 
@@ -297,6 +302,7 @@ void __init sanity_check_meminfo(void)
 void __init paging_init(struct machine_desc *mdesc)
 {
        early_trap_init((void *)CONFIG_VECTORS_BASE);
+       mpu_setup();
        bootmem_init();
 }