Commit cb9d7707 authored by Linus Walleij's avatar Linus Walleij Committed by Russell King

ARM: 6222/1: add memory types for the TCMs

The earlier TCM memory regions were mapped as MT_MEMORY_UNCACHED
which doesn't really work on platforms supporting the new v6
features like the NX bit. Add unique MT_MEMORY_[I|D]TCM types
instead.

Cc: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: default avatarLinus Walleij <linus.walleij@stericsson.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent f159f4ed
...@@ -27,6 +27,8 @@ struct map_desc { ...@@ -27,6 +27,8 @@ struct map_desc {
#define MT_MEMORY 9 #define MT_MEMORY 9
#define MT_ROM 10 #define MT_ROM 10
#define MT_MEMORY_NONCACHED 11 #define MT_MEMORY_NONCACHED 11
#define MT_MEMORY_DTCM 12
#define MT_MEMORY_ITCM 13
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
extern void iotable_init(struct map_desc *, int); extern void iotable_init(struct map_desc *, int);
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/genalloc.h> #include <linux/genalloc.h>
#include <linux/string.h> /* memcpy */ #include <linux/string.h> /* memcpy */
#include <asm/page.h> /* PAGE_SHIFT */
#include <asm/cputype.h> #include <asm/cputype.h>
#include <asm/mach/map.h> #include <asm/mach/map.h>
#include <mach/memory.h> #include <mach/memory.h>
...@@ -53,7 +52,7 @@ static struct map_desc dtcm_iomap[] __initdata = { ...@@ -53,7 +52,7 @@ static struct map_desc dtcm_iomap[] __initdata = {
.virtual = DTCM_OFFSET, .virtual = DTCM_OFFSET,
.pfn = __phys_to_pfn(DTCM_OFFSET), .pfn = __phys_to_pfn(DTCM_OFFSET),
.length = (DTCM_END - DTCM_OFFSET + 1), .length = (DTCM_END - DTCM_OFFSET + 1),
.type = MT_UNCACHED .type = MT_MEMORY_DTCM
} }
}; };
...@@ -62,7 +61,7 @@ static struct map_desc itcm_iomap[] __initdata = { ...@@ -62,7 +61,7 @@ static struct map_desc itcm_iomap[] __initdata = {
.virtual = ITCM_OFFSET, .virtual = ITCM_OFFSET,
.pfn = __phys_to_pfn(ITCM_OFFSET), .pfn = __phys_to_pfn(ITCM_OFFSET),
.length = (ITCM_END - ITCM_OFFSET + 1), .length = (ITCM_END - ITCM_OFFSET + 1),
.type = MT_UNCACHED .type = MT_MEMORY_ITCM
} }
}; };
......
...@@ -258,6 +258,19 @@ static struct mem_type mem_types[] = { ...@@ -258,6 +258,19 @@ static struct mem_type mem_types[] = {
.prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE, .prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE,
.domain = DOMAIN_KERNEL, .domain = DOMAIN_KERNEL,
}, },
[MT_MEMORY_DTCM] = {
.prot_pte = L_PTE_PRESENT | L_PTE_YOUNG |
L_PTE_DIRTY | L_PTE_WRITE,
.prot_l1 = PMD_TYPE_TABLE,
.prot_sect = PMD_TYPE_SECT | PMD_SECT_XN,
.domain = DOMAIN_KERNEL,
},
[MT_MEMORY_ITCM] = {
.prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY |
L_PTE_USER | L_PTE_EXEC,
.prot_l1 = PMD_TYPE_TABLE,
.domain = DOMAIN_IO,
},
}; };
const struct mem_type *get_mem_type(unsigned int type) const struct mem_type *get_mem_type(unsigned int type)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment