aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/sh/kernel/cpu/sh5/entry.S28
-rw-r--r--arch/sh/mm/Makefile_647
-rw-r--r--arch/sh/mm/cache-sh5.c2
-rw-r--r--include/asm-sh/io.h12
-rw-r--r--include/asm-sh/mmu_context.h4
-rw-r--r--include/asm-sh/tlb_64.h10
-rw-r--r--include/asm-sh/uaccess_64.h2
7 files changed, 55 insertions, 10 deletions
diff --git a/arch/sh/kernel/cpu/sh5/entry.S b/arch/sh/kernel/cpu/sh5/entry.S
index ba8750176d91..05372ed6c568 100644
--- a/arch/sh/kernel/cpu/sh5/entry.S
+++ b/arch/sh/kernel/cpu/sh5/entry.S
@@ -143,12 +143,22 @@ resvec_save_area:
143trap_jtable: 143trap_jtable:
144 .long do_exception_error /* 0x000 */ 144 .long do_exception_error /* 0x000 */
145 .long do_exception_error /* 0x020 */ 145 .long do_exception_error /* 0x020 */
146#ifdef CONFIG_MMU
146 .long tlb_miss_load /* 0x040 */ 147 .long tlb_miss_load /* 0x040 */
147 .long tlb_miss_store /* 0x060 */ 148 .long tlb_miss_store /* 0x060 */
149#else
150 .long do_exception_error
151 .long do_exception_error
152#endif
148 ! ARTIFICIAL pseudo-EXPEVT setting 153 ! ARTIFICIAL pseudo-EXPEVT setting
149 .long do_debug_interrupt /* 0x080 */ 154 .long do_debug_interrupt /* 0x080 */
155#ifdef CONFIG_MMU
150 .long tlb_miss_load /* 0x0A0 */ 156 .long tlb_miss_load /* 0x0A0 */
151 .long tlb_miss_store /* 0x0C0 */ 157 .long tlb_miss_store /* 0x0C0 */
158#else
159 .long do_exception_error
160 .long do_exception_error
161#endif
152 .long do_address_error_load /* 0x0E0 */ 162 .long do_address_error_load /* 0x0E0 */
153 .long do_address_error_store /* 0x100 */ 163 .long do_address_error_store /* 0x100 */
154#ifdef CONFIG_SH_FPU 164#ifdef CONFIG_SH_FPU
@@ -185,10 +195,18 @@ trap_jtable:
185 .endr 195 .endr
186 .long do_IRQ /* 0xA00 */ 196 .long do_IRQ /* 0xA00 */
187 .long do_IRQ /* 0xA20 */ 197 .long do_IRQ /* 0xA20 */
198#ifdef CONFIG_MMU
188 .long itlb_miss_or_IRQ /* 0xA40 */ 199 .long itlb_miss_or_IRQ /* 0xA40 */
200#else
201 .long do_IRQ
202#endif
189 .long do_IRQ /* 0xA60 */ 203 .long do_IRQ /* 0xA60 */
190 .long do_IRQ /* 0xA80 */ 204 .long do_IRQ /* 0xA80 */
205#ifdef CONFIG_MMU
191 .long itlb_miss_or_IRQ /* 0xAA0 */ 206 .long itlb_miss_or_IRQ /* 0xAA0 */
207#else
208 .long do_IRQ
209#endif
192 .long do_exception_error /* 0xAC0 */ 210 .long do_exception_error /* 0xAC0 */
193 .long do_address_error_exec /* 0xAE0 */ 211 .long do_address_error_exec /* 0xAE0 */
194 .rept 8 212 .rept 8
@@ -274,6 +292,7 @@ not_a_tlb_miss:
274 * Instead of '.space 1024-TEXT_SIZE' place the RESVEC 292 * Instead of '.space 1024-TEXT_SIZE' place the RESVEC
275 * block making sure the final alignment is correct. 293 * block making sure the final alignment is correct.
276 */ 294 */
295#ifdef CONFIG_MMU
277tlb_miss: 296tlb_miss:
278 synco /* TAKum03020 (but probably a good idea anyway.) */ 297 synco /* TAKum03020 (but probably a good idea anyway.) */
279 putcon SP, KCR1 298 putcon SP, KCR1
@@ -377,6 +396,9 @@ fixup_to_invoke_general_handler:
377 getcon KCR1, SP 396 getcon KCR1, SP
378 pta handle_exception, tr0 397 pta handle_exception, tr0
379 blink tr0, ZERO 398 blink tr0, ZERO
399#else /* CONFIG_MMU */
400 .balign 256
401#endif
380 402
381/* NB TAKE GREAT CARE HERE TO ENSURE THAT THE INTERRUPT CODE 403/* NB TAKE GREAT CARE HERE TO ENSURE THAT THE INTERRUPT CODE
382 DOES END UP AT VBR+0x600 */ 404 DOES END UP AT VBR+0x600 */
@@ -1103,6 +1125,7 @@ restore_all:
1103 * fpu_error_or_IRQ? is a helper to deflect to the right cause. 1125 * fpu_error_or_IRQ? is a helper to deflect to the right cause.
1104 * 1126 *
1105 */ 1127 */
1128#ifdef CONFIG_MMU
1106tlb_miss_load: 1129tlb_miss_load:
1107 or SP, ZERO, r2 1130 or SP, ZERO, r2
1108 or ZERO, ZERO, r3 /* Read */ 1131 or ZERO, ZERO, r3 /* Read */
@@ -1132,6 +1155,7 @@ call_do_page_fault:
1132 movi do_page_fault, r6 1155 movi do_page_fault, r6
1133 ptabs r6, tr0 1156 ptabs r6, tr0
1134 blink tr0, ZERO 1157 blink tr0, ZERO
1158#endif /* CONFIG_MMU */
1135 1159
1136fpu_error_or_IRQA: 1160fpu_error_or_IRQA:
1137 pta its_IRQ, tr0 1161 pta its_IRQ, tr0
@@ -1481,6 +1505,7 @@ poke_real_address_q:
1481 ptabs LINK, tr0 1505 ptabs LINK, tr0
1482 blink tr0, r63 1506 blink tr0, r63
1483 1507
1508#ifdef CONFIG_MMU
1484/* 1509/*
1485 * --- User Access Handling Section 1510 * --- User Access Handling Section
1486 */ 1511 */
@@ -1604,6 +1629,7 @@ ___clear_user_exit:
1604 ptabs LINK, tr0 1629 ptabs LINK, tr0
1605 blink tr0, ZERO 1630 blink tr0, ZERO
1606 1631
1632#endif /* CONFIG_MMU */
1607 1633
1608/* 1634/*
1609 * int __strncpy_from_user(unsigned long __dest, unsigned long __src, 1635 * int __strncpy_from_user(unsigned long __dest, unsigned long __src,
@@ -2014,9 +2040,11 @@ sa_default_restorer:
2014 .global asm_uaccess_start /* Just a marker */ 2040 .global asm_uaccess_start /* Just a marker */
2015asm_uaccess_start: 2041asm_uaccess_start:
2016 2042
2043#ifdef CONFIG_MMU
2017 .long ___copy_user1, ___copy_user_exit 2044 .long ___copy_user1, ___copy_user_exit
2018 .long ___copy_user2, ___copy_user_exit 2045 .long ___copy_user2, ___copy_user_exit
2019 .long ___clear_user1, ___clear_user_exit 2046 .long ___clear_user1, ___clear_user_exit
2047#endif
2020 .long ___strncpy_from_user1, ___strncpy_from_user_exit 2048 .long ___strncpy_from_user1, ___strncpy_from_user_exit
2021 .long ___strnlen_user1, ___strnlen_user_exit 2049 .long ___strnlen_user1, ___strnlen_user_exit
2022 .long ___get_user_asm_b1, ___get_user_asm_b_exit 2050 .long ___get_user_asm_b1, ___get_user_asm_b_exit
diff --git a/arch/sh/mm/Makefile_64 b/arch/sh/mm/Makefile_64
index cbd6aa33c5ac..0d92a8a3ac9a 100644
--- a/arch/sh/mm/Makefile_64
+++ b/arch/sh/mm/Makefile_64
@@ -2,10 +2,11 @@
2# Makefile for the Linux SuperH-specific parts of the memory manager. 2# Makefile for the Linux SuperH-specific parts of the memory manager.
3# 3#
4 4
5obj-y := init.o extable_64.o consistent.o 5obj-y := init.o consistent.o
6 6
7mmu-y := tlb-nommu.o pg-nommu.o 7mmu-y := tlb-nommu.o pg-nommu.o extable_32.o
8mmu-$(CONFIG_MMU) := fault_64.o ioremap_64.o tlbflush_64.o tlb-sh5.o 8mmu-$(CONFIG_MMU) := fault_64.o ioremap_64.o tlbflush_64.o tlb-sh5.o \
9 extable_64.o
9 10
10ifndef CONFIG_CACHE_OFF 11ifndef CONFIG_CACHE_OFF
11obj-y += cache-sh5.o 12obj-y += cache-sh5.o
diff --git a/arch/sh/mm/cache-sh5.c b/arch/sh/mm/cache-sh5.c
index 3877321fcede..9e277ec7d536 100644
--- a/arch/sh/mm/cache-sh5.c
+++ b/arch/sh/mm/cache-sh5.c
@@ -714,6 +714,7 @@ void flush_cache_sigtramp(unsigned long vaddr)
714 sh64_icache_inv_current_user_range(vaddr, end); 714 sh64_icache_inv_current_user_range(vaddr, end);
715} 715}
716 716
717#ifdef CONFIG_MMU
717/* 718/*
718 * These *MUST* lie in an area of virtual address space that's otherwise 719 * These *MUST* lie in an area of virtual address space that's otherwise
719 * unused. 720 * unused.
@@ -830,3 +831,4 @@ void clear_user_page(void *to, unsigned long address, struct page *page)
830 else 831 else
831 sh64_clear_user_page_coloured(to, address); 832 sh64_clear_user_page_coloured(to, address);
832} 833}
834#endif
diff --git a/include/asm-sh/io.h b/include/asm-sh/io.h
index 356e50d06745..a4fbf0c84fb1 100644
--- a/include/asm-sh/io.h
+++ b/include/asm-sh/io.h
@@ -268,11 +268,6 @@ unsigned long long peek_real_address_q(unsigned long long addr);
268unsigned long long poke_real_address_q(unsigned long long addr, 268unsigned long long poke_real_address_q(unsigned long long addr,
269 unsigned long long val); 269 unsigned long long val);
270 270
271/* arch/sh/mm/ioremap_64.c */
272unsigned long onchip_remap(unsigned long addr, unsigned long size,
273 const char *name);
274extern void onchip_unmap(unsigned long vaddr);
275
276#if !defined(CONFIG_MMU) 271#if !defined(CONFIG_MMU)
277#define virt_to_phys(address) ((unsigned long)(address)) 272#define virt_to_phys(address) ((unsigned long)(address))
278#define phys_to_virt(address) ((void *)(address)) 273#define phys_to_virt(address) ((void *)(address))
@@ -302,9 +297,16 @@ extern void onchip_unmap(unsigned long vaddr);
302void __iomem *__ioremap(unsigned long offset, unsigned long size, 297void __iomem *__ioremap(unsigned long offset, unsigned long size,
303 unsigned long flags); 298 unsigned long flags);
304void __iounmap(void __iomem *addr); 299void __iounmap(void __iomem *addr);
300
301/* arch/sh/mm/ioremap_64.c */
302unsigned long onchip_remap(unsigned long addr, unsigned long size,
303 const char *name);
304extern void onchip_unmap(unsigned long vaddr);
305#else 305#else
306#define __ioremap(offset, size, flags) ((void __iomem *)(offset)) 306#define __ioremap(offset, size, flags) ((void __iomem *)(offset))
307#define __iounmap(addr) do { } while (0) 307#define __iounmap(addr) do { } while (0)
308#define onchip_remap(addr, size, name) (addr)
309#define onchip_unmap(addr) do { } while (0)
308#endif /* CONFIG_MMU */ 310#endif /* CONFIG_MMU */
309 311
310static inline void __iomem * 312static inline void __iomem *
diff --git a/include/asm-sh/mmu_context.h b/include/asm-sh/mmu_context.h
index fe58d00b250c..87e812f68bb0 100644
--- a/include/asm-sh/mmu_context.h
+++ b/include/asm-sh/mmu_context.h
@@ -27,6 +27,7 @@
27/* ASID is 8-bit value, so it can't be 0x100 */ 27/* ASID is 8-bit value, so it can't be 0x100 */
28#define MMU_NO_ASID 0x100 28#define MMU_NO_ASID 0x100
29 29
30#ifdef CONFIG_MMU
30#define asid_cache(cpu) (cpu_data[cpu].asid_cache) 31#define asid_cache(cpu) (cpu_data[cpu].asid_cache)
31#define cpu_context(cpu, mm) ((mm)->context.id[cpu]) 32#define cpu_context(cpu, mm) ((mm)->context.id[cpu])
32 33
@@ -38,7 +39,6 @@
38 */ 39 */
39#define MMU_VPN_MASK 0xfffff000 40#define MMU_VPN_MASK 0xfffff000
40 41
41#ifdef CONFIG_MMU
42#if defined(CONFIG_SUPERH32) 42#if defined(CONFIG_SUPERH32)
43#include "mmu_context_32.h" 43#include "mmu_context_32.h"
44#else 44#else
@@ -129,6 +129,8 @@ static inline void switch_mm(struct mm_struct *prev,
129#define destroy_context(mm) do { } while (0) 129#define destroy_context(mm) do { } while (0)
130#define set_asid(asid) do { } while (0) 130#define set_asid(asid) do { } while (0)
131#define get_asid() (0) 131#define get_asid() (0)
132#define cpu_asid(cpu, mm) ({ (void)cpu; 0; })
133#define switch_and_save_asid(asid) (0)
132#define set_TTB(pgd) do { } while (0) 134#define set_TTB(pgd) do { } while (0)
133#define get_TTB() (0) 135#define get_TTB() (0)
134#define activate_context(mm,cpu) do { } while (0) 136#define activate_context(mm,cpu) do { } while (0)
diff --git a/include/asm-sh/tlb_64.h b/include/asm-sh/tlb_64.h
index 0308e05fc57b..0a96f3af69e3 100644
--- a/include/asm-sh/tlb_64.h
+++ b/include/asm-sh/tlb_64.h
@@ -56,6 +56,7 @@ static inline void __flush_tlb_slot(unsigned long long slot)
56 __asm__ __volatile__ ("putcfg %0, 0, r63\n" : : "r" (slot)); 56 __asm__ __volatile__ ("putcfg %0, 0, r63\n" : : "r" (slot));
57} 57}
58 58
59#ifdef CONFIG_MMU
59/* arch/sh64/mm/tlb.c */ 60/* arch/sh64/mm/tlb.c */
60int sh64_tlb_init(void); 61int sh64_tlb_init(void);
61unsigned long long sh64_next_free_dtlb_entry(void); 62unsigned long long sh64_next_free_dtlb_entry(void);
@@ -64,6 +65,13 @@ int sh64_put_wired_dtlb_entry(unsigned long long entry);
64void sh64_setup_tlb_slot(unsigned long long config_addr, unsigned long eaddr, 65void sh64_setup_tlb_slot(unsigned long long config_addr, unsigned long eaddr,
65 unsigned long asid, unsigned long paddr); 66 unsigned long asid, unsigned long paddr);
66void sh64_teardown_tlb_slot(unsigned long long config_addr); 67void sh64_teardown_tlb_slot(unsigned long long config_addr);
67 68#else
69#define sh64_tlb_init() do { } while (0)
70#define sh64_next_free_dtlb_entry() (0)
71#define sh64_get_wired_dtlb_entry() (0)
72#define sh64_put_wired_dtlb_entry(entry) do { } while (0)
73#define sh64_setup_tlb_slot(conf, virt, asid, phys) do { } while (0)
74#define sh64_teardown_tlb_slot(addr) do { } while (0)
75#endif /* CONFIG_MMU */
68#endif /* __ASSEMBLY__ */ 76#endif /* __ASSEMBLY__ */
69#endif /* __ASM_SH_TLB_64_H */ 77#endif /* __ASM_SH_TLB_64_H */
diff --git a/include/asm-sh/uaccess_64.h b/include/asm-sh/uaccess_64.h
index f956b7b316c7..a9b68d094844 100644
--- a/include/asm-sh/uaccess_64.h
+++ b/include/asm-sh/uaccess_64.h
@@ -274,7 +274,9 @@ struct exception_table_entry
274 unsigned long insn, fixup; 274 unsigned long insn, fixup;
275}; 275};
276 276
277#ifdef CONFIG_MMU
277#define ARCH_HAS_SEARCH_EXTABLE 278#define ARCH_HAS_SEARCH_EXTABLE
279#endif
278 280
279/* Returns 0 if exception not found and fixup.unit otherwise. */ 281/* Returns 0 if exception not found and fixup.unit otherwise. */
280extern unsigned long search_exception_table(unsigned long addr); 282extern unsigned long search_exception_table(unsigned long addr);