aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh
diff options
context:
space:
mode:
authorMichael Trimarchi <trimarchimichael@yahoo.it>2009-08-20 00:27:44 -0400
committerPaul Mundt <lethal@linux-sh.org>2009-08-20 00:27:44 -0400
commit6503fe4a6508673c15a509ec4ac3ca5979ae9593 (patch)
treefb5b77f9dfc320b7834c8a1ada22469cf247f36b /arch/sh
parent5c9740a8b797c9141a39e8115f5652d7bb28a67d (diff)
sh: Better description of SH-4 PTEA register update.
Signed-off-by: Michael Trimarchi <trimarchimichael@yahoo.it> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh')
-rw-r--r--arch/sh/include/asm/pgtable_32.h8
-rw-r--r--arch/sh/mm/tlb-sh4.c9
2 files changed, 14 insertions, 3 deletions
diff --git a/arch/sh/include/asm/pgtable_32.h b/arch/sh/include/asm/pgtable_32.h
index 0db19db913c..4c4429cda56 100644
--- a/arch/sh/include/asm/pgtable_32.h
+++ b/arch/sh/include/asm/pgtable_32.h
@@ -87,6 +87,14 @@
87#define _PAGE_PCC_ATR8 0x60000000 /* Attribute Memory space, 8 bit bus */ 87#define _PAGE_PCC_ATR8 0x60000000 /* Attribute Memory space, 8 bit bus */
88#define _PAGE_PCC_ATR16 0x60000001 /* Attribute Memory space, 6 bit bus */ 88#define _PAGE_PCC_ATR16 0x60000001 /* Attribute Memory space, 6 bit bus */
89 89
90#ifndef CONFIG_X2TLB
91/* copy the ptea attributes */
92static inline unsigned long copy_ptea_attributes(unsigned long x)
93{
94 return ((x >> 28) & 0xe) | (x & 0x1);
95}
96#endif
97
90/* Mask which drops unused bits from the PTEL value */ 98/* Mask which drops unused bits from the PTEL value */
91#if defined(CONFIG_CPU_SH3) 99#if defined(CONFIG_CPU_SH3)
92#define _PAGE_CLEAR_FLAGS (_PAGE_PROTNONE | _PAGE_ACCESSED| \ 100#define _PAGE_CLEAR_FLAGS (_PAGE_PROTNONE | _PAGE_ACCESSED| \
diff --git a/arch/sh/mm/tlb-sh4.c b/arch/sh/mm/tlb-sh4.c
index f0c7b7397fa..fd0d11f1a81 100644
--- a/arch/sh/mm/tlb-sh4.c
+++ b/arch/sh/mm/tlb-sh4.c
@@ -61,9 +61,12 @@ void update_mmu_cache(struct vm_area_struct * vma,
61 */ 61 */
62 ctrl_outl(pte.pte_high, MMU_PTEA); 62 ctrl_outl(pte.pte_high, MMU_PTEA);
63#else 63#else
64 if (cpu_data->flags & CPU_HAS_PTEA) 64 if (cpu_data->flags & CPU_HAS_PTEA) {
65 /* TODO: make this look less hacky */ 65 /* The last 3 bits and the first one of pteval contains
66 ctrl_outl(((pteval >> 28) & 0xe) | (pteval & 0x1), MMU_PTEA); 66 * the PTEA timing control and space attribute bits
67 */
68 ctrl_outl(copy_ptea_attributes(pteval), MMU_PTEA);
69 }
67#endif 70#endif
68 71
69 /* Set PTEL register */ 72 /* Set PTEL register */