aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-10-25 10:25:48 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-10-25 10:25:48 -0400
commit7670c7010c7b367ca40c3aba02afb36149764a6e (patch)
tree9f778e3bc3cb4270a60652c3a9731a5287954965
parent0110bba5e7731524940f9e02ce3d4aae75087f68 (diff)
parentdbcbf5885aa5a1ce6cbea72acbee100c0482be26 (diff)
Merge branch 'for-linus' of git://github.com/gregungerer/m68knommu
* 'for-linus' of git://github.com/gregungerer/m68knommu: m68k: drop unused Kconfig symbols m68k: drop unused Kconfig symbols m68knommu: create common externs for _ram* vars m68knommu: remove extern declarations of memory_start/memory_end from mm/init m68knommu: use generic section names in mm/init code m68knommu: use generic section names in setup code m68k: merge the mmu and non-mmu traps.c files m68k: move hardware vector setting from traps.c to its own file m68k: merge mmu and non-mmu include/asm/entry.h files m68k: merge the mmu and non-mmu kernel/Makefiles m68k: merge mmu and non-mmu arch Makefiles m68k: reorganize Kconfig options to improve mmu/non-mmu selections m68knommu: fix problems with SPI/GPIO on ColdFire 520x m68k: fix memcpy to unmatched/unaligned source and dest on 68000
-rw-r--r--arch/m68k/Kconfig195
-rw-r--r--arch/m68k/Kconfig.bus55
-rw-r--r--arch/m68k/Kconfig.cpu429
-rw-r--r--arch/m68k/Kconfig.devices123
-rw-r--r--arch/m68k/Kconfig.machine (renamed from arch/m68k/Kconfig.nommu)562
-rw-r--r--arch/m68k/Kconfig.mmu411
-rw-r--r--arch/m68k/Makefile168
-rw-r--r--arch/m68k/Makefile_mm121
-rw-r--r--arch/m68k/Makefile_no124
-rw-r--r--arch/m68k/include/asm/entry.h255
-rw-r--r--arch/m68k/include/asm/entry_mm.h128
-rw-r--r--arch/m68k/include/asm/entry_no.h181
-rw-r--r--arch/m68k/include/asm/m520xsim.h26
-rw-r--r--arch/m68k/include/asm/mcfqspi.h8
-rw-r--r--arch/m68k/include/asm/page_no.h3
-rw-r--r--arch/m68k/include/asm/processor.h6
-rw-r--r--arch/m68k/include/asm/sections.h2
-rw-r--r--arch/m68k/kernel/Makefile24
-rw-r--r--arch/m68k/kernel/Makefile_mm17
-rw-r--r--arch/m68k/kernel/Makefile_no10
-rw-r--r--arch/m68k/kernel/entry_no.S6
-rw-r--r--arch/m68k/kernel/setup_no.c4
-rw-r--r--arch/m68k/kernel/traps.c1108
-rw-r--r--arch/m68k/kernel/traps_mm.c1207
-rw-r--r--arch/m68k/kernel/traps_no.c361
-rw-r--r--arch/m68k/kernel/vectors.c145
-rw-r--r--arch/m68k/lib/memcpy.c9
-rw-r--r--arch/m68k/mm/init_no.c21
-rw-r--r--arch/m68k/platform/520x/config.c6
-rw-r--r--arch/m68k/platform/520x/gpio.c50
-rw-r--r--arch/m68k/platform/68328/Makefile5
-rw-r--r--arch/m68k/platform/68328/entry.S18
-rw-r--r--arch/m68k/platform/68360/Makefile6
-rw-r--r--arch/m68k/platform/68360/entry.S4
-rw-r--r--arch/m68k/platform/coldfire/entry.S6
35 files changed, 2596 insertions, 3208 deletions
diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig
index 9e8ee9d2b8ca..6c28582fb98f 100644
--- a/arch/m68k/Kconfig
+++ b/arch/m68k/Kconfig
@@ -21,6 +21,15 @@ config ARCH_HAS_ILOG2_U32
21config ARCH_HAS_ILOG2_U64 21config ARCH_HAS_ILOG2_U64
22 bool 22 bool
23 23
24config GENERIC_CLOCKEVENTS
25 bool
26
27config GENERIC_CMOS_UPDATE
28 def_bool !MMU
29
30config GENERIC_GPIO
31 bool
32
24config GENERIC_HWEIGHT 33config GENERIC_HWEIGHT
25 bool 34 bool
26 default y 35 default y
@@ -29,10 +38,16 @@ config GENERIC_CALIBRATE_DELAY
29 bool 38 bool
30 default y 39 default y
31 40
41config GENERIC_IOMAP
42 def_bool MMU
43
32config TIME_LOW_RES 44config TIME_LOW_RES
33 bool 45 bool
34 default y 46 default y
35 47
48config ARCH_USES_GETTIMEOFFSET
49 def_bool MMU
50
36config NO_IOPORT 51config NO_IOPORT
37 def_bool y 52 def_bool y
38 53
@@ -62,13 +77,31 @@ config MMU
62 Select if you want MMU-based virtualised addressing space 77 Select if you want MMU-based virtualised addressing space
63 support by paged memory management. If unsure, say 'Y'. 78 support by paged memory management. If unsure, say 'Y'.
64 79
65menu "Platform dependent setup" 80config MMU_MOTOROLA
81 bool
82
83config MMU_SUN3
84 bool
85 depends on MMU && !MMU_MOTOROLA
86
87menu "Platform setup"
88
89source arch/m68k/Kconfig.cpu
90
91source arch/m68k/Kconfig.machine
92
93source arch/m68k/Kconfig.bus
94
95endmenu
96
97menu "Kernel Features"
66 98
67if MMU 99if COLDFIRE
68source arch/m68k/Kconfig.mmu 100source "kernel/Kconfig.preempt"
69endif 101endif
70if !MMU 102
71source arch/m68k/Kconfig.nommu 103if !MMU || COLDFIRE
104source "kernel/time/Kconfig"
72endif 105endif
73 106
74source "mm/Kconfig" 107source "mm/Kconfig"
@@ -85,9 +118,9 @@ if !MMU
85menu "Power management options" 118menu "Power management options"
86 119
87config PM 120config PM
88 bool "Power Management support" 121 bool "Power Management support"
89 help 122 help
90 Support processor power management modes 123 Support processor power management modes
91 124
92endmenu 125endmenu
93endif 126endif
@@ -96,151 +129,7 @@ source "net/Kconfig"
96 129
97source "drivers/Kconfig" 130source "drivers/Kconfig"
98 131
99if MMU 132source "arch/m68k/Kconfig.devices"
100
101menu "Character devices"
102
103config ATARI_MFPSER
104 tristate "Atari MFP serial support"
105 depends on ATARI
106 ---help---
107 If you like to use the MFP serial ports ("Modem1", "Serial1") under
108 Linux, say Y. The driver equally supports all kinds of MFP serial
109 ports and automatically detects whether Serial1 is available.
110
111 To compile this driver as a module, choose M here.
112
113 Note for Falcon users: You also have an MFP port, it's just not
114 wired to the outside... But you could use the port under Linux.
115
116config ATARI_MIDI
117 tristate "Atari MIDI serial support"
118 depends on ATARI
119 help
120 If you want to use your Atari's MIDI port in Linux, say Y.
121
122 To compile this driver as a module, choose M here.
123
124config ATARI_DSP56K
125 tristate "Atari DSP56k support (EXPERIMENTAL)"
126 depends on ATARI && EXPERIMENTAL
127 help
128 If you want to be able to use the DSP56001 in Falcons, say Y. This
129 driver is still experimental, and if you don't know what it is, or
130 if you don't have this processor, just say N.
131
132 To compile this driver as a module, choose M here.
133
134config AMIGA_BUILTIN_SERIAL
135 tristate "Amiga builtin serial support"
136 depends on AMIGA
137 help
138 If you want to use your Amiga's built-in serial port in Linux,
139 answer Y.
140
141 To compile this driver as a module, choose M here.
142
143config MULTIFACE_III_TTY
144 tristate "Multiface Card III serial support"
145 depends on AMIGA
146 help
147 If you want to use a Multiface III card's serial port in Linux,
148 answer Y.
149
150 To compile this driver as a module, choose M here.
151
152config GVPIOEXT
153 tristate "GVP IO-Extender support"
154 depends on PARPORT=n && ZORRO
155 help
156 If you want to use a GVP IO-Extender serial card in Linux, say Y.
157 Otherwise, say N.
158
159config GVPIOEXT_LP
160 tristate "GVP IO-Extender parallel printer support"
161 depends on GVPIOEXT
162 help
163 Say Y to enable driving a printer from the parallel port on your
164 GVP IO-Extender card, N otherwise.
165
166config GVPIOEXT_PLIP
167 tristate "GVP IO-Extender PLIP support"
168 depends on GVPIOEXT
169 help
170 Say Y to enable doing IP over the parallel port on your GVP
171 IO-Extender card, N otherwise.
172
173config MAC_HID
174 bool
175 depends on INPUT_ADBHID
176 default y
177
178config HPDCA
179 tristate "HP DCA serial support"
180 depends on DIO && SERIAL_8250
181 help
182 If you want to use the internal "DCA" serial ports on an HP300
183 machine, say Y here.
184
185config HPAPCI
186 tristate "HP APCI serial support"
187 depends on HP300 && SERIAL_8250 && EXPERIMENTAL
188 help
189 If you want to use the internal "APCI" serial ports on an HP400
190 machine, say Y here.
191
192config MVME147_SCC
193 bool "SCC support for MVME147 serial ports"
194 depends on MVME147 && BROKEN
195 help
196 This is the driver for the serial ports on the Motorola MVME147
197 boards. Everyone using one of these boards should say Y here.
198
199config MVME162_SCC
200 bool "SCC support for MVME162 serial ports"
201 depends on MVME16x && BROKEN
202 help
203 This is the driver for the serial ports on the Motorola MVME162 and
204 172 boards. Everyone using one of these boards should say Y here.
205
206config BVME6000_SCC
207 bool "SCC support for BVME6000 serial ports"
208 depends on BVME6000 && BROKEN
209 help
210 This is the driver for the serial ports on the BVME4000 and BVME6000
211 boards from BVM Ltd. Everyone using one of these boards should say
212 Y here.
213
214config DN_SERIAL
215 bool "Support for DN serial port (dummy)"
216 depends on APOLLO
217
218config SERIAL_CONSOLE
219 bool "Support for serial port console"
220 depends on (AMIGA || ATARI || SUN3 || SUN3X || VME || APOLLO) && (ATARI_MFPSER=y || ATARI_MIDI=y || AMIGA_BUILTIN_SERIAL=y || GVPIOEXT=y || MULTIFACE_III_TTY=y || SERIAL=y || MVME147_SCC || SERIAL167 || MVME162_SCC || BVME6000_SCC || DN_SERIAL)
221 ---help---
222 If you say Y here, it will be possible to use a serial port as the
223 system console (the system console is the device which receives all
224 kernel messages and warnings and which allows logins in single user
225 mode). This could be useful if some terminal or printer is connected
226 to that serial port.
227
228 Even if you say Y here, the currently visible virtual console
229 (/dev/tty0) will still be used as the system console by default, but
230 you can alter that using a kernel command line option such as
231 "console=ttyS1". (Try "man bootparam" or see the documentation of
232 your boot loader (lilo or loadlin) about how to pass options to the
233 kernel at boot time.)
234
235 If you don't have a VGA card installed and you say Y here, the
236 kernel will automatically use the first serial line, /dev/ttyS0, as
237 system console.
238
239 If unsure, say N.
240
241endmenu
242
243endif
244 133
245source "fs/Kconfig" 134source "fs/Kconfig"
246 135
diff --git a/arch/m68k/Kconfig.bus b/arch/m68k/Kconfig.bus
new file mode 100644
index 000000000000..8294f0c1785e
--- /dev/null
+++ b/arch/m68k/Kconfig.bus
@@ -0,0 +1,55 @@
1if MMU
2
3comment "Bus Support"
4
5config NUBUS
6 bool
7 depends on MAC
8 default y
9
10config ZORRO
11 bool "Amiga Zorro (AutoConfig) bus support"
12 depends on AMIGA
13 help
14 This enables support for the Zorro bus in the Amiga. If you have
15 expansion cards in your Amiga that conform to the Amiga
16 AutoConfig(tm) specification, say Y, otherwise N. Note that even
17 expansion cards that do not fit in the Zorro slots but fit in e.g.
18 the CPU slot may fall in this category, so you have to say Y to let
19 Linux use these.
20
21config AMIGA_PCMCIA
22 bool "Amiga 1200/600 PCMCIA support (EXPERIMENTAL)"
23 depends on AMIGA && EXPERIMENTAL
24 help
25 Include support in the kernel for pcmcia on Amiga 1200 and Amiga
26 600. If you intend to use pcmcia cards say Y; otherwise say N.
27
28config ISA
29 bool
30 depends on Q40 || AMIGA_PCMCIA
31 default y
32 help
33 Find out whether you have ISA slots on your motherboard. ISA is the
34 name of a bus system, i.e. the way the CPU talks to the other stuff
35 inside your box. Other bus systems are PCI, EISA, MicroChannel
36 (MCA) or VESA. ISA is an older system, now being displaced by PCI;
37 newer boards don't support it. If you have ISA, say Y, otherwise N.
38
39config GENERIC_ISA_DMA
40 def_bool ISA
41
42source "drivers/pci/Kconfig"
43
44source "drivers/zorro/Kconfig"
45
46endif
47
48if !MMU
49
50config ISA_DMA_API
51 def_bool !M5272
52
53source "drivers/pcmcia/Kconfig"
54
55endif
diff --git a/arch/m68k/Kconfig.cpu b/arch/m68k/Kconfig.cpu
new file mode 100644
index 000000000000..e632b2d12106
--- /dev/null
+++ b/arch/m68k/Kconfig.cpu
@@ -0,0 +1,429 @@
1comment "Processor Type"
2
3config M68000
4 bool
5 select CPU_HAS_NO_BITFIELDS
6 help
7 The Freescale (was Motorola) 68000 CPU is the first generation of
8 the well known M68K family of processors. The CPU core as well as
9 being available as a stand alone CPU was also used in many
10 System-On-Chip devices (eg 68328, 68302, etc). It does not contain
11 a paging MMU.
12
13config MCPU32
14 bool
15 select CPU_HAS_NO_BITFIELDS
16 help
17 The Freescale (was then Motorola) CPU32 is a CPU core that is
18 based on the 68020 processor. For the most part it is used in
19 System-On-Chip parts, and does not contain a paging MMU.
20
21config COLDFIRE
22 bool
23 select GENERIC_GPIO
24 select ARCH_REQUIRE_GPIOLIB
25 select CPU_HAS_NO_BITFIELDS
26 help
27 The Freescale ColdFire family of processors is a modern derivitive
28 of the 68000 processor family. They are mainly targeted at embedded
29 applications, and are all System-On-Chip (SOC) devices, as opposed
30 to stand alone CPUs. They implement a subset of the original 68000
31 processor instruction set.
32
33config M68020
34 bool "68020 support"
35 depends on MMU
36 help
37 If you anticipate running this kernel on a computer with a MC68020
38 processor, say Y. Otherwise, say N. Note that the 68020 requires a
39 68851 MMU (Memory Management Unit) to run Linux/m68k, except on the
40 Sun 3, which provides its own version.
41
42config M68030
43 bool "68030 support"
44 depends on MMU && !MMU_SUN3
45 help
46 If you anticipate running this kernel on a computer with a MC68030
47 processor, say Y. Otherwise, say N. Note that a MC68EC030 will not
48 work, as it does not include an MMU (Memory Management Unit).
49
50config M68040
51 bool "68040 support"
52 depends on MMU && !MMU_SUN3
53 help
54 If you anticipate running this kernel on a computer with a MC68LC040
55 or MC68040 processor, say Y. Otherwise, say N. Note that an
56 MC68EC040 will not work, as it does not include an MMU (Memory
57 Management Unit).
58
59config M68060
60 bool "68060 support"
61 depends on MMU && !MMU_SUN3
62 help
63 If you anticipate running this kernel on a computer with a MC68060
64 processor, say Y. Otherwise, say N.
65
66config M68328
67 bool "MC68328"
68 depends on !MMU
69 select M68000
70 help
71 Motorola 68328 processor support.
72
73config M68EZ328
74 bool "MC68EZ328"
75 depends on !MMU
76 select M68000
77 help
78 Motorola 68EX328 processor support.
79
80config M68VZ328
81 bool "MC68VZ328"
82 depends on !MMU
83 select M68000
84 help
85 Motorola 68VZ328 processor support.
86
87config M68360
88 bool "MC68360"
89 depends on !MMU
90 select MCPU32
91 help
92 Motorola 68360 processor support.
93
94config M5206
95 bool "MCF5206"
96 depends on !MMU
97 select COLDFIRE
98 select COLDFIRE_SW_A7
99 select HAVE_MBAR
100 help
101 Motorola ColdFire 5206 processor support.
102
103config M5206e
104 bool "MCF5206e"
105 depends on !MMU
106 select COLDFIRE
107 select COLDFIRE_SW_A7
108 select HAVE_MBAR
109 help
110 Motorola ColdFire 5206e processor support.
111
112config M520x
113 bool "MCF520x"
114 depends on !MMU
115 select COLDFIRE
116 select GENERIC_CLOCKEVENTS
117 select HAVE_CACHE_SPLIT
118 help
119 Freescale Coldfire 5207/5208 processor support.
120
121config M523x
122 bool "MCF523x"
123 depends on !MMU
124 select COLDFIRE
125 select GENERIC_CLOCKEVENTS
126 select HAVE_CACHE_SPLIT
127 select HAVE_IPSBAR
128 help
129 Freescale Coldfire 5230/1/2/4/5 processor support
130
131config M5249
132 bool "MCF5249"
133 depends on !MMU
134 select COLDFIRE
135 select COLDFIRE_SW_A7
136 select HAVE_MBAR
137 help
138 Motorola ColdFire 5249 processor support.
139
140config M527x
141 bool
142
143config M5271
144 bool "MCF5271"
145 depends on !MMU
146 select COLDFIRE
147 select M527x
148 select HAVE_CACHE_SPLIT
149 select HAVE_IPSBAR
150 select GENERIC_CLOCKEVENTS
151 help
152 Freescale (Motorola) ColdFire 5270/5271 processor support.
153
154config M5272
155 bool "MCF5272"
156 depends on !MMU
157 select COLDFIRE
158 select COLDFIRE_SW_A7
159 select HAVE_MBAR
160 help
161 Motorola ColdFire 5272 processor support.
162
163config M5275
164 bool "MCF5275"
165 depends on !MMU
166 select COLDFIRE
167 select M527x
168 select HAVE_CACHE_SPLIT
169 select HAVE_IPSBAR
170 select GENERIC_CLOCKEVENTS
171 help
172 Freescale (Motorola) ColdFire 5274/5275 processor support.
173
174config M528x
175 bool "MCF528x"
176 depends on !MMU
177 select COLDFIRE
178 select GENERIC_CLOCKEVENTS
179 select HAVE_CACHE_SPLIT
180 select HAVE_IPSBAR
181 help
182 Motorola ColdFire 5280/5282 processor support.
183
184config M5307
185 bool "MCF5307"
186 depends on !MMU
187 select COLDFIRE
188 select COLDFIRE_SW_A7
189 select HAVE_CACHE_CB
190 select HAVE_MBAR
191 help
192 Motorola ColdFire 5307 processor support.
193
194config M532x
195 bool "MCF532x"
196 depends on !MMU
197 select COLDFIRE
198 select HAVE_CACHE_CB
199 help
200 Freescale (Motorola) ColdFire 532x processor support.
201
202config M5407
203 bool "MCF5407"
204 depends on !MMU
205 select COLDFIRE
206 select COLDFIRE_SW_A7
207 select HAVE_CACHE_CB
208 select HAVE_MBAR
209 help
210 Motorola ColdFire 5407 processor support.
211
212config M54xx
213 bool
214
215config M547x
216 bool "MCF547x"
217 depends on !MMU
218 select COLDFIRE
219 select M54xx
220 select HAVE_CACHE_CB
221 select HAVE_MBAR
222 help
223 Freescale ColdFire 5470/5471/5472/5473/5474/5475 processor support.
224
225config M548x
226 bool "MCF548x"
227 depends on !MMU
228 select COLDFIRE
229 select M54xx
230 select HAVE_CACHE_CB
231 select HAVE_MBAR
232 help
233 Freescale ColdFire 5480/5481/5482/5483/5484/5485 processor support.
234
235
236comment "Processor Specific Options"
237
238config M68KFPU_EMU
239 bool "Math emulation support (EXPERIMENTAL)"
240 depends on MMU
241 depends on EXPERIMENTAL
242 help
243 At some point in the future, this will cause floating-point math
244 instructions to be emulated by the kernel on machines that lack a
245 floating-point math coprocessor. Thrill-seekers and chronically
246 sleep-deprived psychotic hacker types can say Y now, everyone else
247 should probably wait a while.
248
249config M68KFPU_EMU_EXTRAPREC
250 bool "Math emulation extra precision"
251 depends on M68KFPU_EMU
252 help
253 The fpu uses normally a few bit more during calculations for
254 correct rounding, the emulator can (often) do the same but this
255 extra calculation can cost quite some time, so you can disable
256 it here. The emulator will then "only" calculate with a 64 bit
257 mantissa and round slightly incorrect, what is more than enough
258 for normal usage.
259
260config M68KFPU_EMU_ONLY
261 bool "Math emulation only kernel"
262 depends on M68KFPU_EMU
263 help
264 This option prevents any floating-point instructions from being
265 compiled into the kernel, thereby the kernel doesn't save any
266 floating point context anymore during task switches, so this
267 kernel will only be usable on machines without a floating-point
268 math coprocessor. This makes the kernel a bit faster as no tests
269 needs to be executed whether a floating-point instruction in the
270 kernel should be executed or not.
271
272config ADVANCED
273 bool "Advanced configuration options"
274 depends on MMU
275 ---help---
276 This gives you access to some advanced options for the CPU. The
277 defaults should be fine for most users, but these options may make
278 it possible for you to improve performance somewhat if you know what
279 you are doing.
280
281 Note that the answer to this question won't directly affect the
282 kernel: saying N will just cause the configurator to skip all
283 the questions about these options.
284
285 Most users should say N to this question.
286
287config RMW_INSNS
288 bool "Use read-modify-write instructions"
289 depends on ADVANCED
290 ---help---
291 This allows to use certain instructions that work with indivisible
292 read-modify-write bus cycles. While this is faster than the
293 workaround of disabling interrupts, it can conflict with DMA
294 ( = direct memory access) on many Amiga systems, and it is also said
295 to destabilize other machines. It is very likely that this will
296 cause serious problems on any Amiga or Atari Medusa if set. The only
297 configuration where it should work are 68030-based Ataris, where it
298 apparently improves performance. But you've been warned! Unless you
299 really know what you are doing, say N. Try Y only if you're quite
300 adventurous.
301
302config SINGLE_MEMORY_CHUNK
303 bool "Use one physical chunk of memory only" if ADVANCED && !SUN3
304 depends on MMU
305 default y if SUN3
306 select NEED_MULTIPLE_NODES
307 help
308 Ignore all but the first contiguous chunk of physical memory for VM
309 purposes. This will save a few bytes kernel size and may speed up
310 some operations. Say N if not sure.
311
312config ARCH_DISCONTIGMEM_ENABLE
313 def_bool MMU && !SINGLE_MEMORY_CHUNK
314
315config 060_WRITETHROUGH
316 bool "Use write-through caching for 68060 supervisor accesses"
317 depends on ADVANCED && M68060
318 ---help---
319 The 68060 generally uses copyback caching of recently accessed data.
320 Copyback caching means that memory writes will be held in an on-chip
321 cache and only written back to memory some time later. Saying Y
322 here will force supervisor (kernel) accesses to use writethrough
323 caching. Writethrough caching means that data is written to memory
324 straight away, so that cache and memory data always agree.
325 Writethrough caching is less efficient, but is needed for some
326 drivers on 68060 based systems where the 68060 bus snooping signal
327 is hardwired on. The 53c710 SCSI driver is known to suffer from
328 this problem.
329
330config M68K_L2_CACHE
331 bool
332 depends on MAC
333 default y
334
335config NODES_SHIFT
336 int
337 default "3"
338 depends on !SINGLE_MEMORY_CHUNK
339
340config FPU
341 bool
342
343config COLDFIRE_SW_A7
344 bool
345
346config HAVE_CACHE_SPLIT
347 bool
348
349config HAVE_CACHE_CB
350 bool
351
352config HAVE_MBAR
353 bool
354
355config HAVE_IPSBAR
356 bool
357
358config CLOCK_SET
359 bool "Enable setting the CPU clock frequency"
360 depends on COLDFIRE
361 default n
362 help
363 On some CPU's you do not need to know what the core CPU clock
364 frequency is. On these you can disable clock setting. On some
365 traditional 68K parts, and on all ColdFire parts you need to set
366 the appropriate CPU clock frequency. On these devices many of the
367 onboard peripherals derive their timing from the master CPU clock
368 frequency.
369
370config CLOCK_FREQ
371 int "Set the core clock frequency"
372 default "66666666"
373 depends on CLOCK_SET
374 help
375 Define the CPU clock frequency in use. This is the core clock
376 frequency, it may or may not be the same as the external clock
377 crystal fitted to your board. Some processors have an internal
378 PLL and can have their frequency programmed at run time, others
379 use internal dividers. In general the kernel won't setup a PLL
380 if it is fitted (there are some exceptions). This value will be
381 specific to the exact CPU that you are using.
382
383config OLDMASK
384 bool "Old mask 5307 (1H55J) silicon"
385 depends on M5307
386 help
387 Build support for the older revision ColdFire 5307 silicon.
388 Specifically this is the 1H55J mask revision.
389
390if HAVE_CACHE_SPLIT
391choice
392 prompt "Split Cache Configuration"
393 default CACHE_I
394
395config CACHE_I
396 bool "Instruction"
397 help
398 Use all of the ColdFire CPU cache memory as an instruction cache.
399
400config CACHE_D
401 bool "Data"
402 help
403 Use all of the ColdFire CPU cache memory as a data cache.
404
405config CACHE_BOTH
406 bool "Both"
407 help
408 Split the ColdFire CPU cache, and use half as an instruction cache
409 and half as a data cache.
410endchoice
411endif
412
413if HAVE_CACHE_CB
414choice
415 prompt "Data cache mode"
416 default CACHE_WRITETHRU
417
418config CACHE_WRITETHRU
419 bool "Write-through"
420 help
421 The ColdFire CPU cache is set into Write-through mode.
422
423config CACHE_COPYBACK
424 bool "Copy-back"
425 help
426 The ColdFire CPU cache is set into Copy-back mode.
427endchoice
428endif
429
diff --git a/arch/m68k/Kconfig.devices b/arch/m68k/Kconfig.devices
new file mode 100644
index 000000000000..d214034be6a6
--- /dev/null
+++ b/arch/m68k/Kconfig.devices
@@ -0,0 +1,123 @@
1if MMU
2
3config ARCH_MAY_HAVE_PC_FDC
4 bool
5 depends on BROKEN && (Q40 || SUN3X)
6 default y
7
8menu "Platform devices"
9
10config HEARTBEAT
11 bool "Use power LED as a heartbeat" if AMIGA || APOLLO || ATARI || MAC ||Q40
12 default y if !AMIGA && !APOLLO && !ATARI && !MAC && !Q40 && HP300
13 help
14 Use the power-on LED on your machine as a load meter. The exact
15 behavior is platform-dependent, but normally the flash frequency is
16 a hyperbolic function of the 5-minute load average.
17
18# We have a dedicated heartbeat LED. :-)
19config PROC_HARDWARE
20 bool "/proc/hardware support"
21 help
22 Say Y here to support the /proc/hardware file, which gives you
23 access to information about the machine you're running on,
24 including the model, CPU, MMU, clock speed, BogoMIPS rating,
25 and memory size.
26
27endmenu
28
29menu "Character devices"
30
31config ATARI_MFPSER
32 tristate "Atari MFP serial support"
33 depends on ATARI
34 ---help---
35 If you like to use the MFP serial ports ("Modem1", "Serial1") under
36 Linux, say Y. The driver equally supports all kinds of MFP serial
37 ports and automatically detects whether Serial1 is available.
38
39 To compile this driver as a module, choose M here.
40
41 Note for Falcon users: You also have an MFP port, it's just not
42 wired to the outside... But you could use the port under Linux.
43
44config ATARI_MIDI
45 tristate "Atari MIDI serial support"
46 depends on ATARI
47 help
48 If you want to use your Atari's MIDI port in Linux, say Y.
49
50 To compile this driver as a module, choose M here.
51
52config ATARI_DSP56K
53 tristate "Atari DSP56k support (EXPERIMENTAL)"
54 depends on ATARI && EXPERIMENTAL
55 help
56 If you want to be able to use the DSP56001 in Falcons, say Y. This
57 driver is still experimental, and if you don't know what it is, or
58 if you don't have this processor, just say N.
59
60 To compile this driver as a module, choose M here.
61
62config AMIGA_BUILTIN_SERIAL
63 tristate "Amiga builtin serial support"
64 depends on AMIGA
65 help
66 If you want to use your Amiga's built-in serial port in Linux,
67 answer Y.
68
69 To compile this driver as a module, choose M here.
70
71config MULTIFACE_III_TTY
72 tristate "Multiface Card III serial support"
73 depends on AMIGA
74 help
75 If you want to use a Multiface III card's serial port in Linux,
76 answer Y.
77
78 To compile this driver as a module, choose M here.
79
80config HPDCA
81 tristate "HP DCA serial support"
82 depends on DIO && SERIAL_8250
83 help
84 If you want to use the internal "DCA" serial ports on an HP300
85 machine, say Y here.
86
87config HPAPCI
88 tristate "HP APCI serial support"
89 depends on HP300 && SERIAL_8250 && EXPERIMENTAL
90 help
91 If you want to use the internal "APCI" serial ports on an HP400
92 machine, say Y here.
93
94config DN_SERIAL
95 bool "Support for DN serial port (dummy)"
96 depends on APOLLO
97
98config SERIAL_CONSOLE
99 bool "Support for serial port console"
100 depends on (AMIGA || ATARI || SUN3 || SUN3X || VME || APOLLO) && (ATARI_MFPSER=y || ATARI_MIDI=y || AMIGA_BUILTIN_SERIAL=y || MULTIFACE_III_TTY=y || SERIAL=y || SERIAL167 || DN_SERIAL)
101 ---help---
102 If you say Y here, it will be possible to use a serial port as the
103 system console (the system console is the device which receives all
104 kernel messages and warnings and which allows logins in single user
105 mode). This could be useful if some terminal or printer is connected
106 to that serial port.
107
108 Even if you say Y here, the currently visible virtual console
109 (/dev/tty0) will still be used as the system console by default, but
110 you can alter that using a kernel command line option such as
111 "console=ttyS1". (Try "man bootparam" or see the documentation of
112 your boot loader (lilo or loadlin) about how to pass options to the
113 kernel at boot time.)
114
115 If you don't have a VGA card installed and you say Y here, the
116 kernel will automatically use the first serial line, /dev/ttyS0, as
117 system console.
118
119 If unsure, say N.
120
121endmenu
122
123endif
diff --git a/arch/m68k/Kconfig.nommu b/arch/m68k/Kconfig.machine
index ff46383112a4..ef4a26aff780 100644
--- a/arch/m68k/Kconfig.nommu
+++ b/arch/m68k/Kconfig.machine
@@ -1,297 +1,142 @@
1config FPU 1comment "Machine Types"
2 bool 2
3 default n 3config AMIGA
4 4 bool "Amiga support"
5config GENERIC_GPIO 5 depends on MMU
6 bool 6 select MMU_MOTOROLA if MMU
7 default n 7 help
8 8 This option enables support for the Amiga series of computers. If
9config GENERIC_CMOS_UPDATE 9 you plan to use this kernel on an Amiga, say Y here and browse the
10 bool 10 material available in <file:Documentation/m68k>; otherwise say N.
11 default y 11
12 12config ATARI
13config GENERIC_CLOCKEVENTS 13 bool "Atari support"
14 bool 14 depends on MMU
15 default n 15 select MMU_MOTOROLA if MMU
16 16 help
17config M68000 17 This option enables support for the 68000-based Atari series of
18 bool 18 computers (including the TT, Falcon and Medusa). If you plan to use
19 select CPU_HAS_NO_BITFIELDS 19 this kernel on an Atari, say Y here and browse the material
20 help 20 available in <file:Documentation/m68k>; otherwise say N.
21 The Freescale (was Motorola) 68000 CPU is the first generation of 21
22 the well known M68K family of processors. The CPU core as well as 22config MAC
23 being available as a stand alone CPU was also used in many 23 bool "Macintosh support"
24 System-On-Chip devices (eg 68328, 68302, etc). It does not contain 24 depends on MMU
25 a paging MMU. 25 select MMU_MOTOROLA if MMU
26 26 help
27config MCPU32 27 This option enables support for the Apple Macintosh series of
28 bool 28 computers (yes, there is experimental support now, at least for part
29 select CPU_HAS_NO_BITFIELDS 29 of the series).
30 help 30
31 The Freescale (was then Motorola) CPU32 is a CPU core that is 31 Say N unless you're willing to code the remaining necessary support.
32 based on the 68020 processor. For the most part it is used in 32 ;)
33 System-On-Chip parts, and does not contain a paging MMU. 33
34 34config APOLLO
35config COLDFIRE 35 bool "Apollo support"
36 bool 36 depends on MMU
37 select GENERIC_GPIO 37 select MMU_MOTOROLA if MMU
38 select ARCH_REQUIRE_GPIOLIB 38 help
39 select CPU_HAS_NO_BITFIELDS 39 Say Y here if you want to run Linux on an MC680x0-based Apollo
40 help 40 Domain workstation such as the DN3500.
41 The Freescale ColdFire family of processors is a modern derivitive 41
42 of the 68000 processor family. They are mainly targeted at embedded 42config VME
43 applications, and are all System-On-Chip (SOC) devices, as opposed 43 bool "VME (Motorola and BVM) support"
44 to stand alone CPUs. They implement a subset of the original 68000 44 depends on MMU
45 processor instruction set. 45 select MMU_MOTOROLA if MMU
46 46 help
47config COLDFIRE_SW_A7 47 Say Y here if you want to build a kernel for a 680x0 based VME
48 bool 48 board. Boards currently supported include Motorola boards MVME147,
49 default n 49 MVME162, MVME166, MVME167, MVME172, and MVME177. BVME4000 and
50 50 BVME6000 boards from BVM Ltd are also supported.
51config HAVE_CACHE_SPLIT 51
52 bool 52config MVME147
53 53 bool "MVME147 support"
54config HAVE_CACHE_CB 54 depends on MMU
55 bool 55 depends on VME
56 56 help
57config HAVE_MBAR 57 Say Y to include support for early Motorola VME boards. This will
58 bool 58 build a kernel which can run on MVME147 single-board computers. If
59 59 you select this option you will have to select the appropriate
60config HAVE_IPSBAR 60 drivers for SCSI, Ethernet and serial ports later on.
61 bool 61
62 62config MVME16x
63choice 63 bool "MVME162, 166 and 167 support"
64 prompt "CPU" 64 depends on MMU
65 default M68EZ328 65 depends on VME
66 66 help
67config M68328 67 Say Y to include support for Motorola VME boards. This will build a
68 bool "MC68328" 68 kernel which can run on MVME162, MVME166, MVME167, MVME172, and
69 select M68000 69 MVME177 boards. If you select this option you will have to select
70 help 70 the appropriate drivers for SCSI, Ethernet and serial ports later
71 Motorola 68328 processor support. 71 on.
72 72
73config M68EZ328 73config BVME6000
74 bool "MC68EZ328" 74 bool "BVME4000 and BVME6000 support"
75 select M68000 75 depends on MMU
76 help 76 depends on VME
77 Motorola 68EX328 processor support. 77 help
78 78 Say Y to include support for VME boards from BVM Ltd. This will
79config M68VZ328 79 build a kernel which can run on BVME4000 and BVME6000 boards. If
80 bool "MC68VZ328" 80 you select this option you will have to select the appropriate
81 select M68000 81 drivers for SCSI, Ethernet and serial ports later on.
82 help 82
83 Motorola 68VZ328 processor support. 83config HP300
84 84 bool "HP9000/300 and HP9000/400 support"
85config M68360 85 depends on MMU
86 bool "MC68360" 86 select MMU_MOTOROLA if MMU
87 select MCPU32 87 help
88 help 88 This option enables support for the HP9000/300 and HP9000/400 series
89 Motorola 68360 processor support. 89 of workstations. Support for these machines is still somewhat
90 90 experimental. If you plan to try to use the kernel on such a machine
91config M5206 91 say Y here.
92 bool "MCF5206" 92 Everybody else says N.
93 select COLDFIRE 93
94 select COLDFIRE_SW_A7 94config SUN3X
95 select HAVE_MBAR 95 bool "Sun3x support"
96 help 96 depends on MMU
97 Motorola ColdFire 5206 processor support. 97 select MMU_MOTOROLA if MMU
98 select M68030
99 help
100 This option enables support for the Sun 3x series of workstations.
101 Be warned that this support is very experimental.
102 Note that Sun 3x kernels are not compatible with Sun 3 hardware.
103 General Linux information on the Sun 3x series (now discontinued)
104 is at <http://www.angelfire.com/ca2/tech68k/sun3.html>.
105
106 If you don't want to compile a kernel for a Sun 3x, say N.
107
108config Q40
109 bool "Q40/Q60 support"
110 depends on MMU
111 select MMU_MOTOROLA if MMU
112 help
113 The Q40 is a Motorola 68040-based successor to the Sinclair QL
114 manufactured in Germany. There is an official Q40 home page at
115 <http://www.q40.de/>. This option enables support for the Q40 and
116 Q60. Select your CPU below. For 68LC060 don't forget to enable FPU
117 emulation.
118
119config SUN3
120 bool "Sun3 support"
121 depends on MMU
122 depends on !MMU_MOTOROLA
123 select MMU_SUN3 if MMU
124 select M68020
125 help
126 This option enables support for the Sun 3 series of workstations
127 (3/50, 3/60, 3/1xx, 3/2xx systems). Enabling this option requires
128 that all other hardware types must be disabled, as Sun 3 kernels
129 are incompatible with all other m68k targets (including Sun 3x!).
130
131 If you don't want to compile a kernel exclusively for a Sun 3, say N.
98 132
99config M5206e 133config PILOT
100 bool "MCF5206e"
101 select COLDFIRE
102 select COLDFIRE_SW_A7
103 select HAVE_MBAR
104 help
105 Motorola ColdFire 5206e processor support.
106
107config M520x
108 bool "MCF520x"
109 select COLDFIRE
110 select GENERIC_CLOCKEVENTS
111 select HAVE_CACHE_SPLIT
112 help
113 Freescale Coldfire 5207/5208 processor support.
114
115config M523x
116 bool "MCF523x"
117 select COLDFIRE
118 select GENERIC_CLOCKEVENTS
119 select HAVE_CACHE_SPLIT
120 select HAVE_IPSBAR
121 help
122 Freescale Coldfire 5230/1/2/4/5 processor support
123
124config M5249
125 bool "MCF5249"
126 select COLDFIRE
127 select COLDFIRE_SW_A7
128 select HAVE_MBAR
129 help
130 Motorola ColdFire 5249 processor support.
131
132config M5271
133 bool "MCF5271"
134 select COLDFIRE
135 select HAVE_CACHE_SPLIT
136 select HAVE_IPSBAR
137 help
138 Freescale (Motorola) ColdFire 5270/5271 processor support.
139
140config M5272
141 bool "MCF5272"
142 select COLDFIRE
143 select COLDFIRE_SW_A7
144 select HAVE_MBAR
145 help
146 Motorola ColdFire 5272 processor support.
147
148config M5275
149 bool "MCF5275"
150 select COLDFIRE
151 select HAVE_CACHE_SPLIT
152 select HAVE_IPSBAR
153 help
154 Freescale (Motorola) ColdFire 5274/5275 processor support.
155
156config M528x
157 bool "MCF528x"
158 select COLDFIRE
159 select GENERIC_CLOCKEVENTS
160 select HAVE_CACHE_SPLIT
161 select HAVE_IPSBAR
162 help
163 Motorola ColdFire 5280/5282 processor support.
164
165config M5307
166 bool "MCF5307"
167 select COLDFIRE
168 select COLDFIRE_SW_A7
169 select HAVE_CACHE_CB
170 select HAVE_MBAR
171 help
172 Motorola ColdFire 5307 processor support.
173
174config M532x
175 bool "MCF532x"
176 select COLDFIRE
177 select HAVE_CACHE_CB
178 help
179 Freescale (Motorola) ColdFire 532x processor support.
180
181config M5407
182 bool "MCF5407"
183 select COLDFIRE
184 select COLDFIRE_SW_A7
185 select HAVE_CACHE_CB
186 select HAVE_MBAR
187 help
188 Motorola ColdFire 5407 processor support.
189
190config M547x
191 bool "MCF547x"
192 select COLDFIRE
193 select HAVE_CACHE_CB
194 select HAVE_MBAR
195 help
196 Freescale ColdFire 5470/5471/5472/5473/5474/5475 processor support.
197
198config M548x
199 bool "MCF548x"
200 select COLDFIRE
201 select HAVE_CACHE_CB
202 select HAVE_MBAR
203 help
204 Freescale ColdFire 5480/5481/5482/5483/5484/5485 processor support.
205
206endchoice
207
208config M527x
209 bool
210 depends on (M5271 || M5275)
211 select GENERIC_CLOCKEVENTS
212 default y
213
214config M54xx
215 bool 134 bool
216 depends on (M548x || M547x)
217 default y
218
219config CLOCK_SET
220 bool "Enable setting the CPU clock frequency"
221 default n
222 help
223 On some CPU's you do not need to know what the core CPU clock
224 frequency is. On these you can disable clock setting. On some
225 traditional 68K parts, and on all ColdFire parts you need to set
226 the appropriate CPU clock frequency. On these devices many of the
227 onboard peripherals derive their timing from the master CPU clock
228 frequency.
229
230config CLOCK_FREQ
231 int "Set the core clock frequency"
232 default "66666666"
233 depends on CLOCK_SET
234 help
235 Define the CPU clock frequency in use. This is the core clock
236 frequency, it may or may not be the same as the external clock
237 crystal fitted to your board. Some processors have an internal
238 PLL and can have their frequency programmed at run time, others
239 use internal dividers. In general the kernel won't setup a PLL
240 if it is fitted (there are some exceptions). This value will be
241 specific to the exact CPU that you are using.
242
243config OLDMASK
244 bool "Old mask 5307 (1H55J) silicon"
245 depends on M5307
246 help
247 Build support for the older revision ColdFire 5307 silicon.
248 Specifically this is the 1H55J mask revision.
249
250if HAVE_CACHE_SPLIT
251choice
252 prompt "Split Cache Configuration"
253 default CACHE_I
254
255config CACHE_I
256 bool "Instruction"
257 help
258 Use all of the ColdFire CPU cache memory as an instruction cache.
259
260config CACHE_D
261 bool "Data"
262 help
263 Use all of the ColdFire CPU cache memory as a data cache.
264
265config CACHE_BOTH
266 bool "Both"
267 help
268 Split the ColdFire CPU cache, and use half as an instruction cache
269 and half as a data cache.
270endchoice
271endif
272
273if HAVE_CACHE_CB
274choice
275 prompt "Data cache mode"
276 default CACHE_WRITETHRU
277
278config CACHE_WRITETHRU
279 bool "Write-through"
280 help
281 The ColdFire CPU cache is set into Write-through mode.
282
283config CACHE_COPYBACK
284 bool "Copy-back"
285 help
286 The ColdFire CPU cache is set into Copy-back mode.
287endchoice
288endif
289
290comment "Platform"
291 135
292config PILOT3 136config PILOT3
293 bool "Pilot 1000/5000, PalmPilot Personal/Pro, or PalmIII support" 137 bool "Pilot 1000/5000, PalmPilot Personal/Pro, or PalmIII support"
294 depends on M68328 138 depends on M68328
139 select PILOT
295 help 140 help
296 Support for the Palm Pilot 1000/5000, Personal/Pro and PalmIII. 141 Support for the Palm Pilot 1000/5000, Personal/Pro and PalmIII.
297 142
@@ -302,7 +147,7 @@ config XCOPILOT_BUGS
302 Support the bugs of Xcopilot. 147 Support the bugs of Xcopilot.
303 148
304config UC5272 149config UC5272
305 bool 'Arcturus Networks uC5272 dimm board support' 150 bool "Arcturus Networks uC5272 dimm board support"
306 depends on M5272 151 depends on M5272
307 help 152 help
308 Support for the Arcturus Networks uC5272 dimm board. 153 Support for the Arcturus Networks uC5272 dimm board.
@@ -356,15 +201,23 @@ config UCQUICC
356 help 201 help
357 Support for the Lineo uCquicc board. 202 Support for the Lineo uCquicc board.
358 203
204config ARNEWSH
205 bool
206
359config ARN5206 207config ARN5206
360 bool "Arnewsh 5206 board support" 208 bool "Arnewsh 5206 board support"
361 depends on M5206 209 depends on M5206
210 select ARNEWSH
362 help 211 help
363 Support for the Arnewsh 5206 board. 212 Support for the Arnewsh 5206 board.
364 213
214config FREESCALE
215 bool
216
365config M5206eC3 217config M5206eC3
366 bool "Motorola M5206eC3 board support" 218 bool "Motorola M5206eC3 board support"
367 depends on M5206e 219 depends on M5206e
220 select FREESCALE
368 help 221 help
369 Support for the Motorola M5206eC3 board. 222 Support for the Motorola M5206eC3 board.
370 223
@@ -377,75 +230,92 @@ config ELITE
377config M5208EVB 230config M5208EVB
378 bool "Freescale M5208EVB board support" 231 bool "Freescale M5208EVB board support"
379 depends on M520x 232 depends on M520x
233 select FREESCALE
380 help 234 help
381 Support for the Freescale Coldfire M5208EVB. 235 Support for the Freescale Coldfire M5208EVB.
382 236
383config M5235EVB 237config M5235EVB
384 bool "Freescale M5235EVB support" 238 bool "Freescale M5235EVB support"
385 depends on M523x 239 depends on M523x
240 select FREESCALE
386 help 241 help
387 Support for the Freescale M5235EVB board. 242 Support for the Freescale M5235EVB board.
388 243
389config M5249C3 244config M5249C3
390 bool "Motorola M5249C3 board support" 245 bool "Motorola M5249C3 board support"
391 depends on M5249 246 depends on M5249
247 select FREESCALE
392 help 248 help
393 Support for the Motorola M5249C3 board. 249 Support for the Motorola M5249C3 board.
394 250
395config M5271EVB 251config M5271EVB
396 bool "Freescale (Motorola) M5271EVB board support" 252 bool "Freescale (Motorola) M5271EVB board support"
397 depends on M5271 253 depends on M5271
254 select FREESCALE
398 help 255 help
399 Support for the Freescale (Motorola) M5271EVB board. 256 Support for the Freescale (Motorola) M5271EVB board.
400 257
401config M5275EVB 258config M5275EVB
402 bool "Freescale (Motorola) M5275EVB board support" 259 bool "Freescale (Motorola) M5275EVB board support"
403 depends on M5275 260 depends on M5275
261 select FREESCALE
404 help 262 help
405 Support for the Freescale (Motorola) M5275EVB board. 263 Support for the Freescale (Motorola) M5275EVB board.
406 264
407config M5272C3 265config M5272C3
408 bool "Motorola M5272C3 board support" 266 bool "Motorola M5272C3 board support"
409 depends on M5272 267 depends on M5272
268 select FREESCALE
410 help 269 help
411 Support for the Motorola M5272C3 board. 270 Support for the Motorola M5272C3 board.
412 271
272config senTec
273 bool
274
413config COBRA5272 275config COBRA5272
414 bool "senTec COBRA5272 board support" 276 bool "senTec COBRA5272 board support"
415 depends on M5272 277 depends on M5272
278 select senTec
416 help 279 help
417 Support for the senTec COBRA5272 board. 280 Support for the senTec COBRA5272 board.
418 281
282config AVNET
283 bool
284
419config AVNET5282 285config AVNET5282
420 bool "Avnet 5282 board support" 286 bool "Avnet 5282 board support"
421 depends on M528x 287 depends on M528x
288 select AVNET
422 help 289 help
423 Support for the Avnet 5282 board. 290 Support for the Avnet 5282 board.
424 291
425config M5282EVB 292config M5282EVB
426 bool "Motorola M5282EVB board support" 293 bool "Motorola M5282EVB board support"
427 depends on M528x 294 depends on M528x
295 select FREESCALE
428 help 296 help
429 Support for the Motorola M5282EVB board. 297 Support for the Motorola M5282EVB board.
430 298
431config COBRA5282 299config COBRA5282
432 bool "senTec COBRA5282 board support" 300 bool "senTec COBRA5282 board support"
433 depends on M528x 301 depends on M528x
302 select senTec
434 help 303 help
435 Support for the senTec COBRA5282 board. 304 Support for the senTec COBRA5282 board.
436 305
437config SOM5282EM 306config SOM5282EM
438 bool "EMAC.Inc SOM5282EM board support" 307 bool "EMAC.Inc SOM5282EM board support"
439 depends on M528x 308 depends on M528x
309 select EMAC_INC
440 help 310 help
441 Support for the EMAC.Inc SOM5282EM module. 311 Support for the EMAC.Inc SOM5282EM module.
442 312
443config WILDFIRE 313config WILDFIRE
444 bool "Intec Automation Inc. WildFire board support" 314 bool "Intec Automation Inc. WildFire board support"
445 depends on M528x 315 depends on M528x
446 help 316 help
447 Support for the Intec Automation Inc. WildFire. 317 Support for the Intec Automation Inc. WildFire.
448 318
449config WILDFIREMOD 319config WILDFIREMOD
450 bool "Intec Automation Inc. WildFire module support" 320 bool "Intec Automation Inc. WildFire module support"
451 depends on M528x 321 depends on M528x
@@ -455,12 +325,14 @@ config WILDFIREMOD
455config ARN5307 325config ARN5307
456 bool "Arnewsh 5307 board support" 326 bool "Arnewsh 5307 board support"
457 depends on M5307 327 depends on M5307
328 select ARNEWSH
458 help 329 help
459 Support for the Arnewsh 5307 board. 330 Support for the Arnewsh 5307 board.
460 331
461config M5307C3 332config M5307C3
462 bool "Motorola M5307C3 board support" 333 bool "Motorola M5307C3 board support"
463 depends on M5307 334 depends on M5307
335 select FREESCALE
464 help 336 help
465 Support for the Motorola M5307C3 board. 337 Support for the Motorola M5307C3 board.
466 338
@@ -473,6 +345,7 @@ config SECUREEDGEMP3
473config M5329EVB 345config M5329EVB
474 bool "Freescale (Motorola) M5329EVB board support" 346 bool "Freescale (Motorola) M5329EVB board support"
475 depends on M532x 347 depends on M532x
348 select FREESCALE
476 help 349 help
477 Support for the Freescale (Motorola) M5329EVB board. 350 Support for the Freescale (Motorola) M5329EVB board.
478 351
@@ -485,6 +358,7 @@ config COBRA5329
485config M5407C3 358config M5407C3
486 bool "Motorola M5407C3 board support" 359 bool "Motorola M5407C3 board support"
487 depends on M5407 360 depends on M5407
361 select FREESCALE
488 help 362 help
489 Support for the Motorola M5407C3 board. 363 Support for the Motorola M5407C3 board.
490 364
@@ -524,9 +398,13 @@ config SNAPGEAR
524 help 398 help
525 Special additional support for SnapGear router boards. 399 Special additional support for SnapGear router boards.
526 400
401config SNEHA
402 bool
403
527config CPU16B 404config CPU16B
528 bool "Sneha Technologies S.L. Sarasvati board support" 405 bool "Sneha Technologies S.L. Sarasvati board support"
529 depends on M5272 406 depends on M5272
407 select SNEHA
530 help 408 help
531 Support for the SNEHA CPU16B board. 409 Support for the SNEHA CPU16B board.
532 410
@@ -536,63 +414,20 @@ config MOD5272
536 help 414 help
537 Support for the Netburner MOD-5272 board. 415 Support for the Netburner MOD-5272 board.
538 416
417config SAVANT
418 bool
419
539config SAVANTrosie1 420config SAVANTrosie1
540 bool "Savant Rosie1 board support" 421 bool "Savant Rosie1 board support"
541 depends on M523x 422 depends on M523x
423 select SAVANT
542 help 424 help
543 Support for the Savant Rosie1 board. 425 Support for the Savant Rosie1 board.
544 426
545config ROMFS_FROM_ROM
546 bool "ROMFS image not RAM resident"
547 depends on (NETtel || SNAPGEAR)
548 help
549 The ROMfs filesystem will stay resident in the FLASH/ROM, not be
550 moved into RAM.
551
552config PILOT
553 bool
554 default y
555 depends on (PILOT3 || PILOT5)
556
557config ARNEWSH
558 bool
559 default y
560 depends on (ARN5206 || ARN5307)
561
562config FREESCALE
563 bool
564 default y
565 depends on (M5206eC3 || M5208EVB || M5235EVB || M5249C3 || M5271EVB || M5272C3 || M5275EVB || M5282EVB || M5307C3 || M5329EVB || M5407C3)
566
567config HW_FEITH
568 bool
569 default y
570 depends on (CLEOPATRA || CANCam || SCALES)
571
572config senTec
573 bool
574 default y
575 depends on (COBRA5272 || COBRA5282)
576
577config EMAC_INC
578 bool
579 default y
580 depends on (SOM5282EM)
581 427
582config SNEHA 428if !MMU || COLDFIRE
583 bool
584 default y
585 depends on CPU16B
586 429
587config SAVANT 430comment "Machine Options"
588 bool
589 default y
590 depends on SAVANTrosie1
591
592config AVNET
593 bool
594 default y
595 depends on (AVNET5282)
596 431
597config UBOOT 432config UBOOT
598 bool "Support for U-Boot command line parameters" 433 bool "Support for U-Boot command line parameters"
@@ -673,33 +508,6 @@ config KERNELBASE
673 a system with the RAM based at address 0, and leaving enough room 508 a system with the RAM based at address 0, and leaving enough room
674 for the theoretical maximum number of 256 vectors. 509 for the theoretical maximum number of 256 vectors.
675 510
676choice
677 prompt "RAM bus width"
678 default RAMAUTOBIT
679
680config RAMAUTOBIT
681 bool "AUTO"
682 help
683 Select the physical RAM data bus size. Not needed on most platforms,
684 so you can generally choose AUTO.
685
686config RAM8BIT
687 bool "8bit"
688 help
689 Configure RAM bus to be 8 bits wide.
690
691config RAM16BIT
692 bool "16bit"
693 help
694 Configure RAM bus to be 16 bits wide.
695
696config RAM32BIT
697 bool "32bit"
698 help
699 Configure RAM bus to be 32 bits wide.
700
701endchoice
702
703comment "ROM configuration" 511comment "ROM configuration"
704 512
705config ROM 513config ROM
@@ -772,16 +580,4 @@ config ROMKERNEL
772 580
773endchoice 581endchoice
774 582
775if COLDFIRE
776source "kernel/Kconfig.preempt"
777endif 583endif
778
779source "kernel/time/Kconfig"
780
781config ISA_DMA_API
782 bool
783 depends on !M5272
784 default y
785
786source "drivers/pcmcia/Kconfig"
787
diff --git a/arch/m68k/Kconfig.mmu b/arch/m68k/Kconfig.mmu
deleted file mode 100644
index 13e20bbc4079..000000000000
--- a/arch/m68k/Kconfig.mmu
+++ /dev/null
@@ -1,411 +0,0 @@
1config GENERIC_IOMAP
2 bool
3 default y
4
5config ARCH_MAY_HAVE_PC_FDC
6 bool
7 depends on BROKEN && (Q40 || SUN3X)
8 default y
9
10config ARCH_USES_GETTIMEOFFSET
11 def_bool y
12
13config EISA
14 bool
15 ---help---
16 The Extended Industry Standard Architecture (EISA) bus was
17 developed as an open alternative to the IBM MicroChannel bus.
18
19 The EISA bus provided some of the features of the IBM MicroChannel
20 bus while maintaining backward compatibility with cards made for
21 the older ISA bus. The EISA bus saw limited use between 1988 and
22 1995 when it was made obsolete by the PCI bus.
23
24 Say Y here if you are building a kernel for an EISA-based machine.
25
26 Otherwise, say N.
27
28config MCA
29 bool
30 help
31 MicroChannel Architecture is found in some IBM PS/2 machines and
32 laptops. It is a bus system similar to PCI or ISA. See
33 <file:Documentation/mca.txt> (and especially the web page given
34 there) before attempting to build an MCA bus kernel.
35
36config PCMCIA
37 tristate
38 ---help---
39 Say Y here if you want to attach PCMCIA- or PC-cards to your Linux
40 computer. These are credit-card size devices such as network cards,
41 modems or hard drives often used with laptops computers. There are
42 actually two varieties of these cards: the older 16 bit PCMCIA cards
43 and the newer 32 bit CardBus cards. If you want to use CardBus
44 cards, you need to say Y here and also to "CardBus support" below.
45
46 To use your PC-cards, you will need supporting software from David
47 Hinds' pcmcia-cs package (see the file <file:Documentation/Changes>
48 for location). Please also read the PCMCIA-HOWTO, available from
49 <http://www.tldp.org/docs.html#howto>.
50
51 To compile this driver as modules, choose M here: the
52 modules will be called pcmcia_core and ds.
53
54config AMIGA
55 bool "Amiga support"
56 select MMU_MOTOROLA if MMU
57 help
58 This option enables support for the Amiga series of computers. If
59 you plan to use this kernel on an Amiga, say Y here and browse the
60 material available in <file:Documentation/m68k>; otherwise say N.
61
62config ATARI
63 bool "Atari support"
64 select MMU_MOTOROLA if MMU
65 help
66 This option enables support for the 68000-based Atari series of
67 computers (including the TT, Falcon and Medusa). If you plan to use
68 this kernel on an Atari, say Y here and browse the material
69 available in <file:Documentation/m68k>; otherwise say N.
70
71config MAC
72 bool "Macintosh support"
73 select MMU_MOTOROLA if MMU
74 help
75 This option enables support for the Apple Macintosh series of
76 computers (yes, there is experimental support now, at least for part
77 of the series).
78
79 Say N unless you're willing to code the remaining necessary support.
80 ;)
81
82config NUBUS
83 bool
84 depends on MAC
85 default y
86
87config M68K_L2_CACHE
88 bool
89 depends on MAC
90 default y
91
92config APOLLO
93 bool "Apollo support"
94 select MMU_MOTOROLA if MMU
95 help
96 Say Y here if you want to run Linux on an MC680x0-based Apollo
97 Domain workstation such as the DN3500.
98
99config VME
100 bool "VME (Motorola and BVM) support"
101 select MMU_MOTOROLA if MMU
102 help
103 Say Y here if you want to build a kernel for a 680x0 based VME
104 board. Boards currently supported include Motorola boards MVME147,
105 MVME162, MVME166, MVME167, MVME172, and MVME177. BVME4000 and
106 BVME6000 boards from BVM Ltd are also supported.
107
108config MVME147
109 bool "MVME147 support"
110 depends on VME
111 help
112 Say Y to include support for early Motorola VME boards. This will
113 build a kernel which can run on MVME147 single-board computers. If
114 you select this option you will have to select the appropriate
115 drivers for SCSI, Ethernet and serial ports later on.
116
117config MVME16x
118 bool "MVME162, 166 and 167 support"
119 depends on VME
120 help
121 Say Y to include support for Motorola VME boards. This will build a
122 kernel which can run on MVME162, MVME166, MVME167, MVME172, and
123 MVME177 boards. If you select this option you will have to select
124 the appropriate drivers for SCSI, Ethernet and serial ports later
125 on.
126
127config BVME6000
128 bool "BVME4000 and BVME6000 support"
129 depends on VME
130 help
131 Say Y to include support for VME boards from BVM Ltd. This will
132 build a kernel which can run on BVME4000 and BVME6000 boards. If
133 you select this option you will have to select the appropriate
134 drivers for SCSI, Ethernet and serial ports later on.
135
136config HP300
137 bool "HP9000/300 and HP9000/400 support"
138 select MMU_MOTOROLA if MMU
139 help
140 This option enables support for the HP9000/300 and HP9000/400 series
141 of workstations. Support for these machines is still somewhat
142 experimental. If you plan to try to use the kernel on such a machine
143 say Y here.
144 Everybody else says N.
145
146config DIO
147 bool "DIO bus support"
148 depends on HP300
149 default y
150 help
151 Say Y here to enable support for the "DIO" expansion bus used in
152 HP300 machines. If you are using such a system you almost certainly
153 want this.
154
155config SUN3X
156 bool "Sun3x support"
157 select MMU_MOTOROLA if MMU
158 select M68030
159 help
160 This option enables support for the Sun 3x series of workstations.
161 Be warned that this support is very experimental.
162 Note that Sun 3x kernels are not compatible with Sun 3 hardware.
163 General Linux information on the Sun 3x series (now discontinued)
164 is at <http://www.angelfire.com/ca2/tech68k/sun3.html>.
165
166 If you don't want to compile a kernel for a Sun 3x, say N.
167
168config Q40
169 bool "Q40/Q60 support"
170 select MMU_MOTOROLA if MMU
171 help
172 The Q40 is a Motorola 68040-based successor to the Sinclair QL
173 manufactured in Germany. There is an official Q40 home page at
174 <http://www.q40.de/>. This option enables support for the Q40 and
175 Q60. Select your CPU below. For 68LC060 don't forget to enable FPU
176 emulation.
177
178config SUN3
179 bool "Sun3 support"
180 depends on !MMU_MOTOROLA
181 select MMU_SUN3 if MMU
182 select M68020
183 help
184 This option enables support for the Sun 3 series of workstations
185 (3/50, 3/60, 3/1xx, 3/2xx systems). Enabling this option requires
186 that all other hardware types must be disabled, as Sun 3 kernels
187 are incompatible with all other m68k targets (including Sun 3x!).
188
189 If you don't want to compile a kernel exclusively for a Sun 3, say N.
190
191config NATFEAT
192 bool "ARAnyM emulator support"
193 depends on ATARI
194 help
195 This option enables support for ARAnyM native features, such as
196 access to a disk image as /dev/hda.
197
198config NFBLOCK
199 tristate "NatFeat block device support"
200 depends on BLOCK && NATFEAT
201 help
202 Say Y to include support for the ARAnyM NatFeat block device
203 which allows direct access to the hard drives without using
204 the hardware emulation.
205
206config NFCON
207 tristate "NatFeat console driver"
208 depends on NATFEAT
209 help
210 Say Y to include support for the ARAnyM NatFeat console driver
211 which allows the console output to be redirected to the stderr
212 output of ARAnyM.
213
214config NFETH
215 tristate "NatFeat Ethernet support"
216 depends on NET_ETHERNET && NATFEAT
217 help
218 Say Y to include support for the ARAnyM NatFeat network device
219 which will emulate a regular ethernet device while presenting an
220 ethertap device to the host system.
221
222comment "Processor type"
223
224config M68020
225 bool "68020 support"
226 help
227 If you anticipate running this kernel on a computer with a MC68020
228 processor, say Y. Otherwise, say N. Note that the 68020 requires a
229 68851 MMU (Memory Management Unit) to run Linux/m68k, except on the
230 Sun 3, which provides its own version.
231
232config M68030
233 bool "68030 support"
234 depends on !MMU_SUN3
235 help
236 If you anticipate running this kernel on a computer with a MC68030
237 processor, say Y. Otherwise, say N. Note that a MC68EC030 will not
238 work, as it does not include an MMU (Memory Management Unit).
239
240config M68040
241 bool "68040 support"
242 depends on !MMU_SUN3
243 help
244 If you anticipate running this kernel on a computer with a MC68LC040
245 or MC68040 processor, say Y. Otherwise, say N. Note that an
246 MC68EC040 will not work, as it does not include an MMU (Memory
247 Management Unit).
248
249config M68060
250 bool "68060 support"
251 depends on !MMU_SUN3
252 help
253 If you anticipate running this kernel on a computer with a MC68060
254 processor, say Y. Otherwise, say N.
255
256config MMU_MOTOROLA
257 bool
258
259config MMU_SUN3
260 bool
261 depends on MMU && !MMU_MOTOROLA
262
263config M68KFPU_EMU
264 bool "Math emulation support (EXPERIMENTAL)"
265 depends on EXPERIMENTAL
266 help
267 At some point in the future, this will cause floating-point math
268 instructions to be emulated by the kernel on machines that lack a
269 floating-point math coprocessor. Thrill-seekers and chronically
270 sleep-deprived psychotic hacker types can say Y now, everyone else
271 should probably wait a while.
272
273config M68KFPU_EMU_EXTRAPREC
274 bool "Math emulation extra precision"
275 depends on M68KFPU_EMU
276 help
277 The fpu uses normally a few bit more during calculations for
278 correct rounding, the emulator can (often) do the same but this
279 extra calculation can cost quite some time, so you can disable
280 it here. The emulator will then "only" calculate with a 64 bit
281 mantissa and round slightly incorrect, what is more than enough
282 for normal usage.
283
284config M68KFPU_EMU_ONLY
285 bool "Math emulation only kernel"
286 depends on M68KFPU_EMU
287 help
288 This option prevents any floating-point instructions from being
289 compiled into the kernel, thereby the kernel doesn't save any
290 floating point context anymore during task switches, so this
291 kernel will only be usable on machines without a floating-point
292 math coprocessor. This makes the kernel a bit faster as no tests
293 needs to be executed whether a floating-point instruction in the
294 kernel should be executed or not.
295
296config ADVANCED
297 bool "Advanced configuration options"
298 ---help---
299 This gives you access to some advanced options for the CPU. The
300 defaults should be fine for most users, but these options may make
301 it possible for you to improve performance somewhat if you know what
302 you are doing.
303
304 Note that the answer to this question won't directly affect the
305 kernel: saying N will just cause the configurator to skip all
306 the questions about these options.
307
308 Most users should say N to this question.
309
310config RMW_INSNS
311 bool "Use read-modify-write instructions"
312 depends on ADVANCED
313 ---help---
314 This allows to use certain instructions that work with indivisible
315 read-modify-write bus cycles. While this is faster than the
316 workaround of disabling interrupts, it can conflict with DMA
317 ( = direct memory access) on many Amiga systems, and it is also said
318 to destabilize other machines. It is very likely that this will
319 cause serious problems on any Amiga or Atari Medusa if set. The only
320 configuration where it should work are 68030-based Ataris, where it
321 apparently improves performance. But you've been warned! Unless you
322 really know what you are doing, say N. Try Y only if you're quite
323 adventurous.
324
325config SINGLE_MEMORY_CHUNK
326 bool "Use one physical chunk of memory only" if ADVANCED && !SUN3
327 default y if SUN3
328 select NEED_MULTIPLE_NODES
329 help
330 Ignore all but the first contiguous chunk of physical memory for VM
331 purposes. This will save a few bytes kernel size and may speed up
332 some operations. Say N if not sure.
333
334config 060_WRITETHROUGH
335 bool "Use write-through caching for 68060 supervisor accesses"
336 depends on ADVANCED && M68060
337 ---help---
338 The 68060 generally uses copyback caching of recently accessed data.
339 Copyback caching means that memory writes will be held in an on-chip
340 cache and only written back to memory some time later. Saying Y
341 here will force supervisor (kernel) accesses to use writethrough
342 caching. Writethrough caching means that data is written to memory
343 straight away, so that cache and memory data always agree.
344 Writethrough caching is less efficient, but is needed for some
345 drivers on 68060 based systems where the 68060 bus snooping signal
346 is hardwired on. The 53c710 SCSI driver is known to suffer from
347 this problem.
348
349config ARCH_DISCONTIGMEM_ENABLE
350 def_bool !SINGLE_MEMORY_CHUNK
351
352config NODES_SHIFT
353 int
354 default "3"
355 depends on !SINGLE_MEMORY_CHUNK
356
357config ZORRO
358 bool "Amiga Zorro (AutoConfig) bus support"
359 depends on AMIGA
360 help
361 This enables support for the Zorro bus in the Amiga. If you have
362 expansion cards in your Amiga that conform to the Amiga
363 AutoConfig(tm) specification, say Y, otherwise N. Note that even
364 expansion cards that do not fit in the Zorro slots but fit in e.g.
365 the CPU slot may fall in this category, so you have to say Y to let
366 Linux use these.
367
368config AMIGA_PCMCIA
369 bool "Amiga 1200/600 PCMCIA support (EXPERIMENTAL)"
370 depends on AMIGA && EXPERIMENTAL
371 help
372 Include support in the kernel for pcmcia on Amiga 1200 and Amiga
373 600. If you intend to use pcmcia cards say Y; otherwise say N.
374
375config HEARTBEAT
376 bool "Use power LED as a heartbeat" if AMIGA || APOLLO || ATARI || MAC ||Q40
377 default y if !AMIGA && !APOLLO && !ATARI && !MAC && !Q40 && HP300
378 help
379 Use the power-on LED on your machine as a load meter. The exact
380 behavior is platform-dependent, but normally the flash frequency is
381 a hyperbolic function of the 5-minute load average.
382
383# We have a dedicated heartbeat LED. :-)
384config PROC_HARDWARE
385 bool "/proc/hardware support"
386 help
387 Say Y here to support the /proc/hardware file, which gives you
388 access to information about the machine you're running on,
389 including the model, CPU, MMU, clock speed, BogoMIPS rating,
390 and memory size.
391
392config ISA
393 bool
394 depends on Q40 || AMIGA_PCMCIA
395 default y
396 help
397 Find out whether you have ISA slots on your motherboard. ISA is the
398 name of a bus system, i.e. the way the CPU talks to the other stuff
399 inside your box. Other bus systems are PCI, EISA, MicroChannel
400 (MCA) or VESA. ISA is an older system, now being displaced by PCI;
401 newer boards don't support it. If you have ISA, say Y, otherwise N.
402
403config GENERIC_ISA_DMA
404 bool
405 depends on Q40 || AMIGA_PCMCIA
406 default y
407
408source "drivers/pci/Kconfig"
409
410source "drivers/zorro/Kconfig"
411
diff --git a/arch/m68k/Makefile b/arch/m68k/Makefile
index be46cadd4017..cf318f20c64d 100644
--- a/arch/m68k/Makefile
+++ b/arch/m68k/Makefile
@@ -1,7 +1,171 @@
1#
2# m68k/Makefile
3#
4# This file is included by the global makefile so that you can add your own
5# architecture-specific flags and dependencies. Remember to do have actions
6# for "archclean" and "archdep" for cleaning up and making dependencies for
7# this architecture
8#
9# This file is subject to the terms and conditions of the GNU General Public
10# License. See the file "COPYING" in the main directory of this archive
11# for more details.
12#
13# Copyright (C) 1994 by Hamish Macdonald
14# Copyright (C) 2002,2011 Greg Ungerer <gerg@snapgear.com>
15#
16
1KBUILD_DEFCONFIG := multi_defconfig 17KBUILD_DEFCONFIG := multi_defconfig
2 18
19#
20# Enable processor type. Ordering of these is important - we want to
21# use the minimum processor type of the range we support. The logic
22# for 680x0 will only allow use of the -m68060 or -m68040 if no other
23# 680x0 type is specified - and no option is specified for 68030 or
24# 68020. The other m68k/ColdFire types always specify some type of
25# compiler cpu type flag.
26#
27ifndef CONFIG_M68040
28cpuflags-$(CONFIG_M68060) := -m68060
29endif
30ifndef CONFIG_M68060
31cpuflags-$(CONFIG_M68040) := -m68040
32endif
33cpuflags-$(CONFIG_M68030) :=
34cpuflags-$(CONFIG_M68020) :=
35cpuflags-$(CONFIG_M68360) := -m68332
36cpuflags-$(CONFIG_M68000) := -m68000
37cpuflags-$(CONFIG_M54xx) := $(call cc-option,-mcpu=5475,-m5200)
38cpuflags-$(CONFIG_M5407) := $(call cc-option,-mcpu=5407,-m5200)
39cpuflags-$(CONFIG_M532x) := $(call cc-option,-mcpu=532x,-m5307)
40cpuflags-$(CONFIG_M5307) := $(call cc-option,-mcpu=5307,-m5200)
41cpuflags-$(CONFIG_M528x) := $(call cc-option,-mcpu=528x,-m5307)
42cpuflags-$(CONFIG_M5275) := $(call cc-option,-mcpu=5275,-m5307)
43cpuflags-$(CONFIG_M5272) := $(call cc-option,-mcpu=5272,-m5307)
44cpuflags-$(CONFIG_M5271) := $(call cc-option,-mcpu=5271,-m5307)
45cpuflags-$(CONFIG_M523x) := $(call cc-option,-mcpu=523x,-m5307)
46cpuflags-$(CONFIG_M5249) := $(call cc-option,-mcpu=5249,-m5200)
47cpuflags-$(CONFIG_M520x) := $(call cc-option,-mcpu=5208,-m5200)
48cpuflags-$(CONFIG_M5206e) := $(call cc-option,-mcpu=5206e,-m5200)
49cpuflags-$(CONFIG_M5206) := $(call cc-option,-mcpu=5206,-m5200)
50
51KBUILD_AFLAGS += $(cpuflags-y)
52KBUILD_CFLAGS += $(cpuflags-y) -pipe
3ifdef CONFIG_MMU 53ifdef CONFIG_MMU
4include $(srctree)/arch/m68k/Makefile_mm 54# without -fno-strength-reduce the 53c7xx.c driver fails ;-(
55KBUILD_CFLAGS += -fno-strength-reduce -ffixed-a2
56else
57# we can use a m68k-linux-gcc toolchain with these in place
58KBUILD_CFLAGS += -DUTS_SYSNAME=\"uClinux\"
59KBUILD_CFLAGS += -D__uClinux__
60KBUILD_AFLAGS += -D__uClinux__
61endif
62
63LDFLAGS := -m m68kelf
64KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/m68k/kernel/module.lds
65ifneq ($(SUBARCH),$(ARCH))
66 ifeq ($(CROSS_COMPILE),)
67 CROSS_COMPILE := $(call cc-cross-prefix, \
68 m68k-linux-gnu- m68k-linux- m68k-unknown-linux-gnu-)
69 endif
70endif
71
72ifdef CONFIG_SUN3
73LDFLAGS_vmlinux = -N
74endif
75
76CHECKFLAGS += -D__mc68000__
77
78
79ifdef CONFIG_KGDB
80# If configured for kgdb support, include debugging infos and keep the
81# frame pointer
82KBUILD_CFLAGS := $(subst -fomit-frame-pointer,,$(KBUILD_CFLAGS)) -g
83endif
84
85#
86# Select the assembler head startup code. Order is important. The default
87# head code is first, processor specific selections can override it after.
88#
89head-y := arch/m68k/kernel/head.o
90head-$(CONFIG_SUN3) := arch/m68k/kernel/sun3-head.o
91head-$(CONFIG_M68360) := arch/m68k/platform/68360/head.o
92head-$(CONFIG_M68000) := arch/m68k/platform/68328/head.o
93head-$(CONFIG_COLDFIRE) := arch/m68k/platform/coldfire/head.o
94
95core-y += arch/m68k/kernel/ arch/m68k/mm/
96libs-y += arch/m68k/lib/
97
98core-$(CONFIG_Q40) += arch/m68k/q40/
99core-$(CONFIG_AMIGA) += arch/m68k/amiga/
100core-$(CONFIG_ATARI) += arch/m68k/atari/
101core-$(CONFIG_MAC) += arch/m68k/mac/
102core-$(CONFIG_HP300) += arch/m68k/hp300/
103core-$(CONFIG_APOLLO) += arch/m68k/apollo/
104core-$(CONFIG_MVME147) += arch/m68k/mvme147/
105core-$(CONFIG_MVME16x) += arch/m68k/mvme16x/
106core-$(CONFIG_BVME6000) += arch/m68k/bvme6000/
107core-$(CONFIG_SUN3X) += arch/m68k/sun3x/ arch/m68k/sun3/
108core-$(CONFIG_SUN3) += arch/m68k/sun3/ arch/m68k/sun3/prom/
109core-$(CONFIG_NATFEAT) += arch/m68k/emu/
110core-$(CONFIG_M68040) += arch/m68k/fpsp040/
111core-$(CONFIG_M68060) += arch/m68k/ifpsp060/
112core-$(CONFIG_M68KFPU_EMU) += arch/m68k/math-emu/
113core-$(CONFIG_M68360) += arch/m68k/platform/68360/
114core-$(CONFIG_M68000) += arch/m68k/platform/68328/
115core-$(CONFIG_M68EZ328) += arch/m68k/platform/68EZ328/
116core-$(CONFIG_M68VZ328) += arch/m68k/platform/68VZ328/
117core-$(CONFIG_COLDFIRE) += arch/m68k/platform/coldfire/
118core-$(CONFIG_M5206) += arch/m68k/platform/5206/
119core-$(CONFIG_M5206e) += arch/m68k/platform/5206/
120core-$(CONFIG_M520x) += arch/m68k/platform/520x/
121core-$(CONFIG_M523x) += arch/m68k/platform/523x/
122core-$(CONFIG_M5249) += arch/m68k/platform/5249/
123core-$(CONFIG_M527x) += arch/m68k/platform/527x/
124core-$(CONFIG_M5272) += arch/m68k/platform/5272/
125core-$(CONFIG_M528x) += arch/m68k/platform/528x/
126core-$(CONFIG_M5307) += arch/m68k/platform/5307/
127core-$(CONFIG_M532x) += arch/m68k/platform/532x/
128core-$(CONFIG_M5407) += arch/m68k/platform/5407/
129core-$(CONFIG_M54xx) += arch/m68k/platform/54xx/
130
131
132all: zImage
133
134lilo: vmlinux
135 if [ -f $(INSTALL_PATH)/vmlinux ]; then mv -f $(INSTALL_PATH)/vmlinux $(INSTALL_PATH)/vmlinux.old; fi
136 if [ -f $(INSTALL_PATH)/System.map ]; then mv -f $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi
137 cat vmlinux > $(INSTALL_PATH)/vmlinux
138 cp System.map $(INSTALL_PATH)/System.map
139 if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi
140
141zImage compressed: vmlinux.gz
142
143vmlinux.gz: vmlinux
144
145ifndef CONFIG_KGDB
146 cp vmlinux vmlinux.tmp
147 $(STRIP) vmlinux.tmp
148 gzip -9c vmlinux.tmp >vmlinux.gz
149 rm vmlinux.tmp
5else 150else
6include $(srctree)/arch/m68k/Makefile_no 151 gzip -9c vmlinux >vmlinux.gz
7endif 152endif
153
154bzImage: vmlinux.bz2
155
156vmlinux.bz2: vmlinux
157
158ifndef CONFIG_KGDB
159 cp vmlinux vmlinux.tmp
160 $(STRIP) vmlinux.tmp
161 bzip2 -1c vmlinux.tmp >vmlinux.bz2
162 rm vmlinux.tmp
163else
164 bzip2 -1c vmlinux >vmlinux.bz2
165endif
166
167archclean:
168 rm -f vmlinux.gz vmlinux.bz2
169
170install:
171 sh $(srctree)/arch/m68k/install.sh $(KERNELRELEASE) vmlinux.gz System.map "$(INSTALL_PATH)"
diff --git a/arch/m68k/Makefile_mm b/arch/m68k/Makefile_mm
deleted file mode 100644
index d449b6d5aecf..000000000000
--- a/arch/m68k/Makefile_mm
+++ /dev/null
@@ -1,121 +0,0 @@
1#
2# m68k/Makefile
3#
4# This file is included by the global makefile so that you can add your own
5# architecture-specific flags and dependencies. Remember to do have actions
6# for "archclean" and "archdep" for cleaning up and making dependencies for
7# this architecture
8#
9# This file is subject to the terms and conditions of the GNU General Public
10# License. See the file "COPYING" in the main directory of this archive
11# for more details.
12#
13# Copyright (C) 1994 by Hamish Macdonald
14#
15
16# override top level makefile
17AS += -m68020
18LDFLAGS := -m m68kelf
19KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/m68k/kernel/module.lds
20ifneq ($(SUBARCH),$(ARCH))
21 ifeq ($(CROSS_COMPILE),)
22 CROSS_COMPILE := $(call cc-cross-prefix, \
23 m68k-linux-gnu- m68k-linux- m68k-unknown-linux-gnu-)
24 endif
25endif
26
27ifdef CONFIG_SUN3
28LDFLAGS_vmlinux = -N
29endif
30
31CHECKFLAGS += -D__mc68000__
32
33# without -fno-strength-reduce the 53c7xx.c driver fails ;-(
34KBUILD_CFLAGS += -pipe -fno-strength-reduce -ffixed-a2
35
36# enable processor switch if compiled only for a single cpu
37ifndef CONFIG_M68020
38ifndef CONFIG_M68030
39
40ifndef CONFIG_M68060
41KBUILD_CFLAGS += -m68040
42endif
43
44ifndef CONFIG_M68040
45KBUILD_CFLAGS += -m68060
46endif
47
48endif
49endif
50
51ifdef CONFIG_KGDB
52# If configured for kgdb support, include debugging infos and keep the
53# frame pointer
54KBUILD_CFLAGS := $(subst -fomit-frame-pointer,,$(KBUILD_CFLAGS)) -g
55endif
56
57ifndef CONFIG_SUN3
58head-y := arch/m68k/kernel/head.o
59else
60head-y := arch/m68k/kernel/sun3-head.o
61endif
62
63core-y += arch/m68k/kernel/ arch/m68k/mm/
64libs-y += arch/m68k/lib/
65
66core-$(CONFIG_Q40) += arch/m68k/q40/
67core-$(CONFIG_AMIGA) += arch/m68k/amiga/
68core-$(CONFIG_ATARI) += arch/m68k/atari/
69core-$(CONFIG_MAC) += arch/m68k/mac/
70core-$(CONFIG_HP300) += arch/m68k/hp300/
71core-$(CONFIG_APOLLO) += arch/m68k/apollo/
72core-$(CONFIG_MVME147) += arch/m68k/mvme147/
73core-$(CONFIG_MVME16x) += arch/m68k/mvme16x/
74core-$(CONFIG_BVME6000) += arch/m68k/bvme6000/
75core-$(CONFIG_SUN3X) += arch/m68k/sun3x/ arch/m68k/sun3/
76core-$(CONFIG_SUN3) += arch/m68k/sun3/ arch/m68k/sun3/prom/
77core-$(CONFIG_NATFEAT) += arch/m68k/emu/
78core-$(CONFIG_M68040) += arch/m68k/fpsp040/
79core-$(CONFIG_M68060) += arch/m68k/ifpsp060/
80core-$(CONFIG_M68KFPU_EMU) += arch/m68k/math-emu/
81
82all: zImage
83
84lilo: vmlinux
85 if [ -f $(INSTALL_PATH)/vmlinux ]; then mv -f $(INSTALL_PATH)/vmlinux $(INSTALL_PATH)/vmlinux.old; fi
86 if [ -f $(INSTALL_PATH)/System.map ]; then mv -f $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi
87 cat vmlinux > $(INSTALL_PATH)/vmlinux
88 cp System.map $(INSTALL_PATH)/System.map
89 if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi
90
91zImage compressed: vmlinux.gz
92
93vmlinux.gz: vmlinux
94
95ifndef CONFIG_KGDB
96 cp vmlinux vmlinux.tmp
97 $(STRIP) vmlinux.tmp
98 gzip -9c vmlinux.tmp >vmlinux.gz
99 rm vmlinux.tmp
100else
101 gzip -9c vmlinux >vmlinux.gz
102endif
103
104bzImage: vmlinux.bz2
105
106vmlinux.bz2: vmlinux
107
108ifndef CONFIG_KGDB
109 cp vmlinux vmlinux.tmp
110 $(STRIP) vmlinux.tmp
111 bzip2 -1c vmlinux.tmp >vmlinux.bz2
112 rm vmlinux.tmp
113else
114 bzip2 -1c vmlinux >vmlinux.bz2
115endif
116
117archclean:
118 rm -f vmlinux.gz vmlinux.bz2
119
120install:
121 sh $(srctree)/arch/m68k/install.sh $(KERNELRELEASE) vmlinux.gz System.map "$(INSTALL_PATH)"
diff --git a/arch/m68k/Makefile_no b/arch/m68k/Makefile_no
deleted file mode 100644
index 844d3f172264..000000000000
--- a/arch/m68k/Makefile_no
+++ /dev/null
@@ -1,124 +0,0 @@
1#
2# arch/m68k/Makefile
3#
4# This file is subject to the terms and conditions of the GNU General Public
5# License. See the file "COPYING" in the main directory of this archive
6# for more details.
7#
8# (C) Copyright 2002, Greg Ungerer <gerg@snapgear.com>
9#
10
11platform-$(CONFIG_M68328) := 68328
12platform-$(CONFIG_M68EZ328) := 68EZ328
13platform-$(CONFIG_M68VZ328) := 68VZ328
14platform-$(CONFIG_M68360) := 68360
15platform-$(CONFIG_M5206) := 5206
16platform-$(CONFIG_M5206e) := 5206
17platform-$(CONFIG_M520x) := 520x
18platform-$(CONFIG_M523x) := 523x
19platform-$(CONFIG_M5249) := 5249
20platform-$(CONFIG_M527x) := 527x
21platform-$(CONFIG_M5272) := 5272
22platform-$(CONFIG_M528x) := 528x
23platform-$(CONFIG_M5307) := 5307
24platform-$(CONFIG_M532x) := 532x
25platform-$(CONFIG_M5407) := 5407
26platform-$(CONFIG_M54xx) := 54xx
27PLATFORM := $(platform-y)
28
29board-$(CONFIG_PILOT) := pilot
30board-$(CONFIG_UC5272) := UC5272
31board-$(CONFIG_UC5282) := UC5282
32board-$(CONFIG_UCSIMM) := ucsimm
33board-$(CONFIG_UCDIMM) := ucdimm
34board-$(CONFIG_UCQUICC) := uCquicc
35board-$(CONFIG_DRAGEN2) := de2
36board-$(CONFIG_ARNEWSH) := ARNEWSH
37board-$(CONFIG_FREESCALE) := FREESCALE
38board-$(CONFIG_M5235EVB) := M5235EVB
39board-$(CONFIG_M5271EVB) := M5271EVB
40board-$(CONFIG_M5275EVB) := M5275EVB
41board-$(CONFIG_M5282EVB) := M5282EVB
42board-$(CONFIG_ELITE) := eLITE
43board-$(CONFIG_NETtel) := NETtel
44board-$(CONFIG_SECUREEDGEMP3) := MP3
45board-$(CONFIG_CLEOPATRA) := CLEOPATRA
46board-$(CONFIG_senTec) := senTec
47board-$(CONFIG_SNEHA) := SNEHA
48board-$(CONFIG_M5208EVB) := M5208EVB
49board-$(CONFIG_MOD5272) := MOD5272
50board-$(CONFIG_AVNET) := AVNET
51board-$(CONFIG_SAVANT) := SAVANT
52BOARD := $(board-y)
53
54model-$(CONFIG_RAMKERNEL) := ram
55model-$(CONFIG_ROMKERNEL) := rom
56MODEL := $(model-y)
57
58#
59# Some code support is grouped together for a common cpu-subclass (for
60# example all ColdFire cpu's are very similar). Determine the sub-class
61# for the selected cpu. ONLY need to define this for the non-base member
62# of the family.
63#
64cpuclass-$(CONFIG_M5206) := coldfire
65cpuclass-$(CONFIG_M5206e) := coldfire
66cpuclass-$(CONFIG_M520x) := coldfire
67cpuclass-$(CONFIG_M523x) := coldfire
68cpuclass-$(CONFIG_M5249) := coldfire
69cpuclass-$(CONFIG_M527x) := coldfire
70cpuclass-$(CONFIG_M5272) := coldfire
71cpuclass-$(CONFIG_M528x) := coldfire
72cpuclass-$(CONFIG_M5307) := coldfire
73cpuclass-$(CONFIG_M532x) := coldfire
74cpuclass-$(CONFIG_M5407) := coldfire
75cpuclass-$(CONFIG_M54xx) := coldfire
76cpuclass-$(CONFIG_M68328) := 68328
77cpuclass-$(CONFIG_M68EZ328) := 68328
78cpuclass-$(CONFIG_M68VZ328) := 68328
79cpuclass-$(CONFIG_M68360) := 68360
80CPUCLASS := $(cpuclass-y)
81
82ifneq ($(CPUCLASS),$(PLATFORM))
83CLASSDIR := arch/m68k/platform/$(cpuclass-y)/
84endif
85
86export PLATFORM BOARD MODEL CPUCLASS
87
88#
89# Some CFLAG additions based on specific CPU type.
90#
91cflags-$(CONFIG_M5206) := $(call cc-option,-mcpu=5206,-m5200)
92cflags-$(CONFIG_M5206e) := $(call cc-option,-mcpu=5206e,-m5200)
93cflags-$(CONFIG_M520x) := $(call cc-option,-mcpu=5208,-m5200)
94cflags-$(CONFIG_M523x) := $(call cc-option,-mcpu=523x,-m5307)
95cflags-$(CONFIG_M5249) := $(call cc-option,-mcpu=5249,-m5200)
96cflags-$(CONFIG_M5271) := $(call cc-option,-mcpu=5271,-m5307)
97cflags-$(CONFIG_M5272) := $(call cc-option,-mcpu=5272,-m5307)
98cflags-$(CONFIG_M5275) := $(call cc-option,-mcpu=5275,-m5307)
99cflags-$(CONFIG_M528x) := $(call cc-option,-mcpu=528x,-m5307)
100cflags-$(CONFIG_M5307) := $(call cc-option,-mcpu=5307,-m5200)
101cflags-$(CONFIG_M532x) := $(call cc-option,-mcpu=532x,-m5307)
102cflags-$(CONFIG_M5407) := $(call cc-option,-mcpu=5407,-m5200)
103cflags-$(CONFIG_M54xx) := $(call cc-option,-mcpu=5475,-m5200)
104cflags-$(CONFIG_M68328) := -m68000
105cflags-$(CONFIG_M68EZ328) := -m68000
106cflags-$(CONFIG_M68VZ328) := -m68000
107cflags-$(CONFIG_M68360) := -m68332
108
109KBUILD_AFLAGS += $(cflags-y)
110
111KBUILD_CFLAGS += $(cflags-y)
112KBUILD_CFLAGS += -D__linux__
113KBUILD_CFLAGS += -DUTS_SYSNAME=\"uClinux\"
114
115head-y := arch/m68k/platform/$(cpuclass-y)/head.o
116
117core-y += arch/m68k/kernel/ \
118 arch/m68k/mm/ \
119 $(CLASSDIR) \
120 arch/m68k/platform/$(PLATFORM)/
121libs-y += arch/m68k/lib/
122
123archclean:
124
diff --git a/arch/m68k/include/asm/entry.h b/arch/m68k/include/asm/entry.h
index 876eec6f2b52..c3c5a8643e15 100644
--- a/arch/m68k/include/asm/entry.h
+++ b/arch/m68k/include/asm/entry.h
@@ -1,5 +1,254 @@
1#ifdef __uClinux__ 1#ifndef __M68K_ENTRY_H
2#include "entry_no.h" 2#define __M68K_ENTRY_H
3
4#include <asm/setup.h>
5#include <asm/page.h>
6#ifdef __ASSEMBLY__
7#include <asm/thread_info.h>
8#endif
9
10/*
11 * Stack layout in 'ret_from_exception':
12 *
13 * This allows access to the syscall arguments in registers d1-d5
14 *
15 * 0(sp) - d1
16 * 4(sp) - d2
17 * 8(sp) - d3
18 * C(sp) - d4
19 * 10(sp) - d5
20 * 14(sp) - a0
21 * 18(sp) - a1
22 * 1C(sp) - a2
23 * 20(sp) - d0
24 * 24(sp) - orig_d0
25 * 28(sp) - stack adjustment
26 * 2C(sp) - [ sr ] [ format & vector ]
27 * 2E(sp) - [ pc-hiword ] [ sr ]
28 * 30(sp) - [ pc-loword ] [ pc-hiword ]
29 * 32(sp) - [ format & vector ] [ pc-loword ]
30 * ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^
31 * M68K COLDFIRE
32 */
33
34/* the following macro is used when enabling interrupts */
35#if defined(MACH_ATARI_ONLY)
36 /* block out HSYNC on the atari */
37#define ALLOWINT (~0x400)
38#define MAX_NOINT_IPL 3
3#else 39#else
4#include "entry_mm.h" 40 /* portable version */
41#define ALLOWINT (~0x700)
42#define MAX_NOINT_IPL 0
43#endif /* machine compilation types */
44
45#ifdef __ASSEMBLY__
46/*
47 * This defines the normal kernel pt-regs layout.
48 *
49 * regs a3-a6 and d6-d7 are preserved by C code
50 * the kernel doesn't mess with usp unless it needs to
51 */
52#define SWITCH_STACK_SIZE (6*4+4) /* includes return address */
53
54#ifdef CONFIG_COLDFIRE
55#ifdef CONFIG_COLDFIRE_SW_A7
56/*
57 * This is made a little more tricky on older ColdFires. There is no
58 * separate supervisor and user stack pointers. Need to artificially
59 * construct a usp in software... When doing this we need to disable
60 * interrupts, otherwise bad things will happen.
61 */
62.globl sw_usp
63.globl sw_ksp
64
65.macro SAVE_ALL_SYS
66 move #0x2700,%sr /* disable intrs */
67 btst #5,%sp@(2) /* from user? */
68 bnes 6f /* no, skip */
69 movel %sp,sw_usp /* save user sp */
70 addql #8,sw_usp /* remove exception */
71 movel sw_ksp,%sp /* kernel sp */
72 subql #8,%sp /* room for exception */
73 clrl %sp@- /* stkadj */
74 movel %d0,%sp@- /* orig d0 */
75 movel %d0,%sp@- /* d0 */
76 lea %sp@(-32),%sp /* space for 8 regs */
77 moveml %d1-%d5/%a0-%a2,%sp@
78 movel sw_usp,%a0 /* get usp */
79 movel %a0@-,%sp@(PT_OFF_PC) /* copy exception program counter */
80 movel %a0@-,%sp@(PT_OFF_FORMATVEC)/*copy exception format/vector/sr */
81 bra 7f
82 6:
83 clrl %sp@- /* stkadj */
84 movel %d0,%sp@- /* orig d0 */
85 movel %d0,%sp@- /* d0 */
86 lea %sp@(-32),%sp /* space for 8 regs */
87 moveml %d1-%d5/%a0-%a2,%sp@
88 7:
89.endm
90
91.macro SAVE_ALL_INT
92 SAVE_ALL_SYS
93 moveq #-1,%d0 /* not system call entry */
94 movel %d0,%sp@(PT_OFF_ORIG_D0)
95.endm
96
97.macro RESTORE_USER
98 move #0x2700,%sr /* disable intrs */
99 movel sw_usp,%a0 /* get usp */
100 movel %sp@(PT_OFF_PC),%a0@- /* copy exception program counter */
101 movel %sp@(PT_OFF_FORMATVEC),%a0@-/*copy exception format/vector/sr */
102 moveml %sp@,%d1-%d5/%a0-%a2
103 lea %sp@(32),%sp /* space for 8 regs */
104 movel %sp@+,%d0
105 addql #4,%sp /* orig d0 */
106 addl %sp@+,%sp /* stkadj */
107 addql #8,%sp /* remove exception */
108 movel %sp,sw_ksp /* save ksp */
109 subql #8,sw_usp /* set exception */
110 movel sw_usp,%sp /* restore usp */
111 rte
112.endm
113
114.macro RDUSP
115 movel sw_usp,%a3
116.endm
117
118.macro WRUSP
119 movel %a3,sw_usp
120.endm
121
122#else /* !CONFIG_COLDFIRE_SW_A7 */
123/*
124 * Modern ColdFire parts have separate supervisor and user stack
125 * pointers. Simple load and restore macros for this case.
126 */
127.macro SAVE_ALL_SYS
128 move #0x2700,%sr /* disable intrs */
129 clrl %sp@- /* stkadj */
130 movel %d0,%sp@- /* orig d0 */
131 movel %d0,%sp@- /* d0 */
132 lea %sp@(-32),%sp /* space for 8 regs */
133 moveml %d1-%d5/%a0-%a2,%sp@
134.endm
135
136.macro SAVE_ALL_INT
137 move #0x2700,%sr /* disable intrs */
138 clrl %sp@- /* stkadj */
139 pea -1:w /* orig d0 */
140 movel %d0,%sp@- /* d0 */
141 lea %sp@(-32),%sp /* space for 8 regs */
142 moveml %d1-%d5/%a0-%a2,%sp@
143.endm
144
145.macro RESTORE_USER
146 moveml %sp@,%d1-%d5/%a0-%a2
147 lea %sp@(32),%sp /* space for 8 regs */
148 movel %sp@+,%d0
149 addql #4,%sp /* orig d0 */
150 addl %sp@+,%sp /* stkadj */
151 rte
152.endm
153
154.macro RDUSP
155 /*move %usp,%a3*/
156 .word 0x4e6b
157.endm
158
159.macro WRUSP
160 /*move %a3,%usp*/
161 .word 0x4e63
162.endm
163
164#endif /* !CONFIG_COLDFIRE_SW_A7 */
165
166.macro SAVE_SWITCH_STACK
167 lea %sp@(-24),%sp /* 6 regs */
168 moveml %a3-%a6/%d6-%d7,%sp@
169.endm
170
171.macro RESTORE_SWITCH_STACK
172 moveml %sp@,%a3-%a6/%d6-%d7
173 lea %sp@(24),%sp /* 6 regs */
174.endm
175
176#else /* !CONFIG_COLDFIRE */
177
178/*
179 * All other types of m68k parts (68000, 680x0, CPU32) have the same
180 * entry and exit code.
181 */
182
183/*
184 * a -1 in the orig_d0 field signifies
185 * that the stack frame is NOT for syscall
186 */
187.macro SAVE_ALL_INT
188 clrl %sp@- /* stk_adj */
189 pea -1:w /* orig d0 */
190 movel %d0,%sp@- /* d0 */
191 moveml %d1-%d5/%a0-%a2,%sp@-
192.endm
193
194.macro SAVE_ALL_SYS
195 clrl %sp@- /* stk_adj */
196 movel %d0,%sp@- /* orig d0 */
197 movel %d0,%sp@- /* d0 */
198 moveml %d1-%d5/%a0-%a2,%sp@-
199.endm
200
201.macro RESTORE_ALL
202 moveml %sp@+,%a0-%a2/%d1-%d5
203 movel %sp@+,%d0
204 addql #4,%sp /* orig d0 */
205 addl %sp@+,%sp /* stk adj */
206 rte
207.endm
208
209
210.macro SAVE_SWITCH_STACK
211 moveml %a3-%a6/%d6-%d7,%sp@-
212.endm
213
214.macro RESTORE_SWITCH_STACK
215 moveml %sp@+,%a3-%a6/%d6-%d7
216.endm
217
218#endif /* !CONFIG_COLDFIRE */
219
220/*
221 * Register %a2 is reserved and set to current task on MMU enabled systems.
222 * Non-MMU systems do not reserve %a2 in this way, and this definition is
223 * not used for them.
224 */
225#define curptr a2
226
227#define GET_CURRENT(tmp) get_current tmp
228.macro get_current reg=%d0
229 movel %sp,\reg
230 andw #-THREAD_SIZE,\reg
231 movel \reg,%curptr
232 movel %curptr@,%curptr
233.endm
234
235#else /* C source */
236
237#define STR(X) STR1(X)
238#define STR1(X) #X
239
240#define SAVE_ALL_INT \
241 "clrl %%sp@-;" /* stk_adj */ \
242 "pea -1:w;" /* orig d0 = -1 */ \
243 "movel %%d0,%%sp@-;" /* d0 */ \
244 "moveml %%d1-%%d5/%%a0-%%a2,%%sp@-"
245
246#define GET_CURRENT(tmp) \
247 "movel %%sp,"#tmp"\n\t" \
248 "andw #-"STR(THREAD_SIZE)","#tmp"\n\t" \
249 "movel "#tmp",%%a2\n\t" \
250 "movel %%a2@,%%a2"
251
5#endif 252#endif
253
254#endif /* __M68K_ENTRY_H */
diff --git a/arch/m68k/include/asm/entry_mm.h b/arch/m68k/include/asm/entry_mm.h
deleted file mode 100644
index 73b8c8fbed9c..000000000000
--- a/arch/m68k/include/asm/entry_mm.h
+++ /dev/null
@@ -1,128 +0,0 @@
1#ifndef __M68K_ENTRY_H
2#define __M68K_ENTRY_H
3
4#include <asm/setup.h>
5#include <asm/page.h>
6#ifdef __ASSEMBLY__
7#include <asm/thread_info.h>
8#endif
9
10/*
11 * Stack layout in 'ret_from_exception':
12 *
13 * This allows access to the syscall arguments in registers d1-d5
14 *
15 * 0(sp) - d1
16 * 4(sp) - d2
17 * 8(sp) - d3
18 * C(sp) - d4
19 * 10(sp) - d5
20 * 14(sp) - a0
21 * 18(sp) - a1
22 * 1C(sp) - a2
23 * 20(sp) - d0
24 * 24(sp) - orig_d0
25 * 28(sp) - stack adjustment
26 * 2C(sp) - sr
27 * 2E(sp) - pc
28 * 32(sp) - format & vector
29 */
30
31/*
32 * 97/05/14 Andreas: Register %a2 is now set to the current task throughout
33 * the whole kernel.
34 */
35
36/* the following macro is used when enabling interrupts */
37#if defined(MACH_ATARI_ONLY)
38 /* block out HSYNC on the atari */
39#define ALLOWINT (~0x400)
40#define MAX_NOINT_IPL 3
41#else
42 /* portable version */
43#define ALLOWINT (~0x700)
44#define MAX_NOINT_IPL 0
45#endif /* machine compilation types */
46
47#ifdef __ASSEMBLY__
48
49#define curptr a2
50
51LFLUSH_I_AND_D = 0x00000808
52
53#define SAVE_ALL_INT save_all_int
54#define SAVE_ALL_SYS save_all_sys
55#define RESTORE_ALL restore_all
56/*
57 * This defines the normal kernel pt-regs layout.
58 *
59 * regs a3-a6 and d6-d7 are preserved by C code
60 * the kernel doesn't mess with usp unless it needs to
61 */
62
63/*
64 * a -1 in the orig_d0 field signifies
65 * that the stack frame is NOT for syscall
66 */
67.macro save_all_int
68 clrl %sp@- | stk_adj
69 pea -1:w | orig d0
70 movel %d0,%sp@- | d0
71 moveml %d1-%d5/%a0-%a1/%curptr,%sp@-
72.endm
73
74.macro save_all_sys
75 clrl %sp@- | stk_adj
76 movel %d0,%sp@- | orig d0
77 movel %d0,%sp@- | d0
78 moveml %d1-%d5/%a0-%a1/%curptr,%sp@-
79.endm
80
81.macro restore_all
82 moveml %sp@+,%a0-%a1/%curptr/%d1-%d5
83 movel %sp@+,%d0
84 addql #4,%sp | orig d0
85 addl %sp@+,%sp | stk adj
86 rte
87.endm
88
89#define SWITCH_STACK_SIZE (6*4+4) /* includes return address */
90
91#define SAVE_SWITCH_STACK save_switch_stack
92#define RESTORE_SWITCH_STACK restore_switch_stack
93#define GET_CURRENT(tmp) get_current tmp
94
95.macro save_switch_stack
96 moveml %a3-%a6/%d6-%d7,%sp@-
97.endm
98
99.macro restore_switch_stack
100 moveml %sp@+,%a3-%a6/%d6-%d7
101.endm
102
103.macro get_current reg=%d0
104 movel %sp,\reg
105 andw #-THREAD_SIZE,\reg
106 movel \reg,%curptr
107 movel %curptr@,%curptr
108.endm
109
110#else /* C source */
111
112#define STR(X) STR1(X)
113#define STR1(X) #X
114
115#define SAVE_ALL_INT \
116 "clrl %%sp@-;" /* stk_adj */ \
117 "pea -1:w;" /* orig d0 = -1 */ \
118 "movel %%d0,%%sp@-;" /* d0 */ \
119 "moveml %%d1-%%d5/%%a0-%%a2,%%sp@-"
120#define GET_CURRENT(tmp) \
121 "movel %%sp,"#tmp"\n\t" \
122 "andw #-"STR(THREAD_SIZE)","#tmp"\n\t" \
123 "movel "#tmp",%%a2\n\t" \
124 "movel %%a2@,%%a2"
125
126#endif
127
128#endif /* __M68K_ENTRY_H */
diff --git a/arch/m68k/include/asm/entry_no.h b/arch/m68k/include/asm/entry_no.h
deleted file mode 100644
index 68611e3dbb1d..000000000000
--- a/arch/m68k/include/asm/entry_no.h
+++ /dev/null
@@ -1,181 +0,0 @@
1#ifndef __M68KNOMMU_ENTRY_H
2#define __M68KNOMMU_ENTRY_H
3
4#include <asm/setup.h>
5#include <asm/page.h>
6
7/*
8 * Stack layout in 'ret_from_exception':
9 *
10 * This allows access to the syscall arguments in registers d1-d5
11 *
12 * 0(sp) - d1
13 * 4(sp) - d2
14 * 8(sp) - d3
15 * C(sp) - d4
16 * 10(sp) - d5
17 * 14(sp) - a0
18 * 18(sp) - a1
19 * 1C(sp) - a2
20 * 20(sp) - d0
21 * 24(sp) - orig_d0
22 * 28(sp) - stack adjustment
23 * 2C(sp) - [ sr ] [ format & vector ]
24 * 2E(sp) - [ pc-hiword ] [ sr ]
25 * 30(sp) - [ pc-loword ] [ pc-hiword ]
26 * 32(sp) - [ format & vector ] [ pc-loword ]
27 * ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^
28 * M68K COLDFIRE
29 */
30
31#define ALLOWINT (~0x700)
32
33#ifdef __ASSEMBLY__
34
35#define SWITCH_STACK_SIZE (6*4+4) /* Includes return address */
36
37/*
38 * This defines the normal kernel pt-regs layout.
39 *
40 * regs are a2-a6 and d6-d7 preserved by C code
41 * the kernel doesn't mess with usp unless it needs to
42 */
43
44#ifdef CONFIG_COLDFIRE
45#ifdef CONFIG_COLDFIRE_SW_A7
46/*
47 * This is made a little more tricky on older ColdFires. There is no
48 * separate supervisor and user stack pointers. Need to artificially
49 * construct a usp in software... When doing this we need to disable
50 * interrupts, otherwise bad things will happen.
51 */
52.globl sw_usp
53.globl sw_ksp
54
55.macro SAVE_ALL
56 move #0x2700,%sr /* disable intrs */
57 btst #5,%sp@(2) /* from user? */
58 bnes 6f /* no, skip */
59 movel %sp,sw_usp /* save user sp */
60 addql #8,sw_usp /* remove exception */
61 movel sw_ksp,%sp /* kernel sp */
62 subql #8,%sp /* room for exception */
63 clrl %sp@- /* stkadj */
64 movel %d0,%sp@- /* orig d0 */
65 movel %d0,%sp@- /* d0 */
66 lea %sp@(-32),%sp /* space for 8 regs */
67 moveml %d1-%d5/%a0-%a2,%sp@
68 movel sw_usp,%a0 /* get usp */
69 movel %a0@-,%sp@(PT_OFF_PC) /* copy exception program counter */
70 movel %a0@-,%sp@(PT_OFF_FORMATVEC)/*copy exception format/vector/sr */
71 bra 7f
72 6:
73 clrl %sp@- /* stkadj */
74 movel %d0,%sp@- /* orig d0 */
75 movel %d0,%sp@- /* d0 */
76 lea %sp@(-32),%sp /* space for 8 regs */
77 moveml %d1-%d5/%a0-%a2,%sp@
78 7:
79.endm
80
81.macro RESTORE_USER
82 move #0x2700,%sr /* disable intrs */
83 movel sw_usp,%a0 /* get usp */
84 movel %sp@(PT_OFF_PC),%a0@- /* copy exception program counter */
85 movel %sp@(PT_OFF_FORMATVEC),%a0@-/*copy exception format/vector/sr */
86 moveml %sp@,%d1-%d5/%a0-%a2
87 lea %sp@(32),%sp /* space for 8 regs */
88 movel %sp@+,%d0
89 addql #4,%sp /* orig d0 */
90 addl %sp@+,%sp /* stkadj */
91 addql #8,%sp /* remove exception */
92 movel %sp,sw_ksp /* save ksp */
93 subql #8,sw_usp /* set exception */
94 movel sw_usp,%sp /* restore usp */
95 rte
96.endm
97
98.macro RDUSP
99 movel sw_usp,%a3
100.endm
101
102.macro WRUSP
103 movel %a3,sw_usp
104.endm
105
106#else /* !CONFIG_COLDFIRE_SW_A7 */
107/*
108 * Modern ColdFire parts have separate supervisor and user stack
109 * pointers. Simple load and restore macros for this case.
110 */
111.macro SAVE_ALL
112 move #0x2700,%sr /* disable intrs */
113 clrl %sp@- /* stkadj */
114 movel %d0,%sp@- /* orig d0 */
115 movel %d0,%sp@- /* d0 */
116 lea %sp@(-32),%sp /* space for 8 regs */
117 moveml %d1-%d5/%a0-%a2,%sp@
118.endm
119
120.macro RESTORE_USER
121 moveml %sp@,%d1-%d5/%a0-%a2
122 lea %sp@(32),%sp /* space for 8 regs */
123 movel %sp@+,%d0
124 addql #4,%sp /* orig d0 */
125 addl %sp@+,%sp /* stkadj */
126 rte
127.endm
128
129.macro RDUSP
130 /*move %usp,%a3*/
131 .word 0x4e6b
132.endm
133
134.macro WRUSP
135 /*move %a3,%usp*/
136 .word 0x4e63
137.endm
138
139#endif /* !CONFIG_COLDFIRE_SW_A7 */
140
141.macro SAVE_SWITCH_STACK
142 lea %sp@(-24),%sp /* 6 regs */
143 moveml %a3-%a6/%d6-%d7,%sp@
144.endm
145
146.macro RESTORE_SWITCH_STACK
147 moveml %sp@,%a3-%a6/%d6-%d7
148 lea %sp@(24),%sp /* 6 regs */
149.endm
150
151#else /* !CONFIG_COLDFIRE */
152
153/*
154 * Standard 68k interrupt entry and exit macros.
155 */
156.macro SAVE_ALL
157 clrl %sp@- /* stkadj */
158 movel %d0,%sp@- /* orig d0 */
159 movel %d0,%sp@- /* d0 */
160 moveml %d1-%d5/%a0-%a2,%sp@-
161.endm
162
163.macro RESTORE_ALL
164 moveml %sp@+,%a0-%a2/%d1-%d5
165 movel %sp@+,%d0
166 addql #4,%sp /* orig d0 */
167 addl %sp@+,%sp /* stkadj */
168 rte
169.endm
170
171.macro SAVE_SWITCH_STACK
172 moveml %a3-%a6/%d6-%d7,%sp@-
173.endm
174
175.macro RESTORE_SWITCH_STACK
176 moveml %sp@+,%a3-%a6/%d6-%d7
177.endm
178
179#endif /* !COLDFIRE_SW_A7 */
180#endif /* __ASSEMBLY__ */
181#endif /* __M68KNOMMU_ENTRY_H */
diff --git a/arch/m68k/include/asm/m520xsim.h b/arch/m68k/include/asm/m520xsim.h
index b6bf2c518bac..eda62de7e607 100644
--- a/arch/m68k/include/asm/m520xsim.h
+++ b/arch/m68k/include/asm/m520xsim.h
@@ -90,15 +90,13 @@
90#define MCFGPIO_PDDR_FECH 0xFC0A4013 90#define MCFGPIO_PDDR_FECH 0xFC0A4013
91#define MCFGPIO_PDDR_FECL 0xFC0A4014 91#define MCFGPIO_PDDR_FECL 0xFC0A4014
92 92
93#define MCFGPIO_PPDSDR_BUSCTL 0xFC0A401A 93#define MCFGPIO_PPDSDR_CS 0xFC0A401A
94#define MCFGPIO_PPDSDR_BE 0xFC0A401B 94#define MCFGPIO_PPDSDR_FECI2C 0xFC0A401B
95#define MCFGPIO_PPDSDR_CS 0xFC0A401C 95#define MCFGPIO_PPDSDR_QSPI 0xFC0A401C
96#define MCFGPIO_PPDSDR_FECI2C 0xFC0A401D 96#define MCFGPIO_PPDSDR_TIMER 0xFC0A401D
97#define MCFGPIO_PPDSDR_QSPI 0xFC0A401E 97#define MCFGPIO_PPDSDR_UART 0xFC0A401E
98#define MCFGPIO_PPDSDR_TIMER 0xFC0A401F 98#define MCFGPIO_PPDSDR_FECH 0xFC0A401F
99#define MCFGPIO_PPDSDR_UART 0xFC0A4021 99#define MCFGPIO_PPDSDR_FECL 0xFC0A4020
100#define MCFGPIO_PPDSDR_FECH 0xFC0A4021
101#define MCFGPIO_PPDSDR_FECL 0xFC0A4022
102 100
103#define MCFGPIO_PCLRR_BUSCTL 0xFC0A4024 101#define MCFGPIO_PCLRR_BUSCTL 0xFC0A4024
104#define MCFGPIO_PCLRR_BE 0xFC0A4025 102#define MCFGPIO_PCLRR_BE 0xFC0A4025
@@ -113,11 +111,11 @@
113/* 111/*
114 * Generic GPIO support 112 * Generic GPIO support
115 */ 113 */
116#define MCFGPIO_PODR MCFGPIO_PODR_BUSCTL 114#define MCFGPIO_PODR MCFGPIO_PODR_CS
117#define MCFGPIO_PDDR MCFGPIO_PDDR_BUSCTL 115#define MCFGPIO_PDDR MCFGPIO_PDDR_CS
118#define MCFGPIO_PPDR MCFGPIO_PPDSDR_BUSCTL 116#define MCFGPIO_PPDR MCFGPIO_PPDSDR_CS
119#define MCFGPIO_SETR MCFGPIO_PPDSDR_BUSCTL 117#define MCFGPIO_SETR MCFGPIO_PPDSDR_CS
120#define MCFGPIO_CLRR MCFGPIO_PCLRR_BUSCTL 118#define MCFGPIO_CLRR MCFGPIO_PCLRR_CS
121 119
122#define MCFGPIO_PIN_MAX 80 120#define MCFGPIO_PIN_MAX 80
123#define MCFGPIO_IRQ_MAX 8 121#define MCFGPIO_IRQ_MAX 8
diff --git a/arch/m68k/include/asm/mcfqspi.h b/arch/m68k/include/asm/mcfqspi.h
index 39d90d51111d..7fe631972f1f 100644
--- a/arch/m68k/include/asm/mcfqspi.h
+++ b/arch/m68k/include/asm/mcfqspi.h
@@ -24,9 +24,11 @@
24#if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) 24#if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x)
25#define MCFQSPI_IOBASE (MCF_IPSBAR + 0x340) 25#define MCFQSPI_IOBASE (MCF_IPSBAR + 0x340)
26#elif defined(CONFIG_M5249) 26#elif defined(CONFIG_M5249)
27#define MCFQSPI_IOBASE (MCF_MBAR + 0x300) 27#define MCFQSPI_IOBASE (MCF_MBAR + 0x300)
28#elif defined(CONFIG_M520x) || defined(CONFIG_M532x) 28#elif defined(CONFIG_M520x)
29#define MCFQSPI_IOBASE 0xFC058000 29#define MCFQSPI_IOBASE 0xFC05C000
30#elif defined(CONFIG_M532x)
31#define MCFQSPI_IOBASE 0xFC058000
30#endif 32#endif
31#define MCFQSPI_IOSIZE 0x40 33#define MCFQSPI_IOSIZE 0x40
32 34
diff --git a/arch/m68k/include/asm/page_no.h b/arch/m68k/include/asm/page_no.h
index 90595721185f..a8d1c60eb9ce 100644
--- a/arch/m68k/include/asm/page_no.h
+++ b/arch/m68k/include/asm/page_no.h
@@ -5,6 +5,9 @@
5 5
6extern unsigned long memory_start; 6extern unsigned long memory_start;
7extern unsigned long memory_end; 7extern unsigned long memory_end;
8extern unsigned long _rambase;
9extern unsigned long _ramstart;
10extern unsigned long _ramend;
8 11
9#define get_user_page(vaddr) __get_free_page(GFP_KERNEL) 12#define get_user_page(vaddr) __get_free_page(GFP_KERNEL)
10#define free_user_page(page, addr) free_page(addr) 13#define free_user_page(page, addr) free_page(addr)
diff --git a/arch/m68k/include/asm/processor.h b/arch/m68k/include/asm/processor.h
index d8ef53ac03f9..568facf30276 100644
--- a/arch/m68k/include/asm/processor.h
+++ b/arch/m68k/include/asm/processor.h
@@ -135,6 +135,12 @@ do { \
135 wrusp(_usp); \ 135 wrusp(_usp); \
136} while(0) 136} while(0)
137 137
138static inline int handle_kernel_fault(struct pt_regs *regs)
139{
140 /* Any fault in kernel is fatal on non-mmu */
141 return 0;
142}
143
138#endif 144#endif
139 145
140/* Forward declaration, a strange C thing */ 146/* Forward declaration, a strange C thing */
diff --git a/arch/m68k/include/asm/sections.h b/arch/m68k/include/asm/sections.h
index d64967ecfec6..5277e52715ec 100644
--- a/arch/m68k/include/asm/sections.h
+++ b/arch/m68k/include/asm/sections.h
@@ -3,4 +3,6 @@
3 3
4#include <asm-generic/sections.h> 4#include <asm-generic/sections.h>
5 5
6extern char _sbss[], _ebss[];
7
6#endif /* _ASM_M68K_SECTIONS_H */ 8#endif /* _ASM_M68K_SECTIONS_H */
diff --git a/arch/m68k/kernel/Makefile b/arch/m68k/kernel/Makefile
index c482ebc9dd54..e7f0f2e5ad44 100644
--- a/arch/m68k/kernel/Makefile
+++ b/arch/m68k/kernel/Makefile
@@ -1,5 +1,21 @@
1ifdef CONFIG_MMU 1#
2include arch/m68k/kernel/Makefile_mm 2# Makefile for the linux kernel.
3else 3#
4include arch/m68k/kernel/Makefile_no 4
5extra-$(CONFIG_MMU) := head.o
6extra-$(CONFIG_SUN3) := sun3-head.o
7extra-y += vmlinux.lds
8
9obj-y := entry.o m68k_ksyms.o module.o process.o ptrace.o setup.o signal.o \
10 sys_m68k.o syscalltable.o time.o traps.o
11
12obj-$(CONFIG_MMU) += ints.o devres.o vectors.o
13devres-$(CONFIG_MMU) = ../../../kernel/irq/devres.o
14
15ifndef CONFIG_MMU_SUN3
16obj-y += dma.o
5endif 17endif
18ifndef CONFIG_MMU
19obj-y += init_task.o irq.o
20endif
21
diff --git a/arch/m68k/kernel/Makefile_mm b/arch/m68k/kernel/Makefile_mm
deleted file mode 100644
index aced67804579..000000000000
--- a/arch/m68k/kernel/Makefile_mm
+++ /dev/null
@@ -1,17 +0,0 @@
1#
2# Makefile for the linux kernel.
3#
4
5ifndef CONFIG_SUN3
6 extra-y := head.o
7else
8 extra-y := sun3-head.o
9endif
10extra-y += vmlinux.lds
11
12obj-y := entry.o process.o traps.o ints.o signal.o ptrace.o module.o \
13 sys_m68k.o time.o setup.o m68k_ksyms.o devres.o syscalltable.o
14
15devres-y = ../../../kernel/irq/devres.o
16
17obj-y$(CONFIG_MMU_SUN3) += dma.o # no, it's not a typo
diff --git a/arch/m68k/kernel/Makefile_no b/arch/m68k/kernel/Makefile_no
deleted file mode 100644
index 37c3fc074c0a..000000000000
--- a/arch/m68k/kernel/Makefile_no
+++ /dev/null
@@ -1,10 +0,0 @@
1#
2# Makefile for arch/m68knommu/kernel.
3#
4
5extra-y := vmlinux.lds
6
7obj-y += dma.o entry.o init_task.o irq.o m68k_ksyms.o process.o ptrace.o \
8 setup.o signal.o syscalltable.o sys_m68k.o time.o traps.o
9
10obj-$(CONFIG_MODULES) += module.o
diff --git a/arch/m68k/kernel/entry_no.S b/arch/m68k/kernel/entry_no.S
index 5f0f6b598b5a..1b4289061a64 100644
--- a/arch/m68k/kernel/entry_no.S
+++ b/arch/m68k/kernel/entry_no.S
@@ -43,7 +43,7 @@
43.globl sys_vfork 43.globl sys_vfork
44 44
45ENTRY(buserr) 45ENTRY(buserr)
46 SAVE_ALL 46 SAVE_ALL_INT
47 moveq #-1,%d0 47 moveq #-1,%d0
48 movel %d0,%sp@(PT_OFF_ORIG_D0) 48 movel %d0,%sp@(PT_OFF_ORIG_D0)
49 movel %sp,%sp@- /* stack frame pointer argument */ 49 movel %sp,%sp@- /* stack frame pointer argument */
@@ -52,7 +52,7 @@ ENTRY(buserr)
52 jra ret_from_exception 52 jra ret_from_exception
53 53
54ENTRY(trap) 54ENTRY(trap)
55 SAVE_ALL 55 SAVE_ALL_INT
56 moveq #-1,%d0 56 moveq #-1,%d0
57 movel %d0,%sp@(PT_OFF_ORIG_D0) 57 movel %d0,%sp@(PT_OFF_ORIG_D0)
58 movel %sp,%sp@- /* stack frame pointer argument */ 58 movel %sp,%sp@- /* stack frame pointer argument */
@@ -64,7 +64,7 @@ ENTRY(trap)
64 64
65.globl dbginterrupt 65.globl dbginterrupt
66ENTRY(dbginterrupt) 66ENTRY(dbginterrupt)
67 SAVE_ALL 67 SAVE_ALL_INT
68 moveq #-1,%d0 68 moveq #-1,%d0
69 movel %d0,%sp@(PT_OFF_ORIG_D0) 69 movel %d0,%sp@(PT_OFF_ORIG_D0)
70 movel %sp,%sp@- /* stack frame pointer argument */ 70 movel %sp,%sp@- /* stack frame pointer argument */
diff --git a/arch/m68k/kernel/setup_no.c b/arch/m68k/kernel/setup_no.c
index 16b2de7f5101..2ed8c0fb1517 100644
--- a/arch/m68k/kernel/setup_no.c
+++ b/arch/m68k/kernel/setup_no.c
@@ -36,6 +36,7 @@
36#include <asm/irq.h> 36#include <asm/irq.h>
37#include <asm/machdep.h> 37#include <asm/machdep.h>
38#include <asm/pgtable.h> 38#include <asm/pgtable.h>
39#include <asm/sections.h>
39 40
40unsigned long memory_start; 41unsigned long memory_start;
41unsigned long memory_end; 42unsigned long memory_end;
@@ -80,9 +81,6 @@ void (*mach_power_off)(void);
80#define CPU_INSTR_PER_JIFFY 16 81#define CPU_INSTR_PER_JIFFY 16
81#endif 82#endif
82 83
83extern int _stext, _etext, _sdata, _edata, _sbss, _ebss, _end;
84extern int _ramstart, _ramend;
85
86#if defined(CONFIG_UBOOT) 84#if defined(CONFIG_UBOOT)
87/* 85/*
88 * parse_uboot_commandline 86 * parse_uboot_commandline
diff --git a/arch/m68k/kernel/traps.c b/arch/m68k/kernel/traps.c
index c98add3f5f0f..89362f2bb56a 100644
--- a/arch/m68k/kernel/traps.c
+++ b/arch/m68k/kernel/traps.c
@@ -1,5 +1,1107 @@
1#ifdef CONFIG_MMU 1/*
2#include "traps_mm.c" 2 * linux/arch/m68k/kernel/traps.c
3 *
4 * Copyright (C) 1993, 1994 by Hamish Macdonald
5 *
6 * 68040 fixes by Michael Rausch
7 * 68040 fixes by Martin Apel
8 * 68040 fixes and writeback by Richard Zidlicky
9 * 68060 fixes by Roman Hodek
10 * 68060 fixes by Jesper Skov
11 *
12 * This file is subject to the terms and conditions of the GNU General Public
13 * License. See the file COPYING in the main directory of this archive
14 * for more details.
15 */
16
17/*
18 * Sets up all exception vectors
19 */
20
21#include <linux/sched.h>
22#include <linux/signal.h>
23#include <linux/kernel.h>
24#include <linux/mm.h>
25#include <linux/module.h>
26#include <linux/user.h>
27#include <linux/string.h>
28#include <linux/linkage.h>
29#include <linux/init.h>
30#include <linux/ptrace.h>
31#include <linux/kallsyms.h>
32
33#include <asm/setup.h>
34#include <asm/fpu.h>
35#include <asm/system.h>
36#include <asm/uaccess.h>
37#include <asm/traps.h>
38#include <asm/pgalloc.h>
39#include <asm/machdep.h>
40#include <asm/siginfo.h>
41
42
43static const char *vec_names[] = {
44 [VEC_RESETSP] = "RESET SP",
45 [VEC_RESETPC] = "RESET PC",
46 [VEC_BUSERR] = "BUS ERROR",
47 [VEC_ADDRERR] = "ADDRESS ERROR",
48 [VEC_ILLEGAL] = "ILLEGAL INSTRUCTION",
49 [VEC_ZERODIV] = "ZERO DIVIDE",
50 [VEC_CHK] = "CHK",
51 [VEC_TRAP] = "TRAPcc",
52 [VEC_PRIV] = "PRIVILEGE VIOLATION",
53 [VEC_TRACE] = "TRACE",
54 [VEC_LINE10] = "LINE 1010",
55 [VEC_LINE11] = "LINE 1111",
56 [VEC_RESV12] = "UNASSIGNED RESERVED 12",
57 [VEC_COPROC] = "COPROCESSOR PROTOCOL VIOLATION",
58 [VEC_FORMAT] = "FORMAT ERROR",
59 [VEC_UNINT] = "UNINITIALIZED INTERRUPT",
60 [VEC_RESV16] = "UNASSIGNED RESERVED 16",
61 [VEC_RESV17] = "UNASSIGNED RESERVED 17",
62 [VEC_RESV18] = "UNASSIGNED RESERVED 18",
63 [VEC_RESV19] = "UNASSIGNED RESERVED 19",
64 [VEC_RESV20] = "UNASSIGNED RESERVED 20",
65 [VEC_RESV21] = "UNASSIGNED RESERVED 21",
66 [VEC_RESV22] = "UNASSIGNED RESERVED 22",
67 [VEC_RESV23] = "UNASSIGNED RESERVED 23",
68 [VEC_SPUR] = "SPURIOUS INTERRUPT",
69 [VEC_INT1] = "LEVEL 1 INT",
70 [VEC_INT2] = "LEVEL 2 INT",
71 [VEC_INT3] = "LEVEL 3 INT",
72 [VEC_INT4] = "LEVEL 4 INT",
73 [VEC_INT5] = "LEVEL 5 INT",
74 [VEC_INT6] = "LEVEL 6 INT",
75 [VEC_INT7] = "LEVEL 7 INT",
76 [VEC_SYS] = "SYSCALL",
77 [VEC_TRAP1] = "TRAP #1",
78 [VEC_TRAP2] = "TRAP #2",
79 [VEC_TRAP3] = "TRAP #3",
80 [VEC_TRAP4] = "TRAP #4",
81 [VEC_TRAP5] = "TRAP #5",
82 [VEC_TRAP6] = "TRAP #6",
83 [VEC_TRAP7] = "TRAP #7",
84 [VEC_TRAP8] = "TRAP #8",
85 [VEC_TRAP9] = "TRAP #9",
86 [VEC_TRAP10] = "TRAP #10",
87 [VEC_TRAP11] = "TRAP #11",
88 [VEC_TRAP12] = "TRAP #12",
89 [VEC_TRAP13] = "TRAP #13",
90 [VEC_TRAP14] = "TRAP #14",
91 [VEC_TRAP15] = "TRAP #15",
92 [VEC_FPBRUC] = "FPCP BSUN",
93 [VEC_FPIR] = "FPCP INEXACT",
94 [VEC_FPDIVZ] = "FPCP DIV BY 0",
95 [VEC_FPUNDER] = "FPCP UNDERFLOW",
96 [VEC_FPOE] = "FPCP OPERAND ERROR",
97 [VEC_FPOVER] = "FPCP OVERFLOW",
98 [VEC_FPNAN] = "FPCP SNAN",
99 [VEC_FPUNSUP] = "FPCP UNSUPPORTED OPERATION",
100 [VEC_MMUCFG] = "MMU CONFIGURATION ERROR",
101 [VEC_MMUILL] = "MMU ILLEGAL OPERATION ERROR",
102 [VEC_MMUACC] = "MMU ACCESS LEVEL VIOLATION ERROR",
103 [VEC_RESV59] = "UNASSIGNED RESERVED 59",
104 [VEC_UNIMPEA] = "UNASSIGNED RESERVED 60",
105 [VEC_UNIMPII] = "UNASSIGNED RESERVED 61",
106 [VEC_RESV62] = "UNASSIGNED RESERVED 62",
107 [VEC_RESV63] = "UNASSIGNED RESERVED 63",
108};
109
110static const char *space_names[] = {
111 [0] = "Space 0",
112 [USER_DATA] = "User Data",
113 [USER_PROGRAM] = "User Program",
114#ifndef CONFIG_SUN3
115 [3] = "Space 3",
3#else 116#else
4#include "traps_no.c" 117 [FC_CONTROL] = "Control",
118#endif
119 [4] = "Space 4",
120 [SUPER_DATA] = "Super Data",
121 [SUPER_PROGRAM] = "Super Program",
122 [CPU_SPACE] = "CPU"
123};
124
125void die_if_kernel(char *,struct pt_regs *,int);
126asmlinkage int do_page_fault(struct pt_regs *regs, unsigned long address,
127 unsigned long error_code);
128int send_fault_sig(struct pt_regs *regs);
129
130asmlinkage void trap_c(struct frame *fp);
131
132#if defined (CONFIG_M68060)
133static inline void access_error060 (struct frame *fp)
134{
135 unsigned long fslw = fp->un.fmt4.pc; /* is really FSLW for access error */
136
137#ifdef DEBUG
138 printk("fslw=%#lx, fa=%#lx\n", fslw, fp->un.fmt4.effaddr);
139#endif
140
141 if (fslw & MMU060_BPE) {
142 /* branch prediction error -> clear branch cache */
143 __asm__ __volatile__ ("movec %/cacr,%/d0\n\t"
144 "orl #0x00400000,%/d0\n\t"
145 "movec %/d0,%/cacr"
146 : : : "d0" );
147 /* return if there's no other error */
148 if (!(fslw & MMU060_ERR_BITS) && !(fslw & MMU060_SEE))
149 return;
150 }
151
152 if (fslw & (MMU060_DESC_ERR | MMU060_WP | MMU060_SP)) {
153 unsigned long errorcode;
154 unsigned long addr = fp->un.fmt4.effaddr;
155
156 if (fslw & MMU060_MA)
157 addr = (addr + PAGE_SIZE - 1) & PAGE_MASK;
158
159 errorcode = 1;
160 if (fslw & MMU060_DESC_ERR) {
161 __flush_tlb040_one(addr);
162 errorcode = 0;
163 }
164 if (fslw & MMU060_W)
165 errorcode |= 2;
166#ifdef DEBUG
167 printk("errorcode = %d\n", errorcode );
168#endif
169 do_page_fault(&fp->ptregs, addr, errorcode);
170 } else if (fslw & (MMU060_SEE)){
171 /* Software Emulation Error.
172 * fault during mem_read/mem_write in ifpsp060/os.S
173 */
174 send_fault_sig(&fp->ptregs);
175 } else if (!(fslw & (MMU060_RE|MMU060_WE)) ||
176 send_fault_sig(&fp->ptregs) > 0) {
177 printk("pc=%#lx, fa=%#lx\n", fp->ptregs.pc, fp->un.fmt4.effaddr);
178 printk( "68060 access error, fslw=%lx\n", fslw );
179 trap_c( fp );
180 }
181}
182#endif /* CONFIG_M68060 */
183
184#if defined (CONFIG_M68040)
185static inline unsigned long probe040(int iswrite, unsigned long addr, int wbs)
186{
187 unsigned long mmusr;
188 mm_segment_t old_fs = get_fs();
189
190 set_fs(MAKE_MM_SEG(wbs));
191
192 if (iswrite)
193 asm volatile (".chip 68040; ptestw (%0); .chip 68k" : : "a" (addr));
194 else
195 asm volatile (".chip 68040; ptestr (%0); .chip 68k" : : "a" (addr));
196
197 asm volatile (".chip 68040; movec %%mmusr,%0; .chip 68k" : "=r" (mmusr));
198
199 set_fs(old_fs);
200
201 return mmusr;
202}
203
204static inline int do_040writeback1(unsigned short wbs, unsigned long wba,
205 unsigned long wbd)
206{
207 int res = 0;
208 mm_segment_t old_fs = get_fs();
209
210 /* set_fs can not be moved, otherwise put_user() may oops */
211 set_fs(MAKE_MM_SEG(wbs));
212
213 switch (wbs & WBSIZ_040) {
214 case BA_SIZE_BYTE:
215 res = put_user(wbd & 0xff, (char __user *)wba);
216 break;
217 case BA_SIZE_WORD:
218 res = put_user(wbd & 0xffff, (short __user *)wba);
219 break;
220 case BA_SIZE_LONG:
221 res = put_user(wbd, (int __user *)wba);
222 break;
223 }
224
225 /* set_fs can not be moved, otherwise put_user() may oops */
226 set_fs(old_fs);
227
228
229#ifdef DEBUG
230 printk("do_040writeback1, res=%d\n",res);
231#endif
232
233 return res;
234}
235
236/* after an exception in a writeback the stack frame corresponding
237 * to that exception is discarded, set a few bits in the old frame
238 * to simulate what it should look like
239 */
240static inline void fix_xframe040(struct frame *fp, unsigned long wba, unsigned short wbs)
241{
242 fp->un.fmt7.faddr = wba;
243 fp->un.fmt7.ssw = wbs & 0xff;
244 if (wba != current->thread.faddr)
245 fp->un.fmt7.ssw |= MA_040;
246}
247
248static inline void do_040writebacks(struct frame *fp)
249{
250 int res = 0;
251#if 0
252 if (fp->un.fmt7.wb1s & WBV_040)
253 printk("access_error040: cannot handle 1st writeback. oops.\n");
254#endif
255
256 if ((fp->un.fmt7.wb2s & WBV_040) &&
257 !(fp->un.fmt7.wb2s & WBTT_040)) {
258 res = do_040writeback1(fp->un.fmt7.wb2s, fp->un.fmt7.wb2a,
259 fp->un.fmt7.wb2d);
260 if (res)
261 fix_xframe040(fp, fp->un.fmt7.wb2a, fp->un.fmt7.wb2s);
262 else
263 fp->un.fmt7.wb2s = 0;
264 }
265
266 /* do the 2nd wb only if the first one was successful (except for a kernel wb) */
267 if (fp->un.fmt7.wb3s & WBV_040 && (!res || fp->un.fmt7.wb3s & 4)) {
268 res = do_040writeback1(fp->un.fmt7.wb3s, fp->un.fmt7.wb3a,
269 fp->un.fmt7.wb3d);
270 if (res)
271 {
272 fix_xframe040(fp, fp->un.fmt7.wb3a, fp->un.fmt7.wb3s);
273
274 fp->un.fmt7.wb2s = fp->un.fmt7.wb3s;
275 fp->un.fmt7.wb3s &= (~WBV_040);
276 fp->un.fmt7.wb2a = fp->un.fmt7.wb3a;
277 fp->un.fmt7.wb2d = fp->un.fmt7.wb3d;
278 }
279 else
280 fp->un.fmt7.wb3s = 0;
281 }
282
283 if (res)
284 send_fault_sig(&fp->ptregs);
285}
286
287/*
288 * called from sigreturn(), must ensure userspace code didn't
289 * manipulate exception frame to circumvent protection, then complete
290 * pending writebacks
291 * we just clear TM2 to turn it into a userspace access
292 */
293asmlinkage void berr_040cleanup(struct frame *fp)
294{
295 fp->un.fmt7.wb2s &= ~4;
296 fp->un.fmt7.wb3s &= ~4;
297
298 do_040writebacks(fp);
299}
300
301static inline void access_error040(struct frame *fp)
302{
303 unsigned short ssw = fp->un.fmt7.ssw;
304 unsigned long mmusr;
305
306#ifdef DEBUG
307 printk("ssw=%#x, fa=%#lx\n", ssw, fp->un.fmt7.faddr);
308 printk("wb1s=%#x, wb2s=%#x, wb3s=%#x\n", fp->un.fmt7.wb1s,
309 fp->un.fmt7.wb2s, fp->un.fmt7.wb3s);
310 printk ("wb2a=%lx, wb3a=%lx, wb2d=%lx, wb3d=%lx\n",
311 fp->un.fmt7.wb2a, fp->un.fmt7.wb3a,
312 fp->un.fmt7.wb2d, fp->un.fmt7.wb3d);
313#endif
314
315 if (ssw & ATC_040) {
316 unsigned long addr = fp->un.fmt7.faddr;
317 unsigned long errorcode;
318
319 /*
320 * The MMU status has to be determined AFTER the address
321 * has been corrected if there was a misaligned access (MA).
322 */
323 if (ssw & MA_040)
324 addr = (addr + 7) & -8;
325
326 /* MMU error, get the MMUSR info for this access */
327 mmusr = probe040(!(ssw & RW_040), addr, ssw);
328#ifdef DEBUG
329 printk("mmusr = %lx\n", mmusr);
330#endif
331 errorcode = 1;
332 if (!(mmusr & MMU_R_040)) {
333 /* clear the invalid atc entry */
334 __flush_tlb040_one(addr);
335 errorcode = 0;
336 }
337
338 /* despite what documentation seems to say, RMW
339 * accesses have always both the LK and RW bits set */
340 if (!(ssw & RW_040) || (ssw & LK_040))
341 errorcode |= 2;
342
343 if (do_page_fault(&fp->ptregs, addr, errorcode)) {
344#ifdef DEBUG
345 printk("do_page_fault() !=0\n");
346#endif
347 if (user_mode(&fp->ptregs)){
348 /* delay writebacks after signal delivery */
349#ifdef DEBUG
350 printk(".. was usermode - return\n");
351#endif
352 return;
353 }
354 /* disable writeback into user space from kernel
355 * (if do_page_fault didn't fix the mapping,
356 * the writeback won't do good)
357 */
358disable_wb:
359#ifdef DEBUG
360 printk(".. disabling wb2\n");
361#endif
362 if (fp->un.fmt7.wb2a == fp->un.fmt7.faddr)
363 fp->un.fmt7.wb2s &= ~WBV_040;
364 if (fp->un.fmt7.wb3a == fp->un.fmt7.faddr)
365 fp->un.fmt7.wb3s &= ~WBV_040;
366 }
367 } else {
368 /* In case of a bus error we either kill the process or expect
369 * the kernel to catch the fault, which then is also responsible
370 * for cleaning up the mess.
371 */
372 current->thread.signo = SIGBUS;
373 current->thread.faddr = fp->un.fmt7.faddr;
374 if (send_fault_sig(&fp->ptregs) >= 0)
375 printk("68040 bus error (ssw=%x, faddr=%lx)\n", ssw,
376 fp->un.fmt7.faddr);
377 goto disable_wb;
378 }
379
380 do_040writebacks(fp);
381}
382#endif /* CONFIG_M68040 */
383
384#if defined(CONFIG_SUN3)
385#include <asm/sun3mmu.h>
386
387extern int mmu_emu_handle_fault (unsigned long, int, int);
388
389/* sun3 version of bus_error030 */
390
391static inline void bus_error030 (struct frame *fp)
392{
393 unsigned char buserr_type = sun3_get_buserr ();
394 unsigned long addr, errorcode;
395 unsigned short ssw = fp->un.fmtb.ssw;
396 extern unsigned long _sun3_map_test_start, _sun3_map_test_end;
397
398#ifdef DEBUG
399 if (ssw & (FC | FB))
400 printk ("Instruction fault at %#010lx\n",
401 ssw & FC ?
402 fp->ptregs.format == 0xa ? fp->ptregs.pc + 2 : fp->un.fmtb.baddr - 2
403 :
404 fp->ptregs.format == 0xa ? fp->ptregs.pc + 4 : fp->un.fmtb.baddr);
405 if (ssw & DF)
406 printk ("Data %s fault at %#010lx in %s (pc=%#lx)\n",
407 ssw & RW ? "read" : "write",
408 fp->un.fmtb.daddr,
409 space_names[ssw & DFC], fp->ptregs.pc);
410#endif
411
412 /*
413 * Check if this page should be demand-mapped. This needs to go before
414 * the testing for a bad kernel-space access (demand-mapping applies
415 * to kernel accesses too).
416 */
417
418 if ((ssw & DF)
419 && (buserr_type & (SUN3_BUSERR_PROTERR | SUN3_BUSERR_INVALID))) {
420 if (mmu_emu_handle_fault (fp->un.fmtb.daddr, ssw & RW, 0))
421 return;
422 }
423
424 /* Check for kernel-space pagefault (BAD). */
425 if (fp->ptregs.sr & PS_S) {
426 /* kernel fault must be a data fault to user space */
427 if (! ((ssw & DF) && ((ssw & DFC) == USER_DATA))) {
428 // try checking the kernel mappings before surrender
429 if (mmu_emu_handle_fault (fp->un.fmtb.daddr, ssw & RW, 1))
430 return;
431 /* instruction fault or kernel data fault! */
432 if (ssw & (FC | FB))
433 printk ("Instruction fault at %#010lx\n",
434 fp->ptregs.pc);
435 if (ssw & DF) {
436 /* was this fault incurred testing bus mappings? */
437 if((fp->ptregs.pc >= (unsigned long)&_sun3_map_test_start) &&
438 (fp->ptregs.pc <= (unsigned long)&_sun3_map_test_end)) {
439 send_fault_sig(&fp->ptregs);
440 return;
441 }
442
443 printk ("Data %s fault at %#010lx in %s (pc=%#lx)\n",
444 ssw & RW ? "read" : "write",
445 fp->un.fmtb.daddr,
446 space_names[ssw & DFC], fp->ptregs.pc);
447 }
448 printk ("BAD KERNEL BUSERR\n");
449
450 die_if_kernel("Oops", &fp->ptregs,0);
451 force_sig(SIGKILL, current);
452 return;
453 }
454 } else {
455 /* user fault */
456 if (!(ssw & (FC | FB)) && !(ssw & DF))
457 /* not an instruction fault or data fault! BAD */
458 panic ("USER BUSERR w/o instruction or data fault");
459 }
460
461
462 /* First handle the data fault, if any. */
463 if (ssw & DF) {
464 addr = fp->un.fmtb.daddr;
465
466// errorcode bit 0: 0 -> no page 1 -> protection fault
467// errorcode bit 1: 0 -> read fault 1 -> write fault
468
469// (buserr_type & SUN3_BUSERR_PROTERR) -> protection fault
470// (buserr_type & SUN3_BUSERR_INVALID) -> invalid page fault
471
472 if (buserr_type & SUN3_BUSERR_PROTERR)
473 errorcode = 0x01;
474 else if (buserr_type & SUN3_BUSERR_INVALID)
475 errorcode = 0x00;
476 else {
477#ifdef DEBUG
478 printk ("*** unexpected busfault type=%#04x\n", buserr_type);
479 printk ("invalid %s access at %#lx from pc %#lx\n",
480 !(ssw & RW) ? "write" : "read", addr,
481 fp->ptregs.pc);
482#endif
483 die_if_kernel ("Oops", &fp->ptregs, buserr_type);
484 force_sig (SIGBUS, current);
485 return;
486 }
487
488//todo: wtf is RM bit? --m
489 if (!(ssw & RW) || ssw & RM)
490 errorcode |= 0x02;
491
492 /* Handle page fault. */
493 do_page_fault (&fp->ptregs, addr, errorcode);
494
495 /* Retry the data fault now. */
496 return;
497 }
498
499 /* Now handle the instruction fault. */
500
501 /* Get the fault address. */
502 if (fp->ptregs.format == 0xA)
503 addr = fp->ptregs.pc + 4;
504 else
505 addr = fp->un.fmtb.baddr;
506 if (ssw & FC)
507 addr -= 2;
508
509 if (buserr_type & SUN3_BUSERR_INVALID) {
510 if (!mmu_emu_handle_fault (fp->un.fmtb.daddr, 1, 0))
511 do_page_fault (&fp->ptregs, addr, 0);
512 } else {
513#ifdef DEBUG
514 printk ("protection fault on insn access (segv).\n");
515#endif
516 force_sig (SIGSEGV, current);
517 }
518}
519#else
520#if defined(CPU_M68020_OR_M68030)
521static inline void bus_error030 (struct frame *fp)
522{
523 volatile unsigned short temp;
524 unsigned short mmusr;
525 unsigned long addr, errorcode;
526 unsigned short ssw = fp->un.fmtb.ssw;
527#ifdef DEBUG
528 unsigned long desc;
529
530 printk ("pid = %x ", current->pid);
531 printk ("SSW=%#06x ", ssw);
532
533 if (ssw & (FC | FB))
534 printk ("Instruction fault at %#010lx\n",
535 ssw & FC ?
536 fp->ptregs.format == 0xa ? fp->ptregs.pc + 2 : fp->un.fmtb.baddr - 2
537 :
538 fp->ptregs.format == 0xa ? fp->ptregs.pc + 4 : fp->un.fmtb.baddr);
539 if (ssw & DF)
540 printk ("Data %s fault at %#010lx in %s (pc=%#lx)\n",
541 ssw & RW ? "read" : "write",
542 fp->un.fmtb.daddr,
543 space_names[ssw & DFC], fp->ptregs.pc);
544#endif
545
546 /* ++andreas: If a data fault and an instruction fault happen
547 at the same time map in both pages. */
548
549 /* First handle the data fault, if any. */
550 if (ssw & DF) {
551 addr = fp->un.fmtb.daddr;
552
553#ifdef DEBUG
554 asm volatile ("ptestr %3,%2@,#7,%0\n\t"
555 "pmove %%psr,%1@"
556 : "=a&" (desc)
557 : "a" (&temp), "a" (addr), "d" (ssw));
558#else
559 asm volatile ("ptestr %2,%1@,#7\n\t"
560 "pmove %%psr,%0@"
561 : : "a" (&temp), "a" (addr), "d" (ssw));
562#endif
563 mmusr = temp;
564
565#ifdef DEBUG
566 printk("mmusr is %#x for addr %#lx in task %p\n",
567 mmusr, addr, current);
568 printk("descriptor address is %#lx, contents %#lx\n",
569 __va(desc), *(unsigned long *)__va(desc));
570#endif
571
572 errorcode = (mmusr & MMU_I) ? 0 : 1;
573 if (!(ssw & RW) || (ssw & RM))
574 errorcode |= 2;
575
576 if (mmusr & (MMU_I | MMU_WP)) {
577 if (ssw & 4) {
578 printk("Data %s fault at %#010lx in %s (pc=%#lx)\n",
579 ssw & RW ? "read" : "write",
580 fp->un.fmtb.daddr,
581 space_names[ssw & DFC], fp->ptregs.pc);
582 goto buserr;
583 }
584 /* Don't try to do anything further if an exception was
585 handled. */
586 if (do_page_fault (&fp->ptregs, addr, errorcode) < 0)
587 return;
588 } else if (!(mmusr & MMU_I)) {
589 /* probably a 020 cas fault */
590 if (!(ssw & RM) && send_fault_sig(&fp->ptregs) > 0)
591 printk("unexpected bus error (%#x,%#x)\n", ssw, mmusr);
592 } else if (mmusr & (MMU_B|MMU_L|MMU_S)) {
593 printk("invalid %s access at %#lx from pc %#lx\n",
594 !(ssw & RW) ? "write" : "read", addr,
595 fp->ptregs.pc);
596 die_if_kernel("Oops",&fp->ptregs,mmusr);
597 force_sig(SIGSEGV, current);
598 return;
599 } else {
600#if 0
601 static volatile long tlong;
602#endif
603
604 printk("weird %s access at %#lx from pc %#lx (ssw is %#x)\n",
605 !(ssw & RW) ? "write" : "read", addr,
606 fp->ptregs.pc, ssw);
607 asm volatile ("ptestr #1,%1@,#0\n\t"
608 "pmove %%psr,%0@"
609 : /* no outputs */
610 : "a" (&temp), "a" (addr));
611 mmusr = temp;
612
613 printk ("level 0 mmusr is %#x\n", mmusr);
614#if 0
615 asm volatile ("pmove %%tt0,%0@"
616 : /* no outputs */
617 : "a" (&tlong));
618 printk("tt0 is %#lx, ", tlong);
619 asm volatile ("pmove %%tt1,%0@"
620 : /* no outputs */
621 : "a" (&tlong));
622 printk("tt1 is %#lx\n", tlong);
623#endif
624#ifdef DEBUG
625 printk("Unknown SIGSEGV - 1\n");
626#endif
627 die_if_kernel("Oops",&fp->ptregs,mmusr);
628 force_sig(SIGSEGV, current);
629 return;
630 }
631
632 /* setup an ATC entry for the access about to be retried */
633 if (!(ssw & RW) || (ssw & RM))
634 asm volatile ("ploadw %1,%0@" : /* no outputs */
635 : "a" (addr), "d" (ssw));
636 else
637 asm volatile ("ploadr %1,%0@" : /* no outputs */
638 : "a" (addr), "d" (ssw));
639 }
640
641 /* Now handle the instruction fault. */
642
643 if (!(ssw & (FC|FB)))
644 return;
645
646 if (fp->ptregs.sr & PS_S) {
647 printk("Instruction fault at %#010lx\n",
648 fp->ptregs.pc);
649 buserr:
650 printk ("BAD KERNEL BUSERR\n");
651 die_if_kernel("Oops",&fp->ptregs,0);
652 force_sig(SIGKILL, current);
653 return;
654 }
655
656 /* get the fault address */
657 if (fp->ptregs.format == 10)
658 addr = fp->ptregs.pc + 4;
659 else
660 addr = fp->un.fmtb.baddr;
661 if (ssw & FC)
662 addr -= 2;
663
664 if ((ssw & DF) && ((addr ^ fp->un.fmtb.daddr) & PAGE_MASK) == 0)
665 /* Insn fault on same page as data fault. But we
666 should still create the ATC entry. */
667 goto create_atc_entry;
668
669#ifdef DEBUG
670 asm volatile ("ptestr #1,%2@,#7,%0\n\t"
671 "pmove %%psr,%1@"
672 : "=a&" (desc)
673 : "a" (&temp), "a" (addr));
674#else
675 asm volatile ("ptestr #1,%1@,#7\n\t"
676 "pmove %%psr,%0@"
677 : : "a" (&temp), "a" (addr));
678#endif
679 mmusr = temp;
680
681#ifdef DEBUG
682 printk ("mmusr is %#x for addr %#lx in task %p\n",
683 mmusr, addr, current);
684 printk ("descriptor address is %#lx, contents %#lx\n",
685 __va(desc), *(unsigned long *)__va(desc));
686#endif
687
688 if (mmusr & MMU_I)
689 do_page_fault (&fp->ptregs, addr, 0);
690 else if (mmusr & (MMU_B|MMU_L|MMU_S)) {
691 printk ("invalid insn access at %#lx from pc %#lx\n",
692 addr, fp->ptregs.pc);
693#ifdef DEBUG
694 printk("Unknown SIGSEGV - 2\n");
695#endif
696 die_if_kernel("Oops",&fp->ptregs,mmusr);
697 force_sig(SIGSEGV, current);
698 return;
699 }
700
701create_atc_entry:
702 /* setup an ATC entry for the access about to be retried */
703 asm volatile ("ploadr #2,%0@" : /* no outputs */
704 : "a" (addr));
705}
706#endif /* CPU_M68020_OR_M68030 */
707#endif /* !CONFIG_SUN3 */
708
709asmlinkage void buserr_c(struct frame *fp)
710{
711 /* Only set esp0 if coming from user mode */
712 if (user_mode(&fp->ptregs))
713 current->thread.esp0 = (unsigned long) fp;
714
715#ifdef DEBUG
716 printk ("*** Bus Error *** Format is %x\n", fp->ptregs.format);
717#endif
718
719 switch (fp->ptregs.format) {
720#if defined (CONFIG_M68060)
721 case 4: /* 68060 access error */
722 access_error060 (fp);
723 break;
724#endif
725#if defined (CONFIG_M68040)
726 case 0x7: /* 68040 access error */
727 access_error040 (fp);
728 break;
729#endif
730#if defined (CPU_M68020_OR_M68030)
731 case 0xa:
732 case 0xb:
733 bus_error030 (fp);
734 break;
735#endif
736 default:
737 die_if_kernel("bad frame format",&fp->ptregs,0);
738#ifdef DEBUG
739 printk("Unknown SIGSEGV - 4\n");
740#endif
741 force_sig(SIGSEGV, current);
742 }
743}
744
745
746static int kstack_depth_to_print = 48;
747
748void show_trace(unsigned long *stack)
749{
750 unsigned long *endstack;
751 unsigned long addr;
752 int i;
753
754 printk("Call Trace:");
755 addr = (unsigned long)stack + THREAD_SIZE - 1;
756 endstack = (unsigned long *)(addr & -THREAD_SIZE);
757 i = 0;
758 while (stack + 1 <= endstack) {
759 addr = *stack++;
760 /*
761 * If the address is either in the text segment of the
762 * kernel, or in the region which contains vmalloc'ed
763 * memory, it *may* be the address of a calling
764 * routine; if so, print it so that someone tracing
765 * down the cause of the crash will be able to figure
766 * out the call path that was taken.
767 */
768 if (__kernel_text_address(addr)) {
769#ifndef CONFIG_KALLSYMS
770 if (i % 5 == 0)
771 printk("\n ");
772#endif
773 printk(" [<%08lx>] %pS\n", addr, (void *)addr);
774 i++;
775 }
776 }
777 printk("\n");
778}
779
780void show_registers(struct pt_regs *regs)
781{
782 struct frame *fp = (struct frame *)regs;
783 mm_segment_t old_fs = get_fs();
784 u16 c, *cp;
785 unsigned long addr;
786 int i;
787
788 print_modules();
789 printk("PC: [<%08lx>] %pS\n", regs->pc, (void *)regs->pc);
790 printk("SR: %04x SP: %p a2: %08lx\n", regs->sr, regs, regs->a2);
791 printk("d0: %08lx d1: %08lx d2: %08lx d3: %08lx\n",
792 regs->d0, regs->d1, regs->d2, regs->d3);
793 printk("d4: %08lx d5: %08lx a0: %08lx a1: %08lx\n",
794 regs->d4, regs->d5, regs->a0, regs->a1);
795
796 printk("Process %s (pid: %d, task=%p)\n",
797 current->comm, task_pid_nr(current), current);
798 addr = (unsigned long)&fp->un;
799 printk("Frame format=%X ", regs->format);
800 switch (regs->format) {
801 case 0x2:
802 printk("instr addr=%08lx\n", fp->un.fmt2.iaddr);
803 addr += sizeof(fp->un.fmt2);
804 break;
805 case 0x3:
806 printk("eff addr=%08lx\n", fp->un.fmt3.effaddr);
807 addr += sizeof(fp->un.fmt3);
808 break;
809 case 0x4:
810 printk((CPU_IS_060 ? "fault addr=%08lx fslw=%08lx\n"
811 : "eff addr=%08lx pc=%08lx\n"),
812 fp->un.fmt4.effaddr, fp->un.fmt4.pc);
813 addr += sizeof(fp->un.fmt4);
814 break;
815 case 0x7:
816 printk("eff addr=%08lx ssw=%04x faddr=%08lx\n",
817 fp->un.fmt7.effaddr, fp->un.fmt7.ssw, fp->un.fmt7.faddr);
818 printk("wb 1 stat/addr/data: %04x %08lx %08lx\n",
819 fp->un.fmt7.wb1s, fp->un.fmt7.wb1a, fp->un.fmt7.wb1dpd0);
820 printk("wb 2 stat/addr/data: %04x %08lx %08lx\n",
821 fp->un.fmt7.wb2s, fp->un.fmt7.wb2a, fp->un.fmt7.wb2d);
822 printk("wb 3 stat/addr/data: %04x %08lx %08lx\n",
823 fp->un.fmt7.wb3s, fp->un.fmt7.wb3a, fp->un.fmt7.wb3d);
824 printk("push data: %08lx %08lx %08lx %08lx\n",
825 fp->un.fmt7.wb1dpd0, fp->un.fmt7.pd1, fp->un.fmt7.pd2,
826 fp->un.fmt7.pd3);
827 addr += sizeof(fp->un.fmt7);
828 break;
829 case 0x9:
830 printk("instr addr=%08lx\n", fp->un.fmt9.iaddr);
831 addr += sizeof(fp->un.fmt9);
832 break;
833 case 0xa:
834 printk("ssw=%04x isc=%04x isb=%04x daddr=%08lx dobuf=%08lx\n",
835 fp->un.fmta.ssw, fp->un.fmta.isc, fp->un.fmta.isb,
836 fp->un.fmta.daddr, fp->un.fmta.dobuf);
837 addr += sizeof(fp->un.fmta);
838 break;
839 case 0xb:
840 printk("ssw=%04x isc=%04x isb=%04x daddr=%08lx dobuf=%08lx\n",
841 fp->un.fmtb.ssw, fp->un.fmtb.isc, fp->un.fmtb.isb,
842 fp->un.fmtb.daddr, fp->un.fmtb.dobuf);
843 printk("baddr=%08lx dibuf=%08lx ver=%x\n",
844 fp->un.fmtb.baddr, fp->un.fmtb.dibuf, fp->un.fmtb.ver);
845 addr += sizeof(fp->un.fmtb);
846 break;
847 default:
848 printk("\n");
849 }
850 show_stack(NULL, (unsigned long *)addr);
851
852 printk("Code:");
853 set_fs(KERNEL_DS);
854 cp = (u16 *)regs->pc;
855 for (i = -8; i < 16; i++) {
856 if (get_user(c, cp + i) && i >= 0) {
857 printk(" Bad PC value.");
858 break;
859 }
860 printk(i ? " %04x" : " <%04x>", c);
861 }
862 set_fs(old_fs);
863 printk ("\n");
864}
865
866void show_stack(struct task_struct *task, unsigned long *stack)
867{
868 unsigned long *p;
869 unsigned long *endstack;
870 int i;
871
872 if (!stack) {
873 if (task)
874 stack = (unsigned long *)task->thread.esp0;
875 else
876 stack = (unsigned long *)&stack;
877 }
878 endstack = (unsigned long *)(((unsigned long)stack + THREAD_SIZE - 1) & -THREAD_SIZE);
879
880 printk("Stack from %08lx:", (unsigned long)stack);
881 p = stack;
882 for (i = 0; i < kstack_depth_to_print; i++) {
883 if (p + 1 > endstack)
884 break;
885 if (i % 8 == 0)
886 printk("\n ");
887 printk(" %08lx", *p++);
888 }
889 printk("\n");
890 show_trace(stack);
891}
892
893/*
894 * The architecture-independent backtrace generator
895 */
896void dump_stack(void)
897{
898 unsigned long stack;
899
900 show_trace(&stack);
901}
902
903EXPORT_SYMBOL(dump_stack);
904
905/*
906 * The vector number returned in the frame pointer may also contain
907 * the "fs" (Fault Status) bits on ColdFire. These are in the bottom
908 * 2 bits, and upper 2 bits. So we need to mask out the real vector
909 * number before using it in comparisons. You don't need to do this on
910 * real 68k parts, but it won't hurt either.
911 */
912
913void bad_super_trap (struct frame *fp)
914{
915 int vector = (fp->ptregs.vector >> 2) & 0xff;
916
917 console_verbose();
918 if (vector < ARRAY_SIZE(vec_names))
919 printk ("*** %s *** FORMAT=%X\n",
920 vec_names[vector],
921 fp->ptregs.format);
922 else
923 printk ("*** Exception %d *** FORMAT=%X\n",
924 vector, fp->ptregs.format);
925 if (vector == VEC_ADDRERR && CPU_IS_020_OR_030) {
926 unsigned short ssw = fp->un.fmtb.ssw;
927
928 printk ("SSW=%#06x ", ssw);
929
930 if (ssw & RC)
931 printk ("Pipe stage C instruction fault at %#010lx\n",
932 (fp->ptregs.format) == 0xA ?
933 fp->ptregs.pc + 2 : fp->un.fmtb.baddr - 2);
934 if (ssw & RB)
935 printk ("Pipe stage B instruction fault at %#010lx\n",
936 (fp->ptregs.format) == 0xA ?
937 fp->ptregs.pc + 4 : fp->un.fmtb.baddr);
938 if (ssw & DF)
939 printk ("Data %s fault at %#010lx in %s (pc=%#lx)\n",
940 ssw & RW ? "read" : "write",
941 fp->un.fmtb.daddr, space_names[ssw & DFC],
942 fp->ptregs.pc);
943 }
944 printk ("Current process id is %d\n", task_pid_nr(current));
945 die_if_kernel("BAD KERNEL TRAP", &fp->ptregs, 0);
946}
947
948asmlinkage void trap_c(struct frame *fp)
949{
950 int sig;
951 int vector = (fp->ptregs.vector >> 2) & 0xff;
952 siginfo_t info;
953
954 if (fp->ptregs.sr & PS_S) {
955 if (vector == VEC_TRACE) {
956 /* traced a trapping instruction on a 68020/30,
957 * real exception will be executed afterwards.
958 */
959 } else if (!handle_kernel_fault(&fp->ptregs))
960 bad_super_trap(fp);
961 return;
962 }
963
964 /* send the appropriate signal to the user program */
965 switch (vector) {
966 case VEC_ADDRERR:
967 info.si_code = BUS_ADRALN;
968 sig = SIGBUS;
969 break;
970 case VEC_ILLEGAL:
971 case VEC_LINE10:
972 case VEC_LINE11:
973 info.si_code = ILL_ILLOPC;
974 sig = SIGILL;
975 break;
976 case VEC_PRIV:
977 info.si_code = ILL_PRVOPC;
978 sig = SIGILL;
979 break;
980 case VEC_COPROC:
981 info.si_code = ILL_COPROC;
982 sig = SIGILL;
983 break;
984 case VEC_TRAP1:
985 case VEC_TRAP2:
986 case VEC_TRAP3:
987 case VEC_TRAP4:
988 case VEC_TRAP5:
989 case VEC_TRAP6:
990 case VEC_TRAP7:
991 case VEC_TRAP8:
992 case VEC_TRAP9:
993 case VEC_TRAP10:
994 case VEC_TRAP11:
995 case VEC_TRAP12:
996 case VEC_TRAP13:
997 case VEC_TRAP14:
998 info.si_code = ILL_ILLTRP;
999 sig = SIGILL;
1000 break;
1001 case VEC_FPBRUC:
1002 case VEC_FPOE:
1003 case VEC_FPNAN:
1004 info.si_code = FPE_FLTINV;
1005 sig = SIGFPE;
1006 break;
1007 case VEC_FPIR:
1008 info.si_code = FPE_FLTRES;
1009 sig = SIGFPE;
1010 break;
1011 case VEC_FPDIVZ:
1012 info.si_code = FPE_FLTDIV;
1013 sig = SIGFPE;
1014 break;
1015 case VEC_FPUNDER:
1016 info.si_code = FPE_FLTUND;
1017 sig = SIGFPE;
1018 break;
1019 case VEC_FPOVER:
1020 info.si_code = FPE_FLTOVF;
1021 sig = SIGFPE;
1022 break;
1023 case VEC_ZERODIV:
1024 info.si_code = FPE_INTDIV;
1025 sig = SIGFPE;
1026 break;
1027 case VEC_CHK:
1028 case VEC_TRAP:
1029 info.si_code = FPE_INTOVF;
1030 sig = SIGFPE;
1031 break;
1032 case VEC_TRACE: /* ptrace single step */
1033 info.si_code = TRAP_TRACE;
1034 sig = SIGTRAP;
1035 break;
1036 case VEC_TRAP15: /* breakpoint */
1037 info.si_code = TRAP_BRKPT;
1038 sig = SIGTRAP;
1039 break;
1040 default:
1041 info.si_code = ILL_ILLOPC;
1042 sig = SIGILL;
1043 break;
1044 }
1045 info.si_signo = sig;
1046 info.si_errno = 0;
1047 switch (fp->ptregs.format) {
1048 default:
1049 info.si_addr = (void *) fp->ptregs.pc;
1050 break;
1051 case 2:
1052 info.si_addr = (void *) fp->un.fmt2.iaddr;
1053 break;
1054 case 7:
1055 info.si_addr = (void *) fp->un.fmt7.effaddr;
1056 break;
1057 case 9:
1058 info.si_addr = (void *) fp->un.fmt9.iaddr;
1059 break;
1060 case 10:
1061 info.si_addr = (void *) fp->un.fmta.daddr;
1062 break;
1063 case 11:
1064 info.si_addr = (void *) fp->un.fmtb.daddr;
1065 break;
1066 }
1067 force_sig_info (sig, &info, current);
1068}
1069
1070void die_if_kernel (char *str, struct pt_regs *fp, int nr)
1071{
1072 if (!(fp->sr & PS_S))
1073 return;
1074
1075 console_verbose();
1076 printk("%s: %08x\n",str,nr);
1077 show_registers(fp);
1078 add_taint(TAINT_DIE);
1079 do_exit(SIGSEGV);
1080}
1081
1082asmlinkage void set_esp0(unsigned long ssp)
1083{
1084 current->thread.esp0 = ssp;
1085}
1086
1087/*
1088 * This function is called if an error occur while accessing
1089 * user-space from the fpsp040 code.
1090 */
1091asmlinkage void fpsp040_die(void)
1092{
1093 do_exit(SIGSEGV);
1094}
1095
1096#ifdef CONFIG_M68KFPU_EMU
1097asmlinkage void fpemu_signal(int signal, int code, void *addr)
1098{
1099 siginfo_t info;
1100
1101 info.si_signo = signal;
1102 info.si_errno = 0;
1103 info.si_code = code;
1104 info.si_addr = addr;
1105 force_sig_info(signal, &info, current);
1106}
5#endif 1107#endif
diff --git a/arch/m68k/kernel/traps_mm.c b/arch/m68k/kernel/traps_mm.c
deleted file mode 100644
index 4022bbc28878..000000000000
--- a/arch/m68k/kernel/traps_mm.c
+++ /dev/null
@@ -1,1207 +0,0 @@
1/*
2 * linux/arch/m68k/kernel/traps.c
3 *
4 * Copyright (C) 1993, 1994 by Hamish Macdonald
5 *
6 * 68040 fixes by Michael Rausch
7 * 68040 fixes by Martin Apel
8 * 68040 fixes and writeback by Richard Zidlicky
9 * 68060 fixes by Roman Hodek
10 * 68060 fixes by Jesper Skov
11 *
12 * This file is subject to the terms and conditions of the GNU General Public
13 * License. See the file COPYING in the main directory of this archive
14 * for more details.
15 */
16
17/*
18 * Sets up all exception vectors
19 */
20
21#include <linux/sched.h>
22#include <linux/signal.h>
23#include <linux/kernel.h>
24#include <linux/mm.h>
25#include <linux/module.h>
26#include <linux/user.h>
27#include <linux/string.h>
28#include <linux/linkage.h>
29#include <linux/init.h>
30#include <linux/ptrace.h>
31#include <linux/kallsyms.h>
32
33#include <asm/setup.h>
34#include <asm/fpu.h>
35#include <asm/system.h>
36#include <asm/uaccess.h>
37#include <asm/traps.h>
38#include <asm/pgalloc.h>
39#include <asm/machdep.h>
40#include <asm/siginfo.h>
41
42/* assembler routines */
43asmlinkage void system_call(void);
44asmlinkage void buserr(void);
45asmlinkage void trap(void);
46asmlinkage void nmihandler(void);
47#ifdef CONFIG_M68KFPU_EMU
48asmlinkage void fpu_emu(void);
49#endif
50
51e_vector vectors[256];
52
53/* nmi handler for the Amiga */
54asm(".text\n"
55 __ALIGN_STR "\n"
56 "nmihandler: rte");
57
58/*
59 * this must be called very early as the kernel might
60 * use some instruction that are emulated on the 060
61 * and so we're prepared for early probe attempts (e.g. nf_init).
62 */
63void __init base_trap_init(void)
64{
65 if (MACH_IS_SUN3X) {
66 extern e_vector *sun3x_prom_vbr;
67
68 __asm__ volatile ("movec %%vbr, %0" : "=r" (sun3x_prom_vbr));
69 }
70
71 /* setup the exception vector table */
72 __asm__ volatile ("movec %0,%%vbr" : : "r" ((void*)vectors));
73
74 if (CPU_IS_060) {
75 /* set up ISP entry points */
76 asmlinkage void unimp_vec(void) asm ("_060_isp_unimp");
77
78 vectors[VEC_UNIMPII] = unimp_vec;
79 }
80
81 vectors[VEC_BUSERR] = buserr;
82 vectors[VEC_ILLEGAL] = trap;
83 vectors[VEC_SYS] = system_call;
84}
85
86void __init trap_init (void)
87{
88 int i;
89
90 for (i = VEC_SPUR; i <= VEC_INT7; i++)
91 vectors[i] = bad_inthandler;
92
93 for (i = 0; i < VEC_USER; i++)
94 if (!vectors[i])
95 vectors[i] = trap;
96
97 for (i = VEC_USER; i < 256; i++)
98 vectors[i] = bad_inthandler;
99
100#ifdef CONFIG_M68KFPU_EMU
101 if (FPU_IS_EMU)
102 vectors[VEC_LINE11] = fpu_emu;
103#endif
104
105 if (CPU_IS_040 && !FPU_IS_EMU) {
106 /* set up FPSP entry points */
107 asmlinkage void dz_vec(void) asm ("dz");
108 asmlinkage void inex_vec(void) asm ("inex");
109 asmlinkage void ovfl_vec(void) asm ("ovfl");
110 asmlinkage void unfl_vec(void) asm ("unfl");
111 asmlinkage void snan_vec(void) asm ("snan");
112 asmlinkage void operr_vec(void) asm ("operr");
113 asmlinkage void bsun_vec(void) asm ("bsun");
114 asmlinkage void fline_vec(void) asm ("fline");
115 asmlinkage void unsupp_vec(void) asm ("unsupp");
116
117 vectors[VEC_FPDIVZ] = dz_vec;
118 vectors[VEC_FPIR] = inex_vec;
119 vectors[VEC_FPOVER] = ovfl_vec;
120 vectors[VEC_FPUNDER] = unfl_vec;
121 vectors[VEC_FPNAN] = snan_vec;
122 vectors[VEC_FPOE] = operr_vec;
123 vectors[VEC_FPBRUC] = bsun_vec;
124 vectors[VEC_LINE11] = fline_vec;
125 vectors[VEC_FPUNSUP] = unsupp_vec;
126 }
127
128 if (CPU_IS_060 && !FPU_IS_EMU) {
129 /* set up IFPSP entry points */
130 asmlinkage void snan_vec6(void) asm ("_060_fpsp_snan");
131 asmlinkage void operr_vec6(void) asm ("_060_fpsp_operr");
132 asmlinkage void ovfl_vec6(void) asm ("_060_fpsp_ovfl");
133 asmlinkage void unfl_vec6(void) asm ("_060_fpsp_unfl");
134 asmlinkage void dz_vec6(void) asm ("_060_fpsp_dz");
135 asmlinkage void inex_vec6(void) asm ("_060_fpsp_inex");
136 asmlinkage void fline_vec6(void) asm ("_060_fpsp_fline");
137 asmlinkage void unsupp_vec6(void) asm ("_060_fpsp_unsupp");
138 asmlinkage void effadd_vec6(void) asm ("_060_fpsp_effadd");
139
140 vectors[VEC_FPNAN] = snan_vec6;
141 vectors[VEC_FPOE] = operr_vec6;
142 vectors[VEC_FPOVER] = ovfl_vec6;
143 vectors[VEC_FPUNDER] = unfl_vec6;
144 vectors[VEC_FPDIVZ] = dz_vec6;
145 vectors[VEC_FPIR] = inex_vec6;
146 vectors[VEC_LINE11] = fline_vec6;
147 vectors[VEC_FPUNSUP] = unsupp_vec6;
148 vectors[VEC_UNIMPEA] = effadd_vec6;
149 }
150
151 /* if running on an amiga, make the NMI interrupt do nothing */
152 if (MACH_IS_AMIGA) {
153 vectors[VEC_INT7] = nmihandler;
154 }
155}
156
157
158static const char *vec_names[] = {
159 [VEC_RESETSP] = "RESET SP",
160 [VEC_RESETPC] = "RESET PC",
161 [VEC_BUSERR] = "BUS ERROR",
162 [VEC_ADDRERR] = "ADDRESS ERROR",
163 [VEC_ILLEGAL] = "ILLEGAL INSTRUCTION",
164 [VEC_ZERODIV] = "ZERO DIVIDE",
165 [VEC_CHK] = "CHK",
166 [VEC_TRAP] = "TRAPcc",
167 [VEC_PRIV] = "PRIVILEGE VIOLATION",
168 [VEC_TRACE] = "TRACE",
169 [VEC_LINE10] = "LINE 1010",
170 [VEC_LINE11] = "LINE 1111",
171 [VEC_RESV12] = "UNASSIGNED RESERVED 12",
172 [VEC_COPROC] = "COPROCESSOR PROTOCOL VIOLATION",
173 [VEC_FORMAT] = "FORMAT ERROR",
174 [VEC_UNINT] = "UNINITIALIZED INTERRUPT",
175 [VEC_RESV16] = "UNASSIGNED RESERVED 16",
176 [VEC_RESV17] = "UNASSIGNED RESERVED 17",
177 [VEC_RESV18] = "UNASSIGNED RESERVED 18",
178 [VEC_RESV19] = "UNASSIGNED RESERVED 19",
179 [VEC_RESV20] = "UNASSIGNED RESERVED 20",
180 [VEC_RESV21] = "UNASSIGNED RESERVED 21",
181 [VEC_RESV22] = "UNASSIGNED RESERVED 22",
182 [VEC_RESV23] = "UNASSIGNED RESERVED 23",
183 [VEC_SPUR] = "SPURIOUS INTERRUPT",
184 [VEC_INT1] = "LEVEL 1 INT",
185 [VEC_INT2] = "LEVEL 2 INT",
186 [VEC_INT3] = "LEVEL 3 INT",
187 [VEC_INT4] = "LEVEL 4 INT",
188 [VEC_INT5] = "LEVEL 5 INT",
189 [VEC_INT6] = "LEVEL 6 INT",
190 [VEC_INT7] = "LEVEL 7 INT",
191 [VEC_SYS] = "SYSCALL",
192 [VEC_TRAP1] = "TRAP #1",
193 [VEC_TRAP2] = "TRAP #2",
194 [VEC_TRAP3] = "TRAP #3",
195 [VEC_TRAP4] = "TRAP #4",
196 [VEC_TRAP5] = "TRAP #5",
197 [VEC_TRAP6] = "TRAP #6",
198 [VEC_TRAP7] = "TRAP #7",
199 [VEC_TRAP8] = "TRAP #8",
200 [VEC_TRAP9] = "TRAP #9",
201 [VEC_TRAP10] = "TRAP #10",
202 [VEC_TRAP11] = "TRAP #11",
203 [VEC_TRAP12] = "TRAP #12",
204 [VEC_TRAP13] = "TRAP #13",
205 [VEC_TRAP14] = "TRAP #14",
206 [VEC_TRAP15] = "TRAP #15",
207 [VEC_FPBRUC] = "FPCP BSUN",
208 [VEC_FPIR] = "FPCP INEXACT",
209 [VEC_FPDIVZ] = "FPCP DIV BY 0",
210 [VEC_FPUNDER] = "FPCP UNDERFLOW",
211 [VEC_FPOE] = "FPCP OPERAND ERROR",
212 [VEC_FPOVER] = "FPCP OVERFLOW",
213 [VEC_FPNAN] = "FPCP SNAN",
214 [VEC_FPUNSUP] = "FPCP UNSUPPORTED OPERATION",
215 [VEC_MMUCFG] = "MMU CONFIGURATION ERROR",
216 [VEC_MMUILL] = "MMU ILLEGAL OPERATION ERROR",
217 [VEC_MMUACC] = "MMU ACCESS LEVEL VIOLATION ERROR",
218 [VEC_RESV59] = "UNASSIGNED RESERVED 59",
219 [VEC_UNIMPEA] = "UNASSIGNED RESERVED 60",
220 [VEC_UNIMPII] = "UNASSIGNED RESERVED 61",
221 [VEC_RESV62] = "UNASSIGNED RESERVED 62",
222 [VEC_RESV63] = "UNASSIGNED RESERVED 63",
223};
224
225static const char *space_names[] = {
226 [0] = "Space 0",
227 [USER_DATA] = "User Data",
228 [USER_PROGRAM] = "User Program",
229#ifndef CONFIG_SUN3
230 [3] = "Space 3",
231#else
232 [FC_CONTROL] = "Control",
233#endif
234 [4] = "Space 4",
235 [SUPER_DATA] = "Super Data",
236 [SUPER_PROGRAM] = "Super Program",
237 [CPU_SPACE] = "CPU"
238};
239
240void die_if_kernel(char *,struct pt_regs *,int);
241asmlinkage int do_page_fault(struct pt_regs *regs, unsigned long address,
242 unsigned long error_code);
243int send_fault_sig(struct pt_regs *regs);
244
245asmlinkage void trap_c(struct frame *fp);
246
247#if defined (CONFIG_M68060)
248static inline void access_error060 (struct frame *fp)
249{
250 unsigned long fslw = fp->un.fmt4.pc; /* is really FSLW for access error */
251
252#ifdef DEBUG
253 printk("fslw=%#lx, fa=%#lx\n", fslw, fp->un.fmt4.effaddr);
254#endif
255
256 if (fslw & MMU060_BPE) {
257 /* branch prediction error -> clear branch cache */
258 __asm__ __volatile__ ("movec %/cacr,%/d0\n\t"
259 "orl #0x00400000,%/d0\n\t"
260 "movec %/d0,%/cacr"
261 : : : "d0" );
262 /* return if there's no other error */
263 if (!(fslw & MMU060_ERR_BITS) && !(fslw & MMU060_SEE))
264 return;
265 }
266
267 if (fslw & (MMU060_DESC_ERR | MMU060_WP | MMU060_SP)) {
268 unsigned long errorcode;
269 unsigned long addr = fp->un.fmt4.effaddr;
270
271 if (fslw & MMU060_MA)
272 addr = (addr + PAGE_SIZE - 1) & PAGE_MASK;
273
274 errorcode = 1;
275 if (fslw & MMU060_DESC_ERR) {
276 __flush_tlb040_one(addr);
277 errorcode = 0;
278 }
279 if (fslw & MMU060_W)
280 errorcode |= 2;
281#ifdef DEBUG
282 printk("errorcode = %d\n", errorcode );
283#endif
284 do_page_fault(&fp->ptregs, addr, errorcode);
285 } else if (fslw & (MMU060_SEE)){
286 /* Software Emulation Error.
287 * fault during mem_read/mem_write in ifpsp060/os.S
288 */
289 send_fault_sig(&fp->ptregs);
290 } else if (!(fslw & (MMU060_RE|MMU060_WE)) ||
291 send_fault_sig(&fp->ptregs) > 0) {
292 printk("pc=%#lx, fa=%#lx\n", fp->ptregs.pc, fp->un.fmt4.effaddr);
293 printk( "68060 access error, fslw=%lx\n", fslw );
294 trap_c( fp );
295 }
296}
297#endif /* CONFIG_M68060 */
298
299#if defined (CONFIG_M68040)
300static inline unsigned long probe040(int iswrite, unsigned long addr, int wbs)
301{
302 unsigned long mmusr;
303 mm_segment_t old_fs = get_fs();
304
305 set_fs(MAKE_MM_SEG(wbs));
306
307 if (iswrite)
308 asm volatile (".chip 68040; ptestw (%0); .chip 68k" : : "a" (addr));
309 else
310 asm volatile (".chip 68040; ptestr (%0); .chip 68k" : : "a" (addr));
311
312 asm volatile (".chip 68040; movec %%mmusr,%0; .chip 68k" : "=r" (mmusr));
313
314 set_fs(old_fs);
315
316 return mmusr;
317}
318
319static inline int do_040writeback1(unsigned short wbs, unsigned long wba,
320 unsigned long wbd)
321{
322 int res = 0;
323 mm_segment_t old_fs = get_fs();
324
325 /* set_fs can not be moved, otherwise put_user() may oops */
326 set_fs(MAKE_MM_SEG(wbs));
327
328 switch (wbs & WBSIZ_040) {
329 case BA_SIZE_BYTE:
330 res = put_user(wbd & 0xff, (char __user *)wba);
331 break;
332 case BA_SIZE_WORD:
333 res = put_user(wbd & 0xffff, (short __user *)wba);
334 break;
335 case BA_SIZE_LONG:
336 res = put_user(wbd, (int __user *)wba);
337 break;
338 }
339
340 /* set_fs can not be moved, otherwise put_user() may oops */
341 set_fs(old_fs);
342
343
344#ifdef DEBUG
345 printk("do_040writeback1, res=%d\n",res);
346#endif
347
348 return res;
349}
350
351/* after an exception in a writeback the stack frame corresponding
352 * to that exception is discarded, set a few bits in the old frame
353 * to simulate what it should look like
354 */
355static inline void fix_xframe040(struct frame *fp, unsigned long wba, unsigned short wbs)
356{
357 fp->un.fmt7.faddr = wba;
358 fp->un.fmt7.ssw = wbs & 0xff;
359 if (wba != current->thread.faddr)
360 fp->un.fmt7.ssw |= MA_040;
361}
362
363static inline void do_040writebacks(struct frame *fp)
364{
365 int res = 0;
366#if 0
367 if (fp->un.fmt7.wb1s & WBV_040)
368 printk("access_error040: cannot handle 1st writeback. oops.\n");
369#endif
370
371 if ((fp->un.fmt7.wb2s & WBV_040) &&
372 !(fp->un.fmt7.wb2s & WBTT_040)) {
373 res = do_040writeback1(fp->un.fmt7.wb2s, fp->un.fmt7.wb2a,
374 fp->un.fmt7.wb2d);
375 if (res)
376 fix_xframe040(fp, fp->un.fmt7.wb2a, fp->un.fmt7.wb2s);
377 else
378 fp->un.fmt7.wb2s = 0;
379 }
380
381 /* do the 2nd wb only if the first one was successful (except for a kernel wb) */
382 if (fp->un.fmt7.wb3s & WBV_040 && (!res || fp->un.fmt7.wb3s & 4)) {
383 res = do_040writeback1(fp->un.fmt7.wb3s, fp->un.fmt7.wb3a,
384 fp->un.fmt7.wb3d);
385 if (res)
386 {
387 fix_xframe040(fp, fp->un.fmt7.wb3a, fp->un.fmt7.wb3s);
388
389 fp->un.fmt7.wb2s = fp->un.fmt7.wb3s;
390 fp->un.fmt7.wb3s &= (~WBV_040);
391 fp->un.fmt7.wb2a = fp->un.fmt7.wb3a;
392 fp->un.fmt7.wb2d = fp->un.fmt7.wb3d;
393 }
394 else
395 fp->un.fmt7.wb3s = 0;
396 }
397
398 if (res)
399 send_fault_sig(&fp->ptregs);
400}
401
402/*
403 * called from sigreturn(), must ensure userspace code didn't
404 * manipulate exception frame to circumvent protection, then complete
405 * pending writebacks
406 * we just clear TM2 to turn it into a userspace access
407 */
408asmlinkage void berr_040cleanup(struct frame *fp)
409{
410 fp->un.fmt7.wb2s &= ~4;
411 fp->un.fmt7.wb3s &= ~4;
412
413 do_040writebacks(fp);
414}
415
416static inline void access_error040(struct frame *fp)
417{
418 unsigned short ssw = fp->un.fmt7.ssw;
419 unsigned long mmusr;
420
421#ifdef DEBUG
422 printk("ssw=%#x, fa=%#lx\n", ssw, fp->un.fmt7.faddr);
423 printk("wb1s=%#x, wb2s=%#x, wb3s=%#x\n", fp->un.fmt7.wb1s,
424 fp->un.fmt7.wb2s, fp->un.fmt7.wb3s);
425 printk ("wb2a=%lx, wb3a=%lx, wb2d=%lx, wb3d=%lx\n",
426 fp->un.fmt7.wb2a, fp->un.fmt7.wb3a,
427 fp->un.fmt7.wb2d, fp->un.fmt7.wb3d);
428#endif
429
430 if (ssw & ATC_040) {
431 unsigned long addr = fp->un.fmt7.faddr;
432 unsigned long errorcode;
433
434 /*
435 * The MMU status has to be determined AFTER the address
436 * has been corrected if there was a misaligned access (MA).
437 */
438 if (ssw & MA_040)
439 addr = (addr + 7) & -8;
440
441 /* MMU error, get the MMUSR info for this access */
442 mmusr = probe040(!(ssw & RW_040), addr, ssw);
443#ifdef DEBUG
444 printk("mmusr = %lx\n", mmusr);
445#endif
446 errorcode = 1;
447 if (!(mmusr & MMU_R_040)) {
448 /* clear the invalid atc entry */
449 __flush_tlb040_one(addr);
450 errorcode = 0;
451 }
452
453 /* despite what documentation seems to say, RMW
454 * accesses have always both the LK and RW bits set */
455 if (!(ssw & RW_040) || (ssw & LK_040))
456 errorcode |= 2;
457
458 if (do_page_fault(&fp->ptregs, addr, errorcode)) {
459#ifdef DEBUG
460 printk("do_page_fault() !=0\n");
461#endif
462 if (user_mode(&fp->ptregs)){
463 /* delay writebacks after signal delivery */
464#ifdef DEBUG
465 printk(".. was usermode - return\n");
466#endif
467 return;
468 }
469 /* disable writeback into user space from kernel
470 * (if do_page_fault didn't fix the mapping,
471 * the writeback won't do good)
472 */
473disable_wb:
474#ifdef DEBUG
475 printk(".. disabling wb2\n");
476#endif
477 if (fp->un.fmt7.wb2a == fp->un.fmt7.faddr)
478 fp->un.fmt7.wb2s &= ~WBV_040;
479 if (fp->un.fmt7.wb3a == fp->un.fmt7.faddr)
480 fp->un.fmt7.wb3s &= ~WBV_040;
481 }
482 } else {
483 /* In case of a bus error we either kill the process or expect
484 * the kernel to catch the fault, which then is also responsible
485 * for cleaning up the mess.
486 */
487 current->thread.signo = SIGBUS;
488 current->thread.faddr = fp->un.fmt7.faddr;
489 if (send_fault_sig(&fp->ptregs) >= 0)
490 printk("68040 bus error (ssw=%x, faddr=%lx)\n", ssw,
491 fp->un.fmt7.faddr);
492 goto disable_wb;
493 }
494
495 do_040writebacks(fp);
496}
497#endif /* CONFIG_M68040 */
498
499#if defined(CONFIG_SUN3)
500#include <asm/sun3mmu.h>
501
502extern int mmu_emu_handle_fault (unsigned long, int, int);
503
504/* sun3 version of bus_error030 */
505
506static inline void bus_error030 (struct frame *fp)
507{
508 unsigned char buserr_type = sun3_get_buserr ();
509 unsigned long addr, errorcode;
510 unsigned short ssw = fp->un.fmtb.ssw;
511 extern unsigned long _sun3_map_test_start, _sun3_map_test_end;
512
513#ifdef DEBUG
514 if (ssw & (FC | FB))
515 printk ("Instruction fault at %#010lx\n",
516 ssw & FC ?
517 fp->ptregs.format == 0xa ? fp->ptregs.pc + 2 : fp->un.fmtb.baddr - 2
518 :
519 fp->ptregs.format == 0xa ? fp->ptregs.pc + 4 : fp->un.fmtb.baddr);
520 if (ssw & DF)
521 printk ("Data %s fault at %#010lx in %s (pc=%#lx)\n",
522 ssw & RW ? "read" : "write",
523 fp->un.fmtb.daddr,
524 space_names[ssw & DFC], fp->ptregs.pc);
525#endif
526
527 /*
528 * Check if this page should be demand-mapped. This needs to go before
529 * the testing for a bad kernel-space access (demand-mapping applies
530 * to kernel accesses too).
531 */
532
533 if ((ssw & DF)
534 && (buserr_type & (SUN3_BUSERR_PROTERR | SUN3_BUSERR_INVALID))) {
535 if (mmu_emu_handle_fault (fp->un.fmtb.daddr, ssw & RW, 0))
536 return;
537 }
538
539 /* Check for kernel-space pagefault (BAD). */
540 if (fp->ptregs.sr & PS_S) {
541 /* kernel fault must be a data fault to user space */
542 if (! ((ssw & DF) && ((ssw & DFC) == USER_DATA))) {
543 // try checking the kernel mappings before surrender
544 if (mmu_emu_handle_fault (fp->un.fmtb.daddr, ssw & RW, 1))
545 return;
546 /* instruction fault or kernel data fault! */
547 if (ssw & (FC | FB))
548 printk ("Instruction fault at %#010lx\n",
549 fp->ptregs.pc);
550 if (ssw & DF) {
551 /* was this fault incurred testing bus mappings? */
552 if((fp->ptregs.pc >= (unsigned long)&_sun3_map_test_start) &&
553 (fp->ptregs.pc <= (unsigned long)&_sun3_map_test_end)) {
554 send_fault_sig(&fp->ptregs);
555 return;
556 }
557
558 printk ("Data %s fault at %#010lx in %s (pc=%#lx)\n",
559 ssw & RW ? "read" : "write",
560 fp->un.fmtb.daddr,
561 space_names[ssw & DFC], fp->ptregs.pc);
562 }
563 printk ("BAD KERNEL BUSERR\n");
564
565 die_if_kernel("Oops", &fp->ptregs,0);
566 force_sig(SIGKILL, current);
567 return;
568 }
569 } else {
570 /* user fault */
571 if (!(ssw & (FC | FB)) && !(ssw & DF))
572 /* not an instruction fault or data fault! BAD */
573 panic ("USER BUSERR w/o instruction or data fault");
574 }
575
576
577 /* First handle the data fault, if any. */
578 if (ssw & DF) {
579 addr = fp->un.fmtb.daddr;
580
581// errorcode bit 0: 0 -> no page 1 -> protection fault
582// errorcode bit 1: 0 -> read fault 1 -> write fault
583
584// (buserr_type & SUN3_BUSERR_PROTERR) -> protection fault
585// (buserr_type & SUN3_BUSERR_INVALID) -> invalid page fault
586
587 if (buserr_type & SUN3_BUSERR_PROTERR)
588 errorcode = 0x01;
589 else if (buserr_type & SUN3_BUSERR_INVALID)
590 errorcode = 0x00;
591 else {
592#ifdef DEBUG
593 printk ("*** unexpected busfault type=%#04x\n", buserr_type);
594 printk ("invalid %s access at %#lx from pc %#lx\n",
595 !(ssw & RW) ? "write" : "read", addr,
596 fp->ptregs.pc);
597#endif
598 die_if_kernel ("Oops", &fp->ptregs, buserr_type);
599 force_sig (SIGBUS, current);
600 return;
601 }
602
603//todo: wtf is RM bit? --m
604 if (!(ssw & RW) || ssw & RM)
605 errorcode |= 0x02;
606
607 /* Handle page fault. */
608 do_page_fault (&fp->ptregs, addr, errorcode);
609
610 /* Retry the data fault now. */
611 return;
612 }
613
614 /* Now handle the instruction fault. */
615
616 /* Get the fault address. */
617 if (fp->ptregs.format == 0xA)
618 addr = fp->ptregs.pc + 4;
619 else
620 addr = fp->un.fmtb.baddr;
621 if (ssw & FC)
622 addr -= 2;
623
624 if (buserr_type & SUN3_BUSERR_INVALID) {
625 if (!mmu_emu_handle_fault (fp->un.fmtb.daddr, 1, 0))
626 do_page_fault (&fp->ptregs, addr, 0);
627 } else {
628#ifdef DEBUG
629 printk ("protection fault on insn access (segv).\n");
630#endif
631 force_sig (SIGSEGV, current);
632 }
633}
634#else
635#if defined(CPU_M68020_OR_M68030)
636static inline void bus_error030 (struct frame *fp)
637{
638 volatile unsigned short temp;
639 unsigned short mmusr;
640 unsigned long addr, errorcode;
641 unsigned short ssw = fp->un.fmtb.ssw;
642#ifdef DEBUG
643 unsigned long desc;
644
645 printk ("pid = %x ", current->pid);
646 printk ("SSW=%#06x ", ssw);
647
648 if (ssw & (FC | FB))
649 printk ("Instruction fault at %#010lx\n",
650 ssw & FC ?
651 fp->ptregs.format == 0xa ? fp->ptregs.pc + 2 : fp->un.fmtb.baddr - 2
652 :
653 fp->ptregs.format == 0xa ? fp->ptregs.pc + 4 : fp->un.fmtb.baddr);
654 if (ssw & DF)
655 printk ("Data %s fault at %#010lx in %s (pc=%#lx)\n",
656 ssw & RW ? "read" : "write",
657 fp->un.fmtb.daddr,
658 space_names[ssw & DFC], fp->ptregs.pc);
659#endif
660
661 /* ++andreas: If a data fault and an instruction fault happen
662 at the same time map in both pages. */
663
664 /* First handle the data fault, if any. */
665 if (ssw & DF) {
666 addr = fp->un.fmtb.daddr;
667
668#ifdef DEBUG
669 asm volatile ("ptestr %3,%2@,#7,%0\n\t"
670 "pmove %%psr,%1@"
671 : "=a&" (desc)
672 : "a" (&temp), "a" (addr), "d" (ssw));
673#else
674 asm volatile ("ptestr %2,%1@,#7\n\t"
675 "pmove %%psr,%0@"
676 : : "a" (&temp), "a" (addr), "d" (ssw));
677#endif
678 mmusr = temp;
679
680#ifdef DEBUG
681 printk("mmusr is %#x for addr %#lx in task %p\n",
682 mmusr, addr, current);
683 printk("descriptor address is %#lx, contents %#lx\n",
684 __va(desc), *(unsigned long *)__va(desc));
685#endif
686
687 errorcode = (mmusr & MMU_I) ? 0 : 1;
688 if (!(ssw & RW) || (ssw & RM))
689 errorcode |= 2;
690
691 if (mmusr & (MMU_I | MMU_WP)) {
692 if (ssw & 4) {
693 printk("Data %s fault at %#010lx in %s (pc=%#lx)\n",
694 ssw & RW ? "read" : "write",
695 fp->un.fmtb.daddr,
696 space_names[ssw & DFC], fp->ptregs.pc);
697 goto buserr;
698 }
699 /* Don't try to do anything further if an exception was
700 handled. */
701 if (do_page_fault (&fp->ptregs, addr, errorcode) < 0)
702 return;
703 } else if (!(mmusr & MMU_I)) {
704 /* probably a 020 cas fault */
705 if (!(ssw & RM) && send_fault_sig(&fp->ptregs) > 0)
706 printk("unexpected bus error (%#x,%#x)\n", ssw, mmusr);
707 } else if (mmusr & (MMU_B|MMU_L|MMU_S)) {
708 printk("invalid %s access at %#lx from pc %#lx\n",
709 !(ssw & RW) ? "write" : "read", addr,
710 fp->ptregs.pc);
711 die_if_kernel("Oops",&fp->ptregs,mmusr);
712 force_sig(SIGSEGV, current);
713 return;
714 } else {
715#if 0
716 static volatile long tlong;
717#endif
718
719 printk("weird %s access at %#lx from pc %#lx (ssw is %#x)\n",
720 !(ssw & RW) ? "write" : "read", addr,
721 fp->ptregs.pc, ssw);
722 asm volatile ("ptestr #1,%1@,#0\n\t"
723 "pmove %%psr,%0@"
724 : /* no outputs */
725 : "a" (&temp), "a" (addr));
726 mmusr = temp;
727
728 printk ("level 0 mmusr is %#x\n", mmusr);
729#if 0
730 asm volatile ("pmove %%tt0,%0@"
731 : /* no outputs */
732 : "a" (&tlong));
733 printk("tt0 is %#lx, ", tlong);
734 asm volatile ("pmove %%tt1,%0@"
735 : /* no outputs */
736 : "a" (&tlong));
737 printk("tt1 is %#lx\n", tlong);
738#endif
739#ifdef DEBUG
740 printk("Unknown SIGSEGV - 1\n");
741#endif
742 die_if_kernel("Oops",&fp->ptregs,mmusr);
743 force_sig(SIGSEGV, current);
744 return;
745 }
746
747 /* setup an ATC entry for the access about to be retried */
748 if (!(ssw & RW) || (ssw & RM))
749 asm volatile ("ploadw %1,%0@" : /* no outputs */
750 : "a" (addr), "d" (ssw));
751 else
752 asm volatile ("ploadr %1,%0@" : /* no outputs */
753 : "a" (addr), "d" (ssw));
754 }
755
756 /* Now handle the instruction fault. */
757
758 if (!(ssw & (FC|FB)))
759 return;
760
761 if (fp->ptregs.sr & PS_S) {
762 printk("Instruction fault at %#010lx\n",
763 fp->ptregs.pc);
764 buserr:
765 printk ("BAD KERNEL BUSERR\n");
766 die_if_kernel("Oops",&fp->ptregs,0);
767 force_sig(SIGKILL, current);
768 return;
769 }
770
771 /* get the fault address */
772 if (fp->ptregs.format == 10)
773 addr = fp->ptregs.pc + 4;
774 else
775 addr = fp->un.fmtb.baddr;
776 if (ssw & FC)
777 addr -= 2;
778
779 if ((ssw & DF) && ((addr ^ fp->un.fmtb.daddr) & PAGE_MASK) == 0)
780 /* Insn fault on same page as data fault. But we
781 should still create the ATC entry. */
782 goto create_atc_entry;
783
784#ifdef DEBUG
785 asm volatile ("ptestr #1,%2@,#7,%0\n\t"
786 "pmove %%psr,%1@"
787 : "=a&" (desc)
788 : "a" (&temp), "a" (addr));
789#else
790 asm volatile ("ptestr #1,%1@,#7\n\t"
791 "pmove %%psr,%0@"
792 : : "a" (&temp), "a" (addr));
793#endif
794 mmusr = temp;
795
796#ifdef DEBUG
797 printk ("mmusr is %#x for addr %#lx in task %p\n",
798 mmusr, addr, current);
799 printk ("descriptor address is %#lx, contents %#lx\n",
800 __va(desc), *(unsigned long *)__va(desc));
801#endif
802
803 if (mmusr & MMU_I)
804 do_page_fault (&fp->ptregs, addr, 0);
805 else if (mmusr & (MMU_B|MMU_L|MMU_S)) {
806 printk ("invalid insn access at %#lx from pc %#lx\n",
807 addr, fp->ptregs.pc);
808#ifdef DEBUG
809 printk("Unknown SIGSEGV - 2\n");
810#endif
811 die_if_kernel("Oops",&fp->ptregs,mmusr);
812 force_sig(SIGSEGV, current);
813 return;
814 }
815
816create_atc_entry:
817 /* setup an ATC entry for the access about to be retried */
818 asm volatile ("ploadr #2,%0@" : /* no outputs */
819 : "a" (addr));
820}
821#endif /* CPU_M68020_OR_M68030 */
822#endif /* !CONFIG_SUN3 */
823
824asmlinkage void buserr_c(struct frame *fp)
825{
826 /* Only set esp0 if coming from user mode */
827 if (user_mode(&fp->ptregs))
828 current->thread.esp0 = (unsigned long) fp;
829
830#ifdef DEBUG
831 printk ("*** Bus Error *** Format is %x\n", fp->ptregs.format);
832#endif
833
834 switch (fp->ptregs.format) {
835#if defined (CONFIG_M68060)
836 case 4: /* 68060 access error */
837 access_error060 (fp);
838 break;
839#endif
840#if defined (CONFIG_M68040)
841 case 0x7: /* 68040 access error */
842 access_error040 (fp);
843 break;
844#endif
845#if defined (CPU_M68020_OR_M68030)
846 case 0xa:
847 case 0xb:
848 bus_error030 (fp);
849 break;
850#endif
851 default:
852 die_if_kernel("bad frame format",&fp->ptregs,0);
853#ifdef DEBUG
854 printk("Unknown SIGSEGV - 4\n");
855#endif
856 force_sig(SIGSEGV, current);
857 }
858}
859
860
861static int kstack_depth_to_print = 48;
862
863void show_trace(unsigned long *stack)
864{
865 unsigned long *endstack;
866 unsigned long addr;
867 int i;
868
869 printk("Call Trace:");
870 addr = (unsigned long)stack + THREAD_SIZE - 1;
871 endstack = (unsigned long *)(addr & -THREAD_SIZE);
872 i = 0;
873 while (stack + 1 <= endstack) {
874 addr = *stack++;
875 /*
876 * If the address is either in the text segment of the
877 * kernel, or in the region which contains vmalloc'ed
878 * memory, it *may* be the address of a calling
879 * routine; if so, print it so that someone tracing
880 * down the cause of the crash will be able to figure
881 * out the call path that was taken.
882 */
883 if (__kernel_text_address(addr)) {
884#ifndef CONFIG_KALLSYMS
885 if (i % 5 == 0)
886 printk("\n ");
887#endif
888 printk(" [<%08lx>] %pS\n", addr, (void *)addr);
889 i++;
890 }
891 }
892 printk("\n");
893}
894
895void show_registers(struct pt_regs *regs)
896{
897 struct frame *fp = (struct frame *)regs;
898 mm_segment_t old_fs = get_fs();
899 u16 c, *cp;
900 unsigned long addr;
901 int i;
902
903 print_modules();
904 printk("PC: [<%08lx>] %pS\n", regs->pc, (void *)regs->pc);
905 printk("SR: %04x SP: %p a2: %08lx\n", regs->sr, regs, regs->a2);
906 printk("d0: %08lx d1: %08lx d2: %08lx d3: %08lx\n",
907 regs->d0, regs->d1, regs->d2, regs->d3);
908 printk("d4: %08lx d5: %08lx a0: %08lx a1: %08lx\n",
909 regs->d4, regs->d5, regs->a0, regs->a1);
910
911 printk("Process %s (pid: %d, task=%p)\n",
912 current->comm, task_pid_nr(current), current);
913 addr = (unsigned long)&fp->un;
914 printk("Frame format=%X ", regs->format);
915 switch (regs->format) {
916 case 0x2:
917 printk("instr addr=%08lx\n", fp->un.fmt2.iaddr);
918 addr += sizeof(fp->un.fmt2);
919 break;
920 case 0x3:
921 printk("eff addr=%08lx\n", fp->un.fmt3.effaddr);
922 addr += sizeof(fp->un.fmt3);
923 break;
924 case 0x4:
925 printk((CPU_IS_060 ? "fault addr=%08lx fslw=%08lx\n"
926 : "eff addr=%08lx pc=%08lx\n"),
927 fp->un.fmt4.effaddr, fp->un.fmt4.pc);
928 addr += sizeof(fp->un.fmt4);
929 break;
930 case 0x7:
931 printk("eff addr=%08lx ssw=%04x faddr=%08lx\n",
932 fp->un.fmt7.effaddr, fp->un.fmt7.ssw, fp->un.fmt7.faddr);
933 printk("wb 1 stat/addr/data: %04x %08lx %08lx\n",
934 fp->un.fmt7.wb1s, fp->un.fmt7.wb1a, fp->un.fmt7.wb1dpd0);
935 printk("wb 2 stat/addr/data: %04x %08lx %08lx\n",
936 fp->un.fmt7.wb2s, fp->un.fmt7.wb2a, fp->un.fmt7.wb2d);
937 printk("wb 3 stat/addr/data: %04x %08lx %08lx\n",
938 fp->un.fmt7.wb3s, fp->un.fmt7.wb3a, fp->un.fmt7.wb3d);
939 printk("push data: %08lx %08lx %08lx %08lx\n",
940 fp->un.fmt7.wb1dpd0, fp->un.fmt7.pd1, fp->un.fmt7.pd2,
941 fp->un.fmt7.pd3);
942 addr += sizeof(fp->un.fmt7);
943 break;
944 case 0x9:
945 printk("instr addr=%08lx\n", fp->un.fmt9.iaddr);
946 addr += sizeof(fp->un.fmt9);
947 break;
948 case 0xa:
949 printk("ssw=%04x isc=%04x isb=%04x daddr=%08lx dobuf=%08lx\n",
950 fp->un.fmta.ssw, fp->un.fmta.isc, fp->un.fmta.isb,
951 fp->un.fmta.daddr, fp->un.fmta.dobuf);
952 addr += sizeof(fp->un.fmta);
953 break;
954 case 0xb:
955 printk("ssw=%04x isc=%04x isb=%04x daddr=%08lx dobuf=%08lx\n",
956 fp->un.fmtb.ssw, fp->un.fmtb.isc, fp->un.fmtb.isb,
957 fp->un.fmtb.daddr, fp->un.fmtb.dobuf);
958 printk("baddr=%08lx dibuf=%08lx ver=%x\n",
959 fp->un.fmtb.baddr, fp->un.fmtb.dibuf, fp->un.fmtb.ver);
960 addr += sizeof(fp->un.fmtb);
961 break;
962 default:
963 printk("\n");
964 }
965 show_stack(NULL, (unsigned long *)addr);
966
967 printk("Code:");
968 set_fs(KERNEL_DS);
969 cp = (u16 *)regs->pc;
970 for (i = -8; i < 16; i++) {
971 if (get_user(c, cp + i) && i >= 0) {
972 printk(" Bad PC value.");
973 break;
974 }
975 printk(i ? " %04x" : " <%04x>", c);
976 }
977 set_fs(old_fs);
978 printk ("\n");
979}
980
981void show_stack(struct task_struct *task, unsigned long *stack)
982{
983 unsigned long *p;
984 unsigned long *endstack;
985 int i;
986
987 if (!stack) {
988 if (task)
989 stack = (unsigned long *)task->thread.esp0;
990 else
991 stack = (unsigned long *)&stack;
992 }
993 endstack = (unsigned long *)(((unsigned long)stack + THREAD_SIZE - 1) & -THREAD_SIZE);
994
995 printk("Stack from %08lx:", (unsigned long)stack);
996 p = stack;
997 for (i = 0; i < kstack_depth_to_print; i++) {
998 if (p + 1 > endstack)
999 break;
1000 if (i % 8 == 0)
1001 printk("\n ");
1002 printk(" %08lx", *p++);
1003 }
1004 printk("\n");
1005 show_trace(stack);
1006}
1007
1008/*
1009 * The architecture-independent backtrace generator
1010 */
1011void dump_stack(void)
1012{
1013 unsigned long stack;
1014
1015 show_trace(&stack);
1016}
1017
1018EXPORT_SYMBOL(dump_stack);
1019
1020void bad_super_trap (struct frame *fp)
1021{
1022 console_verbose();
1023 if (fp->ptregs.vector < 4 * ARRAY_SIZE(vec_names))
1024 printk ("*** %s *** FORMAT=%X\n",
1025 vec_names[(fp->ptregs.vector) >> 2],
1026 fp->ptregs.format);
1027 else
1028 printk ("*** Exception %d *** FORMAT=%X\n",
1029 (fp->ptregs.vector) >> 2,
1030 fp->ptregs.format);
1031 if (fp->ptregs.vector >> 2 == VEC_ADDRERR && CPU_IS_020_OR_030) {
1032 unsigned short ssw = fp->un.fmtb.ssw;
1033
1034 printk ("SSW=%#06x ", ssw);
1035
1036 if (ssw & RC)
1037 printk ("Pipe stage C instruction fault at %#010lx\n",
1038 (fp->ptregs.format) == 0xA ?
1039 fp->ptregs.pc + 2 : fp->un.fmtb.baddr - 2);
1040 if (ssw & RB)
1041 printk ("Pipe stage B instruction fault at %#010lx\n",
1042 (fp->ptregs.format) == 0xA ?
1043 fp->ptregs.pc + 4 : fp->un.fmtb.baddr);
1044 if (ssw & DF)
1045 printk ("Data %s fault at %#010lx in %s (pc=%#lx)\n",
1046 ssw & RW ? "read" : "write",
1047 fp->un.fmtb.daddr, space_names[ssw & DFC],
1048 fp->ptregs.pc);
1049 }
1050 printk ("Current process id is %d\n", task_pid_nr(current));
1051 die_if_kernel("BAD KERNEL TRAP", &fp->ptregs, 0);
1052}
1053
1054asmlinkage void trap_c(struct frame *fp)
1055{
1056 int sig;
1057 siginfo_t info;
1058
1059 if (fp->ptregs.sr & PS_S) {
1060 if (fp->ptregs.vector == VEC_TRACE << 2) {
1061 /* traced a trapping instruction on a 68020/30,
1062 * real exception will be executed afterwards.
1063 */
1064 } else if (!handle_kernel_fault(&fp->ptregs))
1065 bad_super_trap(fp);
1066 return;
1067 }
1068
1069 /* send the appropriate signal to the user program */
1070 switch ((fp->ptregs.vector) >> 2) {
1071 case VEC_ADDRERR:
1072 info.si_code = BUS_ADRALN;
1073 sig = SIGBUS;
1074 break;
1075 case VEC_ILLEGAL:
1076 case VEC_LINE10:
1077 case VEC_LINE11:
1078 info.si_code = ILL_ILLOPC;
1079 sig = SIGILL;
1080 break;
1081 case VEC_PRIV:
1082 info.si_code = ILL_PRVOPC;
1083 sig = SIGILL;
1084 break;
1085 case VEC_COPROC:
1086 info.si_code = ILL_COPROC;
1087 sig = SIGILL;
1088 break;
1089 case VEC_TRAP1:
1090 case VEC_TRAP2:
1091 case VEC_TRAP3:
1092 case VEC_TRAP4:
1093 case VEC_TRAP5:
1094 case VEC_TRAP6:
1095 case VEC_TRAP7:
1096 case VEC_TRAP8:
1097 case VEC_TRAP9:
1098 case VEC_TRAP10:
1099 case VEC_TRAP11:
1100 case VEC_TRAP12:
1101 case VEC_TRAP13:
1102 case VEC_TRAP14:
1103 info.si_code = ILL_ILLTRP;
1104 sig = SIGILL;
1105 break;
1106 case VEC_FPBRUC:
1107 case VEC_FPOE:
1108 case VEC_FPNAN:
1109 info.si_code = FPE_FLTINV;
1110 sig = SIGFPE;
1111 break;
1112 case VEC_FPIR:
1113 info.si_code = FPE_FLTRES;
1114 sig = SIGFPE;
1115 break;
1116 case VEC_FPDIVZ:
1117 info.si_code = FPE_FLTDIV;
1118 sig = SIGFPE;
1119 break;
1120 case VEC_FPUNDER:
1121 info.si_code = FPE_FLTUND;
1122 sig = SIGFPE;
1123 break;
1124 case VEC_FPOVER:
1125 info.si_code = FPE_FLTOVF;
1126 sig = SIGFPE;
1127 break;
1128 case VEC_ZERODIV:
1129 info.si_code = FPE_INTDIV;
1130 sig = SIGFPE;
1131 break;
1132 case VEC_CHK:
1133 case VEC_TRAP:
1134 info.si_code = FPE_INTOVF;
1135 sig = SIGFPE;
1136 break;
1137 case VEC_TRACE: /* ptrace single step */
1138 info.si_code = TRAP_TRACE;
1139 sig = SIGTRAP;
1140 break;
1141 case VEC_TRAP15: /* breakpoint */
1142 info.si_code = TRAP_BRKPT;
1143 sig = SIGTRAP;
1144 break;
1145 default:
1146 info.si_code = ILL_ILLOPC;
1147 sig = SIGILL;
1148 break;
1149 }
1150 info.si_signo = sig;
1151 info.si_errno = 0;
1152 switch (fp->ptregs.format) {
1153 default:
1154 info.si_addr = (void *) fp->ptregs.pc;
1155 break;
1156 case 2:
1157 info.si_addr = (void *) fp->un.fmt2.iaddr;
1158 break;
1159 case 7:
1160 info.si_addr = (void *) fp->un.fmt7.effaddr;
1161 break;
1162 case 9:
1163 info.si_addr = (void *) fp->un.fmt9.iaddr;
1164 break;
1165 case 10:
1166 info.si_addr = (void *) fp->un.fmta.daddr;
1167 break;
1168 case 11:
1169 info.si_addr = (void *) fp->un.fmtb.daddr;
1170 break;
1171 }
1172 force_sig_info (sig, &info, current);
1173}
1174
1175void die_if_kernel (char *str, struct pt_regs *fp, int nr)
1176{
1177 if (!(fp->sr & PS_S))
1178 return;
1179
1180 console_verbose();
1181 printk("%s: %08x\n",str,nr);
1182 show_registers(fp);
1183 add_taint(TAINT_DIE);
1184 do_exit(SIGSEGV);
1185}
1186
1187/*
1188 * This function is called if an error occur while accessing
1189 * user-space from the fpsp040 code.
1190 */
1191asmlinkage void fpsp040_die(void)
1192{
1193 do_exit(SIGSEGV);
1194}
1195
1196#ifdef CONFIG_M68KFPU_EMU
1197asmlinkage void fpemu_signal(int signal, int code, void *addr)
1198{
1199 siginfo_t info;
1200
1201 info.si_signo = signal;
1202 info.si_errno = 0;
1203 info.si_code = code;
1204 info.si_addr = addr;
1205 force_sig_info(signal, &info, current);
1206}
1207#endif
diff --git a/arch/m68k/kernel/traps_no.c b/arch/m68k/kernel/traps_no.c
deleted file mode 100644
index e67b8c806959..000000000000
--- a/arch/m68k/kernel/traps_no.c
+++ /dev/null
@@ -1,361 +0,0 @@
1/*
2 * linux/arch/m68knommu/kernel/traps.c
3 *
4 * Copyright (C) 1993, 1994 by Hamish Macdonald
5 *
6 * 68040 fixes by Michael Rausch
7 * 68040 fixes by Martin Apel
8 * 68060 fixes by Roman Hodek
9 * 68060 fixes by Jesper Skov
10 *
11 * This file is subject to the terms and conditions of the GNU General Public
12 * License. See the file COPYING in the main directory of this archive
13 * for more details.
14 */
15
16/*
17 * Sets up all exception vectors
18 */
19#include <linux/sched.h>
20#include <linux/signal.h>
21#include <linux/kernel.h>
22#include <linux/mm.h>
23#include <linux/module.h>
24#include <linux/types.h>
25#include <linux/user.h>
26#include <linux/string.h>
27#include <linux/linkage.h>
28#include <linux/init.h>
29#include <linux/ptrace.h>
30#include <linux/kallsyms.h>
31
32#include <asm/setup.h>
33#include <asm/fpu.h>
34#include <asm/system.h>
35#include <asm/uaccess.h>
36#include <asm/traps.h>
37#include <asm/pgtable.h>
38#include <asm/machdep.h>
39#include <asm/siginfo.h>
40
41static char const * const vec_names[] = {
42 "RESET SP", "RESET PC", "BUS ERROR", "ADDRESS ERROR",
43 "ILLEGAL INSTRUCTION", "ZERO DIVIDE", "CHK", "TRAPcc",
44 "PRIVILEGE VIOLATION", "TRACE", "LINE 1010", "LINE 1111",
45 "UNASSIGNED RESERVED 12", "COPROCESSOR PROTOCOL VIOLATION",
46 "FORMAT ERROR", "UNINITIALIZED INTERRUPT",
47 "UNASSIGNED RESERVED 16", "UNASSIGNED RESERVED 17",
48 "UNASSIGNED RESERVED 18", "UNASSIGNED RESERVED 19",
49 "UNASSIGNED RESERVED 20", "UNASSIGNED RESERVED 21",
50 "UNASSIGNED RESERVED 22", "UNASSIGNED RESERVED 23",
51 "SPURIOUS INTERRUPT", "LEVEL 1 INT", "LEVEL 2 INT", "LEVEL 3 INT",
52 "LEVEL 4 INT", "LEVEL 5 INT", "LEVEL 6 INT", "LEVEL 7 INT",
53 "SYSCALL", "TRAP #1", "TRAP #2", "TRAP #3",
54 "TRAP #4", "TRAP #5", "TRAP #6", "TRAP #7",
55 "TRAP #8", "TRAP #9", "TRAP #10", "TRAP #11",
56 "TRAP #12", "TRAP #13", "TRAP #14", "TRAP #15",
57 "FPCP BSUN", "FPCP INEXACT", "FPCP DIV BY 0", "FPCP UNDERFLOW",
58 "FPCP OPERAND ERROR", "FPCP OVERFLOW", "FPCP SNAN",
59 "FPCP UNSUPPORTED OPERATION",
60 "MMU CONFIGURATION ERROR"
61};
62
63void die_if_kernel(char *str, struct pt_regs *fp, int nr)
64{
65 if (!(fp->sr & PS_S))
66 return;
67
68 console_verbose();
69 printk(KERN_EMERG "%s: %08x\n",str,nr);
70 printk(KERN_EMERG "PC: [<%08lx>]\nSR: %04x SP: %p a2: %08lx\n",
71 fp->pc, fp->sr, fp, fp->a2);
72 printk(KERN_EMERG "d0: %08lx d1: %08lx d2: %08lx d3: %08lx\n",
73 fp->d0, fp->d1, fp->d2, fp->d3);
74 printk(KERN_EMERG "d4: %08lx d5: %08lx a0: %08lx a1: %08lx\n",
75 fp->d4, fp->d5, fp->a0, fp->a1);
76
77 printk(KERN_EMERG "Process %s (pid: %d, stackpage=%08lx)\n",
78 current->comm, current->pid, PAGE_SIZE+(unsigned long)current);
79 show_stack(NULL, (unsigned long *)(fp + 1));
80 add_taint(TAINT_DIE);
81 do_exit(SIGSEGV);
82}
83
84asmlinkage void buserr_c(struct frame *fp)
85{
86 /* Only set esp0 if coming from user mode */
87 if (user_mode(&fp->ptregs))
88 current->thread.esp0 = (unsigned long) fp;
89
90#if defined(DEBUG)
91 printk (KERN_DEBUG "*** Bus Error *** Format is %x\n", fp->ptregs.format);
92#endif
93
94 die_if_kernel("bad frame format",&fp->ptregs,0);
95#if defined(DEBUG)
96 printk(KERN_DEBUG "Unknown SIGSEGV - 4\n");
97#endif
98 force_sig(SIGSEGV, current);
99}
100
101static void print_this_address(unsigned long addr, int i)
102{
103#ifdef CONFIG_KALLSYMS
104 printk(KERN_EMERG " [%08lx] ", addr);
105 print_symbol(KERN_CONT "%s\n", addr);
106#else
107 if (i % 5)
108 printk(KERN_CONT " [%08lx] ", addr);
109 else
110 printk(KERN_EMERG " [%08lx] ", addr);
111 i++;
112#endif
113}
114
115int kstack_depth_to_print = 48;
116
117static void __show_stack(struct task_struct *task, unsigned long *stack)
118{
119 unsigned long *endstack, addr;
120#ifdef CONFIG_FRAME_POINTER
121 unsigned long *last_stack;
122#endif
123 int i;
124
125 if (!stack)
126 stack = (unsigned long *)task->thread.ksp;
127
128 addr = (unsigned long) stack;
129 endstack = (unsigned long *) PAGE_ALIGN(addr);
130
131 printk(KERN_EMERG "Stack from %08lx:", (unsigned long)stack);
132 for (i = 0; i < kstack_depth_to_print; i++) {
133 if (stack + 1 + i > endstack)
134 break;
135 if (i % 8 == 0)
136 printk(KERN_EMERG " ");
137 printk(KERN_CONT " %08lx", *(stack + i));
138 }
139 printk("\n");
140 i = 0;
141
142#ifdef CONFIG_FRAME_POINTER
143 printk(KERN_EMERG "Call Trace:\n");
144
145 last_stack = stack - 1;
146 while (stack <= endstack && stack > last_stack) {
147
148 addr = *(stack + 1);
149 print_this_address(addr, i);
150 i++;
151
152 last_stack = stack;
153 stack = (unsigned long *)*stack;
154 }
155 printk("\n");
156#else
157 printk(KERN_EMERG "Call Trace with CONFIG_FRAME_POINTER disabled:\n");
158 while (stack <= endstack) {
159 addr = *stack++;
160 /*
161 * If the address is either in the text segment of the kernel,
162 * or in a region which is occupied by a module then it *may*
163 * be the address of a calling routine; if so, print it so that
164 * someone tracing down the cause of the crash will be able to
165 * figure out the call path that was taken.
166 */
167 if (__kernel_text_address(addr)) {
168 print_this_address(addr, i);
169 i++;
170 }
171 }
172 printk(KERN_CONT "\n");
173#endif
174}
175
176void bad_super_trap(struct frame *fp)
177{
178 int vector = (fp->ptregs.vector >> 2) & 0xff;
179
180 console_verbose();
181 if (vector < ARRAY_SIZE(vec_names))
182 printk (KERN_WARNING "*** %s *** FORMAT=%X\n",
183 vec_names[vector],
184 fp->ptregs.format);
185 else
186 printk (KERN_WARNING "*** Exception %d *** FORMAT=%X\n",
187 vector,
188 fp->ptregs.format);
189 printk (KERN_WARNING "Current process id is %d\n", current->pid);
190 die_if_kernel("BAD KERNEL TRAP", &fp->ptregs, 0);
191}
192
193asmlinkage void trap_c(struct frame *fp)
194{
195 int sig;
196 int vector = (fp->ptregs.vector >> 2) & 0xff;
197 siginfo_t info;
198
199 if (fp->ptregs.sr & PS_S) {
200 if (vector == VEC_TRACE) {
201 /* traced a trapping instruction */
202 } else
203 bad_super_trap(fp);
204 return;
205 }
206
207 /* send the appropriate signal to the user program */
208 switch (vector) {
209 case VEC_ADDRERR:
210 info.si_code = BUS_ADRALN;
211 sig = SIGBUS;
212 break;
213 case VEC_ILLEGAL:
214 case VEC_LINE10:
215 case VEC_LINE11:
216 info.si_code = ILL_ILLOPC;
217 sig = SIGILL;
218 break;
219 case VEC_PRIV:
220 info.si_code = ILL_PRVOPC;
221 sig = SIGILL;
222 break;
223 case VEC_COPROC:
224 info.si_code = ILL_COPROC;
225 sig = SIGILL;
226 break;
227 case VEC_TRAP1: /* gdbserver breakpoint */
228 fp->ptregs.pc -= 2;
229 info.si_code = TRAP_TRACE;
230 sig = SIGTRAP;
231 break;
232 case VEC_TRAP2:
233 case VEC_TRAP3:
234 case VEC_TRAP4:
235 case VEC_TRAP5:
236 case VEC_TRAP6:
237 case VEC_TRAP7:
238 case VEC_TRAP8:
239 case VEC_TRAP9:
240 case VEC_TRAP10:
241 case VEC_TRAP11:
242 case VEC_TRAP12:
243 case VEC_TRAP13:
244 case VEC_TRAP14:
245 info.si_code = ILL_ILLTRP;
246 sig = SIGILL;
247 break;
248 case VEC_FPBRUC:
249 case VEC_FPOE:
250 case VEC_FPNAN:
251 info.si_code = FPE_FLTINV;
252 sig = SIGFPE;
253 break;
254 case VEC_FPIR:
255 info.si_code = FPE_FLTRES;
256 sig = SIGFPE;
257 break;
258 case VEC_FPDIVZ:
259 info.si_code = FPE_FLTDIV;
260 sig = SIGFPE;
261 break;
262 case VEC_FPUNDER:
263 info.si_code = FPE_FLTUND;
264 sig = SIGFPE;
265 break;
266 case VEC_FPOVER:
267 info.si_code = FPE_FLTOVF;
268 sig = SIGFPE;
269 break;
270 case VEC_ZERODIV:
271 info.si_code = FPE_INTDIV;
272 sig = SIGFPE;
273 break;
274 case VEC_CHK:
275 case VEC_TRAP:
276 info.si_code = FPE_INTOVF;
277 sig = SIGFPE;
278 break;
279 case VEC_TRACE: /* ptrace single step */
280 info.si_code = TRAP_TRACE;
281 sig = SIGTRAP;
282 break;
283 case VEC_TRAP15: /* breakpoint */
284 info.si_code = TRAP_BRKPT;
285 sig = SIGTRAP;
286 break;
287 default:
288 info.si_code = ILL_ILLOPC;
289 sig = SIGILL;
290 break;
291 }
292 info.si_signo = sig;
293 info.si_errno = 0;
294 switch (fp->ptregs.format) {
295 default:
296 info.si_addr = (void *) fp->ptregs.pc;
297 break;
298 case 2:
299 info.si_addr = (void *) fp->un.fmt2.iaddr;
300 break;
301 case 7:
302 info.si_addr = (void *) fp->un.fmt7.effaddr;
303 break;
304 case 9:
305 info.si_addr = (void *) fp->un.fmt9.iaddr;
306 break;
307 case 10:
308 info.si_addr = (void *) fp->un.fmta.daddr;
309 break;
310 case 11:
311 info.si_addr = (void *) fp->un.fmtb.daddr;
312 break;
313 }
314 force_sig_info (sig, &info, current);
315}
316
317asmlinkage void set_esp0(unsigned long ssp)
318{
319 current->thread.esp0 = ssp;
320}
321
322/*
323 * The architecture-independent backtrace generator
324 */
325void dump_stack(void)
326{
327 /*
328 * We need frame pointers for this little trick, which works as follows:
329 *
330 * +------------+ 0x00
331 * | Next SP | -> 0x0c
332 * +------------+ 0x04
333 * | Caller |
334 * +------------+ 0x08
335 * | Local vars | -> our stack var
336 * +------------+ 0x0c
337 * | Next SP | -> 0x18, that is what we pass to show_stack()
338 * +------------+ 0x10
339 * | Caller |
340 * +------------+ 0x14
341 * | Local vars |
342 * +------------+ 0x18
343 * | ... |
344 * +------------+
345 */
346
347 unsigned long *stack;
348
349 stack = (unsigned long *)&stack;
350 stack++;
351 __show_stack(current, stack);
352}
353EXPORT_SYMBOL(dump_stack);
354
355void show_stack(struct task_struct *task, unsigned long *stack)
356{
357 if (!stack && !task)
358 dump_stack();
359 else
360 __show_stack(task, stack);
361}
diff --git a/arch/m68k/kernel/vectors.c b/arch/m68k/kernel/vectors.c
new file mode 100644
index 000000000000..147b03fbc71e
--- /dev/null
+++ b/arch/m68k/kernel/vectors.c
@@ -0,0 +1,145 @@
1/*
2 * vectors.c
3 *
4 * Copyright (C) 1993, 1994 by Hamish Macdonald
5 *
6 * 68040 fixes by Michael Rausch
7 * 68040 fixes by Martin Apel
8 * 68040 fixes and writeback by Richard Zidlicky
9 * 68060 fixes by Roman Hodek
10 * 68060 fixes by Jesper Skov
11 *
12 * This file is subject to the terms and conditions of the GNU General Public
13 * License. See the file COPYING in the main directory of this archive
14 * for more details.
15 */
16
17/*
18 * Sets up all exception vectors
19 */
20#include <linux/sched.h>
21#include <linux/kernel.h>
22#include <linux/linkage.h>
23#include <linux/init.h>
24#include <linux/kallsyms.h>
25
26#include <asm/setup.h>
27#include <asm/fpu.h>
28#include <asm/system.h>
29#include <asm/traps.h>
30
31/* assembler routines */
32asmlinkage void system_call(void);
33asmlinkage void buserr(void);
34asmlinkage void trap(void);
35asmlinkage void nmihandler(void);
36#ifdef CONFIG_M68KFPU_EMU
37asmlinkage void fpu_emu(void);
38#endif
39
40e_vector vectors[256];
41
42/* nmi handler for the Amiga */
43asm(".text\n"
44 __ALIGN_STR "\n"
45 "nmihandler: rte");
46
47/*
48 * this must be called very early as the kernel might
49 * use some instruction that are emulated on the 060
50 * and so we're prepared for early probe attempts (e.g. nf_init).
51 */
52void __init base_trap_init(void)
53{
54 if (MACH_IS_SUN3X) {
55 extern e_vector *sun3x_prom_vbr;
56
57 __asm__ volatile ("movec %%vbr, %0" : "=r" (sun3x_prom_vbr));
58 }
59
60 /* setup the exception vector table */
61 __asm__ volatile ("movec %0,%%vbr" : : "r" ((void*)vectors));
62
63 if (CPU_IS_060) {
64 /* set up ISP entry points */
65 asmlinkage void unimp_vec(void) asm ("_060_isp_unimp");
66
67 vectors[VEC_UNIMPII] = unimp_vec;
68 }
69
70 vectors[VEC_BUSERR] = buserr;
71 vectors[VEC_ILLEGAL] = trap;
72 vectors[VEC_SYS] = system_call;
73}
74
75void __init trap_init (void)
76{
77 int i;
78
79 for (i = VEC_SPUR; i <= VEC_INT7; i++)
80 vectors[i] = bad_inthandler;
81
82 for (i = 0; i < VEC_USER; i++)
83 if (!vectors[i])
84 vectors[i] = trap;
85
86 for (i = VEC_USER; i < 256; i++)
87 vectors[i] = bad_inthandler;
88
89#ifdef CONFIG_M68KFPU_EMU
90 if (FPU_IS_EMU)
91 vectors[VEC_LINE11] = fpu_emu;
92#endif
93
94 if (CPU_IS_040 && !FPU_IS_EMU) {
95 /* set up FPSP entry points */
96 asmlinkage void dz_vec(void) asm ("dz");
97 asmlinkage void inex_vec(void) asm ("inex");
98 asmlinkage void ovfl_vec(void) asm ("ovfl");
99 asmlinkage void unfl_vec(void) asm ("unfl");
100 asmlinkage void snan_vec(void) asm ("snan");
101 asmlinkage void operr_vec(void) asm ("operr");
102 asmlinkage void bsun_vec(void) asm ("bsun");
103 asmlinkage void fline_vec(void) asm ("fline");
104 asmlinkage void unsupp_vec(void) asm ("unsupp");
105
106 vectors[VEC_FPDIVZ] = dz_vec;
107 vectors[VEC_FPIR] = inex_vec;
108 vectors[VEC_FPOVER] = ovfl_vec;
109 vectors[VEC_FPUNDER] = unfl_vec;
110 vectors[VEC_FPNAN] = snan_vec;
111 vectors[VEC_FPOE] = operr_vec;
112 vectors[VEC_FPBRUC] = bsun_vec;
113 vectors[VEC_LINE11] = fline_vec;
114 vectors[VEC_FPUNSUP] = unsupp_vec;
115 }
116
117 if (CPU_IS_060 && !FPU_IS_EMU) {
118 /* set up IFPSP entry points */
119 asmlinkage void snan_vec6(void) asm ("_060_fpsp_snan");
120 asmlinkage void operr_vec6(void) asm ("_060_fpsp_operr");
121 asmlinkage void ovfl_vec6(void) asm ("_060_fpsp_ovfl");
122 asmlinkage void unfl_vec6(void) asm ("_060_fpsp_unfl");
123 asmlinkage void dz_vec6(void) asm ("_060_fpsp_dz");
124 asmlinkage void inex_vec6(void) asm ("_060_fpsp_inex");
125 asmlinkage void fline_vec6(void) asm ("_060_fpsp_fline");
126 asmlinkage void unsupp_vec6(void) asm ("_060_fpsp_unsupp");
127 asmlinkage void effadd_vec6(void) asm ("_060_fpsp_effadd");
128
129 vectors[VEC_FPNAN] = snan_vec6;
130 vectors[VEC_FPOE] = operr_vec6;
131 vectors[VEC_FPOVER] = ovfl_vec6;
132 vectors[VEC_FPUNDER] = unfl_vec6;
133 vectors[VEC_FPDIVZ] = dz_vec6;
134 vectors[VEC_FPIR] = inex_vec6;
135 vectors[VEC_LINE11] = fline_vec6;
136 vectors[VEC_FPUNSUP] = unsupp_vec6;
137 vectors[VEC_UNIMPEA] = effadd_vec6;
138 }
139
140 /* if running on an amiga, make the NMI interrupt do nothing */
141 if (MACH_IS_AMIGA) {
142 vectors[VEC_INT7] = nmihandler;
143 }
144}
145
diff --git a/arch/m68k/lib/memcpy.c b/arch/m68k/lib/memcpy.c
index 064889316974..10ca051d56b8 100644
--- a/arch/m68k/lib/memcpy.c
+++ b/arch/m68k/lib/memcpy.c
@@ -22,6 +22,15 @@ void *memcpy(void *to, const void *from, size_t n)
22 from = cfrom; 22 from = cfrom;
23 n--; 23 n--;
24 } 24 }
25#if defined(CONFIG_M68000)
26 if ((long)from & 1) {
27 char *cto = to;
28 const char *cfrom = from;
29 for (; n; n--)
30 *cto++ = *cfrom++;
31 return xto;
32 }
33#endif
25 if (n > 2 && (long)to & 2) { 34 if (n > 2 && (long)to & 2) {
26 short *sto = to; 35 short *sto = to;
27 const short *sfrom = from; 36 const short *sfrom = from;
diff --git a/arch/m68k/mm/init_no.c b/arch/m68k/mm/init_no.c
index 50cd12cf28d9..1e33d39ca9a0 100644
--- a/arch/m68k/mm/init_no.c
+++ b/arch/m68k/mm/init_no.c
@@ -32,6 +32,7 @@
32#include <linux/gfp.h> 32#include <linux/gfp.h>
33 33
34#include <asm/setup.h> 34#include <asm/setup.h>
35#include <asm/sections.h>
35#include <asm/segment.h> 36#include <asm/segment.h>
36#include <asm/page.h> 37#include <asm/page.h>
37#include <asm/pgtable.h> 38#include <asm/pgtable.h>
@@ -44,9 +45,6 @@
44 */ 45 */
45void *empty_zero_page; 46void *empty_zero_page;
46 47
47extern unsigned long memory_start;
48extern unsigned long memory_end;
49
50/* 48/*
51 * paging_init() continues the virtual memory environment setup which 49 * paging_init() continues the virtual memory environment setup which
52 * was begun by the code in arch/head.S. 50 * was begun by the code in arch/head.S.
@@ -78,8 +76,6 @@ void __init mem_init(void)
78{ 76{
79 int codek = 0, datak = 0, initk = 0; 77 int codek = 0, datak = 0, initk = 0;
80 unsigned long tmp; 78 unsigned long tmp;
81 extern char _etext, _stext, _sdata, _ebss, __init_begin, __init_end;
82 extern unsigned int _ramend, _rambase;
83 unsigned long len = _ramend - _rambase; 79 unsigned long len = _ramend - _rambase;
84 unsigned long start_mem = memory_start; /* DAVIDM - these must start at end of kernel */ 80 unsigned long start_mem = memory_start; /* DAVIDM - these must start at end of kernel */
85 unsigned long end_mem = memory_end; /* DAVIDM - this must not include kernel stack at top */ 81 unsigned long end_mem = memory_end; /* DAVIDM - this must not include kernel stack at top */
@@ -95,9 +91,9 @@ void __init mem_init(void)
95 /* this will put all memory onto the freelists */ 91 /* this will put all memory onto the freelists */
96 totalram_pages = free_all_bootmem(); 92 totalram_pages = free_all_bootmem();
97 93
98 codek = (&_etext - &_stext) >> 10; 94 codek = (_etext - _stext) >> 10;
99 datak = (&_ebss - &_sdata) >> 10; 95 datak = (_ebss - _sdata) >> 10;
100 initk = (&__init_begin - &__init_end) >> 10; 96 initk = (__init_begin - __init_end) >> 10;
101 97
102 tmp = nr_free_pages() << PAGE_SHIFT; 98 tmp = nr_free_pages() << PAGE_SHIFT;
103 printk(KERN_INFO "Memory available: %luk/%luk RAM, (%dk kernel code, %dk data)\n", 99 printk(KERN_INFO "Memory available: %luk/%luk RAM, (%dk kernel code, %dk data)\n",
@@ -129,22 +125,21 @@ void free_initmem(void)
129{ 125{
130#ifdef CONFIG_RAMKERNEL 126#ifdef CONFIG_RAMKERNEL
131 unsigned long addr; 127 unsigned long addr;
132 extern char __init_begin, __init_end;
133 /* 128 /*
134 * The following code should be cool even if these sections 129 * The following code should be cool even if these sections
135 * are not page aligned. 130 * are not page aligned.
136 */ 131 */
137 addr = PAGE_ALIGN((unsigned long)(&__init_begin)); 132 addr = PAGE_ALIGN((unsigned long) __init_begin);
138 /* next to check that the page we free is not a partial page */ 133 /* next to check that the page we free is not a partial page */
139 for (; addr + PAGE_SIZE < (unsigned long)(&__init_end); addr +=PAGE_SIZE) { 134 for (; addr + PAGE_SIZE < ((unsigned long) __init_end); addr += PAGE_SIZE) {
140 ClearPageReserved(virt_to_page(addr)); 135 ClearPageReserved(virt_to_page(addr));
141 init_page_count(virt_to_page(addr)); 136 init_page_count(virt_to_page(addr));
142 free_page(addr); 137 free_page(addr);
143 totalram_pages++; 138 totalram_pages++;
144 } 139 }
145 pr_notice("Freeing unused kernel memory: %luk freed (0x%x - 0x%x)\n", 140 pr_notice("Freeing unused kernel memory: %luk freed (0x%x - 0x%x)\n",
146 (addr - PAGE_ALIGN((long) &__init_begin)) >> 10, 141 (addr - PAGE_ALIGN((unsigned long) __init_begin)) >> 10,
147 (int)(PAGE_ALIGN((unsigned long)(&__init_begin))), 142 (int)(PAGE_ALIGN((unsigned long) __init_begin)),
148 (int)(addr - PAGE_SIZE)); 143 (int)(addr - PAGE_SIZE));
149#endif 144#endif
150} 145}
diff --git a/arch/m68k/platform/520x/config.c b/arch/m68k/platform/520x/config.c
index 621238f1a219..8a98683f1b15 100644
--- a/arch/m68k/platform/520x/config.c
+++ b/arch/m68k/platform/520x/config.c
@@ -91,9 +91,9 @@ static struct resource m520x_qspi_resources[] = {
91 }, 91 },
92}; 92};
93 93
94#define MCFQSPI_CS0 62 94#define MCFQSPI_CS0 46
95#define MCFQSPI_CS1 63 95#define MCFQSPI_CS1 47
96#define MCFQSPI_CS2 44 96#define MCFQSPI_CS2 27
97 97
98static int m520x_cs_setup(struct mcfqspi_cs_control *cs_control) 98static int m520x_cs_setup(struct mcfqspi_cs_control *cs_control)
99{ 99{
diff --git a/arch/m68k/platform/520x/gpio.c b/arch/m68k/platform/520x/gpio.c
index d757328563d1..9bcc3e4b60c5 100644
--- a/arch/m68k/platform/520x/gpio.c
+++ b/arch/m68k/platform/520x/gpio.c
@@ -38,42 +38,6 @@ static struct mcf_gpio_chip mcf_gpio_chips[] = {
38 }, 38 },
39 { 39 {
40 .gpio_chip = { 40 .gpio_chip = {
41 .label = "BUSCTL",
42 .request = mcf_gpio_request,
43 .free = mcf_gpio_free,
44 .direction_input = mcf_gpio_direction_input,
45 .direction_output = mcf_gpio_direction_output,
46 .get = mcf_gpio_get_value,
47 .set = mcf_gpio_set_value_fast,
48 .base = 8,
49 .ngpio = 4,
50 },
51 .pddr = (void __iomem *) MCFGPIO_PDDR_BUSCTL,
52 .podr = (void __iomem *) MCFGPIO_PODR_BUSCTL,
53 .ppdr = (void __iomem *) MCFGPIO_PPDSDR_BUSCTL,
54 .setr = (void __iomem *) MCFGPIO_PPDSDR_BUSCTL,
55 .clrr = (void __iomem *) MCFGPIO_PCLRR_BUSCTL,
56 },
57 {
58 .gpio_chip = {
59 .label = "BE",
60 .request = mcf_gpio_request,
61 .free = mcf_gpio_free,
62 .direction_input = mcf_gpio_direction_input,
63 .direction_output = mcf_gpio_direction_output,
64 .get = mcf_gpio_get_value,
65 .set = mcf_gpio_set_value_fast,
66 .base = 16,
67 .ngpio = 4,
68 },
69 .pddr = (void __iomem *) MCFGPIO_PDDR_BE,
70 .podr = (void __iomem *) MCFGPIO_PODR_BE,
71 .ppdr = (void __iomem *) MCFGPIO_PPDSDR_BE,
72 .setr = (void __iomem *) MCFGPIO_PPDSDR_BE,
73 .clrr = (void __iomem *) MCFGPIO_PCLRR_BE,
74 },
75 {
76 .gpio_chip = {
77 .label = "CS", 41 .label = "CS",
78 .request = mcf_gpio_request, 42 .request = mcf_gpio_request,
79 .free = mcf_gpio_free, 43 .free = mcf_gpio_free,
@@ -81,7 +45,7 @@ static struct mcf_gpio_chip mcf_gpio_chips[] = {
81 .direction_output = mcf_gpio_direction_output, 45 .direction_output = mcf_gpio_direction_output,
82 .get = mcf_gpio_get_value, 46 .get = mcf_gpio_get_value,
83 .set = mcf_gpio_set_value_fast, 47 .set = mcf_gpio_set_value_fast,
84 .base = 25, 48 .base = 9,
85 .ngpio = 3, 49 .ngpio = 3,
86 }, 50 },
87 .pddr = (void __iomem *) MCFGPIO_PDDR_CS, 51 .pddr = (void __iomem *) MCFGPIO_PDDR_CS,
@@ -99,7 +63,7 @@ static struct mcf_gpio_chip mcf_gpio_chips[] = {
99 .direction_output = mcf_gpio_direction_output, 63 .direction_output = mcf_gpio_direction_output,
100 .get = mcf_gpio_get_value, 64 .get = mcf_gpio_get_value,
101 .set = mcf_gpio_set_value_fast, 65 .set = mcf_gpio_set_value_fast,
102 .base = 32, 66 .base = 16,
103 .ngpio = 4, 67 .ngpio = 4,
104 }, 68 },
105 .pddr = (void __iomem *) MCFGPIO_PDDR_FECI2C, 69 .pddr = (void __iomem *) MCFGPIO_PDDR_FECI2C,
@@ -117,7 +81,7 @@ static struct mcf_gpio_chip mcf_gpio_chips[] = {
117 .direction_output = mcf_gpio_direction_output, 81 .direction_output = mcf_gpio_direction_output,
118 .get = mcf_gpio_get_value, 82 .get = mcf_gpio_get_value,
119 .set = mcf_gpio_set_value_fast, 83 .set = mcf_gpio_set_value_fast,
120 .base = 40, 84 .base = 24,
121 .ngpio = 4, 85 .ngpio = 4,
122 }, 86 },
123 .pddr = (void __iomem *) MCFGPIO_PDDR_QSPI, 87 .pddr = (void __iomem *) MCFGPIO_PDDR_QSPI,
@@ -135,7 +99,7 @@ static struct mcf_gpio_chip mcf_gpio_chips[] = {
135 .direction_output = mcf_gpio_direction_output, 99 .direction_output = mcf_gpio_direction_output,
136 .get = mcf_gpio_get_value, 100 .get = mcf_gpio_get_value,
137 .set = mcf_gpio_set_value_fast, 101 .set = mcf_gpio_set_value_fast,
138 .base = 48, 102 .base = 32,
139 .ngpio = 4, 103 .ngpio = 4,
140 }, 104 },
141 .pddr = (void __iomem *) MCFGPIO_PDDR_TIMER, 105 .pddr = (void __iomem *) MCFGPIO_PDDR_TIMER,
@@ -153,7 +117,7 @@ static struct mcf_gpio_chip mcf_gpio_chips[] = {
153 .direction_output = mcf_gpio_direction_output, 117 .direction_output = mcf_gpio_direction_output,
154 .get = mcf_gpio_get_value, 118 .get = mcf_gpio_get_value,
155 .set = mcf_gpio_set_value_fast, 119 .set = mcf_gpio_set_value_fast,
156 .base = 56, 120 .base = 40,
157 .ngpio = 8, 121 .ngpio = 8,
158 }, 122 },
159 .pddr = (void __iomem *) MCFGPIO_PDDR_UART, 123 .pddr = (void __iomem *) MCFGPIO_PDDR_UART,
@@ -171,7 +135,7 @@ static struct mcf_gpio_chip mcf_gpio_chips[] = {
171 .direction_output = mcf_gpio_direction_output, 135 .direction_output = mcf_gpio_direction_output,
172 .get = mcf_gpio_get_value, 136 .get = mcf_gpio_get_value,
173 .set = mcf_gpio_set_value_fast, 137 .set = mcf_gpio_set_value_fast,
174 .base = 64, 138 .base = 48,
175 .ngpio = 8, 139 .ngpio = 8,
176 }, 140 },
177 .pddr = (void __iomem *) MCFGPIO_PDDR_FECH, 141 .pddr = (void __iomem *) MCFGPIO_PDDR_FECH,
@@ -189,7 +153,7 @@ static struct mcf_gpio_chip mcf_gpio_chips[] = {
189 .direction_output = mcf_gpio_direction_output, 153 .direction_output = mcf_gpio_direction_output,
190 .get = mcf_gpio_get_value, 154 .get = mcf_gpio_get_value,
191 .set = mcf_gpio_set_value_fast, 155 .set = mcf_gpio_set_value_fast,
192 .base = 72, 156 .base = 56,
193 .ngpio = 8, 157 .ngpio = 8,
194 }, 158 },
195 .pddr = (void __iomem *) MCFGPIO_PDDR_FECL, 159 .pddr = (void __iomem *) MCFGPIO_PDDR_FECL,
diff --git a/arch/m68k/platform/68328/Makefile b/arch/m68k/platform/68328/Makefile
index 5e5435552d56..e4dfd8fde068 100644
--- a/arch/m68k/platform/68328/Makefile
+++ b/arch/m68k/platform/68328/Makefile
@@ -2,7 +2,10 @@
2# Makefile for arch/m68knommu/platform/68328. 2# Makefile for arch/m68knommu/platform/68328.
3# 3#
4 4
5head-y = head-$(MODEL).o 5model-y := ram
6model-$(CONFIG_ROMKERNEL) := rom
7
8head-y = head-$(model-y).o
6head-$(CONFIG_PILOT) = head-pilot.o 9head-$(CONFIG_PILOT) = head-pilot.o
7head-$(CONFIG_DRAGEN2) = head-de2.o 10head-$(CONFIG_DRAGEN2) = head-de2.o
8 11
diff --git a/arch/m68k/platform/68328/entry.S b/arch/m68k/platform/68328/entry.S
index 293e1eba9acc..5c39b80ed7de 100644
--- a/arch/m68k/platform/68328/entry.S
+++ b/arch/m68k/platform/68328/entry.S
@@ -67,7 +67,7 @@ ret_from_signal:
67 jra ret_from_exception 67 jra ret_from_exception
68 68
69ENTRY(system_call) 69ENTRY(system_call)
70 SAVE_ALL 70 SAVE_ALL_SYS
71 71
72 /* save top of frame*/ 72 /* save top of frame*/
73 pea %sp@ 73 pea %sp@
@@ -129,7 +129,7 @@ Lsignal_return:
129 * This is the main interrupt handler, responsible for calling process_int() 129 * This is the main interrupt handler, responsible for calling process_int()
130 */ 130 */
131inthandler1: 131inthandler1:
132 SAVE_ALL 132 SAVE_ALL_INT
133 movew %sp@(PT_OFF_FORMATVEC), %d0 133 movew %sp@(PT_OFF_FORMATVEC), %d0
134 and #0x3ff, %d0 134 and #0x3ff, %d0
135 135
@@ -140,7 +140,7 @@ inthandler1:
140 bra ret_from_interrupt 140 bra ret_from_interrupt
141 141
142inthandler2: 142inthandler2:
143 SAVE_ALL 143 SAVE_ALL_INT
144 movew %sp@(PT_OFF_FORMATVEC), %d0 144 movew %sp@(PT_OFF_FORMATVEC), %d0
145 and #0x3ff, %d0 145 and #0x3ff, %d0
146 146
@@ -151,7 +151,7 @@ inthandler2:
151 bra ret_from_interrupt 151 bra ret_from_interrupt
152 152
153inthandler3: 153inthandler3:
154 SAVE_ALL 154 SAVE_ALL_INT
155 movew %sp@(PT_OFF_FORMATVEC), %d0 155 movew %sp@(PT_OFF_FORMATVEC), %d0
156 and #0x3ff, %d0 156 and #0x3ff, %d0
157 157
@@ -162,7 +162,7 @@ inthandler3:
162 bra ret_from_interrupt 162 bra ret_from_interrupt
163 163
164inthandler4: 164inthandler4:
165 SAVE_ALL 165 SAVE_ALL_INT
166 movew %sp@(PT_OFF_FORMATVEC), %d0 166 movew %sp@(PT_OFF_FORMATVEC), %d0
167 and #0x3ff, %d0 167 and #0x3ff, %d0
168 168
@@ -173,7 +173,7 @@ inthandler4:
173 bra ret_from_interrupt 173 bra ret_from_interrupt
174 174
175inthandler5: 175inthandler5:
176 SAVE_ALL 176 SAVE_ALL_INT
177 movew %sp@(PT_OFF_FORMATVEC), %d0 177 movew %sp@(PT_OFF_FORMATVEC), %d0
178 and #0x3ff, %d0 178 and #0x3ff, %d0
179 179
@@ -184,7 +184,7 @@ inthandler5:
184 bra ret_from_interrupt 184 bra ret_from_interrupt
185 185
186inthandler6: 186inthandler6:
187 SAVE_ALL 187 SAVE_ALL_INT
188 movew %sp@(PT_OFF_FORMATVEC), %d0 188 movew %sp@(PT_OFF_FORMATVEC), %d0
189 and #0x3ff, %d0 189 and #0x3ff, %d0
190 190
@@ -195,7 +195,7 @@ inthandler6:
195 bra ret_from_interrupt 195 bra ret_from_interrupt
196 196
197inthandler7: 197inthandler7:
198 SAVE_ALL 198 SAVE_ALL_INT
199 movew %sp@(PT_OFF_FORMATVEC), %d0 199 movew %sp@(PT_OFF_FORMATVEC), %d0
200 and #0x3ff, %d0 200 and #0x3ff, %d0
201 201
@@ -206,7 +206,7 @@ inthandler7:
206 bra ret_from_interrupt 206 bra ret_from_interrupt
207 207
208inthandler: 208inthandler:
209 SAVE_ALL 209 SAVE_ALL_INT
210 movew %sp@(PT_OFF_FORMATVEC), %d0 210 movew %sp@(PT_OFF_FORMATVEC), %d0
211 and #0x3ff, %d0 211 and #0x3ff, %d0
212 212
diff --git a/arch/m68k/platform/68360/Makefile b/arch/m68k/platform/68360/Makefile
index cf5af73a5789..f6f434383049 100644
--- a/arch/m68k/platform/68360/Makefile
+++ b/arch/m68k/platform/68360/Makefile
@@ -1,10 +1,12 @@
1# 1#
2# Makefile for arch/m68knommu/platform/68360. 2# Makefile for arch/m68knommu/platform/68360.
3# 3#
4model-y := ram
5model-$(CONFIG_ROMKERNEL) := rom
4 6
5obj-y := config.o commproc.o entry.o ints.o 7obj-y := config.o commproc.o entry.o ints.o
6 8
7extra-y := head.o 9extra-y := head.o
8 10
9$(obj)/head.o: $(obj)/head-$(MODEL).o 11$(obj)/head.o: $(obj)/head-$(model-y).o
10 ln -sf head-$(MODEL).o $(obj)/head.o 12 ln -sf head-$(model-y).o $(obj)/head.o
diff --git a/arch/m68k/platform/68360/entry.S b/arch/m68k/platform/68360/entry.S
index abbb89672ea0..aa47d1d49929 100644
--- a/arch/m68k/platform/68360/entry.S
+++ b/arch/m68k/platform/68360/entry.S
@@ -63,7 +63,7 @@ ret_from_signal:
63 jra ret_from_exception 63 jra ret_from_exception
64 64
65ENTRY(system_call) 65ENTRY(system_call)
66 SAVE_ALL 66 SAVE_ALL_SYS
67 67
68 /* save top of frame*/ 68 /* save top of frame*/
69 pea %sp@ 69 pea %sp@
@@ -125,7 +125,7 @@ Lsignal_return:
125 * This is the main interrupt handler, responsible for calling do_IRQ() 125 * This is the main interrupt handler, responsible for calling do_IRQ()
126 */ 126 */
127inthandler: 127inthandler:
128 SAVE_ALL 128 SAVE_ALL_INT
129 movew %sp@(PT_OFF_FORMATVEC), %d0 129 movew %sp@(PT_OFF_FORMATVEC), %d0
130 and.l #0x3ff, %d0 130 and.l #0x3ff, %d0
131 lsr.l #0x02, %d0 131 lsr.l #0x02, %d0
diff --git a/arch/m68k/platform/coldfire/entry.S b/arch/m68k/platform/coldfire/entry.S
index bd27242c2f43..3157461a8d1d 100644
--- a/arch/m68k/platform/coldfire/entry.S
+++ b/arch/m68k/platform/coldfire/entry.S
@@ -61,7 +61,7 @@ enosys:
61 bra 1f 61 bra 1f
62 62
63ENTRY(system_call) 63ENTRY(system_call)
64 SAVE_ALL 64 SAVE_ALL_SYS
65 move #0x2000,%sr /* enable intrs again */ 65 move #0x2000,%sr /* enable intrs again */
66 66
67 cmpl #NR_syscalls,%d0 67 cmpl #NR_syscalls,%d0
@@ -165,9 +165,7 @@ Lsignal_return:
165 * sources). Calls up to high level code to do all the work. 165 * sources). Calls up to high level code to do all the work.
166 */ 166 */
167ENTRY(inthandler) 167ENTRY(inthandler)
168 SAVE_ALL 168 SAVE_ALL_INT
169 moveq #-1,%d0
170 movel %d0,%sp@(PT_OFF_ORIG_D0)
171 169
172 movew %sp@(PT_OFF_FORMATVEC),%d0 /* put exception # in d0 */ 170 movew %sp@(PT_OFF_FORMATVEC),%d0 /* put exception # in d0 */
173 andl #0x03fc,%d0 /* mask out vector only */ 171 andl #0x03fc,%d0 /* mask out vector only */