diff options
Diffstat (limited to 'arch/arm/mm/mmu.c')
-rw-r--r-- | arch/arm/mm/mmu.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index cf504885a5fb..1585814f8414 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c | |||
@@ -245,6 +245,10 @@ static struct mem_type mem_types[] = { | |||
245 | .prot_sect = PMD_TYPE_SECT, | 245 | .prot_sect = PMD_TYPE_SECT, |
246 | .domain = DOMAIN_KERNEL, | 246 | .domain = DOMAIN_KERNEL, |
247 | }, | 247 | }, |
248 | [MT_MEMORY_NONCACHED] = { | ||
249 | .prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE, | ||
250 | .domain = DOMAIN_KERNEL, | ||
251 | }, | ||
248 | }; | 252 | }; |
249 | 253 | ||
250 | const struct mem_type *get_mem_type(unsigned int type) | 254 | const struct mem_type *get_mem_type(unsigned int type) |
@@ -408,9 +412,28 @@ static void __init build_mem_type_table(void) | |||
408 | kern_pgprot |= L_PTE_SHARED; | 412 | kern_pgprot |= L_PTE_SHARED; |
409 | vecs_pgprot |= L_PTE_SHARED; | 413 | vecs_pgprot |= L_PTE_SHARED; |
410 | mem_types[MT_MEMORY].prot_sect |= PMD_SECT_S; | 414 | mem_types[MT_MEMORY].prot_sect |= PMD_SECT_S; |
415 | mem_types[MT_MEMORY_NONCACHED].prot_sect |= PMD_SECT_S; | ||
411 | #endif | 416 | #endif |
412 | } | 417 | } |
413 | 418 | ||
419 | /* | ||
420 | * Non-cacheable Normal - intended for memory areas that must | ||
421 | * not cause dirty cache line writebacks when used | ||
422 | */ | ||
423 | if (cpu_arch >= CPU_ARCH_ARMv6) { | ||
424 | if (cpu_arch >= CPU_ARCH_ARMv7 && (cr & CR_TRE)) { | ||
425 | /* Non-cacheable Normal is XCB = 001 */ | ||
426 | mem_types[MT_MEMORY_NONCACHED].prot_sect |= | ||
427 | PMD_SECT_BUFFERED; | ||
428 | } else { | ||
429 | /* For both ARMv6 and non-TEX-remapping ARMv7 */ | ||
430 | mem_types[MT_MEMORY_NONCACHED].prot_sect |= | ||
431 | PMD_SECT_TEX(1); | ||
432 | } | ||
433 | } else { | ||
434 | mem_types[MT_MEMORY_NONCACHED].prot_sect |= PMD_SECT_BUFFERABLE; | ||
435 | } | ||
436 | |||
414 | for (i = 0; i < 16; i++) { | 437 | for (i = 0; i < 16; i++) { |
415 | unsigned long v = pgprot_val(protection_map[i]); | 438 | unsigned long v = pgprot_val(protection_map[i]); |
416 | protection_map[i] = __pgprot(v | user_pgprot); | 439 | protection_map[i] = __pgprot(v | user_pgprot); |