aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mm/mmu.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mm/mmu.c')
-rw-r--r--arch/arm/mm/mmu.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index 594d677b92c8..dc8c550e6cbd 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -60,7 +60,7 @@ EXPORT_SYMBOL(pgprot_kernel);
60struct cachepolicy { 60struct cachepolicy {
61 const char policy[16]; 61 const char policy[16];
62 unsigned int cr_mask; 62 unsigned int cr_mask;
63 unsigned int pmd; 63 pmdval_t pmd;
64 pteval_t pte; 64 pteval_t pte;
65}; 65};
66 66
@@ -273,6 +273,14 @@ static struct mem_type mem_types[] = {
273 .prot_l1 = PMD_TYPE_TABLE, 273 .prot_l1 = PMD_TYPE_TABLE,
274 .domain = DOMAIN_KERNEL, 274 .domain = DOMAIN_KERNEL,
275 }, 275 },
276 [MT_MEMORY_SO] = {
277 .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY |
278 L_PTE_MT_UNCACHED,
279 .prot_l1 = PMD_TYPE_TABLE,
280 .prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_SECT_S |
281 PMD_SECT_UNCACHED | PMD_SECT_XN,
282 .domain = DOMAIN_KERNEL,
283 },
276}; 284};
277 285
278const struct mem_type *get_mem_type(unsigned int type) 286const struct mem_type *get_mem_type(unsigned int type)
@@ -288,7 +296,7 @@ static void __init build_mem_type_table(void)
288{ 296{
289 struct cachepolicy *cp; 297 struct cachepolicy *cp;
290 unsigned int cr = get_cr(); 298 unsigned int cr = get_cr();
291 unsigned int user_pgprot, kern_pgprot, vecs_pgprot; 299 pteval_t user_pgprot, kern_pgprot, vecs_pgprot;
292 int cpu_arch = cpu_architecture(); 300 int cpu_arch = cpu_architecture();
293 int i; 301 int i;
294 302
@@ -863,14 +871,14 @@ static inline void prepare_page_table(void)
863 /* 871 /*
864 * Clear out all the mappings below the kernel image. 872 * Clear out all the mappings below the kernel image.
865 */ 873 */
866 for (addr = 0; addr < MODULES_VADDR; addr += PGDIR_SIZE) 874 for (addr = 0; addr < MODULES_VADDR; addr += PMD_SIZE)
867 pmd_clear(pmd_off_k(addr)); 875 pmd_clear(pmd_off_k(addr));
868 876
869#ifdef CONFIG_XIP_KERNEL 877#ifdef CONFIG_XIP_KERNEL
870 /* The XIP kernel is mapped in the module area -- skip over it */ 878 /* The XIP kernel is mapped in the module area -- skip over it */
871 addr = ((unsigned long)_etext + PGDIR_SIZE - 1) & PGDIR_MASK; 879 addr = ((unsigned long)_etext + PMD_SIZE - 1) & PMD_MASK;
872#endif 880#endif
873 for ( ; addr < PAGE_OFFSET; addr += PGDIR_SIZE) 881 for ( ; addr < PAGE_OFFSET; addr += PMD_SIZE)
874 pmd_clear(pmd_off_k(addr)); 882 pmd_clear(pmd_off_k(addr));
875 883
876 /* 884 /*
@@ -885,10 +893,12 @@ static inline void prepare_page_table(void)
885 * memory bank, up to the end of the vmalloc region. 893 * memory bank, up to the end of the vmalloc region.
886 */ 894 */
887 for (addr = __phys_to_virt(end); 895 for (addr = __phys_to_virt(end);
888 addr < VMALLOC_END; addr += PGDIR_SIZE) 896 addr < VMALLOC_END; addr += PMD_SIZE)
889 pmd_clear(pmd_off_k(addr)); 897 pmd_clear(pmd_off_k(addr));
890} 898}
891 899
900#define SWAPPER_PG_DIR_SIZE (PTRS_PER_PGD * sizeof(pgd_t))
901
892/* 902/*
893 * Reserve the special regions of memory 903 * Reserve the special regions of memory
894 */ 904 */
@@ -898,7 +908,7 @@ void __init arm_mm_memblock_reserve(void)
898 * Reserve the page tables. These are already in use, 908 * Reserve the page tables. These are already in use,
899 * and can only be in node 0. 909 * and can only be in node 0.
900 */ 910 */
901 memblock_reserve(__pa(swapper_pg_dir), PTRS_PER_PGD * sizeof(pgd_t)); 911 memblock_reserve(__pa(swapper_pg_dir), SWAPPER_PG_DIR_SIZE);
902 912
903#ifdef CONFIG_SA1111 913#ifdef CONFIG_SA1111
904 /* 914 /*
@@ -926,7 +936,7 @@ static void __init devicemaps_init(struct machine_desc *mdesc)
926 */ 936 */
927 vectors_page = early_alloc(PAGE_SIZE); 937 vectors_page = early_alloc(PAGE_SIZE);
928 938
929 for (addr = VMALLOC_END; addr; addr += PGDIR_SIZE) 939 for (addr = VMALLOC_END; addr; addr += PMD_SIZE)
930 pmd_clear(pmd_off_k(addr)); 940 pmd_clear(pmd_off_k(addr));
931 941
932 /* 942 /*