aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mn10300
diff options
context:
space:
mode:
authorAkira Takeuchi <takeuchi.akr@jp.panasonic.com>2010-10-27 12:28:48 -0400
committerDavid Howells <dhowells@redhat.com>2010-10-27 12:28:48 -0400
commit8f19e3daf3fffee9e18a8812067a6a4b538ae6c8 (patch)
tree854a50f4fae7f35688171cb20874cfddabda99a4 /arch/mn10300
parent633171861a3120af011bb1ee8dd40069951dfeac (diff)
MN10300: AM34 erratum requires MMUCTR read and write on exception entry
An AM34 erratum requires MMUCTR read and write on entry to certain exceptions, prior to EPSW.NMID being cleared to allow NMIs to happen. Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com> Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com> Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'arch/mn10300')
-rw-r--r--arch/mn10300/Kconfig3
-rw-r--r--arch/mn10300/kernel/entry.S8
-rw-r--r--arch/mn10300/mm/tlb-mn10300.S32
3 files changed, 37 insertions, 6 deletions
diff --git a/arch/mn10300/Kconfig b/arch/mn10300/Kconfig
index 21e2a534d98e..dd7b5700358b 100644
--- a/arch/mn10300/Kconfig
+++ b/arch/mn10300/Kconfig
@@ -20,6 +20,9 @@ config AM34_2
20 select MN10300_HAS_ATOMIC_OPS_UNIT 20 select MN10300_HAS_ATOMIC_OPS_UNIT
21 select MN10300_HAS_CACHE_SNOOP 21 select MN10300_HAS_CACHE_SNOOP
22 22
23config ERRATUM_NEED_TO_RELOAD_MMUCTR
24 def_bool y if AM33_3 || AM34_2
25
23config MMU 26config MMU
24 def_bool y 27 def_bool y
25 28
diff --git a/arch/mn10300/kernel/entry.S b/arch/mn10300/kernel/entry.S
index b82ce7b47fcb..355f68176771 100644
--- a/arch/mn10300/kernel/entry.S
+++ b/arch/mn10300/kernel/entry.S
@@ -251,6 +251,10 @@ double_fault_loop:
251ENTRY(raw_bus_error) 251ENTRY(raw_bus_error)
252 add -4,sp 252 add -4,sp
253 mov d0,(sp) 253 mov d0,(sp)
254#if defined(CONFIG_ERRATUM_NEED_TO_RELOAD_MMUCTR)
255 mov (MMUCTR),d0
256 mov d0,(MMUCTR)
257#endif
254 mov (BCBERR),d0 # what 258 mov (BCBERR),d0 # what
255 btst BCBERR_BEMR_DMA,d0 # see if it was an external bus error 259 btst BCBERR_BEMR_DMA,d0 # see if it was an external bus error
256 beq __common_exception_aux # it wasn't 260 beq __common_exception_aux # it wasn't
@@ -282,6 +286,10 @@ ENTRY(nmi_handler)
282ENTRY(__common_exception) 286ENTRY(__common_exception)
283 add -4,sp 287 add -4,sp
284 mov d0,(sp) 288 mov d0,(sp)
289#if defined(CONFIG_ERRATUM_NEED_TO_RELOAD_MMUCTR)
290 mov (MMUCTR),d0
291 mov d0,(MMUCTR)
292#endif
285 293
286__common_exception_aux: 294__common_exception_aux:
287 mov (TBR),d0 295 mov (TBR),d0
diff --git a/arch/mn10300/mm/tlb-mn10300.S b/arch/mn10300/mm/tlb-mn10300.S
index 7095147dcb8b..ccf622999a5b 100644
--- a/arch/mn10300/mm/tlb-mn10300.S
+++ b/arch/mn10300/mm/tlb-mn10300.S
@@ -27,7 +27,6 @@
27############################################################################### 27###############################################################################
28 .type itlb_miss,@function 28 .type itlb_miss,@function
29ENTRY(itlb_miss) 29ENTRY(itlb_miss)
30 and ~EPSW_NMID,epsw
31#ifdef CONFIG_GDBSTUB 30#ifdef CONFIG_GDBSTUB
32 movm [d2,d3,a2],(sp) 31 movm [d2,d3,a2],(sp)
33#else 32#else
@@ -38,6 +37,12 @@ ENTRY(itlb_miss)
38 nop 37 nop
39#endif 38#endif
40 39
40#if defined(CONFIG_ERRATUM_NEED_TO_RELOAD_MMUCTR)
41 mov (MMUCTR),d2
42 mov d2,(MMUCTR)
43#endif
44
45 and ~EPSW_NMID,epsw
41 mov (IPTEU),d3 46 mov (IPTEU),d3
42 mov (PTBR),a2 47 mov (PTBR),a2
43 mov d3,d2 48 mov d3,d2
@@ -79,7 +84,6 @@ itlb_miss_fault:
79############################################################################### 84###############################################################################
80 .type dtlb_miss,@function 85 .type dtlb_miss,@function
81ENTRY(dtlb_miss) 86ENTRY(dtlb_miss)
82 and ~EPSW_NMID,epsw
83#ifdef CONFIG_GDBSTUB 87#ifdef CONFIG_GDBSTUB
84 movm [d2,d3,a2],(sp) 88 movm [d2,d3,a2],(sp)
85#else 89#else
@@ -90,6 +94,12 @@ ENTRY(dtlb_miss)
90 nop 94 nop
91#endif 95#endif
92 96
97#if defined(CONFIG_ERRATUM_NEED_TO_RELOAD_MMUCTR)
98 mov (MMUCTR),d2
99 mov d2,(MMUCTR)
100#endif
101
102 and ~EPSW_NMID,epsw
93 mov (DPTEU),d3 103 mov (DPTEU),d3
94 mov (PTBR),a2 104 mov (PTBR),a2
95 mov d3,d2 105 mov d3,d2
@@ -130,9 +140,15 @@ dtlb_miss_fault:
130############################################################################### 140###############################################################################
131 .type itlb_aerror,@function 141 .type itlb_aerror,@function
132ENTRY(itlb_aerror) 142ENTRY(itlb_aerror)
133 and ~EPSW_NMID,epsw
134 add -4,sp 143 add -4,sp
135 SAVE_ALL 144 SAVE_ALL
145
146#if defined(CONFIG_ERRATUM_NEED_TO_RELOAD_MMUCTR)
147 mov (MMUCTR),d1
148 mov d1,(MMUCTR)
149#endif
150
151 and ~EPSW_NMID,epsw
136 add -4,sp # need to pass three params 152 add -4,sp # need to pass three params
137 153
138 # calculate the fault code 154 # calculate the fault code
@@ -148,7 +164,6 @@ ENTRY(itlb_aerror)
148 clr d0 164 clr d0
149 mov d0,(IPTEL) 165 mov d0,(IPTEL)
150 166
151 and ~EPSW_NMID,epsw
152 or EPSW_IE,epsw 167 or EPSW_IE,epsw
153 mov fp,d0 168 mov fp,d0
154 call do_page_fault[],0 # do_page_fault(regs,code,addr 169 call do_page_fault[],0 # do_page_fault(regs,code,addr
@@ -163,10 +178,16 @@ ENTRY(itlb_aerror)
163############################################################################### 178###############################################################################
164 .type dtlb_aerror,@function 179 .type dtlb_aerror,@function
165ENTRY(dtlb_aerror) 180ENTRY(dtlb_aerror)
166 and ~EPSW_NMID,epsw
167 add -4,sp 181 add -4,sp
168 SAVE_ALL 182 SAVE_ALL
183
184#if defined(CONFIG_ERRATUM_NEED_TO_RELOAD_MMUCTR)
185 mov (MMUCTR),d1
186 mov d1,(MMUCTR)
187#endif
188
169 add -4,sp # need to pass three params 189 add -4,sp # need to pass three params
190 and ~EPSW_NMID,epsw
170 191
171 # calculate the fault code 192 # calculate the fault code
172 movhu (MMUFCR_DFC),d1 193 movhu (MMUFCR_DFC),d1
@@ -180,7 +201,6 @@ ENTRY(dtlb_aerror)
180 clr d0 201 clr d0
181 mov d0,(DPTEL) 202 mov d0,(DPTEL)
182 203
183 and ~EPSW_NMID,epsw
184 or EPSW_IE,epsw 204 or EPSW_IE,epsw
185 mov fp,d0 205 mov fp,d0
186 call do_page_fault[],0 # do_page_fault(regs,code,addr 206 call do_page_fault[],0 # do_page_fault(regs,code,addr