diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-01-28 16:52:50 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-01-28 16:52:50 -0500 |
commit | e189f3495c4e30fc84fc9241096edf3932e23439 (patch) | |
tree | 5916c89ace81537a02ae01869386ba6caafdab9c /arch | |
parent | f4798748dee00c807a63f5518f08b3df161e0f6d (diff) | |
parent | 6582d7b7376aa587d74b08c74457dc28abc1a9fa (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: (197 commits)
sh: add spi header and r2d platform data V3
sh: update r7780rp interrupt code
sh: remove consistent alloc stuff from the machine vector
sh: use declared coherent memory for dreamcast pci ethernet adapter
sh: declared coherent memory support V2
sh: Add support for SDK7780 board.
sh: constify function pointer tables
sh: Kill off -traditional for linker script.
cdrom: Add support for Sega Dreamcast GD-ROM.
sh: Kill off hs7751rvoip reference from arch/sh/Kconfig.
sh: Drop r7780rp_defconfig, use r7780mp_defconfig as kbuild default.
sh: Kill off dead HS771RVoIP board support.
sh: r7785rp: Fix up DECLARE_INTC_DESC() arg mismatch.
sh: r7785rp: Hook up the rest of the HL7785 FPGA IRQ vectors.
sh: r2d - enable sm501 usb host function
sh: remove voyagergx
sh: r2d - add lcd planel timings to sm501 platform data
sh: Add OHCI and UDC platform devices for SH7720.
sh: intc - remove default interrupt priority tables
sh: Correct pte size mismatch for X2 TLB.
...
Diffstat (limited to 'arch')
216 files changed, 8055 insertions, 11082 deletions
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index 496d635f89b2..1cd9c8fd927d 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig | |||
@@ -6,8 +6,7 @@ | |||
6 | mainmenu "Linux/SuperH Kernel Configuration" | 6 | mainmenu "Linux/SuperH Kernel Configuration" |
7 | 7 | ||
8 | config SUPERH | 8 | config SUPERH |
9 | bool | 9 | def_bool y |
10 | default y | ||
11 | select EMBEDDED | 10 | select EMBEDDED |
12 | help | 11 | help |
13 | The SuperH is a RISC processor targeted for use in embedded systems | 12 | The SuperH is a RISC processor targeted for use in embedded systems |
@@ -15,36 +14,36 @@ config SUPERH | |||
15 | gaming console. The SuperH port has a home page at | 14 | gaming console. The SuperH port has a home page at |
16 | <http://www.linux-sh.org/>. | 15 | <http://www.linux-sh.org/>. |
17 | 16 | ||
17 | config SUPERH32 | ||
18 | def_bool !SUPERH64 | ||
19 | |||
20 | config SUPERH64 | ||
21 | def_bool y if CPU_SH5 | ||
22 | |||
18 | config RWSEM_GENERIC_SPINLOCK | 23 | config RWSEM_GENERIC_SPINLOCK |
19 | bool | 24 | def_bool y |
20 | default y | ||
21 | 25 | ||
22 | config RWSEM_XCHGADD_ALGORITHM | 26 | config RWSEM_XCHGADD_ALGORITHM |
23 | bool | 27 | bool |
24 | 28 | ||
25 | config GENERIC_BUG | 29 | config GENERIC_BUG |
26 | def_bool y | 30 | def_bool y |
27 | depends on BUG | 31 | depends on BUG && SUPERH32 |
28 | 32 | ||
29 | config GENERIC_FIND_NEXT_BIT | 33 | config GENERIC_FIND_NEXT_BIT |
30 | bool | 34 | def_bool y |
31 | default y | ||
32 | 35 | ||
33 | config GENERIC_HWEIGHT | 36 | config GENERIC_HWEIGHT |
34 | bool | 37 | def_bool y |
35 | default y | ||
36 | 38 | ||
37 | config GENERIC_HARDIRQS | 39 | config GENERIC_HARDIRQS |
38 | bool | 40 | def_bool y |
39 | default y | ||
40 | 41 | ||
41 | config GENERIC_IRQ_PROBE | 42 | config GENERIC_IRQ_PROBE |
42 | bool | 43 | def_bool y |
43 | default y | ||
44 | 44 | ||
45 | config GENERIC_CALIBRATE_DELAY | 45 | config GENERIC_CALIBRATE_DELAY |
46 | bool | 46 | def_bool y |
47 | default y | ||
48 | 47 | ||
49 | config GENERIC_IOMAP | 48 | config GENERIC_IOMAP |
50 | bool | 49 | bool |
@@ -75,20 +74,16 @@ config ARCH_MAY_HAVE_PC_FDC | |||
75 | bool | 74 | bool |
76 | 75 | ||
77 | config STACKTRACE_SUPPORT | 76 | config STACKTRACE_SUPPORT |
78 | bool | 77 | def_bool y |
79 | default y | ||
80 | 78 | ||
81 | config LOCKDEP_SUPPORT | 79 | config LOCKDEP_SUPPORT |
82 | bool | 80 | def_bool y |
83 | default y | ||
84 | 81 | ||
85 | config ARCH_HAS_ILOG2_U32 | 82 | config ARCH_HAS_ILOG2_U32 |
86 | bool | 83 | def_bool n |
87 | default n | ||
88 | 84 | ||
89 | config ARCH_HAS_ILOG2_U64 | 85 | config ARCH_HAS_ILOG2_U64 |
90 | bool | 86 | def_bool n |
91 | default n | ||
92 | 87 | ||
93 | config ARCH_NO_VIRT_TO_BUS | 88 | config ARCH_NO_VIRT_TO_BUS |
94 | def_bool y | 89 | def_bool y |
@@ -97,110 +92,234 @@ source "init/Kconfig" | |||
97 | 92 | ||
98 | menu "System type" | 93 | menu "System type" |
99 | 94 | ||
100 | source "arch/sh/mm/Kconfig" | 95 | # |
96 | # Processor families | ||
97 | # | ||
98 | config CPU_SH2 | ||
99 | bool | ||
101 | 100 | ||
102 | menu "Processor features" | 101 | config CPU_SH2A |
102 | bool | ||
103 | select CPU_SH2 | ||
104 | |||
105 | config CPU_SH3 | ||
106 | bool | ||
107 | select CPU_HAS_INTEVT | ||
108 | select CPU_HAS_SR_RB | ||
109 | |||
110 | config CPU_SH4 | ||
111 | bool | ||
112 | select CPU_HAS_INTEVT | ||
113 | select CPU_HAS_SR_RB | ||
114 | select CPU_HAS_PTEA if !CPU_SH4A || CPU_SHX2 | ||
115 | select CPU_HAS_FPU if !CPU_SH4AL_DSP | ||
116 | |||
117 | config CPU_SH4A | ||
118 | bool | ||
119 | select CPU_SH4 | ||
120 | |||
121 | config CPU_SH4AL_DSP | ||
122 | bool | ||
123 | select CPU_SH4A | ||
124 | select CPU_HAS_DSP | ||
125 | |||
126 | config CPU_SH5 | ||
127 | bool | ||
128 | select CPU_HAS_FPU | ||
129 | |||
130 | config CPU_SHX2 | ||
131 | bool | ||
132 | |||
133 | config CPU_SHX3 | ||
134 | bool | ||
103 | 135 | ||
104 | choice | 136 | choice |
105 | prompt "Endianess selection" | 137 | prompt "Processor sub-type selection" |
106 | default CPU_LITTLE_ENDIAN | ||
107 | help | ||
108 | Some SuperH machines can be configured for either little or big | ||
109 | endian byte order. These modes require different kernels. | ||
110 | 138 | ||
111 | config CPU_LITTLE_ENDIAN | 139 | # |
112 | bool "Little Endian" | 140 | # Processor subtypes |
141 | # | ||
113 | 142 | ||
114 | config CPU_BIG_ENDIAN | 143 | # SH-2 Processor Support |
115 | bool "Big Endian" | ||
116 | 144 | ||
117 | endchoice | 145 | config CPU_SUBTYPE_SH7619 |
146 | bool "Support SH7619 processor" | ||
147 | select CPU_SH2 | ||
148 | |||
149 | # SH-2A Processor Support | ||
150 | |||
151 | config CPU_SUBTYPE_SH7203 | ||
152 | bool "Support SH7203 processor" | ||
153 | select CPU_SH2A | ||
154 | select CPU_HAS_FPU | ||
155 | |||
156 | config CPU_SUBTYPE_SH7206 | ||
157 | bool "Support SH7206 processor" | ||
158 | select CPU_SH2A | ||
118 | 159 | ||
119 | config SH_FPU | 160 | config CPU_SUBTYPE_SH7263 |
120 | bool "FPU support" | 161 | bool "Support SH7263 processor" |
121 | depends on CPU_HAS_FPU | 162 | select CPU_SH2A |
122 | default y | 163 | select CPU_HAS_FPU |
164 | |||
165 | # SH-3 Processor Support | ||
166 | |||
167 | config CPU_SUBTYPE_SH7705 | ||
168 | bool "Support SH7705 processor" | ||
169 | select CPU_SH3 | ||
170 | |||
171 | config CPU_SUBTYPE_SH7706 | ||
172 | bool "Support SH7706 processor" | ||
173 | select CPU_SH3 | ||
123 | help | 174 | help |
124 | Selecting this option will enable support for SH processors that | 175 | Select SH7706 if you have a 133 Mhz SH-3 HD6417706 CPU. |
125 | have FPU units (ie, SH77xx). | ||
126 | 176 | ||
127 | This option must be set in order to enable the FPU. | 177 | config CPU_SUBTYPE_SH7707 |
178 | bool "Support SH7707 processor" | ||
179 | select CPU_SH3 | ||
180 | help | ||
181 | Select SH7707 if you have a 60 Mhz SH-3 HD6417707 CPU. | ||
128 | 182 | ||
129 | config SH_FPU_EMU | 183 | config CPU_SUBTYPE_SH7708 |
130 | bool "FPU emulation support" | 184 | bool "Support SH7708 processor" |
131 | depends on !SH_FPU && EXPERIMENTAL | 185 | select CPU_SH3 |
132 | default n | ||
133 | help | 186 | help |
134 | Selecting this option will enable support for software FPU emulation. | 187 | Select SH7708 if you have a 60 Mhz SH-3 HD6417708S or |
135 | Most SH-3 users will want to say Y here, whereas most SH-4 users will | 188 | if you have a 100 Mhz SH-3 HD6417708R CPU. |
136 | want to say N. | ||
137 | 189 | ||
138 | config SH_DSP | 190 | config CPU_SUBTYPE_SH7709 |
139 | bool "DSP support" | 191 | bool "Support SH7709 processor" |
140 | depends on CPU_HAS_DSP | 192 | select CPU_SH3 |
141 | default y | ||
142 | help | 193 | help |
143 | Selecting this option will enable support for SH processors that | 194 | Select SH7709 if you have a 80 Mhz SH-3 HD6417709 CPU. |
144 | have DSP units (ie, SH2-DSP, SH3-DSP, and SH4AL-DSP). | ||
145 | 195 | ||
146 | This option must be set in order to enable the DSP. | 196 | config CPU_SUBTYPE_SH7710 |
197 | bool "Support SH7710 processor" | ||
198 | select CPU_SH3 | ||
199 | select CPU_HAS_DSP | ||
200 | help | ||
201 | Select SH7710 if you have a SH3-DSP SH7710 CPU. | ||
147 | 202 | ||
148 | config SH_ADC | 203 | config CPU_SUBTYPE_SH7712 |
149 | bool "ADC support" | 204 | bool "Support SH7712 processor" |
150 | depends on CPU_SH3 | 205 | select CPU_SH3 |
151 | default y | 206 | select CPU_HAS_DSP |
152 | help | 207 | help |
153 | Selecting this option will allow the Linux kernel to use SH3 on-chip | 208 | Select SH7712 if you have a SH3-DSP SH7712 CPU. |
154 | ADC module. | ||
155 | 209 | ||
156 | If unsure, say N. | 210 | config CPU_SUBTYPE_SH7720 |
211 | bool "Support SH7720 processor" | ||
212 | select CPU_SH3 | ||
213 | select CPU_HAS_DSP | ||
214 | help | ||
215 | Select SH7720 if you have a SH3-DSP SH7720 CPU. | ||
157 | 216 | ||
158 | config SH_STORE_QUEUES | 217 | config CPU_SUBTYPE_SH7721 |
159 | bool "Support for Store Queues" | 218 | bool "Support SH7721 processor" |
160 | depends on CPU_SH4 | 219 | select CPU_SH3 |
220 | select CPU_HAS_DSP | ||
161 | help | 221 | help |
162 | Selecting this option will enable an in-kernel API for manipulating | 222 | Select SH7721 if you have a SH3-DSP SH7721 CPU. |
163 | the store queues integrated in the SH-4 processors. | ||
164 | 223 | ||
165 | config SPECULATIVE_EXECUTION | 224 | # SH-4 Processor Support |
166 | bool "Speculative subroutine return" | 225 | |
167 | depends on CPU_SUBTYPE_SH7780 && EXPERIMENTAL | 226 | config CPU_SUBTYPE_SH7750 |
227 | bool "Support SH7750 processor" | ||
228 | select CPU_SH4 | ||
168 | help | 229 | help |
169 | This enables support for a speculative instruction fetch for | 230 | Select SH7750 if you have a 200 Mhz SH-4 HD6417750 CPU. |
170 | subroutine return. There are various pitfalls associated with | ||
171 | this, as outlined in the SH7780 hardware manual. | ||
172 | 231 | ||
173 | If unsure, say N. | 232 | config CPU_SUBTYPE_SH7091 |
233 | bool "Support SH7091 processor" | ||
234 | select CPU_SH4 | ||
235 | help | ||
236 | Select SH7091 if you have an SH-4 based Sega device (such as | ||
237 | the Dreamcast, Naomi, and Naomi 2). | ||
174 | 238 | ||
175 | config CPU_HAS_INTEVT | 239 | config CPU_SUBTYPE_SH7750R |
176 | bool | 240 | bool "Support SH7750R processor" |
241 | select CPU_SH4 | ||
177 | 242 | ||
178 | config CPU_HAS_MASKREG_IRQ | 243 | config CPU_SUBTYPE_SH7750S |
179 | bool | 244 | bool "Support SH7750S processor" |
245 | select CPU_SH4 | ||
180 | 246 | ||
181 | config CPU_HAS_IPR_IRQ | 247 | config CPU_SUBTYPE_SH7751 |
182 | bool | 248 | bool "Support SH7751 processor" |
249 | select CPU_SH4 | ||
250 | help | ||
251 | Select SH7751 if you have a 166 Mhz SH-4 HD6417751 CPU, | ||
252 | or if you have a HD6417751R CPU. | ||
183 | 253 | ||
184 | config CPU_HAS_SR_RB | 254 | config CPU_SUBTYPE_SH7751R |
185 | bool | 255 | bool "Support SH7751R processor" |
256 | select CPU_SH4 | ||
257 | |||
258 | config CPU_SUBTYPE_SH7760 | ||
259 | bool "Support SH7760 processor" | ||
260 | select CPU_SH4 | ||
261 | |||
262 | config CPU_SUBTYPE_SH4_202 | ||
263 | bool "Support SH4-202 processor" | ||
264 | select CPU_SH4 | ||
265 | |||
266 | # SH-4A Processor Support | ||
267 | |||
268 | config CPU_SUBTYPE_SH7763 | ||
269 | bool "Support SH7763 processor" | ||
270 | select CPU_SH4A | ||
186 | help | 271 | help |
187 | This will enable the use of SR.RB register bank usage. Processors | 272 | Select SH7763 if you have a SH4A SH7763(R5S77631) CPU. |
188 | that are lacking this bit must have another method in place for | ||
189 | accomplishing what is taken care of by the banked registers. | ||
190 | 273 | ||
191 | See <file:Documentation/sh/register-banks.txt> for further | 274 | config CPU_SUBTYPE_SH7770 |
192 | information on SR.RB and register banking in the kernel in general. | 275 | bool "Support SH7770 processor" |
276 | select CPU_SH4A | ||
193 | 277 | ||
194 | config CPU_HAS_PTEA | 278 | config CPU_SUBTYPE_SH7780 |
195 | bool | 279 | bool "Support SH7780 processor" |
280 | select CPU_SH4A | ||
196 | 281 | ||
197 | config CPU_HAS_DSP | 282 | config CPU_SUBTYPE_SH7785 |
198 | bool | 283 | bool "Support SH7785 processor" |
284 | select CPU_SH4A | ||
285 | select CPU_SHX2 | ||
286 | select ARCH_SPARSEMEM_ENABLE | ||
287 | select SYS_SUPPORTS_NUMA | ||
199 | 288 | ||
200 | config CPU_HAS_FPU | 289 | config CPU_SUBTYPE_SHX3 |
201 | bool | 290 | bool "Support SH-X3 processor" |
291 | select CPU_SH4A | ||
292 | select CPU_SHX3 | ||
293 | select ARCH_SPARSEMEM_ENABLE | ||
294 | select SYS_SUPPORTS_NUMA | ||
295 | select SYS_SUPPORTS_SMP | ||
202 | 296 | ||
203 | endmenu | 297 | # SH4AL-DSP Processor Support |
298 | |||
299 | config CPU_SUBTYPE_SH7343 | ||
300 | bool "Support SH7343 processor" | ||
301 | select CPU_SH4AL_DSP | ||
302 | |||
303 | config CPU_SUBTYPE_SH7722 | ||
304 | bool "Support SH7722 processor" | ||
305 | select CPU_SH4AL_DSP | ||
306 | select CPU_SHX2 | ||
307 | select ARCH_SPARSEMEM_ENABLE | ||
308 | select SYS_SUPPORTS_NUMA | ||
309 | |||
310 | # SH-5 Processor Support | ||
311 | |||
312 | config CPU_SUBTYPE_SH5_101 | ||
313 | bool "Support SH5-101 processor" | ||
314 | select CPU_SH5 | ||
315 | |||
316 | config CPU_SUBTYPE_SH5_103 | ||
317 | bool "Support SH5-103 processor" | ||
318 | |||
319 | endchoice | ||
320 | |||
321 | source "arch/sh/mm/Kconfig" | ||
322 | source "arch/sh/Kconfig.cpu" | ||
204 | 323 | ||
205 | menu "Board support" | 324 | menu "Board support" |
206 | 325 | ||
@@ -321,13 +440,6 @@ config SH_SECUREEDGE5410 | |||
321 | This includes both the OEM SecureEdge products as well as the | 440 | This includes both the OEM SecureEdge products as well as the |
322 | SME product line. | 441 | SME product line. |
323 | 442 | ||
324 | config SH_HS7751RVOIP | ||
325 | bool "HS7751RVOIP" | ||
326 | depends on CPU_SUBTYPE_SH7751R | ||
327 | help | ||
328 | Select HS7751RVOIP if configuring for a Renesas Technology | ||
329 | Sales VoIP board. | ||
330 | |||
331 | config SH_7710VOIPGW | 443 | config SH_7710VOIPGW |
332 | bool "SH7710-VOIP-GW" | 444 | bool "SH7710-VOIP-GW" |
333 | depends on CPU_SUBTYPE_SH7710 | 445 | depends on CPU_SUBTYPE_SH7710 |
@@ -343,6 +455,14 @@ config SH_RTS7751R2D | |||
343 | Select RTS7751R2D if configuring for a Renesas Technology | 455 | Select RTS7751R2D if configuring for a Renesas Technology |
344 | Sales SH-Graphics board. | 456 | Sales SH-Graphics board. |
345 | 457 | ||
458 | config SH_SDK7780 | ||
459 | bool "SDK7780R3" | ||
460 | depends on CPU_SUBTYPE_SH7780 | ||
461 | select SYS_SUPPORTS_PCI | ||
462 | help | ||
463 | Select SDK7780 if configuring for a Renesas SH7780 SDK7780R3 | ||
464 | evaluation board. | ||
465 | |||
346 | config SH_HIGHLANDER | 466 | config SH_HIGHLANDER |
347 | bool "Highlander" | 467 | bool "Highlander" |
348 | depends on CPU_SUBTYPE_SH7780 || CPU_SUBTYPE_SH7785 | 468 | depends on CPU_SUBTYPE_SH7780 || CPU_SUBTYPE_SH7785 |
@@ -399,41 +519,47 @@ config SH_MAGIC_PANEL_R2 | |||
399 | help | 519 | help |
400 | Select Magic Panel R2 if configuring for Magic Panel R2. | 520 | Select Magic Panel R2 if configuring for Magic Panel R2. |
401 | 521 | ||
522 | config SH_CAYMAN | ||
523 | bool "Hitachi Cayman" | ||
524 | depends on CPU_SUBTYPE_SH5_101 || CPU_SUBTYPE_SH5_103 | ||
525 | select SYS_SUPPORTS_PCI | ||
526 | |||
402 | endmenu | 527 | endmenu |
403 | 528 | ||
404 | source "arch/sh/boards/renesas/hs7751rvoip/Kconfig" | ||
405 | source "arch/sh/boards/renesas/rts7751r2d/Kconfig" | 529 | source "arch/sh/boards/renesas/rts7751r2d/Kconfig" |
406 | source "arch/sh/boards/renesas/r7780rp/Kconfig" | 530 | source "arch/sh/boards/renesas/r7780rp/Kconfig" |
531 | source "arch/sh/boards/renesas/sdk7780/Kconfig" | ||
407 | source "arch/sh/boards/magicpanelr2/Kconfig" | 532 | source "arch/sh/boards/magicpanelr2/Kconfig" |
408 | 533 | ||
409 | menu "Timer and clock configuration" | 534 | menu "Timer and clock configuration" |
410 | 535 | ||
411 | config SH_TMU | 536 | config SH_TMU |
412 | bool "TMU timer support" | 537 | def_bool y |
538 | prompt "TMU timer support" | ||
413 | depends on CPU_SH3 || CPU_SH4 | 539 | depends on CPU_SH3 || CPU_SH4 |
414 | select GENERIC_TIME | 540 | select GENERIC_TIME |
415 | select GENERIC_CLOCKEVENTS | 541 | select GENERIC_CLOCKEVENTS |
416 | default y | ||
417 | help | 542 | help |
418 | This enables the use of the TMU as the system timer. | 543 | This enables the use of the TMU as the system timer. |
419 | 544 | ||
420 | config SH_CMT | 545 | config SH_CMT |
421 | bool "CMT timer support" | 546 | def_bool y |
547 | prompt "CMT timer support" | ||
422 | depends on CPU_SH2 | 548 | depends on CPU_SH2 |
423 | default y | ||
424 | help | 549 | help |
425 | This enables the use of the CMT as the system timer. | 550 | This enables the use of the CMT as the system timer. |
426 | 551 | ||
427 | config SH_MTU2 | 552 | config SH_MTU2 |
428 | bool "MTU2 timer support" | 553 | def_bool n |
554 | prompt "MTU2 timer support" | ||
429 | depends on CPU_SH2A | 555 | depends on CPU_SH2A |
430 | default n | ||
431 | help | 556 | help |
432 | This enables the use of the MTU2 as the system timer. | 557 | This enables the use of the MTU2 as the system timer. |
433 | 558 | ||
434 | config SH_TIMER_IRQ | 559 | config SH_TIMER_IRQ |
435 | int | 560 | int |
436 | default "28" if CPU_SUBTYPE_SH7780 || CPU_SUBTYPE_SH7785 | 561 | default "28" if CPU_SUBTYPE_SH7780 || CPU_SUBTYPE_SH7785 || \ |
562 | CPU_SUBTYPE_SH7763 | ||
437 | default "86" if CPU_SUBTYPE_SH7619 | 563 | default "86" if CPU_SUBTYPE_SH7619 |
438 | default "140" if CPU_SUBTYPE_SH7206 | 564 | default "140" if CPU_SUBTYPE_SH7206 |
439 | default "16" | 565 | default "16" |
@@ -445,7 +571,8 @@ config SH_PCLK_FREQ | |||
445 | default "32000000" if CPU_SUBTYPE_SH7722 | 571 | default "32000000" if CPU_SUBTYPE_SH7722 |
446 | default "33333333" if CPU_SUBTYPE_SH7770 || \ | 572 | default "33333333" if CPU_SUBTYPE_SH7770 || \ |
447 | CPU_SUBTYPE_SH7760 || CPU_SUBTYPE_SH7705 || \ | 573 | CPU_SUBTYPE_SH7760 || CPU_SUBTYPE_SH7705 || \ |
448 | CPU_SUBTYPE_SH7206 | 574 | CPU_SUBTYPE_SH7203 || CPU_SUBTYPE_SH7206 || \ |
575 | CPU_SUBTYPE_SH7263 | ||
449 | default "60000000" if CPU_SUBTYPE_SH7751 || CPU_SUBTYPE_SH7751R | 576 | default "60000000" if CPU_SUBTYPE_SH7751 || CPU_SUBTYPE_SH7751R |
450 | default "66000000" if CPU_SUBTYPE_SH4_202 | 577 | default "66000000" if CPU_SUBTYPE_SH4_202 |
451 | default "50000000" | 578 | default "50000000" |
@@ -456,7 +583,7 @@ config SH_PCLK_FREQ | |||
456 | 583 | ||
457 | config SH_CLK_MD | 584 | config SH_CLK_MD |
458 | int "CPU Mode Pin Setting" | 585 | int "CPU Mode Pin Setting" |
459 | depends on CPU_SUBTYPE_SH7619 || CPU_SUBTYPE_SH7206 | 586 | depends on CPU_SH2 |
460 | default 6 if CPU_SUBTYPE_SH7206 | 587 | default 6 if CPU_SUBTYPE_SH7206 |
461 | default 5 if CPU_SUBTYPE_SH7619 | 588 | default 5 if CPU_SUBTYPE_SH7619 |
462 | default 0 | 589 | default 0 |
@@ -490,9 +617,8 @@ source "arch/sh/drivers/Kconfig" | |||
490 | endmenu | 617 | endmenu |
491 | 618 | ||
492 | config ISA_DMA_API | 619 | config ISA_DMA_API |
493 | bool | 620 | def_bool y |
494 | depends on SH_MPC1211 | 621 | depends on SH_MPC1211 |
495 | default y | ||
496 | 622 | ||
497 | menu "Kernel features" | 623 | menu "Kernel features" |
498 | 624 | ||
@@ -570,7 +696,7 @@ source "kernel/Kconfig.preempt" | |||
570 | 696 | ||
571 | config GUSA | 697 | config GUSA |
572 | def_bool y | 698 | def_bool y |
573 | depends on !SMP | 699 | depends on !SMP && SUPERH32 |
574 | help | 700 | help |
575 | This enables support for gUSA (general UserSpace Atomicity). | 701 | This enables support for gUSA (general UserSpace Atomicity). |
576 | This is the default implementation for both UP and non-ll/sc | 702 | This is the default implementation for both UP and non-ll/sc |
@@ -582,6 +708,16 @@ config GUSA | |||
582 | This should only be disabled for special cases where alternate | 708 | This should only be disabled for special cases where alternate |
583 | atomicity implementations exist. | 709 | atomicity implementations exist. |
584 | 710 | ||
711 | config GUSA_RB | ||
712 | bool "Implement atomic operations by roll-back (gRB) (EXPERIMENTAL)" | ||
713 | depends on GUSA && CPU_SH3 || (CPU_SH4 && !CPU_SH4A) | ||
714 | help | ||
715 | Enabling this option will allow the kernel to implement some | ||
716 | atomic operations using a software implemention of load-locked/ | ||
717 | store-conditional (LLSC). On machines which do not have hardware | ||
718 | LLSC, this should be more efficient than the other alternative of | ||
719 | disabling insterrupts around the atomic sequence. | ||
720 | |||
585 | endmenu | 721 | endmenu |
586 | 722 | ||
587 | menu "Boot options" | 723 | menu "Boot options" |
diff --git a/arch/sh/Kconfig.cpu b/arch/sh/Kconfig.cpu new file mode 100644 index 000000000000..d850184d0694 --- /dev/null +++ b/arch/sh/Kconfig.cpu | |||
@@ -0,0 +1,115 @@ | |||
1 | menu "Processor features" | ||
2 | |||
3 | choice | ||
4 | prompt "Endianess selection" | ||
5 | default CPU_LITTLE_ENDIAN | ||
6 | help | ||
7 | Some SuperH machines can be configured for either little or big | ||
8 | endian byte order. These modes require different kernels. | ||
9 | |||
10 | config CPU_LITTLE_ENDIAN | ||
11 | bool "Little Endian" | ||
12 | |||
13 | config CPU_BIG_ENDIAN | ||
14 | bool "Big Endian" | ||
15 | |||
16 | endchoice | ||
17 | |||
18 | config SH_FPU | ||
19 | def_bool y | ||
20 | prompt "FPU support" | ||
21 | depends on CPU_HAS_FPU | ||
22 | help | ||
23 | Selecting this option will enable support for SH processors that | ||
24 | have FPU units (ie, SH77xx). | ||
25 | |||
26 | This option must be set in order to enable the FPU. | ||
27 | |||
28 | config SH64_FPU_DENORM_FLUSH | ||
29 | bool "Flush floating point denorms to zero" | ||
30 | depends on SH_FPU && SUPERH64 | ||
31 | |||
32 | config SH_FPU_EMU | ||
33 | def_bool n | ||
34 | prompt "FPU emulation support" | ||
35 | depends on !SH_FPU && EXPERIMENTAL | ||
36 | help | ||
37 | Selecting this option will enable support for software FPU emulation. | ||
38 | Most SH-3 users will want to say Y here, whereas most SH-4 users will | ||
39 | want to say N. | ||
40 | |||
41 | config SH_DSP | ||
42 | def_bool y | ||
43 | prompt "DSP support" | ||
44 | depends on CPU_HAS_DSP | ||
45 | help | ||
46 | Selecting this option will enable support for SH processors that | ||
47 | have DSP units (ie, SH2-DSP, SH3-DSP, and SH4AL-DSP). | ||
48 | |||
49 | This option must be set in order to enable the DSP. | ||
50 | |||
51 | config SH_ADC | ||
52 | def_bool y | ||
53 | prompt "ADC support" | ||
54 | depends on CPU_SH3 | ||
55 | help | ||
56 | Selecting this option will allow the Linux kernel to use SH3 on-chip | ||
57 | ADC module. | ||
58 | |||
59 | If unsure, say N. | ||
60 | |||
61 | config SH_STORE_QUEUES | ||
62 | bool "Support for Store Queues" | ||
63 | depends on CPU_SH4 | ||
64 | help | ||
65 | Selecting this option will enable an in-kernel API for manipulating | ||
66 | the store queues integrated in the SH-4 processors. | ||
67 | |||
68 | config SPECULATIVE_EXECUTION | ||
69 | bool "Speculative subroutine return" | ||
70 | depends on CPU_SUBTYPE_SH7780 && EXPERIMENTAL | ||
71 | help | ||
72 | This enables support for a speculative instruction fetch for | ||
73 | subroutine return. There are various pitfalls associated with | ||
74 | this, as outlined in the SH7780 hardware manual. | ||
75 | |||
76 | If unsure, say N. | ||
77 | |||
78 | config SH64_USER_MISALIGNED_FIXUP | ||
79 | def_bool y | ||
80 | prompt "Fixup misaligned loads/stores occurring in user mode" | ||
81 | depends on SUPERH64 | ||
82 | |||
83 | config SH64_ID2815_WORKAROUND | ||
84 | bool "Include workaround for SH5-101 cut2 silicon defect ID2815" | ||
85 | depends on CPU_SUBTYPE_SH5_101 | ||
86 | |||
87 | config CPU_HAS_INTEVT | ||
88 | bool | ||
89 | |||
90 | config CPU_HAS_MASKREG_IRQ | ||
91 | bool | ||
92 | |||
93 | config CPU_HAS_IPR_IRQ | ||
94 | bool | ||
95 | |||
96 | config CPU_HAS_SR_RB | ||
97 | bool | ||
98 | help | ||
99 | This will enable the use of SR.RB register bank usage. Processors | ||
100 | that are lacking this bit must have another method in place for | ||
101 | accomplishing what is taken care of by the banked registers. | ||
102 | |||
103 | See <file:Documentation/sh/register-banks.txt> for further | ||
104 | information on SR.RB and register banking in the kernel in general. | ||
105 | |||
106 | config CPU_HAS_PTEA | ||
107 | bool | ||
108 | |||
109 | config CPU_HAS_DSP | ||
110 | bool | ||
111 | |||
112 | config CPU_HAS_FPU | ||
113 | bool | ||
114 | |||
115 | endmenu | ||
diff --git a/arch/sh/Kconfig.debug b/arch/sh/Kconfig.debug index 722da6851f56..f7c716166ce8 100644 --- a/arch/sh/Kconfig.debug +++ b/arch/sh/Kconfig.debug | |||
@@ -1,8 +1,7 @@ | |||
1 | menu "Kernel hacking" | 1 | menu "Kernel hacking" |
2 | 2 | ||
3 | config TRACE_IRQFLAGS_SUPPORT | 3 | config TRACE_IRQFLAGS_SUPPORT |
4 | bool | 4 | def_bool y |
5 | default y | ||
6 | 5 | ||
7 | source "lib/Kconfig.debug" | 6 | source "lib/Kconfig.debug" |
8 | 7 | ||
@@ -30,12 +29,13 @@ config EARLY_SCIF_CONSOLE | |||
30 | config EARLY_SCIF_CONSOLE_PORT | 29 | config EARLY_SCIF_CONSOLE_PORT |
31 | hex | 30 | hex |
32 | depends on EARLY_SCIF_CONSOLE | 31 | depends on EARLY_SCIF_CONSOLE |
33 | default "0xffe00000" if CPU_SUBTYPE_SH7780 | 32 | default "0xffe00000" if CPU_SUBTYPE_SH7780 || CPU_SUBTYPE_SH7763 |
34 | default "0xffea0000" if CPU_SUBTYPE_SH7785 | 33 | default "0xffea0000" if CPU_SUBTYPE_SH7785 |
35 | default "0xfffe9800" if CPU_SUBTYPE_SH7206 | 34 | default "0xfffe8000" if CPU_SUBTYPE_SH7203 |
35 | default "0xfffe9800" if CPU_SUBTYPE_SH7206 || CPU_SUBTYPE_SH7263 | ||
36 | default "0xf8420000" if CPU_SUBTYPE_SH7619 | 36 | default "0xf8420000" if CPU_SUBTYPE_SH7619 |
37 | default "0xa4400000" if CPU_SUBTYPE_SH7712 || CPU_SUBTYPE_SH7705 | 37 | default "0xa4400000" if CPU_SUBTYPE_SH7712 || CPU_SUBTYPE_SH7705 |
38 | default "0xa4430000" if CPU_SUBTYPE_SH7720 | 38 | default "0xa4430000" if CPU_SUBTYPE_SH7720 || CPU_SUBTYPE_SH7721 |
39 | default "0xffc30000" if CPU_SUBTYPE_SHX3 | 39 | default "0xffc30000" if CPU_SUBTYPE_SHX3 |
40 | default "0xffe80000" if CPU_SH4 | 40 | default "0xffe80000" if CPU_SH4 |
41 | default "0x00000000" | 41 | default "0x00000000" |
@@ -62,7 +62,7 @@ config DEBUG_BOOTMEM | |||
62 | 62 | ||
63 | config DEBUG_STACKOVERFLOW | 63 | config DEBUG_STACKOVERFLOW |
64 | bool "Check for stack overflows" | 64 | bool "Check for stack overflows" |
65 | depends on DEBUG_KERNEL | 65 | depends on DEBUG_KERNEL && SUPERH32 |
66 | help | 66 | help |
67 | This option will cause messages to be printed if free stack space | 67 | This option will cause messages to be printed if free stack space |
68 | drops below a certain limit. | 68 | drops below a certain limit. |
@@ -88,7 +88,7 @@ config 4KSTACKS | |||
88 | 88 | ||
89 | config IRQSTACKS | 89 | config IRQSTACKS |
90 | bool "Use separate kernel stacks when processing interrupts" | 90 | bool "Use separate kernel stacks when processing interrupts" |
91 | depends on DEBUG_KERNEL | 91 | depends on DEBUG_KERNEL && SUPERH32 |
92 | help | 92 | help |
93 | If you say Y here the kernel will use separate kernel stacks | 93 | If you say Y here the kernel will use separate kernel stacks |
94 | for handling hard and soft interrupts. This can help avoid | 94 | for handling hard and soft interrupts. This can help avoid |
@@ -119,19 +119,19 @@ config COMPILE_OPTIONS | |||
119 | depends on MORE_COMPILE_OPTIONS | 119 | depends on MORE_COMPILE_OPTIONS |
120 | 120 | ||
121 | config KGDB_NMI | 121 | config KGDB_NMI |
122 | bool "Enter KGDB on NMI" | 122 | def_bool n |
123 | default n | 123 | prompt "Enter KGDB on NMI" |
124 | 124 | ||
125 | config SH_KGDB_CONSOLE | 125 | config SH_KGDB_CONSOLE |
126 | bool "Console messages through GDB" | 126 | def_bool n |
127 | prompt "Console messages through GDB" | ||
127 | depends on !SERIAL_SH_SCI_CONSOLE && SERIAL_SH_SCI=y | 128 | depends on !SERIAL_SH_SCI_CONSOLE && SERIAL_SH_SCI=y |
128 | select SERIAL_CORE_CONSOLE | 129 | select SERIAL_CORE_CONSOLE |
129 | default n | ||
130 | 130 | ||
131 | config KGDB_SYSRQ | 131 | config KGDB_SYSRQ |
132 | bool "Allow SysRq 'G' to enter KGDB" | 132 | def_bool y |
133 | prompt "Allow SysRq 'G' to enter KGDB" | ||
133 | depends on MAGIC_SYSRQ | 134 | depends on MAGIC_SYSRQ |
134 | default y | ||
135 | 135 | ||
136 | comment "Serial port setup" | 136 | comment "Serial port setup" |
137 | 137 | ||
@@ -174,4 +174,29 @@ endchoice | |||
174 | 174 | ||
175 | endmenu | 175 | endmenu |
176 | 176 | ||
177 | if SUPERH64 | ||
178 | |||
179 | config SH64_PROC_ASIDS | ||
180 | bool "Debug: report ASIDs through /proc/asids" | ||
181 | depends on PROC_FS | ||
182 | |||
183 | config SH64_SR_WATCH | ||
184 | bool "Debug: set SR.WATCH to enable hardware watchpoints and trace" | ||
185 | |||
186 | config POOR_MANS_STRACE | ||
187 | bool "Debug: enable rudimentary strace facility" | ||
188 | help | ||
189 | This option allows system calls to be traced to the console. It also | ||
190 | aids in detecting kernel stack underflow. It is useful for debugging | ||
191 | early-userland problems (e.g. init incurring fatal exceptions.) | ||
192 | |||
193 | config SH_ALPHANUMERIC | ||
194 | bool "Enable debug outputs to on-board alphanumeric display" | ||
195 | depends on SH_CAYMAN | ||
196 | |||
197 | config SH_NO_BSS_INIT | ||
198 | bool "Avoid zeroing BSS (to speed-up startup on suitable platforms)" | ||
199 | |||
200 | endif | ||
201 | |||
177 | endmenu | 202 | endmenu |
diff --git a/arch/sh/Makefile b/arch/sh/Makefile index e189fae8b60c..17fc36186bf4 100644 --- a/arch/sh/Makefile +++ b/arch/sh/Makefile | |||
@@ -1,17 +1,13 @@ | |||
1 | # $Id: Makefile,v 1.35 2004/04/15 03:39:20 sugioka Exp $ | ||
2 | # | 1 | # |
3 | # This file is subject to the terms and conditions of the GNU General Public | 2 | # arch/sh/Makefile |
4 | # License. See the file "COPYING" in the main directory of this archive | ||
5 | # for more details. | ||
6 | # | 3 | # |
7 | # Copyright (C) 1999 Kaz Kojima | 4 | # Copyright (C) 1999 Kaz Kojima |
8 | # Copyright (C) 2002, 2003, 2004 Paul Mundt | 5 | # Copyright (C) 2002, 2003, 2004 Paul Mundt |
9 | # Copyright (C) 2002 M. R. Brown | 6 | # Copyright (C) 2002 M. R. Brown |
10 | # | 7 | # |
11 | # This file is included by the global makefile so that you can add your own | 8 | # This file is subject to the terms and conditions of the GNU General Public |
12 | # architecture-specific flags and dependencies. Remember to do have actions | 9 | # License. See the file "COPYING" in the main directory of this archive |
13 | # for "archclean" and "archdep" for cleaning up and making dependencies for | 10 | # for more details. |
14 | # this architecture | ||
15 | # | 11 | # |
16 | isa-y := any | 12 | isa-y := any |
17 | isa-$(CONFIG_SH_DSP) := sh | 13 | isa-$(CONFIG_SH_DSP) := sh |
@@ -21,13 +17,9 @@ isa-$(CONFIG_CPU_SH3) := sh3 | |||
21 | isa-$(CONFIG_CPU_SH4) := sh4 | 17 | isa-$(CONFIG_CPU_SH4) := sh4 |
22 | isa-$(CONFIG_CPU_SH4A) := sh4a | 18 | isa-$(CONFIG_CPU_SH4A) := sh4a |
23 | isa-$(CONFIG_CPU_SH4AL_DSP) := sh4al | 19 | isa-$(CONFIG_CPU_SH4AL_DSP) := sh4al |
24 | 20 | isa-$(CONFIG_CPU_SH5) := shmedia | |
25 | isa-$(CONFIG_SH_DSP) := $(isa-y)-dsp | 21 | isa-$(CONFIG_SH_DSP) := $(isa-y)-dsp |
26 | 22 | ||
27 | ifndef CONFIG_MMU | ||
28 | isa-y := $(isa-y)-nommu | ||
29 | endif | ||
30 | |||
31 | ifndef CONFIG_SH_DSP | 23 | ifndef CONFIG_SH_DSP |
32 | ifndef CONFIG_SH_FPU | 24 | ifndef CONFIG_SH_FPU |
33 | isa-y := $(isa-y)-nofpu | 25 | isa-y := $(isa-y)-nofpu |
@@ -44,6 +36,7 @@ cflags-$(CONFIG_CPU_SH4) := $(call cc-option,-m4,) \ | |||
44 | $(call cc-option,-mno-implicit-fp,-m4-nofpu) | 36 | $(call cc-option,-mno-implicit-fp,-m4-nofpu) |
45 | cflags-$(CONFIG_CPU_SH4A) += $(call cc-option,-m4a,) \ | 37 | cflags-$(CONFIG_CPU_SH4A) += $(call cc-option,-m4a,) \ |
46 | $(call cc-option,-m4a-nofpu,) | 38 | $(call cc-option,-m4a-nofpu,) |
39 | cflags-$(CONFIG_CPU_SH5) := $(call cc-option,-m5-32media-nofpu,) | ||
47 | 40 | ||
48 | cflags-$(CONFIG_CPU_BIG_ENDIAN) += -mb | 41 | cflags-$(CONFIG_CPU_BIG_ENDIAN) += -mb |
49 | cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -ml | 42 | cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -ml |
@@ -66,22 +59,27 @@ cflags-y += $(isaflags-y) -ffreestanding | |||
66 | cflags-$(CONFIG_MORE_COMPILE_OPTIONS) += \ | 59 | cflags-$(CONFIG_MORE_COMPILE_OPTIONS) += \ |
67 | $(shell echo $(CONFIG_COMPILE_OPTIONS) | sed -e 's/"//g') | 60 | $(shell echo $(CONFIG_COMPILE_OPTIONS) | sed -e 's/"//g') |
68 | 61 | ||
69 | OBJCOPYFLAGS := -O binary -R .note -R .note.gnu.build-id -R .comment -R .stab -R .stabstr -S | 62 | OBJCOPYFLAGS := -O binary -R .note -R .note.gnu.build-id -R .comment \ |
63 | -R .stab -R .stabstr -S | ||
70 | 64 | ||
71 | # | 65 | # Give the various platforms the opportunity to set default image types |
72 | # arch/sh/defconfig doesn't reflect any real hardware, and as such should | 66 | defaultimage-$(CONFIG_SUPERH32) := zImage |
73 | # never be used by anyone. Use a board-specific defconfig that has a | ||
74 | # reasonable chance of being current instead. | ||
75 | # | ||
76 | KBUILD_DEFCONFIG := r7780rp_defconfig | ||
77 | 67 | ||
78 | KBUILD_IMAGE := arch/sh/boot/zImage | 68 | # Set some sensible Kbuild defaults |
69 | KBUILD_DEFCONFIG := r7780mp_defconfig | ||
70 | KBUILD_IMAGE := $(defaultimage-y) | ||
79 | 71 | ||
80 | # | 72 | # |
81 | # Choosing incompatible machines durings configuration will result in | 73 | # Choosing incompatible machines durings configuration will result in |
82 | # error messages during linking. | 74 | # error messages during linking. |
83 | # | 75 | # |
84 | LDFLAGS_vmlinux += -e _stext | 76 | ifdef CONFIG_SUPERH32 |
77 | LDFLAGS_vmlinux += -e _stext | ||
78 | else | ||
79 | LDFLAGS_vmlinux += --defsym phys_stext=_stext-$(CONFIG_PAGE_OFFSET) \ | ||
80 | --defsym phys_stext_shmedia=phys_stext+1 \ | ||
81 | -e phys_stext_shmedia | ||
82 | endif | ||
85 | 83 | ||
86 | ifdef CONFIG_CPU_LITTLE_ENDIAN | 84 | ifdef CONFIG_CPU_LITTLE_ENDIAN |
87 | LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64' | 85 | LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64' |
@@ -94,7 +92,9 @@ endif | |||
94 | KBUILD_CFLAGS += -pipe $(cflags-y) | 92 | KBUILD_CFLAGS += -pipe $(cflags-y) |
95 | KBUILD_AFLAGS += $(cflags-y) | 93 | KBUILD_AFLAGS += $(cflags-y) |
96 | 94 | ||
97 | head-y := arch/sh/kernel/head.o arch/sh/kernel/init_task.o | 95 | head-y := arch/sh/kernel/init_task.o |
96 | head-$(CONFIG_SUPERH32) += arch/sh/kernel/head_32.o | ||
97 | head-$(CONFIG_SUPERH64) += arch/sh/kernel/head_64.o | ||
98 | 98 | ||
99 | LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) | 99 | LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) |
100 | 100 | ||
@@ -112,11 +112,11 @@ machdir-$(CONFIG_SH_DREAMCAST) += dreamcast | |||
112 | machdir-$(CONFIG_SH_MPC1211) += mpc1211 | 112 | machdir-$(CONFIG_SH_MPC1211) += mpc1211 |
113 | machdir-$(CONFIG_SH_SH03) += sh03 | 113 | machdir-$(CONFIG_SH_SH03) += sh03 |
114 | machdir-$(CONFIG_SH_SECUREEDGE5410) += snapgear | 114 | machdir-$(CONFIG_SH_SECUREEDGE5410) += snapgear |
115 | machdir-$(CONFIG_SH_HS7751RVOIP) += renesas/hs7751rvoip | ||
116 | machdir-$(CONFIG_SH_RTS7751R2D) += renesas/rts7751r2d | 115 | machdir-$(CONFIG_SH_RTS7751R2D) += renesas/rts7751r2d |
117 | machdir-$(CONFIG_SH_7751_SYSTEMH) += renesas/systemh | 116 | machdir-$(CONFIG_SH_7751_SYSTEMH) += renesas/systemh |
118 | machdir-$(CONFIG_SH_EDOSK7705) += renesas/edosk7705 | 117 | machdir-$(CONFIG_SH_EDOSK7705) += renesas/edosk7705 |
119 | machdir-$(CONFIG_SH_HIGHLANDER) += renesas/r7780rp | 118 | machdir-$(CONFIG_SH_HIGHLANDER) += renesas/r7780rp |
119 | machdir-$(CONFIG_SH_SDK7780) += renesas/sdk7780 | ||
120 | machdir-$(CONFIG_SH_7710VOIPGW) += renesas/sh7710voipgw | 120 | machdir-$(CONFIG_SH_7710VOIPGW) += renesas/sh7710voipgw |
121 | machdir-$(CONFIG_SH_X3PROTO) += renesas/x3proto | 121 | machdir-$(CONFIG_SH_X3PROTO) += renesas/x3proto |
122 | machdir-$(CONFIG_SH_SH4202_MICRODEV) += superh/microdev | 122 | machdir-$(CONFIG_SH_SH4202_MICRODEV) += superh/microdev |
@@ -127,6 +127,7 @@ machdir-$(CONFIG_SH_7206_SOLUTION_ENGINE) += se/7206 | |||
127 | machdir-$(CONFIG_SH_7619_SOLUTION_ENGINE) += se/7619 | 127 | machdir-$(CONFIG_SH_7619_SOLUTION_ENGINE) += se/7619 |
128 | machdir-$(CONFIG_SH_LBOX_RE2) += lboxre2 | 128 | machdir-$(CONFIG_SH_LBOX_RE2) += lboxre2 |
129 | machdir-$(CONFIG_SH_MAGIC_PANEL_R2) += magicpanelr2 | 129 | machdir-$(CONFIG_SH_MAGIC_PANEL_R2) += magicpanelr2 |
130 | machdir-$(CONFIG_SH_CAYMAN) += cayman | ||
130 | 131 | ||
131 | incdir-y := $(notdir $(machdir-y)) | 132 | incdir-y := $(notdir $(machdir-y)) |
132 | 133 | ||
@@ -137,22 +138,22 @@ endif | |||
137 | 138 | ||
138 | # Companion chips | 139 | # Companion chips |
139 | core-$(CONFIG_HD6446X_SERIES) += arch/sh/cchips/hd6446x/ | 140 | core-$(CONFIG_HD6446X_SERIES) += arch/sh/cchips/hd6446x/ |
140 | core-$(CONFIG_MFD_SM501) += arch/sh/cchips/voyagergx/ | ||
141 | 141 | ||
142 | cpuincdir-$(CONFIG_CPU_SH2) := cpu-sh2 | 142 | cpuincdir-$(CONFIG_CPU_SH2) := cpu-sh2 |
143 | cpuincdir-$(CONFIG_CPU_SH2A) := cpu-sh2a | 143 | cpuincdir-$(CONFIG_CPU_SH2A) := cpu-sh2a |
144 | cpuincdir-$(CONFIG_CPU_SH3) := cpu-sh3 | 144 | cpuincdir-$(CONFIG_CPU_SH3) := cpu-sh3 |
145 | cpuincdir-$(CONFIG_CPU_SH4) := cpu-sh4 | 145 | cpuincdir-$(CONFIG_CPU_SH4) := cpu-sh4 |
146 | cpuincdir-$(CONFIG_CPU_SH5) := cpu-sh5 | ||
146 | 147 | ||
147 | libs-y := arch/sh/lib/ $(libs-y) $(LIBGCC) | 148 | libs-$(CONFIG_SUPERH32) := arch/sh/lib/ $(libs-y) |
149 | libs-$(CONFIG_SUPERH64) := arch/sh/lib64/ $(libs-y) | ||
150 | libs-y += $(LIBGCC) | ||
148 | 151 | ||
149 | drivers-y += arch/sh/drivers/ | 152 | drivers-y += arch/sh/drivers/ |
150 | drivers-$(CONFIG_OPROFILE) += arch/sh/oprofile/ | 153 | drivers-$(CONFIG_OPROFILE) += arch/sh/oprofile/ |
151 | 154 | ||
152 | boot := arch/sh/boot | 155 | boot := arch/sh/boot |
153 | 156 | ||
154 | CPPFLAGS_vmlinux.lds := -traditional | ||
155 | |||
156 | incdir-prefix := $(srctree)/include/asm-sh/ | 157 | incdir-prefix := $(srctree)/include/asm-sh/ |
157 | 158 | ||
158 | # Update machine arch and proc symlinks if something which affects | 159 | # Update machine arch and proc symlinks if something which affects |
@@ -196,29 +197,61 @@ include/asm-sh/.mach: $(wildcard include/config/sh/*.h) \ | |||
196 | done | 197 | done |
197 | @touch $@ | 198 | @touch $@ |
198 | 199 | ||
199 | archprepare: include/asm-sh/.cpu include/asm-sh/.mach maketools | ||
200 | |||
201 | PHONY += maketools FORCE | 200 | PHONY += maketools FORCE |
201 | |||
202 | maketools: include/linux/version.h FORCE | 202 | maketools: include/linux/version.h FORCE |
203 | $(Q)$(MAKE) $(build)=arch/sh/tools include/asm-sh/machtypes.h | 203 | $(Q)$(MAKE) $(build)=arch/sh/tools include/asm-sh/machtypes.h |
204 | 204 | ||
205 | all: zImage | 205 | all: $(KBUILD_IMAGE) |
206 | 206 | ||
207 | zImage uImage uImage.srec vmlinux.srec: vmlinux | 207 | zImage uImage uImage.srec vmlinux.srec: vmlinux |
208 | $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ | 208 | $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ |
209 | 209 | ||
210 | compressed: zImage | 210 | compressed: zImage |
211 | 211 | ||
212 | archprepare: include/asm-sh/.cpu include/asm-sh/.mach maketools \ | ||
213 | arch/sh/lib64/syscalltab.h | ||
214 | |||
212 | archclean: | 215 | archclean: |
213 | $(Q)$(MAKE) $(clean)=$(boot) | 216 | $(Q)$(MAKE) $(clean)=$(boot) |
214 | 217 | ||
215 | CLEAN_FILES += include/asm-sh/machtypes.h \ | ||
216 | include/asm-sh/cpu include/asm-sh/.cpu \ | ||
217 | include/asm-sh/mach include/asm-sh/.mach | ||
218 | |||
219 | define archhelp | 218 | define archhelp |
220 | @echo '* zImage - Compressed kernel image' | 219 | @echo '* zImage - Compressed kernel image' |
221 | @echo ' vmlinux.srec - Create an ELF S-record' | 220 | @echo ' vmlinux.srec - Create an ELF S-record' |
222 | @echo ' uImage - Create a bootable image for U-Boot' | 221 | @echo ' uImage - Create a bootable image for U-Boot' |
223 | @echo ' uImage.srec - Create an S-record for U-Boot' | 222 | @echo ' uImage.srec - Create an S-record for U-Boot' |
224 | endef | 223 | endef |
224 | |||
225 | define filechk_gen-syscalltab | ||
226 | (set -e; \ | ||
227 | echo "/*"; \ | ||
228 | echo " * DO NOT MODIFY."; \ | ||
229 | echo " *"; \ | ||
230 | echo " * This file was generated by arch/sh/Makefile"; \ | ||
231 | echo " * Any changes will be reverted at build time."; \ | ||
232 | echo " */"; \ | ||
233 | echo ""; \ | ||
234 | echo "#ifndef __SYSCALLTAB_H"; \ | ||
235 | echo "#define __SYSCALLTAB_H"; \ | ||
236 | echo ""; \ | ||
237 | echo "#include <linux/kernel.h>"; \ | ||
238 | echo ""; \ | ||
239 | echo "struct syscall_info {"; \ | ||
240 | echo " const char *name;"; \ | ||
241 | echo "} syscall_info_table[] = {"; \ | ||
242 | sed -e '/^.*\.long /!d;s// { "/;s/\(\([^/]*\)\/\)\{1\}.*/\2/; \ | ||
243 | s/[ \t]*$$//g;s/$$/" },/;s/\("\)sys_/\1/g'; \ | ||
244 | echo "};"; \ | ||
245 | echo ""; \ | ||
246 | echo "#define NUM_SYSCALL_INFO_ENTRIES ARRAY_SIZE(syscall_info_table)";\ | ||
247 | echo ""; \ | ||
248 | echo "#endif /* __SYSCALLTAB_H */" ) | ||
249 | endef | ||
250 | |||
251 | arch/sh/lib64/syscalltab.h: arch/sh/kernel/syscalls_64.S | ||
252 | $(call filechk,gen-syscalltab) | ||
253 | |||
254 | CLEAN_FILES += arch/sh/lib64/syscalltab.h \ | ||
255 | include/asm-sh/machtypes.h \ | ||
256 | include/asm-sh/cpu include/asm-sh/.cpu \ | ||
257 | include/asm-sh/mach include/asm-sh/.mach | ||
diff --git a/arch/sh/boards/cayman/Makefile b/arch/sh/boards/cayman/Makefile new file mode 100644 index 000000000000..489a8f867368 --- /dev/null +++ b/arch/sh/boards/cayman/Makefile | |||
@@ -0,0 +1,5 @@ | |||
1 | # | ||
2 | # Makefile for the Hitachi Cayman specific parts of the kernel | ||
3 | # | ||
4 | obj-y := setup.o irq.o | ||
5 | obj-$(CONFIG_HEARTBEAT) += led.o | ||
diff --git a/arch/sh64/mach-cayman/irq.c b/arch/sh/boards/cayman/irq.c index aaad36d37d1f..30ec7bebfaf1 100644 --- a/arch/sh64/mach-cayman/irq.c +++ b/arch/sh/boards/cayman/irq.c | |||
@@ -1,24 +1,26 @@ | |||
1 | /* | 1 | /* |
2 | * This file is subject to the terms and conditions of the GNU General Public | 2 | * arch/sh/mach-cayman/irq.c - SH-5 Cayman Interrupt Support |
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * arch/sh64/kernel/irq_cayman.c | ||
7 | * | ||
8 | * SH-5 Cayman Interrupt Support | ||
9 | * | 3 | * |
10 | * This file handles the board specific parts of the Cayman interrupt system | 4 | * This file handles the board specific parts of the Cayman interrupt system |
11 | * | 5 | * |
12 | * Copyright (C) 2002 Stuart Menefy | 6 | * Copyright (C) 2002 Stuart Menefy |
7 | * | ||
8 | * This file is subject to the terms and conditions of the GNU General Public | ||
9 | * License. See the file "COPYING" in the main directory of this archive | ||
10 | * for more details. | ||
13 | */ | 11 | */ |
14 | 12 | #include <linux/io.h> | |
15 | #include <asm/irq.h> | ||
16 | #include <asm/page.h> | ||
17 | #include <asm/io.h> | ||
18 | #include <linux/irq.h> | 13 | #include <linux/irq.h> |
19 | #include <linux/interrupt.h> | 14 | #include <linux/interrupt.h> |
20 | #include <linux/signal.h> | 15 | #include <linux/signal.h> |
21 | #include <asm/cayman.h> | 16 | #include <asm/cpu/irq.h> |
17 | #include <asm/page.h> | ||
18 | |||
19 | /* Setup for the SMSC FDC37C935 / LAN91C100FD */ | ||
20 | #define SMSC_IRQ IRQ_IRL1 | ||
21 | |||
22 | /* Setup for PCI Bus 2, which transmits interrupts via the EPLD */ | ||
23 | #define PCI2_IRQ IRQ_IRL3 | ||
22 | 24 | ||
23 | unsigned long epld_virt; | 25 | unsigned long epld_virt; |
24 | 26 | ||
diff --git a/arch/sh64/mach-cayman/led.c b/arch/sh/boards/cayman/led.c index b4e122fd9502..a808eac4ecd6 100644 --- a/arch/sh64/mach-cayman/led.c +++ b/arch/sh/boards/cayman/led.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * arch/sh64/mach-cayman/led.c | 2 | * arch/sh/boards/cayman/led.c |
3 | * | 3 | * |
4 | * Copyright (C) 2002 Stuart Menefy <stuart.menefy@st.com> | 4 | * Copyright (C) 2002 Stuart Menefy <stuart.menefy@st.com> |
5 | * | 5 | * |
diff --git a/arch/sh64/mach-cayman/setup.c b/arch/sh/boards/cayman/setup.c index 726c520d7eb9..8c9fa472d8f5 100644 --- a/arch/sh64/mach-cayman/setup.c +++ b/arch/sh/boards/cayman/setup.c | |||
@@ -1,28 +1,19 @@ | |||
1 | /* | 1 | /* |
2 | * This file is subject to the terms and conditions of the GNU General Public | 2 | * arch/sh/mach-cayman/setup.c |
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * arch/sh64/mach-cayman/setup.c | ||
7 | * | 3 | * |
8 | * SH5 Cayman support | 4 | * SH5 Cayman support |
9 | * | 5 | * |
10 | * This file handles the architecture-dependent parts of initialization | 6 | * Copyright (C) 2002 David J. Mckay & Benedict Gaster |
7 | * Copyright (C) 2003 - 2007 Paul Mundt | ||
11 | * | 8 | * |
12 | * Copyright David J. Mckay. | 9 | * This file is subject to the terms and conditions of the GNU General Public |
13 | * Needs major work! | 10 | * License. See the file "COPYING" in the main directory of this archive |
14 | * | 11 | * for more details. |
15 | * benedict.gaster@superh.com: 3rd May 2002 | ||
16 | * Added support for ramdisk, removing statically linked romfs at the same time. | ||
17 | * | ||
18 | * lethal@linux-sh.org: 15th May 2003 | ||
19 | * Use the generic procfs cpuinfo interface, just return a valid board name. | ||
20 | */ | 12 | */ |
21 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/io.h> | ||
22 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
23 | #include <asm/platform.h> | 16 | #include <asm/cpu/irq.h> |
24 | #include <asm/irq.h> | ||
25 | #include <asm/io.h> | ||
26 | 17 | ||
27 | /* | 18 | /* |
28 | * Platform Dependent Interrupt Priorities. | 19 | * Platform Dependent Interrupt Priorities. |
@@ -96,42 +87,6 @@ | |||
96 | 87 | ||
97 | unsigned long smsc_superio_virt; | 88 | unsigned long smsc_superio_virt; |
98 | 89 | ||
99 | /* | ||
100 | * Platform dependent structures: maps and parms block. | ||
101 | */ | ||
102 | struct resource io_resources[] = { | ||
103 | /* To be updated with external devices */ | ||
104 | }; | ||
105 | |||
106 | struct resource kram_resources[] = { | ||
107 | /* These must be last in the array */ | ||
108 | { .name = "Kernel code", .start = 0, .end = 0 }, | ||
109 | /* These must be last in the array */ | ||
110 | { .name = "Kernel data", .start = 0, .end = 0 } | ||
111 | }; | ||
112 | |||
113 | struct resource xram_resources[] = { | ||
114 | /* To be updated with external devices */ | ||
115 | }; | ||
116 | |||
117 | struct resource rom_resources[] = { | ||
118 | /* To be updated with external devices */ | ||
119 | }; | ||
120 | |||
121 | struct sh64_platform platform_parms = { | ||
122 | .readonly_rootfs = 1, | ||
123 | .initial_root_dev = 0x0100, | ||
124 | .loader_type = 1, | ||
125 | .io_res_p = io_resources, | ||
126 | .io_res_count = ARRAY_SIZE(io_resources), | ||
127 | .kram_res_p = kram_resources, | ||
128 | .kram_res_count = ARRAY_SIZE(kram_resources), | ||
129 | .xram_res_p = xram_resources, | ||
130 | .xram_res_count = ARRAY_SIZE(xram_resources), | ||
131 | .rom_res_p = rom_resources, | ||
132 | .rom_res_count = ARRAY_SIZE(rom_resources), | ||
133 | }; | ||
134 | |||
135 | int platform_int_priority[NR_INTC_IRQS] = { | 90 | int platform_int_priority[NR_INTC_IRQS] = { |
136 | IR0, IR1, IR2, IR3, PCA, PCB, PCC, PCD, /* IRQ 0- 7 */ | 91 | IR0, IR1, IR2, IR3, PCA, PCB, PCC, PCD, /* IRQ 0- 7 */ |
137 | RES, RES, RES, RES, SER, ERR, PW3, PW2, /* IRQ 8-15 */ | 92 | RES, RES, RES, RES, SER, ERR, PW3, PW2, /* IRQ 8-15 */ |
@@ -210,30 +165,23 @@ static int __init smsc_superio_setup(void) | |||
210 | 165 | ||
211 | return 0; | 166 | return 0; |
212 | } | 167 | } |
213 | |||
214 | /* This is grotty, but, because kernel is always referenced on the link line | ||
215 | * before any devices, this is safe. | ||
216 | */ | ||
217 | __initcall(smsc_superio_setup); | 168 | __initcall(smsc_superio_setup); |
218 | 169 | ||
219 | void __init platform_setup(void) | 170 | static void __iomem *cayman_ioport_map(unsigned long port, unsigned int len) |
220 | { | ||
221 | /* Cayman platform leaves the decision to head.S, for now */ | ||
222 | platform_parms.fpu_flags = fpu_in_use; | ||
223 | } | ||
224 | |||
225 | void __init platform_monitor(void) | ||
226 | { | 171 | { |
227 | /* Nothing yet .. */ | 172 | if (port < 0x400) { |
228 | } | 173 | extern unsigned long smsc_superio_virt; |
174 | return (void __iomem *)((port << 2) | smsc_superio_virt); | ||
175 | } | ||
229 | 176 | ||
230 | void __init platform_reserve(void) | 177 | return (void __iomem *)port; |
231 | { | ||
232 | /* Nothing yet .. */ | ||
233 | } | 178 | } |
234 | 179 | ||
235 | const char *get_system_type(void) | 180 | extern void init_cayman_irq(void); |
236 | { | ||
237 | return "Hitachi Cayman"; | ||
238 | } | ||
239 | 181 | ||
182 | static struct sh_machine_vector mv_cayman __initmv = { | ||
183 | .mv_name = "Hitachi Cayman", | ||
184 | .mv_nr_irqs = 64, | ||
185 | .mv_ioport_map = cayman_ioport_map, | ||
186 | .mv_init_irq = init_cayman_irq, | ||
187 | }; | ||
diff --git a/arch/sh/boards/dreamcast/irq.c b/arch/sh/boards/dreamcast/irq.c index 5bf01f86c20c..9d0673a9092a 100644 --- a/arch/sh/boards/dreamcast/irq.c +++ b/arch/sh/boards/dreamcast/irq.c | |||
@@ -136,7 +136,7 @@ int systemasic_irq_demux(int irq) | |||
136 | emr = EMR_BASE + (level << 4) + (level << 2); | 136 | emr = EMR_BASE + (level << 4) + (level << 2); |
137 | esr = ESR_BASE + (level << 2); | 137 | esr = ESR_BASE + (level << 2); |
138 | 138 | ||
139 | /* Mask the ESR to filter any spurious, unwanted interrtupts */ | 139 | /* Mask the ESR to filter any spurious, unwanted interrupts */ |
140 | status = inl(esr); | 140 | status = inl(esr); |
141 | status &= inl(emr); | 141 | status &= inl(emr); |
142 | 142 | ||
diff --git a/arch/sh/boards/dreamcast/setup.c b/arch/sh/boards/dreamcast/setup.c index 8799df6e866a..2581c8cd5df7 100644 --- a/arch/sh/boards/dreamcast/setup.c +++ b/arch/sh/boards/dreamcast/setup.c | |||
@@ -33,9 +33,6 @@ extern void aica_time_init(void); | |||
33 | extern int gapspci_init(void); | 33 | extern int gapspci_init(void); |
34 | extern int systemasic_irq_demux(int); | 34 | extern int systemasic_irq_demux(int); |
35 | 35 | ||
36 | void *dreamcast_consistent_alloc(struct device *, size_t, dma_addr_t *, gfp_t); | ||
37 | int dreamcast_consistent_free(struct device *, size_t, void *, dma_addr_t); | ||
38 | |||
39 | static void __init dreamcast_setup(char **cmdline_p) | 36 | static void __init dreamcast_setup(char **cmdline_p) |
40 | { | 37 | { |
41 | int i; | 38 | int i; |
@@ -64,9 +61,4 @@ static struct sh_machine_vector mv_dreamcast __initmv = { | |||
64 | .mv_name = "Sega Dreamcast", | 61 | .mv_name = "Sega Dreamcast", |
65 | .mv_setup = dreamcast_setup, | 62 | .mv_setup = dreamcast_setup, |
66 | .mv_irq_demux = systemasic_irq_demux, | 63 | .mv_irq_demux = systemasic_irq_demux, |
67 | |||
68 | #ifdef CONFIG_PCI | ||
69 | .mv_consistent_alloc = dreamcast_consistent_alloc, | ||
70 | .mv_consistent_free = dreamcast_consistent_free, | ||
71 | #endif | ||
72 | }; | 64 | }; |
diff --git a/arch/sh/boards/landisk/gio.c b/arch/sh/boards/landisk/gio.c index a37643d002b2..17025080db35 100644 --- a/arch/sh/boards/landisk/gio.c +++ b/arch/sh/boards/landisk/gio.c | |||
@@ -121,7 +121,7 @@ static int gio_ioctl(struct inode *inode, struct file *filp, | |||
121 | return 0; | 121 | return 0; |
122 | } | 122 | } |
123 | 123 | ||
124 | static struct file_operations gio_fops = { | 124 | static const struct file_operations gio_fops = { |
125 | .owner = THIS_MODULE, | 125 | .owner = THIS_MODULE, |
126 | .open = gio_open, /* open */ | 126 | .open = gio_open, /* open */ |
127 | .release = gio_close, /* release */ | 127 | .release = gio_close, /* release */ |
diff --git a/arch/sh/boards/renesas/hs7751rvoip/Kconfig b/arch/sh/boards/renesas/hs7751rvoip/Kconfig deleted file mode 100644 index 1743be477be5..000000000000 --- a/arch/sh/boards/renesas/hs7751rvoip/Kconfig +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | if SH_HS7751RVOIP | ||
2 | |||
3 | menu "HS7751RVoIP options" | ||
4 | |||
5 | config HS7751RVOIP_CODEC | ||
6 | bool "Support VoIP Codec section" | ||
7 | help | ||
8 | Selecting this option will support CODEC section. | ||
9 | |||
10 | endmenu | ||
11 | |||
12 | endif | ||
diff --git a/arch/sh/boards/renesas/hs7751rvoip/Makefile b/arch/sh/boards/renesas/hs7751rvoip/Makefile deleted file mode 100644 index e626377c55ee..000000000000 --- a/arch/sh/boards/renesas/hs7751rvoip/Makefile +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | # | ||
2 | # Makefile for the HS7751RVoIP specific parts of the kernel | ||
3 | # | ||
4 | |||
5 | obj-y := setup.o io.o irq.o | ||
6 | |||
7 | obj-$(CONFIG_PCI) += pci.o | ||
8 | |||
diff --git a/arch/sh/boards/renesas/hs7751rvoip/io.c b/arch/sh/boards/renesas/hs7751rvoip/io.c deleted file mode 100644 index bb9aa0d62852..000000000000 --- a/arch/sh/boards/renesas/hs7751rvoip/io.c +++ /dev/null | |||
@@ -1,283 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/sh/boards/renesas/hs7751rvoip/io.c | ||
3 | * | ||
4 | * Copyright (C) 2001 Ian da Silva, Jeremy Siegel | ||
5 | * Based largely on io_se.c. | ||
6 | * | ||
7 | * I/O routine for Renesas Technology sales HS7751RVoIP | ||
8 | * | ||
9 | * Initial version only to support LAN access; some | ||
10 | * placeholder code from io_hs7751rvoip.c left in with the | ||
11 | * expectation of later SuperIO and PCMCIA access. | ||
12 | */ | ||
13 | #include <linux/kernel.h> | ||
14 | #include <linux/types.h> | ||
15 | #include <linux/module.h> | ||
16 | #include <linux/pci.h> | ||
17 | #include <asm/io.h> | ||
18 | #include <asm/hs7751rvoip.h> | ||
19 | #include <asm/addrspace.h> | ||
20 | |||
21 | extern void *area6_io8_base; /* Area 6 8bit I/O Base address */ | ||
22 | extern void *area5_io16_base; /* Area 5 16bit I/O Base address */ | ||
23 | |||
24 | /* | ||
25 | * The 7751R HS7751RVoIP uses the built-in PCI controller (PCIC) | ||
26 | * of the 7751R processor, and has a SuperIO accessible via the PCI. | ||
27 | * The board also includes a PCMCIA controller on its memory bus, | ||
28 | * like the other Solution Engine boards. | ||
29 | */ | ||
30 | |||
31 | #define CODEC_IO_BASE 0x1000 | ||
32 | #define CODEC_IOMAP(a) ((unsigned long)area6_io8_base + ((a) - CODEC_IO_BASE)) | ||
33 | |||
34 | static inline unsigned long port2adr(unsigned int port) | ||
35 | { | ||
36 | if ((0x1f0 <= port && port < 0x1f8) || port == 0x3f6) | ||
37 | if (port == 0x3f6) | ||
38 | return ((unsigned long)area5_io16_base + 0x0c); | ||
39 | else | ||
40 | return ((unsigned long)area5_io16_base + 0x800 + | ||
41 | ((port-0x1f0) << 1)); | ||
42 | else | ||
43 | maybebadio((unsigned long)port); | ||
44 | return port; | ||
45 | } | ||
46 | |||
47 | /* The 7751R HS7751RVoIP seems to have everything hooked */ | ||
48 | /* up pretty normally (nothing on high-bytes only...) so this */ | ||
49 | /* shouldn't be needed */ | ||
50 | static inline int shifted_port(unsigned long port) | ||
51 | { | ||
52 | /* For IDE registers, value is not shifted */ | ||
53 | if ((0x1f0 <= port && port < 0x1f8) || port == 0x3f6) | ||
54 | return 0; | ||
55 | else | ||
56 | return 1; | ||
57 | } | ||
58 | |||
59 | #if defined(CONFIG_HS7751RVOIP_CODEC) | ||
60 | #define codec_port(port) \ | ||
61 | ((CODEC_IO_BASE <= (port)) && ((port) < (CODEC_IO_BASE + 0x20))) | ||
62 | #else | ||
63 | #define codec_port(port) (0) | ||
64 | #endif | ||
65 | |||
66 | /* | ||
67 | * General outline: remap really low stuff [eventually] to SuperIO, | ||
68 | * stuff in PCI IO space (at or above window at pci.h:PCIBIOS_MIN_IO) | ||
69 | * is mapped through the PCI IO window. Stuff with high bits (PXSEG) | ||
70 | * should be way beyond the window, and is used w/o translation for | ||
71 | * compatibility. | ||
72 | */ | ||
73 | unsigned char hs7751rvoip_inb(unsigned long port) | ||
74 | { | ||
75 | if (PXSEG(port)) | ||
76 | return ctrl_inb(port); | ||
77 | else if (codec_port(port)) | ||
78 | return ctrl_inb(CODEC_IOMAP(port)); | ||
79 | else if (is_pci_ioaddr(port) || shifted_port(port)) | ||
80 | return ctrl_inb(pci_ioaddr(port)); | ||
81 | else | ||
82 | return ctrl_inw(port2adr(port)) & 0xff; | ||
83 | } | ||
84 | |||
85 | unsigned char hs7751rvoip_inb_p(unsigned long port) | ||
86 | { | ||
87 | unsigned char v; | ||
88 | |||
89 | if (PXSEG(port)) | ||
90 | v = ctrl_inb(port); | ||
91 | else if (codec_port(port)) | ||
92 | v = ctrl_inb(CODEC_IOMAP(port)); | ||
93 | else if (is_pci_ioaddr(port) || shifted_port(port)) | ||
94 | v = ctrl_inb(pci_ioaddr(port)); | ||
95 | else | ||
96 | v = ctrl_inw(port2adr(port)) & 0xff; | ||
97 | ctrl_delay(); | ||
98 | return v; | ||
99 | } | ||
100 | |||
101 | unsigned short hs7751rvoip_inw(unsigned long port) | ||
102 | { | ||
103 | if (PXSEG(port)) | ||
104 | return ctrl_inw(port); | ||
105 | else if (is_pci_ioaddr(port) || shifted_port(port)) | ||
106 | return ctrl_inw(pci_ioaddr(port)); | ||
107 | else | ||
108 | maybebadio(port); | ||
109 | return 0; | ||
110 | } | ||
111 | |||
112 | unsigned int hs7751rvoip_inl(unsigned long port) | ||
113 | { | ||
114 | if (PXSEG(port)) | ||
115 | return ctrl_inl(port); | ||
116 | else if (is_pci_ioaddr(port) || shifted_port(port)) | ||
117 | return ctrl_inl(pci_ioaddr(port)); | ||
118 | else | ||
119 | maybebadio(port); | ||
120 | return 0; | ||
121 | } | ||
122 | |||
123 | void hs7751rvoip_outb(unsigned char value, unsigned long port) | ||
124 | { | ||
125 | |||
126 | if (PXSEG(port)) | ||
127 | ctrl_outb(value, port); | ||
128 | else if (codec_port(port)) | ||
129 | ctrl_outb(value, CODEC_IOMAP(port)); | ||
130 | else if (is_pci_ioaddr(port) || shifted_port(port)) | ||
131 | ctrl_outb(value, pci_ioaddr(port)); | ||
132 | else | ||
133 | ctrl_outb(value, port2adr(port)); | ||
134 | } | ||
135 | |||
136 | void hs7751rvoip_outb_p(unsigned char value, unsigned long port) | ||
137 | { | ||
138 | if (PXSEG(port)) | ||
139 | ctrl_outb(value, port); | ||
140 | else if (codec_port(port)) | ||
141 | ctrl_outb(value, CODEC_IOMAP(port)); | ||
142 | else if (is_pci_ioaddr(port) || shifted_port(port)) | ||
143 | ctrl_outb(value, pci_ioaddr(port)); | ||
144 | else | ||
145 | ctrl_outw(value, port2adr(port)); | ||
146 | |||
147 | ctrl_delay(); | ||
148 | } | ||
149 | |||
150 | void hs7751rvoip_outw(unsigned short value, unsigned long port) | ||
151 | { | ||
152 | if (PXSEG(port)) | ||
153 | ctrl_outw(value, port); | ||
154 | else if (is_pci_ioaddr(port) || shifted_port(port)) | ||
155 | ctrl_outw(value, pci_ioaddr(port)); | ||
156 | else | ||
157 | maybebadio(port); | ||
158 | } | ||
159 | |||
160 | void hs7751rvoip_outl(unsigned int value, unsigned long port) | ||
161 | { | ||
162 | if (PXSEG(port)) | ||
163 | ctrl_outl(value, port); | ||
164 | else if (is_pci_ioaddr(port) || shifted_port(port)) | ||
165 | ctrl_outl(value, pci_ioaddr(port)); | ||
166 | else | ||
167 | maybebadio(port); | ||
168 | } | ||
169 | |||
170 | void hs7751rvoip_insb(unsigned long port, void *addr, unsigned long count) | ||
171 | { | ||
172 | u8 *buf = addr; | ||
173 | |||
174 | if (PXSEG(port)) | ||
175 | while (count--) | ||
176 | *buf++ = ctrl_inb(port); | ||
177 | else if (codec_port(port)) | ||
178 | while (count--) | ||
179 | *buf++ = ctrl_inb(CODEC_IOMAP(port)); | ||
180 | else if (is_pci_ioaddr(port) || shifted_port(port)) { | ||
181 | volatile u8 *bp = (volatile u8 *)pci_ioaddr(port); | ||
182 | |||
183 | while (count--) | ||
184 | *buf++ = *bp; | ||
185 | } else { | ||
186 | volatile u16 *p = (volatile u16 *)port2adr(port); | ||
187 | |||
188 | while (count--) | ||
189 | *buf++ = *p & 0xff; | ||
190 | } | ||
191 | } | ||
192 | |||
193 | void hs7751rvoip_insw(unsigned long port, void *addr, unsigned long count) | ||
194 | { | ||
195 | volatile u16 *p; | ||
196 | u16 *buf = addr; | ||
197 | |||
198 | if (PXSEG(port)) | ||
199 | p = (volatile u16 *)port; | ||
200 | else if (is_pci_ioaddr(port) || shifted_port(port)) | ||
201 | p = (volatile u16 *)pci_ioaddr(port); | ||
202 | else | ||
203 | p = (volatile u16 *)port2adr(port); | ||
204 | while (count--) | ||
205 | *buf++ = *p; | ||
206 | } | ||
207 | |||
208 | void hs7751rvoip_insl(unsigned long port, void *addr, unsigned long count) | ||
209 | { | ||
210 | |||
211 | if (is_pci_ioaddr(port) || shifted_port(port)) { | ||
212 | volatile u32 *p = (volatile u32 *)pci_ioaddr(port); | ||
213 | u32 *buf = addr; | ||
214 | |||
215 | while (count--) | ||
216 | *buf++ = *p; | ||
217 | } else | ||
218 | maybebadio(port); | ||
219 | } | ||
220 | |||
221 | void hs7751rvoip_outsb(unsigned long port, const void *addr, unsigned long count) | ||
222 | { | ||
223 | const u8 *buf = addr; | ||
224 | |||
225 | if (PXSEG(port)) | ||
226 | while (count--) | ||
227 | ctrl_outb(*buf++, port); | ||
228 | else if (codec_port(port)) | ||
229 | while (count--) | ||
230 | ctrl_outb(*buf++, CODEC_IOMAP(port)); | ||
231 | else if (is_pci_ioaddr(port) || shifted_port(port)) { | ||
232 | volatile u8 *bp = (volatile u8 *)pci_ioaddr(port); | ||
233 | |||
234 | while (count--) | ||
235 | *bp = *buf++; | ||
236 | } else { | ||
237 | volatile u16 *p = (volatile u16 *)port2adr(port); | ||
238 | |||
239 | while (count--) | ||
240 | *p = *buf++; | ||
241 | } | ||
242 | } | ||
243 | |||
244 | void hs7751rvoip_outsw(unsigned long port, const void *addr, unsigned long count) | ||
245 | { | ||
246 | volatile u16 *p; | ||
247 | const u16 *buf = addr; | ||
248 | |||
249 | if (PXSEG(port)) | ||
250 | p = (volatile u16 *)port; | ||
251 | else if (is_pci_ioaddr(port) || shifted_port(port)) | ||
252 | p = (volatile u16 *)pci_ioaddr(port); | ||
253 | else | ||
254 | p = (volatile u16 *)port2adr(port); | ||
255 | |||
256 | while (count--) | ||
257 | *p = *buf++; | ||
258 | } | ||
259 | |||
260 | void hs7751rvoip_outsl(unsigned long port, const void *addr, unsigned long count) | ||
261 | { | ||
262 | const u32 *buf = addr; | ||
263 | |||
264 | if (is_pci_ioaddr(port) || shifted_port(port)) { | ||
265 | volatile u32 *p = (volatile u32 *)pci_ioaddr(port); | ||
266 | |||
267 | while (count--) | ||
268 | *p = *buf++; | ||
269 | } else | ||
270 | maybebadio(port); | ||
271 | } | ||
272 | |||
273 | void __iomem *hs7751rvoip_ioport_map(unsigned long port, unsigned int size) | ||
274 | { | ||
275 | if (PXSEG(port)) | ||
276 | return (void __iomem *)port; | ||
277 | else if (unlikely(codec_port(port) && (size == 1))) | ||
278 | return (void __iomem *)CODEC_IOMAP(port); | ||
279 | else if (is_pci_ioaddr(port)) | ||
280 | return (void __iomem *)pci_ioaddr(port); | ||
281 | |||
282 | return (void __iomem *)port2adr(port); | ||
283 | } | ||
diff --git a/arch/sh/boards/renesas/hs7751rvoip/irq.c b/arch/sh/boards/renesas/hs7751rvoip/irq.c deleted file mode 100644 index e55c6686b21f..000000000000 --- a/arch/sh/boards/renesas/hs7751rvoip/irq.c +++ /dev/null | |||
@@ -1,116 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/sh/boards/renesas/hs7751rvoip/irq.c | ||
3 | * | ||
4 | * Copyright (C) 2000 Kazumoto Kojima | ||
5 | * | ||
6 | * Renesas Technology Sales HS7751RVoIP Support. | ||
7 | * | ||
8 | * Modified for HS7751RVoIP by | ||
9 | * Atom Create Engineering Co., Ltd. 2002. | ||
10 | * Lineo uSolutions, Inc. 2003. | ||
11 | */ | ||
12 | |||
13 | #include <linux/init.h> | ||
14 | #include <linux/irq.h> | ||
15 | #include <linux/interrupt.h> | ||
16 | #include <asm/io.h> | ||
17 | #include <asm/irq.h> | ||
18 | #include <asm/hs7751rvoip.h> | ||
19 | |||
20 | static int mask_pos[] = {8, 9, 10, 11, 12, 13, 0, 1, 2, 3, 4, 5, 6, 7}; | ||
21 | |||
22 | static void enable_hs7751rvoip_irq(unsigned int irq); | ||
23 | static void disable_hs7751rvoip_irq(unsigned int irq); | ||
24 | |||
25 | /* shutdown is same as "disable" */ | ||
26 | #define shutdown_hs7751rvoip_irq disable_hs7751rvoip_irq | ||
27 | |||
28 | static void ack_hs7751rvoip_irq(unsigned int irq); | ||
29 | static void end_hs7751rvoip_irq(unsigned int irq); | ||
30 | |||
31 | static unsigned int startup_hs7751rvoip_irq(unsigned int irq) | ||
32 | { | ||
33 | enable_hs7751rvoip_irq(irq); | ||
34 | return 0; /* never anything pending */ | ||
35 | } | ||
36 | |||
37 | static void disable_hs7751rvoip_irq(unsigned int irq) | ||
38 | { | ||
39 | unsigned short val; | ||
40 | unsigned short mask = 0xffff ^ (0x0001 << mask_pos[irq]); | ||
41 | |||
42 | /* Set the priority in IPR to 0 */ | ||
43 | val = ctrl_inw(IRLCNTR3); | ||
44 | val &= mask; | ||
45 | ctrl_outw(val, IRLCNTR3); | ||
46 | } | ||
47 | |||
48 | static void enable_hs7751rvoip_irq(unsigned int irq) | ||
49 | { | ||
50 | unsigned short val; | ||
51 | unsigned short value = (0x0001 << mask_pos[irq]); | ||
52 | |||
53 | /* Set priority in IPR back to original value */ | ||
54 | val = ctrl_inw(IRLCNTR3); | ||
55 | val |= value; | ||
56 | ctrl_outw(val, IRLCNTR3); | ||
57 | } | ||
58 | |||
59 | static void ack_hs7751rvoip_irq(unsigned int irq) | ||
60 | { | ||
61 | disable_hs7751rvoip_irq(irq); | ||
62 | } | ||
63 | |||
64 | static void end_hs7751rvoip_irq(unsigned int irq) | ||
65 | { | ||
66 | if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))) | ||
67 | enable_hs7751rvoip_irq(irq); | ||
68 | } | ||
69 | |||
70 | static struct hw_interrupt_type hs7751rvoip_irq_type = { | ||
71 | .typename = "HS7751RVoIP IRQ", | ||
72 | .startup = startup_hs7751rvoip_irq, | ||
73 | .shutdown = shutdown_hs7751rvoip_irq, | ||
74 | .enable = enable_hs7751rvoip_irq, | ||
75 | .disable = disable_hs7751rvoip_irq, | ||
76 | .ack = ack_hs7751rvoip_irq, | ||
77 | .end = end_hs7751rvoip_irq, | ||
78 | }; | ||
79 | |||
80 | static void make_hs7751rvoip_irq(unsigned int irq) | ||
81 | { | ||
82 | disable_irq_nosync(irq); | ||
83 | irq_desc[irq].chip = &hs7751rvoip_irq_type; | ||
84 | disable_hs7751rvoip_irq(irq); | ||
85 | } | ||
86 | |||
87 | /* | ||
88 | * Initialize IRQ setting | ||
89 | */ | ||
90 | void __init init_hs7751rvoip_IRQ(void) | ||
91 | { | ||
92 | int i; | ||
93 | |||
94 | /* IRL0=ON HOOK1 | ||
95 | * IRL1=OFF HOOK1 | ||
96 | * IRL2=ON HOOK2 | ||
97 | * IRL3=OFF HOOK2 | ||
98 | * IRL4=Ringing Detection | ||
99 | * IRL5=CODEC | ||
100 | * IRL6=Ethernet | ||
101 | * IRL7=Ethernet Hub | ||
102 | * IRL8=USB Communication | ||
103 | * IRL9=USB Connection | ||
104 | * IRL10=USB DMA | ||
105 | * IRL11=CF Card | ||
106 | * IRL12=PCMCIA | ||
107 | * IRL13=PCI Slot | ||
108 | */ | ||
109 | ctrl_outw(0x9876, IRLCNTR1); | ||
110 | ctrl_outw(0xdcba, IRLCNTR2); | ||
111 | ctrl_outw(0x0050, IRLCNTR4); | ||
112 | ctrl_outw(0x4321, IRLCNTR5); | ||
113 | |||
114 | for (i=0; i<14; i++) | ||
115 | make_hs7751rvoip_irq(i); | ||
116 | } | ||
diff --git a/arch/sh/boards/renesas/hs7751rvoip/pci.c b/arch/sh/boards/renesas/hs7751rvoip/pci.c deleted file mode 100644 index 1c0ddee30d21..000000000000 --- a/arch/sh/boards/renesas/hs7751rvoip/pci.c +++ /dev/null | |||
@@ -1,149 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/sh/boards/renesas/hs7751rvoip/pci.c | ||
3 | * | ||
4 | * Author: Ian DaSilva (idasilva@mvista.com) | ||
5 | * | ||
6 | * Highly leveraged from pci-bigsur.c, written by Dustin McIntire. | ||
7 | * | ||
8 | * May be copied or modified under the terms of the GNU General Public | ||
9 | * License. See linux/COPYING for more information. | ||
10 | * | ||
11 | * PCI initialization for the Renesas SH7751R HS7751RVoIP board | ||
12 | */ | ||
13 | |||
14 | #include <linux/kernel.h> | ||
15 | #include <linux/types.h> | ||
16 | #include <linux/init.h> | ||
17 | #include <linux/delay.h> | ||
18 | #include <linux/pci.h> | ||
19 | #include <linux/module.h> | ||
20 | |||
21 | #include <asm/io.h> | ||
22 | #include "../../../drivers/pci/pci-sh7751.h" | ||
23 | #include <asm/hs7751rvoip/hs7751rvoip.h> | ||
24 | |||
25 | #define PCIMCR_MRSET_OFF 0xBFFFFFFF | ||
26 | #define PCIMCR_RFSH_OFF 0xFFFFFFFB | ||
27 | |||
28 | /* | ||
29 | * Only long word accesses of the PCIC's internal local registers and the | ||
30 | * configuration registers from the CPU is supported. | ||
31 | */ | ||
32 | #define PCIC_WRITE(x,v) writel((v), PCI_REG(x)) | ||
33 | #define PCIC_READ(x) readl(PCI_REG(x)) | ||
34 | |||
35 | /* | ||
36 | * Description: This function sets up and initializes the pcic, sets | ||
37 | * up the BARS, maps the DRAM into the address space etc, etc. | ||
38 | */ | ||
39 | int __init pcibios_init_platform(void) | ||
40 | { | ||
41 | unsigned long bcr1, wcr1, wcr2, wcr3, mcr; | ||
42 | unsigned short bcr2, bcr3; | ||
43 | |||
44 | /* | ||
45 | * Initialize the slave bus controller on the pcic. The values used | ||
46 | * here should not be hardcoded, but they should be taken from the bsc | ||
47 | * on the processor, to make this function as generic as possible. | ||
48 | * (i.e. Another sbc may usr different SDRAM timing settings -- in order | ||
49 | * for the pcic to work, its settings need to be exactly the same.) | ||
50 | */ | ||
51 | bcr1 = (*(volatile unsigned long *)(SH7751_BCR1)); | ||
52 | bcr2 = (*(volatile unsigned short *)(SH7751_BCR2)); | ||
53 | bcr3 = (*(volatile unsigned short *)(SH7751_BCR3)); | ||
54 | wcr1 = (*(volatile unsigned long *)(SH7751_WCR1)); | ||
55 | wcr2 = (*(volatile unsigned long *)(SH7751_WCR2)); | ||
56 | wcr3 = (*(volatile unsigned long *)(SH7751_WCR3)); | ||
57 | mcr = (*(volatile unsigned long *)(SH7751_MCR)); | ||
58 | |||
59 | bcr1 = bcr1 | 0x00080000; /* Enable Bit 19, BREQEN */ | ||
60 | (*(volatile unsigned long *)(SH7751_BCR1)) = bcr1; | ||
61 | |||
62 | bcr1 = bcr1 | 0x40080000; /* Enable Bit 19 BREQEN, set PCIC to slave */ | ||
63 | PCIC_WRITE(SH7751_PCIBCR1, bcr1); /* PCIC BCR1 */ | ||
64 | PCIC_WRITE(SH7751_PCIBCR2, bcr2); /* PCIC BCR2 */ | ||
65 | PCIC_WRITE(SH7751_PCIBCR3, bcr3); /* PCIC BCR3 */ | ||
66 | PCIC_WRITE(SH7751_PCIWCR1, wcr1); /* PCIC WCR1 */ | ||
67 | PCIC_WRITE(SH7751_PCIWCR2, wcr2); /* PCIC WCR2 */ | ||
68 | PCIC_WRITE(SH7751_PCIWCR3, wcr3); /* PCIC WCR3 */ | ||
69 | mcr = (mcr & PCIMCR_MRSET_OFF) & PCIMCR_RFSH_OFF; | ||
70 | PCIC_WRITE(SH7751_PCIMCR, mcr); /* PCIC MCR */ | ||
71 | |||
72 | /* Enable all interrupts, so we know what to fix */ | ||
73 | PCIC_WRITE(SH7751_PCIINTM, 0x0000c3ff); | ||
74 | PCIC_WRITE(SH7751_PCIAINTM, 0x0000380f); | ||
75 | |||
76 | /* Set up standard PCI config registers */ | ||
77 | PCIC_WRITE(SH7751_PCICONF1, 0xFB900047); /* Bus Master, Mem & I/O access */ | ||
78 | PCIC_WRITE(SH7751_PCICONF2, 0x00000000); /* PCI Class code & Revision ID */ | ||
79 | PCIC_WRITE(SH7751_PCICONF4, 0xab000001); /* PCI I/O address (local regs) */ | ||
80 | PCIC_WRITE(SH7751_PCICONF5, 0x0c000000); /* PCI MEM address (local RAM) */ | ||
81 | PCIC_WRITE(SH7751_PCICONF6, 0xd0000000); /* PCI MEM address (unused) */ | ||
82 | PCIC_WRITE(SH7751_PCICONF11, 0x35051054); /* PCI Subsystem ID & Vendor ID */ | ||
83 | PCIC_WRITE(SH7751_PCILSR0, 0x03f00000); /* MEM (full 64M exposed) */ | ||
84 | PCIC_WRITE(SH7751_PCILSR1, 0x00000000); /* MEM (unused) */ | ||
85 | PCIC_WRITE(SH7751_PCILAR0, 0x0c000000); /* MEM (direct map from PCI) */ | ||
86 | PCIC_WRITE(SH7751_PCILAR1, 0x00000000); /* MEM (unused) */ | ||
87 | |||
88 | /* Now turn it on... */ | ||
89 | PCIC_WRITE(SH7751_PCICR, 0xa5000001); | ||
90 | |||
91 | /* | ||
92 | * Set PCIMBR and PCIIOBR here, assuming a single window | ||
93 | * (16M MEM, 256K IO) is enough. If a larger space is | ||
94 | * needed, the readx/writex and inx/outx functions will | ||
95 | * have to do more (e.g. setting registers for each call). | ||
96 | */ | ||
97 | |||
98 | /* | ||
99 | * Set the MBR so PCI address is one-to-one with window, | ||
100 | * meaning all calls go straight through... use ifdef to | ||
101 | * catch erroneous assumption. | ||
102 | */ | ||
103 | BUG_ON(PCIBIOS_MIN_MEM != SH7751_PCI_MEMORY_BASE); | ||
104 | |||
105 | PCIC_WRITE(SH7751_PCIMBR, PCIBIOS_MIN_MEM); | ||
106 | |||
107 | /* Set IOBR for window containing area specified in pci.h */ | ||
108 | PCIC_WRITE(SH7751_PCIIOBR, (PCIBIOS_MIN_IO & SH7751_PCIIOBR_MASK)); | ||
109 | |||
110 | /* All done, may as well say so... */ | ||
111 | printk("SH7751R PCI: Finished initialization of the PCI controller\n"); | ||
112 | |||
113 | return 1; | ||
114 | } | ||
115 | |||
116 | int __init pcibios_map_platform_irq(u8 slot, u8 pin) | ||
117 | { | ||
118 | switch (slot) { | ||
119 | case 0: return IRQ_PCISLOT; /* PCI Extend slot */ | ||
120 | case 1: return IRQ_PCMCIA; /* PCI Cardbus Bridge */ | ||
121 | case 2: return IRQ_PCIETH; /* Realtek Ethernet controller */ | ||
122 | case 3: return IRQ_PCIHUB; /* Realtek Ethernet Hub controller */ | ||
123 | default: | ||
124 | printk("PCI: Bad IRQ mapping request for slot %d\n", slot); | ||
125 | return -1; | ||
126 | } | ||
127 | } | ||
128 | |||
129 | static struct resource sh7751_io_resource = { | ||
130 | .name = "SH7751_IO", | ||
131 | .start = 0x4000, | ||
132 | .end = 0x4000 + SH7751_PCI_IO_SIZE - 1, | ||
133 | .flags = IORESOURCE_IO | ||
134 | }; | ||
135 | |||
136 | static struct resource sh7751_mem_resource = { | ||
137 | .name = "SH7751_mem", | ||
138 | .start = SH7751_PCI_MEMORY_BASE, | ||
139 | .end = SH7751_PCI_MEMORY_BASE + SH7751_PCI_MEM_SIZE - 1, | ||
140 | .flags = IORESOURCE_MEM | ||
141 | }; | ||
142 | |||
143 | extern struct pci_ops sh7751_pci_ops; | ||
144 | |||
145 | struct pci_channel board_pci_channels[] = { | ||
146 | { &sh7751_pci_ops, &sh7751_io_resource, &sh7751_mem_resource, 0, 0xff }, | ||
147 | { NULL, NULL, NULL, 0, 0 }, | ||
148 | }; | ||
149 | EXPORT_SYMBOL(board_pci_channels); | ||
diff --git a/arch/sh/boards/renesas/hs7751rvoip/setup.c b/arch/sh/boards/renesas/hs7751rvoip/setup.c deleted file mode 100644 index c05625975f2c..000000000000 --- a/arch/sh/boards/renesas/hs7751rvoip/setup.c +++ /dev/null | |||
@@ -1,105 +0,0 @@ | |||
1 | /* | ||
2 | * Renesas Technology Sales HS7751RVoIP Support. | ||
3 | * | ||
4 | * Copyright (C) 2000 Kazumoto Kojima | ||
5 | * | ||
6 | * Modified for HS7751RVoIP by | ||
7 | * Atom Create Engineering Co., Ltd. 2002. | ||
8 | * Lineo uSolutions, Inc. 2003. | ||
9 | */ | ||
10 | #include <linux/init.h> | ||
11 | #include <linux/irq.h> | ||
12 | #include <linux/mm.h> | ||
13 | #include <linux/pm.h> | ||
14 | #include <asm/hs7751rvoip.h> | ||
15 | #include <asm/io.h> | ||
16 | #include <asm/machvec.h> | ||
17 | |||
18 | static void hs7751rvoip_power_off(void) | ||
19 | { | ||
20 | ctrl_outw(ctrl_inw(PA_OUTPORTR) & 0xffdf, PA_OUTPORTR); | ||
21 | } | ||
22 | |||
23 | void *area5_io8_base; | ||
24 | void *area6_io8_base; | ||
25 | void *area5_io16_base; | ||
26 | void *area6_io16_base; | ||
27 | |||
28 | static int __init hs7751rvoip_cf_init(void) | ||
29 | { | ||
30 | pgprot_t prot; | ||
31 | unsigned long paddrbase; | ||
32 | |||
33 | /* open I/O area window */ | ||
34 | paddrbase = virt_to_phys((void *)(PA_AREA5_IO+0x00000800)); | ||
35 | prot = PAGE_KERNEL_PCC(1, _PAGE_PCC_COM16); | ||
36 | area5_io16_base = p3_ioremap(paddrbase, PAGE_SIZE, prot.pgprot); | ||
37 | if (!area5_io16_base) { | ||
38 | printk("allocate_cf_area : can't open CF I/O window!\n"); | ||
39 | return -ENOMEM; | ||
40 | } | ||
41 | |||
42 | /* XXX : do we need attribute and common-memory area also? */ | ||
43 | |||
44 | paddrbase = virt_to_phys((void *)PA_AREA6_IO); | ||
45 | #if defined(CONFIG_HS7751RVOIP_CODEC) | ||
46 | prot = PAGE_KERNEL_PCC(0, _PAGE_PCC_COM8); | ||
47 | #else | ||
48 | prot = PAGE_KERNEL_PCC(0, _PAGE_PCC_IO8); | ||
49 | #endif | ||
50 | area6_io8_base = p3_ioremap(paddrbase, PAGE_SIZE, prot.pgprot); | ||
51 | if (!area6_io8_base) { | ||
52 | printk("allocate_cf_area : can't open CODEC I/O 8bit window!\n"); | ||
53 | return -ENOMEM; | ||
54 | } | ||
55 | prot = PAGE_KERNEL_PCC(0, _PAGE_PCC_IO16); | ||
56 | area6_io16_base = p3_ioremap(paddrbase, PAGE_SIZE, prot.pgprot); | ||
57 | if (!area6_io16_base) { | ||
58 | printk("allocate_cf_area : can't open CODEC I/O 16bit window!\n"); | ||
59 | return -ENOMEM; | ||
60 | } | ||
61 | |||
62 | return 0; | ||
63 | } | ||
64 | device_initcall(hs7751rvoip_cf_init); | ||
65 | |||
66 | /* | ||
67 | * Initialize the board | ||
68 | */ | ||
69 | static void __init hs7751rvoip_setup(char **cmdline_p) | ||
70 | { | ||
71 | ctrl_outb(0xf0, PA_OUTPORTR); | ||
72 | pm_power_off = hs7751rvoip_power_off; | ||
73 | |||
74 | printk(KERN_INFO "Renesas Technology Sales HS7751RVoIP-2 support.\n"); | ||
75 | } | ||
76 | |||
77 | static struct sh_machine_vector mv_hs7751rvoip __initmv = { | ||
78 | .mv_name = "HS7751RVoIP", | ||
79 | .mv_setup = hs7751rvoip_setup, | ||
80 | .mv_nr_irqs = 72, | ||
81 | |||
82 | .mv_inb = hs7751rvoip_inb, | ||
83 | .mv_inw = hs7751rvoip_inw, | ||
84 | .mv_inl = hs7751rvoip_inl, | ||
85 | .mv_outb = hs7751rvoip_outb, | ||
86 | .mv_outw = hs7751rvoip_outw, | ||
87 | .mv_outl = hs7751rvoip_outl, | ||
88 | |||
89 | .mv_inb_p = hs7751rvoip_inb_p, | ||
90 | .mv_inw_p = hs7751rvoip_inw, | ||
91 | .mv_inl_p = hs7751rvoip_inl, | ||
92 | .mv_outb_p = hs7751rvoip_outb_p, | ||
93 | .mv_outw_p = hs7751rvoip_outw, | ||
94 | .mv_outl_p = hs7751rvoip_outl, | ||
95 | |||
96 | .mv_insb = hs7751rvoip_insb, | ||
97 | .mv_insw = hs7751rvoip_insw, | ||
98 | .mv_insl = hs7751rvoip_insl, | ||
99 | .mv_outsb = hs7751rvoip_outsb, | ||
100 | .mv_outsw = hs7751rvoip_outsw, | ||
101 | .mv_outsl = hs7751rvoip_outsl, | ||
102 | |||
103 | .mv_init_irq = init_hs7751rvoip_IRQ, | ||
104 | .mv_ioport_map = hs7751rvoip_ioport_map, | ||
105 | }; | ||
diff --git a/arch/sh/boards/renesas/r7780rp/Makefile b/arch/sh/boards/renesas/r7780rp/Makefile index dd26182fbf58..20a10080b11f 100644 --- a/arch/sh/boards/renesas/r7780rp/Makefile +++ b/arch/sh/boards/renesas/r7780rp/Makefile | |||
@@ -3,7 +3,7 @@ | |||
3 | # | 3 | # |
4 | irqinit-$(CONFIG_SH_R7780MP) := irq-r7780mp.o | 4 | irqinit-$(CONFIG_SH_R7780MP) := irq-r7780mp.o |
5 | irqinit-$(CONFIG_SH_R7785RP) := irq-r7785rp.o | 5 | irqinit-$(CONFIG_SH_R7785RP) := irq-r7785rp.o |
6 | irqinit-$(CONFIG_SH_R7780RP) := irq-r7780rp.o irq.o | 6 | irqinit-$(CONFIG_SH_R7780RP) := irq-r7780rp.o |
7 | obj-y := setup.o $(irqinit-y) | 7 | obj-y := setup.o $(irqinit-y) |
8 | 8 | ||
9 | ifneq ($(CONFIG_SH_R7785RP),y) | 9 | ifneq ($(CONFIG_SH_R7785RP),y) |
diff --git a/arch/sh/boards/renesas/r7780rp/irq-r7780mp.c b/arch/sh/boards/renesas/r7780rp/irq-r7780mp.c index 59b47fe061f9..1f8f073f27be 100644 --- a/arch/sh/boards/renesas/r7780rp/irq-r7780mp.c +++ b/arch/sh/boards/renesas/r7780rp/irq-r7780mp.c | |||
@@ -47,7 +47,7 @@ static unsigned char irl2irq[HL_NR_IRL] __initdata = { | |||
47 | }; | 47 | }; |
48 | 48 | ||
49 | static DECLARE_INTC_DESC(intc_desc, "r7780mp", vectors, | 49 | static DECLARE_INTC_DESC(intc_desc, "r7780mp", vectors, |
50 | NULL, NULL, mask_registers, NULL, NULL); | 50 | NULL, mask_registers, NULL, NULL); |
51 | 51 | ||
52 | unsigned char * __init highlander_init_irq_r7780mp(void) | 52 | unsigned char * __init highlander_init_irq_r7780mp(void) |
53 | { | 53 | { |
diff --git a/arch/sh/boards/renesas/r7780rp/irq-r7780rp.c b/arch/sh/boards/renesas/r7780rp/irq-r7780rp.c index fa4a534cade9..bd34048ed0e1 100644 --- a/arch/sh/boards/renesas/r7780rp/irq-r7780rp.c +++ b/arch/sh/boards/renesas/r7780rp/irq-r7780rp.c | |||
@@ -3,21 +3,65 @@ | |||
3 | * | 3 | * |
4 | * Copyright (C) 2002 Atom Create Engineering Co., Ltd. | 4 | * Copyright (C) 2002 Atom Create Engineering Co., Ltd. |
5 | * Copyright (C) 2006 Paul Mundt | 5 | * Copyright (C) 2006 Paul Mundt |
6 | * Copyright (C) 2008 Magnus Damm | ||
6 | * | 7 | * |
7 | * This file is subject to the terms and conditions of the GNU General Public | 8 | * This file is subject to the terms and conditions of the GNU General Public |
8 | * License. See the file "COPYING" in the main directory of this archive | 9 | * License. See the file "COPYING" in the main directory of this archive |
9 | * for more details. | 10 | * for more details. |
10 | */ | 11 | */ |
11 | #include <linux/init.h> | 12 | #include <linux/init.h> |
13 | #include <linux/irq.h> | ||
12 | #include <linux/io.h> | 14 | #include <linux/io.h> |
13 | #include <asm/r7780rp.h> | 15 | #include <asm/r7780rp.h> |
14 | 16 | ||
17 | enum { | ||
18 | UNUSED = 0, | ||
19 | |||
20 | /* board specific interrupt sources */ | ||
21 | |||
22 | AX88796, /* Ethernet controller */ | ||
23 | PSW, /* Push Switch */ | ||
24 | CF, /* Compact Flash */ | ||
25 | |||
26 | PCI_A, | ||
27 | PCI_B, | ||
28 | PCI_C, | ||
29 | PCI_D, | ||
30 | }; | ||
31 | |||
32 | static struct intc_vect vectors[] __initdata = { | ||
33 | INTC_IRQ(PCI_A, 65), /* dirty: overwrite cpu vectors for pci */ | ||
34 | INTC_IRQ(PCI_B, 66), | ||
35 | INTC_IRQ(PCI_C, 67), | ||
36 | INTC_IRQ(PCI_D, 68), | ||
37 | INTC_IRQ(CF, IRQ_CF), | ||
38 | INTC_IRQ(PSW, IRQ_PSW), | ||
39 | INTC_IRQ(AX88796, IRQ_AX88796), | ||
40 | }; | ||
41 | |||
42 | static struct intc_mask_reg mask_registers[] __initdata = { | ||
43 | { 0xa5000000, 0, 16, /* IRLMSK */ | ||
44 | { PCI_A, PCI_B, PCI_C, PCI_D, CF, 0, 0, 0, | ||
45 | 0, 0, 0, 0, 0, 0, PSW, AX88796 } }, | ||
46 | }; | ||
47 | |||
48 | static unsigned char irl2irq[HL_NR_IRL] __initdata = { | ||
49 | 65, 66, 67, 68, | ||
50 | IRQ_CF, 0, 0, 0, | ||
51 | 0, 0, 0, 0, | ||
52 | IRQ_AX88796, IRQ_PSW | ||
53 | }; | ||
54 | |||
55 | static DECLARE_INTC_DESC(intc_desc, "r7780rp", vectors, | ||
56 | NULL, mask_registers, NULL, NULL); | ||
57 | |||
15 | unsigned char * __init highlander_init_irq_r7780rp(void) | 58 | unsigned char * __init highlander_init_irq_r7780rp(void) |
16 | { | 59 | { |
17 | int i; | 60 | if (ctrl_inw(0xa5000600)) { |
18 | 61 | printk(KERN_INFO "Using r7780rp interrupt controller.\n"); | |
19 | for (i = 0; i < 15; i++) | 62 | register_intc_controller(&intc_desc); |
20 | make_r7780rp_irq(i); | 63 | return irl2irq; |
64 | } | ||
21 | 65 | ||
22 | return NULL; | 66 | return NULL; |
23 | } | 67 | } |
diff --git a/arch/sh/boards/renesas/r7780rp/irq-r7785rp.c b/arch/sh/boards/renesas/r7780rp/irq-r7785rp.c index b2c6a84673bd..bf7ec107fbc6 100644 --- a/arch/sh/boards/renesas/r7780rp/irq-r7785rp.c +++ b/arch/sh/boards/renesas/r7780rp/irq-r7785rp.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * Renesas Solutions Highlander R7785RP Support. | 2 | * Renesas Solutions Highlander R7785RP Support. |
3 | * | 3 | * |
4 | * Copyright (C) 2002 Atom Create Engineering Co., Ltd. | 4 | * Copyright (C) 2002 Atom Create Engineering Co., Ltd. |
5 | * Copyright (C) 2006 Paul Mundt | 5 | * Copyright (C) 2006 - 2008 Paul Mundt |
6 | * Copyright (C) 2007 Magnus Damm | 6 | * Copyright (C) 2007 Magnus Damm |
7 | * | 7 | * |
8 | * This file is subject to the terms and conditions of the GNU General Public | 8 | * This file is subject to the terms and conditions of the GNU General Public |
@@ -17,31 +17,52 @@ | |||
17 | enum { | 17 | enum { |
18 | UNUSED = 0, | 18 | UNUSED = 0, |
19 | 19 | ||
20 | /* board specific interrupt sources */ | 20 | /* FPGA specific interrupt sources */ |
21 | AX88796, /* Ethernet controller */ | 21 | CF, /* Compact Flash */ |
22 | CF, /* Compact Flash */ | 22 | SMBUS, /* SMBUS */ |
23 | TP, /* Touch panel */ | ||
24 | RTC, /* RTC Alarm */ | ||
25 | TH_ALERT, /* Temperature sensor */ | ||
26 | AX88796, /* Ethernet controller */ | ||
27 | |||
28 | /* external bus connector */ | ||
29 | EXT0, EXT1, EXT2, EXT3, EXT4, EXT5, EXT6, EXT7, | ||
23 | }; | 30 | }; |
24 | 31 | ||
25 | static struct intc_vect vectors[] __initdata = { | 32 | static struct intc_vect vectors[] __initdata = { |
26 | INTC_IRQ(CF, IRQ_CF), | 33 | INTC_IRQ(CF, IRQ_CF), |
34 | INTC_IRQ(SMBUS, IRQ_SMBUS), | ||
35 | INTC_IRQ(TP, IRQ_TP), | ||
36 | INTC_IRQ(RTC, IRQ_RTC), | ||
37 | INTC_IRQ(TH_ALERT, IRQ_TH_ALERT), | ||
38 | |||
39 | INTC_IRQ(EXT0, IRQ_EXT0), INTC_IRQ(EXT1, IRQ_EXT1), | ||
40 | INTC_IRQ(EXT2, IRQ_EXT2), INTC_IRQ(EXT3, IRQ_EXT3), | ||
41 | |||
42 | INTC_IRQ(EXT4, IRQ_EXT4), INTC_IRQ(EXT5, IRQ_EXT5), | ||
43 | INTC_IRQ(EXT6, IRQ_EXT6), INTC_IRQ(EXT7, IRQ_EXT7), | ||
44 | |||
27 | INTC_IRQ(AX88796, IRQ_AX88796), | 45 | INTC_IRQ(AX88796, IRQ_AX88796), |
28 | }; | 46 | }; |
29 | 47 | ||
30 | static struct intc_mask_reg mask_registers[] __initdata = { | 48 | static struct intc_mask_reg mask_registers[] __initdata = { |
31 | { 0xa4000010, 0, 16, /* IRLMCR1 */ | 49 | { 0xa4000010, 0, 16, /* IRLMCR1 */ |
32 | { 0, 0, 0, 0, CF, AX88796, 0, 0, | 50 | { 0, 0, 0, 0, CF, AX88796, SMBUS, TP, |
33 | 0, 0, 0, 0, 0, 0, 0, 0 } }, | 51 | RTC, 0, TH_ALERT, 0, 0, 0, 0, 0 } }, |
52 | { 0xa4000012, 0, 16, /* IRLMCR2 */ | ||
53 | { 0, 0, 0, 0, 0, 0, 0, 0, | ||
54 | EXT7, EXT6, EXT5, EXT4, EXT3, EXT2, EXT1, EXT0 } }, | ||
34 | }; | 55 | }; |
35 | 56 | ||
36 | static unsigned char irl2irq[HL_NR_IRL] __initdata = { | 57 | static unsigned char irl2irq[HL_NR_IRL] __initdata = { |
37 | 0, IRQ_CF, 0, 0, | 58 | 0, IRQ_CF, IRQ_EXT4, IRQ_EXT5, |
38 | 0, 0, 0, 0, | 59 | IRQ_EXT6, IRQ_EXT7, IRQ_SMBUS, IRQ_TP, |
39 | 0, 0, IRQ_AX88796, 0, | 60 | IRQ_RTC, IRQ_TH_ALERT, IRQ_AX88796, IRQ_EXT0, |
40 | 0, 0, 0, | 61 | IRQ_EXT1, IRQ_EXT2, IRQ_EXT3, |
41 | }; | 62 | }; |
42 | 63 | ||
43 | static DECLARE_INTC_DESC(intc_desc, "r7785rp", vectors, | 64 | static DECLARE_INTC_DESC(intc_desc, "r7785rp", vectors, |
44 | NULL, NULL, mask_registers, NULL, NULL); | 65 | NULL, mask_registers, NULL, NULL); |
45 | 66 | ||
46 | unsigned char * __init highlander_init_irq_r7785rp(void) | 67 | unsigned char * __init highlander_init_irq_r7785rp(void) |
47 | { | 68 | { |
@@ -58,7 +79,7 @@ unsigned char * __init highlander_init_irq_r7785rp(void) | |||
58 | ctrl_outw(0x7060, PA_IRLPRC); /* FPGA IRLC */ | 79 | ctrl_outw(0x7060, PA_IRLPRC); /* FPGA IRLC */ |
59 | ctrl_outw(0x0000, PA_IRLPRD); /* FPGA IRLD */ | 80 | ctrl_outw(0x0000, PA_IRLPRD); /* FPGA IRLD */ |
60 | ctrl_outw(0x4321, PA_IRLPRE); /* FPGA IRLE */ | 81 | ctrl_outw(0x4321, PA_IRLPRE); /* FPGA IRLE */ |
61 | ctrl_outw(0x0000, PA_IRLPRF); /* FPGA IRLF */ | 82 | ctrl_outw(0xdcba, PA_IRLPRF); /* FPGA IRLF */ |
62 | 83 | ||
63 | register_intc_controller(&intc_desc); | 84 | register_intc_controller(&intc_desc); |
64 | return irl2irq; | 85 | return irl2irq; |
diff --git a/arch/sh/boards/renesas/r7780rp/irq.c b/arch/sh/boards/renesas/r7780rp/irq.c deleted file mode 100644 index e0b8eb52f376..000000000000 --- a/arch/sh/boards/renesas/r7780rp/irq.c +++ /dev/null | |||
@@ -1,51 +0,0 @@ | |||
1 | /* | ||
2 | * Renesas Solutions Highlander R7780RP-1 Support. | ||
3 | * | ||
4 | * Copyright (C) 2002 Atom Create Engineering Co., Ltd. | ||
5 | * Copyright (C) 2006 Paul Mundt | ||
6 | * | ||
7 | * This file is subject to the terms and conditions of the GNU General Public | ||
8 | * License. See the file "COPYING" in the main directory of this archive | ||
9 | * for more details. | ||
10 | */ | ||
11 | #include <linux/init.h> | ||
12 | #include <linux/irq.h> | ||
13 | #include <linux/interrupt.h> | ||
14 | #include <linux/io.h> | ||
15 | #include <asm/r7780rp.h> | ||
16 | |||
17 | #ifdef CONFIG_SH_R7780RP | ||
18 | static int mask_pos[] = {15, 14, 13, 12, 11, 10, 9, 8, 7, 5, 6, 4, 0, 1, 2, 0}; | ||
19 | #elif defined(CONFIG_SH_R7780MP) | ||
20 | static int mask_pos[] = {12, 11, 9, 14, 15, 8, 13, 6, 5, 4, 3, 2, 0, 0, 1, 0}; | ||
21 | #elif defined(CONFIG_SH_R7785RP) | ||
22 | static int mask_pos[] = {2, 11, 2, 2, 2, 2, 9, 8, 7, 5, 10, 2, 2, 2, 2, 2}; | ||
23 | #endif | ||
24 | |||
25 | static void enable_r7780rp_irq(unsigned int irq) | ||
26 | { | ||
27 | /* Set priority in IPR back to original value */ | ||
28 | ctrl_outw(ctrl_inw(IRLCNTR1) | (1 << mask_pos[irq]), IRLCNTR1); | ||
29 | } | ||
30 | |||
31 | static void disable_r7780rp_irq(unsigned int irq) | ||
32 | { | ||
33 | /* Set the priority in IPR to 0 */ | ||
34 | ctrl_outw(ctrl_inw(IRLCNTR1) & (0xffff ^ (1 << mask_pos[irq])), | ||
35 | IRLCNTR1); | ||
36 | } | ||
37 | |||
38 | static struct irq_chip r7780rp_irq_chip __read_mostly = { | ||
39 | .name = "R7780RP", | ||
40 | .mask = disable_r7780rp_irq, | ||
41 | .unmask = enable_r7780rp_irq, | ||
42 | .mask_ack = disable_r7780rp_irq, | ||
43 | }; | ||
44 | |||
45 | void make_r7780rp_irq(unsigned int irq) | ||
46 | { | ||
47 | disable_irq_nosync(irq); | ||
48 | set_irq_chip_and_handler_name(irq, &r7780rp_irq_chip, | ||
49 | handle_level_irq, "level"); | ||
50 | enable_r7780rp_irq(irq); | ||
51 | } | ||
diff --git a/arch/sh/boards/renesas/r7780rp/setup.c b/arch/sh/boards/renesas/r7780rp/setup.c index 0fdc0bc19145..a43b47726f54 100644 --- a/arch/sh/boards/renesas/r7780rp/setup.c +++ b/arch/sh/boards/renesas/r7780rp/setup.c | |||
@@ -179,9 +179,11 @@ static struct platform_device ax88796_device = { | |||
179 | static struct platform_device *r7780rp_devices[] __initdata = { | 179 | static struct platform_device *r7780rp_devices[] __initdata = { |
180 | &r8a66597_usb_host_device, | 180 | &r8a66597_usb_host_device, |
181 | &m66592_usb_peripheral_device, | 181 | &m66592_usb_peripheral_device, |
182 | &cf_ide_device, | ||
183 | &heartbeat_device, | 182 | &heartbeat_device, |
183 | #ifndef CONFIG_SH_R7780RP | ||
184 | &cf_ide_device, | ||
184 | &ax88796_device, | 185 | &ax88796_device, |
186 | #endif | ||
185 | }; | 187 | }; |
186 | 188 | ||
187 | static int __init r7780rp_devices_setup(void) | 189 | static int __init r7780rp_devices_setup(void) |
@@ -316,9 +318,9 @@ void __init highlander_init_irq(void) | |||
316 | break; | 318 | break; |
317 | #endif | 319 | #endif |
318 | #ifdef CONFIG_SH_R7780RP | 320 | #ifdef CONFIG_SH_R7780RP |
319 | highlander_init_irq_r7780rp(); | 321 | ucp = highlander_init_irq_r7780rp(); |
320 | ucp = irl2irq; | 322 | if (ucp) |
321 | break; | 323 | break; |
322 | #endif | 324 | #endif |
323 | } while (0); | 325 | } while (0); |
324 | 326 | ||
diff --git a/arch/sh/boards/renesas/rts7751r2d/irq.c b/arch/sh/boards/renesas/rts7751r2d/irq.c index 7cc2813adfe4..8e49f6e51247 100644 --- a/arch/sh/boards/renesas/rts7751r2d/irq.c +++ b/arch/sh/boards/renesas/rts7751r2d/irq.c | |||
@@ -13,7 +13,6 @@ | |||
13 | #include <linux/irq.h> | 13 | #include <linux/irq.h> |
14 | #include <linux/interrupt.h> | 14 | #include <linux/interrupt.h> |
15 | #include <linux/io.h> | 15 | #include <linux/io.h> |
16 | #include <asm/voyagergx.h> | ||
17 | #include <asm/rts7751r2d.h> | 16 | #include <asm/rts7751r2d.h> |
18 | 17 | ||
19 | #define R2D_NR_IRL 13 | 18 | #define R2D_NR_IRL 13 |
@@ -71,7 +70,7 @@ static unsigned char irl2irq_r2d_1[R2D_NR_IRL] __initdata = { | |||
71 | }; | 70 | }; |
72 | 71 | ||
73 | static DECLARE_INTC_DESC(intc_desc_r2d_1, "r2d-1", vectors_r2d_1, | 72 | static DECLARE_INTC_DESC(intc_desc_r2d_1, "r2d-1", vectors_r2d_1, |
74 | NULL, NULL, mask_registers_r2d_1, NULL, NULL); | 73 | NULL, mask_registers_r2d_1, NULL, NULL); |
75 | 74 | ||
76 | #endif /* CONFIG_RTS7751R2D_1 */ | 75 | #endif /* CONFIG_RTS7751R2D_1 */ |
77 | 76 | ||
@@ -109,7 +108,7 @@ static unsigned char irl2irq_r2d_plus[R2D_NR_IRL] __initdata = { | |||
109 | }; | 108 | }; |
110 | 109 | ||
111 | static DECLARE_INTC_DESC(intc_desc_r2d_plus, "r2d-plus", vectors_r2d_plus, | 110 | static DECLARE_INTC_DESC(intc_desc_r2d_plus, "r2d-plus", vectors_r2d_plus, |
112 | NULL, NULL, mask_registers_r2d_plus, NULL, NULL); | 111 | NULL, mask_registers_r2d_plus, NULL, NULL); |
113 | 112 | ||
114 | #endif /* CONFIG_RTS7751R2D_PLUS */ | 113 | #endif /* CONFIG_RTS7751R2D_PLUS */ |
115 | 114 | ||
@@ -153,7 +152,4 @@ void __init init_rts7751r2d_IRQ(void) | |||
153 | } | 152 | } |
154 | 153 | ||
155 | register_intc_controller(d); | 154 | register_intc_controller(d); |
156 | #ifdef CONFIG_MFD_SM501 | ||
157 | setup_voyagergx_irq(); | ||
158 | #endif | ||
159 | } | 155 | } |
diff --git a/arch/sh/boards/renesas/rts7751r2d/setup.c b/arch/sh/boards/renesas/rts7751r2d/setup.c index 8125d20fdbd8..3452b072adde 100644 --- a/arch/sh/boards/renesas/rts7751r2d/setup.c +++ b/arch/sh/boards/renesas/rts7751r2d/setup.c | |||
@@ -13,34 +13,15 @@ | |||
13 | #include <linux/pata_platform.h> | 13 | #include <linux/pata_platform.h> |
14 | #include <linux/serial_8250.h> | 14 | #include <linux/serial_8250.h> |
15 | #include <linux/sm501.h> | 15 | #include <linux/sm501.h> |
16 | #include <linux/sm501-regs.h> | ||
16 | #include <linux/pm.h> | 17 | #include <linux/pm.h> |
18 | #include <linux/fb.h> | ||
19 | #include <linux/spi/spi.h> | ||
20 | #include <linux/spi/spi_bitbang.h> | ||
17 | #include <asm/machvec.h> | 21 | #include <asm/machvec.h> |
18 | #include <asm/rts7751r2d.h> | 22 | #include <asm/rts7751r2d.h> |
19 | #include <asm/voyagergx.h> | ||
20 | #include <asm/io.h> | 23 | #include <asm/io.h> |
21 | 24 | #include <asm/spi.h> | |
22 | static void __init voyagergx_serial_init(void) | ||
23 | { | ||
24 | unsigned long val; | ||
25 | |||
26 | /* | ||
27 | * GPIO Control | ||
28 | */ | ||
29 | val = readl((void __iomem *)GPIO_MUX_HIGH); | ||
30 | val |= 0x00001fe0; | ||
31 | writel(val, (void __iomem *)GPIO_MUX_HIGH); | ||
32 | |||
33 | /* | ||
34 | * Power Mode Gate | ||
35 | */ | ||
36 | val = readl((void __iomem *)POWER_MODE0_GATE); | ||
37 | val |= (POWER_MODE0_GATE_U0 | POWER_MODE0_GATE_U1); | ||
38 | writel(val, (void __iomem *)POWER_MODE0_GATE); | ||
39 | |||
40 | val = readl((void __iomem *)POWER_MODE1_GATE); | ||
41 | val |= (POWER_MODE1_GATE_U0 | POWER_MODE1_GATE_U1); | ||
42 | writel(val, (void __iomem *)POWER_MODE1_GATE); | ||
43 | } | ||
44 | 25 | ||
45 | static struct resource cf_ide_resources[] = { | 26 | static struct resource cf_ide_resources[] = { |
46 | [0] = { | 27 | [0] = { |
@@ -75,6 +56,43 @@ static struct platform_device cf_ide_device = { | |||
75 | }, | 56 | }, |
76 | }; | 57 | }; |
77 | 58 | ||
59 | static struct spi_board_info spi_bus[] = { | ||
60 | { | ||
61 | .modalias = "rtc-r9701", | ||
62 | .max_speed_hz = 1000000, | ||
63 | .mode = SPI_MODE_3, | ||
64 | }, | ||
65 | }; | ||
66 | |||
67 | static void r2d_chip_select(struct sh_spi_info *spi, int cs, int state) | ||
68 | { | ||
69 | BUG_ON(cs != 0); /* Single Epson RTC-9701JE attached on CS0 */ | ||
70 | ctrl_outw(state == BITBANG_CS_ACTIVE, PA_RTCCE); | ||
71 | } | ||
72 | |||
73 | static struct sh_spi_info spi_info = { | ||
74 | .num_chipselect = 1, | ||
75 | .chip_select = r2d_chip_select, | ||
76 | }; | ||
77 | |||
78 | static struct resource spi_sh_sci_resources[] = { | ||
79 | { | ||
80 | .start = 0xffe00000, | ||
81 | .end = 0xffe0001f, | ||
82 | .flags = IORESOURCE_MEM, | ||
83 | }, | ||
84 | }; | ||
85 | |||
86 | static struct platform_device spi_sh_sci_device = { | ||
87 | .name = "spi_sh_sci", | ||
88 | .id = -1, | ||
89 | .num_resources = ARRAY_SIZE(spi_sh_sci_resources), | ||
90 | .resource = spi_sh_sci_resources, | ||
91 | .dev = { | ||
92 | .platform_data = &spi_info, | ||
93 | }, | ||
94 | }; | ||
95 | |||
78 | static struct resource heartbeat_resources[] = { | 96 | static struct resource heartbeat_resources[] = { |
79 | [0] = { | 97 | [0] = { |
80 | .start = PA_OUTPORT, | 98 | .start = PA_OUTPORT, |
@@ -93,11 +111,11 @@ static struct platform_device heartbeat_device = { | |||
93 | #ifdef CONFIG_MFD_SM501 | 111 | #ifdef CONFIG_MFD_SM501 |
94 | static struct plat_serial8250_port uart_platform_data[] = { | 112 | static struct plat_serial8250_port uart_platform_data[] = { |
95 | { | 113 | { |
96 | .membase = (void __iomem *)VOYAGER_UART_BASE, | 114 | .membase = (void __iomem *)0xb3e30000, |
97 | .mapbase = VOYAGER_UART_BASE, | 115 | .mapbase = 0xb3e30000, |
98 | .iotype = UPIO_MEM, | 116 | .iotype = UPIO_MEM, |
99 | .irq = IRQ_SM501_U0, | 117 | .irq = IRQ_VOYAGER, |
100 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, | 118 | .flags = UPF_BOOT_AUTOCONF | UPF_SHARE_IRQ, |
101 | .regshift = 2, | 119 | .regshift = 2, |
102 | .uartclk = (9600 * 16), | 120 | .uartclk = (9600 * 16), |
103 | }, | 121 | }, |
@@ -124,14 +142,67 @@ static struct resource sm501_resources[] = { | |||
124 | .flags = IORESOURCE_MEM, | 142 | .flags = IORESOURCE_MEM, |
125 | }, | 143 | }, |
126 | [2] = { | 144 | [2] = { |
127 | .start = IRQ_SM501_CV, | 145 | .start = IRQ_VOYAGER, |
128 | .flags = IORESOURCE_IRQ, | 146 | .flags = IORESOURCE_IRQ, |
129 | }, | 147 | }, |
130 | }; | 148 | }; |
131 | 149 | ||
150 | static struct fb_videomode sm501_default_mode = { | ||
151 | .pixclock = 35714, | ||
152 | .xres = 640, | ||
153 | .yres = 480, | ||
154 | .left_margin = 105, | ||
155 | .right_margin = 50, | ||
156 | .upper_margin = 35, | ||
157 | .lower_margin = 0, | ||
158 | .hsync_len = 96, | ||
159 | .vsync_len = 2, | ||
160 | .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, | ||
161 | }; | ||
162 | |||
163 | static struct sm501_platdata_fbsub sm501_pdata_fbsub_pnl = { | ||
164 | .def_bpp = 16, | ||
165 | .def_mode = &sm501_default_mode, | ||
166 | .flags = SM501FB_FLAG_USE_INIT_MODE | | ||
167 | SM501FB_FLAG_USE_HWCURSOR | | ||
168 | SM501FB_FLAG_USE_HWACCEL | | ||
169 | SM501FB_FLAG_DISABLE_AT_EXIT, | ||
170 | }; | ||
171 | |||
172 | static struct sm501_platdata_fbsub sm501_pdata_fbsub_crt = { | ||
173 | .flags = (SM501FB_FLAG_USE_INIT_MODE | | ||
174 | SM501FB_FLAG_USE_HWCURSOR | | ||
175 | SM501FB_FLAG_USE_HWACCEL | | ||
176 | SM501FB_FLAG_DISABLE_AT_EXIT), | ||
177 | |||
178 | }; | ||
179 | |||
180 | static struct sm501_platdata_fb sm501_fb_pdata = { | ||
181 | .fb_route = SM501_FB_OWN, | ||
182 | .fb_crt = &sm501_pdata_fbsub_crt, | ||
183 | .fb_pnl = &sm501_pdata_fbsub_pnl, | ||
184 | .flags = SM501_FBPD_SWAP_FB_ENDIAN, | ||
185 | }; | ||
186 | |||
187 | static struct sm501_initdata sm501_initdata = { | ||
188 | .gpio_high = { | ||
189 | .set = 0x00001fe0, | ||
190 | .mask = 0x0, | ||
191 | }, | ||
192 | .devices = SM501_USE_USB_HOST, | ||
193 | }; | ||
194 | |||
195 | static struct sm501_platdata sm501_platform_data = { | ||
196 | .init = &sm501_initdata, | ||
197 | .fb = &sm501_fb_pdata, | ||
198 | }; | ||
199 | |||
132 | static struct platform_device sm501_device = { | 200 | static struct platform_device sm501_device = { |
133 | .name = "sm501", | 201 | .name = "sm501", |
134 | .id = -1, | 202 | .id = -1, |
203 | .dev = { | ||
204 | .platform_data = &sm501_platform_data, | ||
205 | }, | ||
135 | .num_resources = ARRAY_SIZE(sm501_resources), | 206 | .num_resources = ARRAY_SIZE(sm501_resources), |
136 | .resource = sm501_resources, | 207 | .resource = sm501_resources, |
137 | }; | 208 | }; |
@@ -145,10 +216,12 @@ static struct platform_device *rts7751r2d_devices[] __initdata = { | |||
145 | #endif | 216 | #endif |
146 | &cf_ide_device, | 217 | &cf_ide_device, |
147 | &heartbeat_device, | 218 | &heartbeat_device, |
219 | &spi_sh_sci_device, | ||
148 | }; | 220 | }; |
149 | 221 | ||
150 | static int __init rts7751r2d_devices_setup(void) | 222 | static int __init rts7751r2d_devices_setup(void) |
151 | { | 223 | { |
224 | spi_register_board_info(spi_bus, ARRAY_SIZE(spi_bus)); | ||
152 | return platform_add_devices(rts7751r2d_devices, | 225 | return platform_add_devices(rts7751r2d_devices, |
153 | ARRAY_SIZE(rts7751r2d_devices)); | 226 | ARRAY_SIZE(rts7751r2d_devices)); |
154 | } | 227 | } |
@@ -192,6 +265,7 @@ u8 rts7751r2d_readb(void __iomem *addr) | |||
192 | */ | 265 | */ |
193 | static void __init rts7751r2d_setup(char **cmdline_p) | 266 | static void __init rts7751r2d_setup(char **cmdline_p) |
194 | { | 267 | { |
268 | void __iomem *sm501_reg; | ||
195 | u16 ver = ctrl_inw(PA_VERREG); | 269 | u16 ver = ctrl_inw(PA_VERREG); |
196 | 270 | ||
197 | printk(KERN_INFO "Renesas Technology Sales RTS7751R2D support.\n"); | 271 | printk(KERN_INFO "Renesas Technology Sales RTS7751R2D support.\n"); |
@@ -202,7 +276,30 @@ static void __init rts7751r2d_setup(char **cmdline_p) | |||
202 | ctrl_outw(0x0000, PA_OUTPORT); | 276 | ctrl_outw(0x0000, PA_OUTPORT); |
203 | pm_power_off = rts7751r2d_power_off; | 277 | pm_power_off = rts7751r2d_power_off; |
204 | 278 | ||
205 | voyagergx_serial_init(); | 279 | /* sm501 dram configuration: |
280 | * ColSizeX = 11 - External Memory Column Size: 256 words. | ||
281 | * APX = 1 - External Memory Active to Pre-Charge Delay: 7 clocks. | ||
282 | * RstX = 1 - External Memory Reset: Normal. | ||
283 | * Rfsh = 1 - Local Memory Refresh to Command Delay: 12 clocks. | ||
284 | * BwC = 1 - Local Memory Block Write Cycle Time: 2 clocks. | ||
285 | * BwP = 1 - Local Memory Block Write to Pre-Charge Delay: 1 clock. | ||
286 | * AP = 1 - Internal Memory Active to Pre-Charge Delay: 7 clocks. | ||
287 | * Rst = 1 - Internal Memory Reset: Normal. | ||
288 | * RA = 1 - Internal Memory Remain in Active State: Do not remain. | ||
289 | */ | ||
290 | |||
291 | sm501_reg = (void __iomem *)0xb3e00000 + SM501_DRAM_CONTROL; | ||
292 | writel(readl(sm501_reg) | 0x00f107c0, sm501_reg); | ||
293 | |||
294 | /* | ||
295 | * Power Mode Gate - Enable UART0 | ||
296 | */ | ||
297 | |||
298 | sm501_reg = (void __iomem *)0xb3e00000 + SM501_POWER_MODE_0_GATE; | ||
299 | writel(readl(sm501_reg) | (1 << SM501_GATE_UART0), sm501_reg); | ||
300 | |||
301 | sm501_reg = (void __iomem *)0xb3e00000 + SM501_POWER_MODE_1_GATE; | ||
302 | writel(readl(sm501_reg) | (1 << SM501_GATE_UART0), sm501_reg); | ||
206 | } | 303 | } |
207 | 304 | ||
208 | /* | 305 | /* |
@@ -215,8 +312,4 @@ static struct sh_machine_vector mv_rts7751r2d __initmv = { | |||
215 | .mv_irq_demux = rts7751r2d_irq_demux, | 312 | .mv_irq_demux = rts7751r2d_irq_demux, |
216 | .mv_writeb = rts7751r2d_writeb, | 313 | .mv_writeb = rts7751r2d_writeb, |
217 | .mv_readb = rts7751r2d_readb, | 314 | .mv_readb = rts7751r2d_readb, |
218 | #if defined(CONFIG_MFD_SM501) && defined(CONFIG_USB_OHCI_HCD) | ||
219 | .mv_consistent_alloc = voyagergx_consistent_alloc, | ||
220 | .mv_consistent_free = voyagergx_consistent_free, | ||
221 | #endif | ||
222 | }; | 315 | }; |
diff --git a/arch/sh/boards/renesas/sdk7780/Kconfig b/arch/sh/boards/renesas/sdk7780/Kconfig new file mode 100644 index 000000000000..e4f5b6985be1 --- /dev/null +++ b/arch/sh/boards/renesas/sdk7780/Kconfig | |||
@@ -0,0 +1,23 @@ | |||
1 | if SH_SDK7780 | ||
2 | |||
3 | choice | ||
4 | prompt "SDK7780 options" | ||
5 | default SH_SDK7780_BASE | ||
6 | |||
7 | config SH_SDK7780_STANDALONE | ||
8 | bool "SDK7780 board support" | ||
9 | depends on CPU_SUBTYPE_SH7780 | ||
10 | help | ||
11 | Selecting this option will enable support for the | ||
12 | standalone version of the SDK7780. If in doubt, say Y. | ||
13 | |||
14 | config SH_SDK7780_BASE | ||
15 | bool "SDK7780 with base-board support" | ||
16 | depends on CPU_SUBTYPE_SH7780 | ||
17 | help | ||
18 | Selecting this option will enable support for the expansion | ||
19 | baseboard devices. If in doubt, say Y. | ||
20 | |||
21 | endchoice | ||
22 | |||
23 | endif | ||
diff --git a/arch/sh/boards/renesas/sdk7780/Makefile b/arch/sh/boards/renesas/sdk7780/Makefile new file mode 100644 index 000000000000..3d8f0befc35d --- /dev/null +++ b/arch/sh/boards/renesas/sdk7780/Makefile | |||
@@ -0,0 +1,5 @@ | |||
1 | # | ||
2 | # Makefile for the SDK7780 specific parts of the kernel | ||
3 | # | ||
4 | obj-y := setup.o irq.o | ||
5 | |||
diff --git a/arch/sh/boards/renesas/sdk7780/irq.c b/arch/sh/boards/renesas/sdk7780/irq.c new file mode 100644 index 000000000000..87cdc578f6ff --- /dev/null +++ b/arch/sh/boards/renesas/sdk7780/irq.c | |||
@@ -0,0 +1,46 @@ | |||
1 | /* | ||
2 | * linux/arch/sh/boards/renesas/sdk7780/irq.c | ||
3 | * | ||
4 | * Renesas Technology Europe SDK7780 Support. | ||
5 | * | ||
6 | * Copyright (C) 2008 Nicholas Beck <nbeck@mpc-data.co.uk> | ||
7 | * | ||
8 | * This file is subject to the terms and conditions of the GNU General Public | ||
9 | * License. See the file "COPYING" in the main directory of this archive | ||
10 | * for more details. | ||
11 | */ | ||
12 | #include <linux/init.h> | ||
13 | #include <linux/irq.h> | ||
14 | #include <linux/io.h> | ||
15 | #include <asm/sdk7780.h> | ||
16 | |||
17 | enum { | ||
18 | UNUSED = 0, | ||
19 | /* board specific interrupt sources */ | ||
20 | SMC91C111, /* Ethernet controller */ | ||
21 | }; | ||
22 | |||
23 | static struct intc_vect fpga_vectors[] __initdata = { | ||
24 | INTC_IRQ(SMC91C111, IRQ_ETHERNET), | ||
25 | }; | ||
26 | |||
27 | static struct intc_mask_reg fpga_mask_registers[] __initdata = { | ||
28 | { 0, FPGA_IRQ0MR, 16, | ||
29 | { 0, 0, 0, 0, 0, 0, 0, 0, | ||
30 | 0, 0, 0, SMC91C111, 0, 0, 0, 0 } }, | ||
31 | }; | ||
32 | |||
33 | static DECLARE_INTC_DESC(fpga_intc_desc, "sdk7780-irq", fpga_vectors, | ||
34 | NULL, fpga_mask_registers, NULL, NULL); | ||
35 | |||
36 | void __init init_sdk7780_IRQ(void) | ||
37 | { | ||
38 | printk(KERN_INFO "Using SDK7780 interrupt controller.\n"); | ||
39 | |||
40 | ctrl_outw(0xFFFF, FPGA_IRQ0MR); | ||
41 | /* Setup IRL 0-3 */ | ||
42 | ctrl_outw(0x0003, FPGA_IMSR); | ||
43 | plat_irq_setup_pins(IRQ_MODE_IRL3210); | ||
44 | |||
45 | register_intc_controller(&fpga_intc_desc); | ||
46 | } | ||
diff --git a/arch/sh/boards/renesas/sdk7780/setup.c b/arch/sh/boards/renesas/sdk7780/setup.c new file mode 100644 index 000000000000..5df32f201870 --- /dev/null +++ b/arch/sh/boards/renesas/sdk7780/setup.c | |||
@@ -0,0 +1,109 @@ | |||
1 | /* | ||
2 | * arch/sh/boards/renesas/sdk7780/setup.c | ||
3 | * | ||
4 | * Renesas Solutions SH7780 SDK Support | ||
5 | * Copyright (C) 2008 Nicholas Beck <nbeck@mpc-data.co.uk> | ||
6 | * | ||
7 | * This file is subject to the terms and conditions of the GNU General Public | ||
8 | * License. See the file "COPYING" in the main directory of this archive | ||
9 | * for more details. | ||
10 | */ | ||
11 | #include <linux/init.h> | ||
12 | #include <linux/types.h> | ||
13 | #include <linux/platform_device.h> | ||
14 | #include <linux/pata_platform.h> | ||
15 | #include <asm/machvec.h> | ||
16 | #include <asm/sdk7780.h> | ||
17 | #include <asm/heartbeat.h> | ||
18 | #include <asm/io.h> | ||
19 | #include <asm/addrspace.h> | ||
20 | |||
21 | #define GPIO_PECR 0xFFEA0008 | ||
22 | |||
23 | //* Heartbeat */ | ||
24 | static struct heartbeat_data heartbeat_data = { | ||
25 | .regsize = 16, | ||
26 | }; | ||
27 | |||
28 | static struct resource heartbeat_resources[] = { | ||
29 | [0] = { | ||
30 | .start = PA_LED, | ||
31 | .end = PA_LED, | ||
32 | .flags = IORESOURCE_MEM, | ||
33 | }, | ||
34 | }; | ||
35 | |||
36 | static struct platform_device heartbeat_device = { | ||
37 | .name = "heartbeat", | ||
38 | .id = -1, | ||
39 | .dev = { | ||
40 | .platform_data = &heartbeat_data, | ||
41 | }, | ||
42 | .num_resources = ARRAY_SIZE(heartbeat_resources), | ||
43 | .resource = heartbeat_resources, | ||
44 | }; | ||
45 | |||
46 | /* SMC91x */ | ||
47 | static struct resource smc91x_eth_resources[] = { | ||
48 | [0] = { | ||
49 | .name = "smc91x-regs" , | ||
50 | .start = PA_LAN + 0x300, | ||
51 | .end = PA_LAN + 0x300 + 0x10 , | ||
52 | .flags = IORESOURCE_MEM, | ||
53 | }, | ||
54 | [1] = { | ||
55 | .start = IRQ_ETHERNET, | ||
56 | .end = IRQ_ETHERNET, | ||
57 | .flags = IORESOURCE_IRQ, | ||
58 | }, | ||
59 | }; | ||
60 | |||
61 | static struct platform_device smc91x_eth_device = { | ||
62 | .name = "smc91x", | ||
63 | .id = 0, | ||
64 | .dev = { | ||
65 | .dma_mask = NULL, /* don't use dma */ | ||
66 | .coherent_dma_mask = 0xffffffff, | ||
67 | }, | ||
68 | .num_resources = ARRAY_SIZE(smc91x_eth_resources), | ||
69 | .resource = smc91x_eth_resources, | ||
70 | }; | ||
71 | |||
72 | static struct platform_device *sdk7780_devices[] __initdata = { | ||
73 | &heartbeat_device, | ||
74 | &smc91x_eth_device, | ||
75 | }; | ||
76 | |||
77 | static int __init sdk7780_devices_setup(void) | ||
78 | { | ||
79 | return platform_add_devices(sdk7780_devices, | ||
80 | ARRAY_SIZE(sdk7780_devices)); | ||
81 | } | ||
82 | device_initcall(sdk7780_devices_setup); | ||
83 | |||
84 | static void __init sdk7780_setup(char **cmdline_p) | ||
85 | { | ||
86 | u16 ver = ctrl_inw(FPGA_FPVERR); | ||
87 | u16 dateStamp = ctrl_inw(FPGA_FPDATER); | ||
88 | |||
89 | printk(KERN_INFO "Renesas Technology Europe SDK7780 support.\n"); | ||
90 | printk(KERN_INFO "Board version: %d (revision %d), " | ||
91 | "FPGA version: %d (revision %d), datestamp : %d\n", | ||
92 | (ver >> 12) & 0xf, (ver >> 8) & 0xf, | ||
93 | (ver >> 4) & 0xf, ver & 0xf, | ||
94 | dateStamp); | ||
95 | |||
96 | /* Setup pin mux'ing for PCIC */ | ||
97 | ctrl_outw(0x0000, GPIO_PECR); | ||
98 | } | ||
99 | |||
100 | /* | ||
101 | * The Machine Vector | ||
102 | */ | ||
103 | static struct sh_machine_vector mv_se7780 __initmv = { | ||
104 | .mv_name = "Renesas SDK7780-R3" , | ||
105 | .mv_setup = sdk7780_setup, | ||
106 | .mv_nr_irqs = 111, | ||
107 | .mv_init_irq = init_sdk7780_IRQ, | ||
108 | }; | ||
109 | |||
diff --git a/arch/sh/boot/Makefile b/arch/sh/boot/Makefile index 1b0f5be01d10..59f552c13349 100644 --- a/arch/sh/boot/Makefile +++ b/arch/sh/boot/Makefile | |||
@@ -35,17 +35,28 @@ $(obj)/compressed/vmlinux: FORCE | |||
35 | KERNEL_LOAD := $(shell /bin/bash -c 'printf "0x%8x" \ | 35 | KERNEL_LOAD := $(shell /bin/bash -c 'printf "0x%8x" \ |
36 | $$[$(CONFIG_PAGE_OFFSET) + \ | 36 | $$[$(CONFIG_PAGE_OFFSET) + \ |
37 | $(CONFIG_MEMORY_START) + \ | 37 | $(CONFIG_MEMORY_START) + \ |
38 | $(CONFIG_ZERO_PAGE_OFFSET)]') | ||
39 | |||
40 | KERNEL_ENTRY := $(shell /bin/bash -c 'printf "0x%8x" \ | ||
41 | $$[$(CONFIG_PAGE_OFFSET) + \ | ||
42 | $(CONFIG_MEMORY_START) + \ | ||
38 | $(CONFIG_ZERO_PAGE_OFFSET)+0x1000]') | 43 | $(CONFIG_ZERO_PAGE_OFFSET)+0x1000]') |
39 | 44 | ||
40 | quiet_cmd_uimage = UIMAGE $@ | 45 | quiet_cmd_uimage = UIMAGE $@ |
41 | cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A sh -O linux -T kernel \ | 46 | cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A sh -O linux -T kernel \ |
42 | -C none -a $(KERNEL_LOAD) -e $(KERNEL_LOAD) \ | 47 | -C none -a $(KERNEL_LOAD) -e $(KERNEL_ENTRY) \ |
43 | -n 'Linux-$(KERNELRELEASE)' -d $< $@ | 48 | -n 'Linux-$(KERNELRELEASE)' -d $< $@ |
44 | 49 | ||
45 | $(obj)/uImage: $(obj)/zImage FORCE | 50 | $(obj)/uImage: $(obj)/vmlinux.bin.gz FORCE |
46 | $(call if_changed,uimage) | 51 | $(call if_changed,uimage) |
47 | @echo ' Image $@ is ready' | 52 | @echo ' Image $@ is ready' |
48 | 53 | ||
54 | $(obj)/vmlinux.bin: vmlinux FORCE | ||
55 | $(call if_changed,objcopy) | ||
56 | |||
57 | $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE | ||
58 | $(call if_changed,gzip) | ||
59 | |||
49 | OBJCOPYFLAGS_vmlinux.srec := -I binary -O srec | 60 | OBJCOPYFLAGS_vmlinux.srec := -I binary -O srec |
50 | $(obj)/vmlinux.srec: $(obj)/compressed/vmlinux | 61 | $(obj)/vmlinux.srec: $(obj)/compressed/vmlinux |
51 | $(call if_changed,objcopy) | 62 | $(call if_changed,objcopy) |
@@ -54,4 +65,5 @@ OBJCOPYFLAGS_uImage.srec := -I binary -O srec | |||
54 | $(obj)/uImage.srec: $(obj)/uImage | 65 | $(obj)/uImage.srec: $(obj)/uImage |
55 | $(call if_changed,objcopy) | 66 | $(call if_changed,objcopy) |
56 | 67 | ||
57 | clean-files += uImage uImage.srec vmlinux.srec | 68 | clean-files += uImage uImage.srec vmlinux.srec \ |
69 | vmlinux.bin vmlinux.bin.gz | ||
diff --git a/arch/sh/boot/compressed/Makefile b/arch/sh/boot/compressed/Makefile index 906a13f82fe0..efb01dc3c8c3 100644 --- a/arch/sh/boot/compressed/Makefile +++ b/arch/sh/boot/compressed/Makefile | |||
@@ -1,43 +1,5 @@ | |||
1 | # | 1 | ifeq ($(CONFIG_SUPERH32),y) |
2 | # linux/arch/sh/boot/compressed/Makefile | 2 | include ${srctree}/arch/sh/boot/compressed/Makefile_32 |
3 | # | 3 | else |
4 | # create a compressed vmlinux image from the original vmlinux | 4 | include ${srctree}/arch/sh/boot/compressed/Makefile_64 |
5 | # | ||
6 | |||
7 | targets := vmlinux vmlinux.bin vmlinux.bin.gz head.o misc.o piggy.o | ||
8 | EXTRA_AFLAGS := -traditional | ||
9 | |||
10 | OBJECTS = $(obj)/head.o $(obj)/misc.o | ||
11 | |||
12 | ifdef CONFIG_SH_STANDARD_BIOS | ||
13 | OBJECTS += $(obj)/../../kernel/sh_bios.o | ||
14 | endif | 5 | endif |
15 | |||
16 | # | ||
17 | # IMAGE_OFFSET is the load offset of the compression loader | ||
18 | # | ||
19 | IMAGE_OFFSET := $(shell /bin/bash -c 'printf "0x%08x" \ | ||
20 | $$[$(CONFIG_PAGE_OFFSET) + \ | ||
21 | $(CONFIG_MEMORY_START) + \ | ||
22 | $(CONFIG_BOOT_LINK_OFFSET)]') | ||
23 | |||
24 | LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) | ||
25 | |||
26 | LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -e startup -T $(obj)/../../kernel/vmlinux.lds | ||
27 | |||
28 | |||
29 | $(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o $(LIBGCC) FORCE | ||
30 | $(call if_changed,ld) | ||
31 | @: | ||
32 | |||
33 | $(obj)/vmlinux.bin: vmlinux FORCE | ||
34 | $(call if_changed,objcopy) | ||
35 | |||
36 | $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE | ||
37 | $(call if_changed,gzip) | ||
38 | |||
39 | LDFLAGS_piggy.o := -r --format binary --oformat elf32-sh-linux -T | ||
40 | OBJCOPYFLAGS += -R .empty_zero_page | ||
41 | |||
42 | $(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.gz FORCE | ||
43 | $(call if_changed,ld) | ||
diff --git a/arch/sh/boot/compressed/Makefile_32 b/arch/sh/boot/compressed/Makefile_32 new file mode 100644 index 000000000000..6ac8d4a4ed1d --- /dev/null +++ b/arch/sh/boot/compressed/Makefile_32 | |||
@@ -0,0 +1,43 @@ | |||
1 | # | ||
2 | # linux/arch/sh/boot/compressed/Makefile | ||
3 | # | ||
4 | # create a compressed vmlinux image from the original vmlinux | ||
5 | # | ||
6 | |||
7 | targets := vmlinux vmlinux.bin vmlinux.bin.gz \ | ||
8 | head_32.o misc_32.o piggy.o | ||
9 | EXTRA_AFLAGS := -traditional | ||
10 | |||
11 | OBJECTS = $(obj)/head_32.o $(obj)/misc_32.o | ||
12 | |||
13 | ifdef CONFIG_SH_STANDARD_BIOS | ||
14 | OBJECTS += $(obj)/../../kernel/sh_bios.o | ||
15 | endif | ||
16 | |||
17 | # | ||
18 | # IMAGE_OFFSET is the load offset of the compression loader | ||
19 | # | ||
20 | IMAGE_OFFSET := $(shell /bin/bash -c 'printf "0x%08x" \ | ||
21 | $$[$(CONFIG_PAGE_OFFSET) + \ | ||
22 | $(CONFIG_MEMORY_START) + \ | ||
23 | $(CONFIG_BOOT_LINK_OFFSET)]') | ||
24 | |||
25 | LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) | ||
26 | |||
27 | LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -e startup -T $(obj)/../../kernel/vmlinux.lds | ||
28 | |||
29 | $(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o $(LIBGCC) FORCE | ||
30 | $(call if_changed,ld) | ||
31 | @: | ||
32 | |||
33 | $(obj)/vmlinux.bin: vmlinux FORCE | ||
34 | $(call if_changed,objcopy) | ||
35 | |||
36 | $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE | ||
37 | $(call if_changed,gzip) | ||
38 | |||
39 | LDFLAGS_piggy.o := -r --format binary --oformat elf32-sh-linux -T | ||
40 | OBJCOPYFLAGS += -R .empty_zero_page | ||
41 | |||
42 | $(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.gz FORCE | ||
43 | $(call if_changed,ld) | ||
diff --git a/arch/sh64/boot/compressed/Makefile b/arch/sh/boot/compressed/Makefile_64 index 9cd216718856..4334f2b86d8f 100644 --- a/arch/sh64/boot/compressed/Makefile +++ b/arch/sh/boot/compressed/Makefile_64 | |||
@@ -1,32 +1,32 @@ | |||
1 | # | 1 | # |
2 | # linux/arch/sh64/boot/compressed/Makefile | 2 | # arch/sh/boot/compressed/Makefile_64 |
3 | # | 3 | # |
4 | # This file is subject to the terms and conditions of the GNU General Public | 4 | # create a compressed vmlinux image from the original vmlinux |
5 | # License. See the file "COPYING" in the main directory of this archive | ||
6 | # for more details. | ||
7 | # | 5 | # |
8 | # Copyright (C) 2002 Stuart Menefy | 6 | # Copyright (C) 2002 Stuart Menefy |
9 | # Copyright (C) 2004 Paul Mundt | 7 | # Copyright (C) 2004 Paul Mundt |
10 | # | 8 | # |
11 | # create a compressed vmlinux image from the original vmlinux | 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 | # | 12 | # |
13 | 13 | ||
14 | targets := vmlinux vmlinux.bin vmlinux.bin.gz \ | 14 | targets := vmlinux vmlinux.bin vmlinux.bin.gz \ |
15 | head.o misc.o cache.o piggy.o vmlinux.lds | 15 | head_64.o misc_64.o cache.o piggy.o |
16 | |||
17 | EXTRA_AFLAGS := -traditional | 16 | EXTRA_AFLAGS := -traditional |
18 | 17 | ||
19 | OBJECTS := $(obj)/head.o $(obj)/misc.o $(obj)/cache.o | 18 | OBJECTS := $(obj)/vmlinux_64.lds $(obj)/head_64.o $(obj)/misc_64.o \ |
19 | $(obj)/cache.o | ||
20 | 20 | ||
21 | # | 21 | # |
22 | # ZIMAGE_OFFSET is the load offset of the compression loader | 22 | # ZIMAGE_OFFSET is the load offset of the compression loader |
23 | # (4M for the kernel plus 64K for this loader) | 23 | # (4M for the kernel plus 64K for this loader) |
24 | # | 24 | # |
25 | ZIMAGE_OFFSET = $(shell printf "0x%8x" $$[$(CONFIG_MEMORY_START)+0x400000+0x10000]) | 25 | ZIMAGE_OFFSET := $(shell /bin/bash -c 'printf "0x%08x" \ |
26 | $$[$(CONFIG_PAGE_OFFSET)+0x400000+0x10000]') | ||
26 | 27 | ||
27 | LDFLAGS_vmlinux := -Ttext $(ZIMAGE_OFFSET) -e startup \ | 28 | LDFLAGS_vmlinux := -Ttext $(ZIMAGE_OFFSET) -e startup \ |
28 | -T $(obj)/../../kernel/vmlinux.lds \ | 29 | -T $(obj)/../../kernel/vmlinux.lds |
29 | --no-warn-mismatch | ||
30 | 30 | ||
31 | $(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o FORCE | 31 | $(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o FORCE |
32 | $(call if_changed,ld) | 32 | $(call if_changed,ld) |
@@ -41,6 +41,5 @@ $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE | |||
41 | LDFLAGS_piggy.o := -r --format binary --oformat elf32-sh64-linux -T | 41 | LDFLAGS_piggy.o := -r --format binary --oformat elf32-sh64-linux -T |
42 | OBJCOPYFLAGS += -R .empty_zero_page | 42 | OBJCOPYFLAGS += -R .empty_zero_page |
43 | 43 | ||
44 | $(obj)/piggy.o: $(obj)/vmlinux.lds $(obj)/vmlinux.bin.gz FORCE | 44 | $(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.gz FORCE |
45 | $(call if_changed,ld) | 45 | $(call if_changed,ld) |
46 | |||
diff --git a/arch/sh/boot/compressed/cache.c b/arch/sh/boot/compressed/cache.c new file mode 100644 index 000000000000..e27fc74f228c --- /dev/null +++ b/arch/sh/boot/compressed/cache.c | |||
@@ -0,0 +1,12 @@ | |||
1 | int cache_control(unsigned int command) | ||
2 | { | ||
3 | volatile unsigned int *p = (volatile unsigned int *) 0x80000000; | ||
4 | int i; | ||
5 | |||
6 | for (i = 0; i < (32 * 1024); i += 32) { | ||
7 | (void)*p; | ||
8 | p += (32 / sizeof (int)); | ||
9 | } | ||
10 | |||
11 | return 0; | ||
12 | } | ||
diff --git a/arch/sh/boot/compressed/head.S b/arch/sh/boot/compressed/head_32.S index a8399b013729..a8399b013729 100644 --- a/arch/sh/boot/compressed/head.S +++ b/arch/sh/boot/compressed/head_32.S | |||
diff --git a/arch/sh64/boot/compressed/head.S b/arch/sh/boot/compressed/head_64.S index 82040b1a29cf..1d4ecbfc767c 100644 --- a/arch/sh64/boot/compressed/head.S +++ b/arch/sh/boot/compressed/head_64.S | |||
@@ -13,11 +13,10 @@ | |||
13 | * Modification for compressed loader: | 13 | * Modification for compressed loader: |
14 | * Copyright (C) 2002 Stuart Menefy (stuart.menefy@st.com) | 14 | * Copyright (C) 2002 Stuart Menefy (stuart.menefy@st.com) |
15 | */ | 15 | */ |
16 | |||
17 | #include <linux/linkage.h> | 16 | #include <linux/linkage.h> |
18 | #include <asm/registers.h> | ||
19 | #include <asm/cache.h> | 17 | #include <asm/cache.h> |
20 | #include <asm/mmu_context.h> | 18 | #include <asm/cpu/mmu_context.h> |
19 | #include <asm/cpu/registers.h> | ||
21 | 20 | ||
22 | /* | 21 | /* |
23 | * Fixed TLB entries to identity map the beginning of RAM | 22 | * Fixed TLB entries to identity map the beginning of RAM |
@@ -51,14 +50,14 @@ startup: | |||
51 | * uninitialized target registers. | 50 | * uninitialized target registers. |
52 | * This must be executed before the first branch. | 51 | * This must be executed before the first branch. |
53 | */ | 52 | */ |
54 | ptabs/u ZERO, tr0 | 53 | ptabs/u r63, tr0 |
55 | ptabs/u ZERO, tr1 | 54 | ptabs/u r63, tr1 |
56 | ptabs/u ZERO, tr2 | 55 | ptabs/u r63, tr2 |
57 | ptabs/u ZERO, tr3 | 56 | ptabs/u r63, tr3 |
58 | ptabs/u ZERO, tr4 | 57 | ptabs/u r63, tr4 |
59 | ptabs/u ZERO, tr5 | 58 | ptabs/u r63, tr5 |
60 | ptabs/u ZERO, tr6 | 59 | ptabs/u r63, tr6 |
61 | ptabs/u ZERO, tr7 | 60 | ptabs/u r63, tr7 |
62 | synci | 61 | synci |
63 | 62 | ||
64 | /* | 63 | /* |
@@ -69,7 +68,7 @@ startup: | |||
69 | pta 1f, tr1 | 68 | pta 1f, tr1 |
70 | movi ITLB_FIXED, r21 | 69 | movi ITLB_FIXED, r21 |
71 | movi ITLB_LAST_VAR_UNRESTRICTED+TLB_STEP, r22 | 70 | movi ITLB_LAST_VAR_UNRESTRICTED+TLB_STEP, r22 |
72 | 1: putcfg r21, 0, ZERO /* Clear MMUIR[n].PTEH.V */ | 71 | 1: putcfg r21, 0, r63 /* Clear MMUIR[n].PTEH.V */ |
73 | addi r21, TLB_STEP, r21 | 72 | addi r21, TLB_STEP, r21 |
74 | bne r21, r22, tr1 | 73 | bne r21, r22, tr1 |
75 | 74 | ||
@@ -77,7 +76,7 @@ startup: | |||
77 | pta 1f, tr1 | 76 | pta 1f, tr1 |
78 | movi DTLB_FIXED, r21 | 77 | movi DTLB_FIXED, r21 |
79 | movi DTLB_LAST_VAR_UNRESTRICTED+TLB_STEP, r22 | 78 | movi DTLB_LAST_VAR_UNRESTRICTED+TLB_STEP, r22 |
80 | 1: putcfg r21, 0, ZERO /* Clear MMUDR[n].PTEH.V */ | 79 | 1: putcfg r21, 0, r63 /* Clear MMUDR[n].PTEH.V */ |
81 | addi r21, TLB_STEP, r21 | 80 | addi r21, TLB_STEP, r21 |
82 | bne r21, r22, tr1 | 81 | bne r21, r22, tr1 |
83 | 82 | ||
@@ -133,7 +132,7 @@ startup: | |||
133 | pt 1f, tr1 | 132 | pt 1f, tr1 |
134 | movi datalabel __bss_start, r22 | 133 | movi datalabel __bss_start, r22 |
135 | movi datalabel _end, r23 | 134 | movi datalabel _end, r23 |
136 | 1: st.l r22, 0, ZERO | 135 | 1: st.l r22, 0, r63 |
137 | addi r22, 4, r22 | 136 | addi r22, 4, r22 |
138 | bne r22, r23, tr1 | 137 | bne r22, r23, tr1 |
139 | 138 | ||
@@ -161,4 +160,4 @@ startup: | |||
161 | 160 | ||
162 | /* Shouldn't return here, but just in case, loop forever */ | 161 | /* Shouldn't return here, but just in case, loop forever */ |
163 | pt 1f, tr0 | 162 | pt 1f, tr0 |
164 | 1: blink tr0, ZERO | 163 | 1: blink tr0, r63 |
diff --git a/arch/sh/boot/compressed/misc.c b/arch/sh/boot/compressed/misc_32.c index df65e305acf7..adcea31e663e 100644 --- a/arch/sh/boot/compressed/misc.c +++ b/arch/sh/boot/compressed/misc_32.c | |||
@@ -230,7 +230,10 @@ long* stack_start = &user_stack[STACK_SIZE]; | |||
230 | void decompress_kernel(void) | 230 | void decompress_kernel(void) |
231 | { | 231 | { |
232 | output_data = 0; | 232 | output_data = 0; |
233 | output_ptr = P2SEGADDR((unsigned long)&_text+PAGE_SIZE); | 233 | output_ptr = PHYSADDR((unsigned long)&_text+PAGE_SIZE); |
234 | #ifdef CONFIG_29BIT | ||
235 | output_ptr |= P2SEG; | ||
236 | #endif | ||
234 | free_mem_ptr = (unsigned long)&_end; | 237 | free_mem_ptr = (unsigned long)&_end; |
235 | free_mem_end_ptr = free_mem_ptr + HEAP_SIZE; | 238 | free_mem_end_ptr = free_mem_ptr + HEAP_SIZE; |
236 | 239 | ||
diff --git a/arch/sh64/boot/compressed/misc.c b/arch/sh/boot/compressed/misc_64.c index aea00c53ce29..a006ef89b9dd 100644 --- a/arch/sh64/boot/compressed/misc.c +++ b/arch/sh/boot/compressed/misc_64.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * arch/sh64/boot/compressed/misc.c | 2 | * arch/sh/boot/compressed/misc_64.c |
3 | * | 3 | * |
4 | * This is a collection of several routines from gzip-1.0.3 | 4 | * This is a collection of several routines from gzip-1.0.3 |
5 | * adapted for Linux. | 5 | * adapted for Linux. |
diff --git a/arch/sh64/boot/compressed/vmlinux.lds.S b/arch/sh/boot/compressed/vmlinux_64.lds index 59c2ef4aeda5..59c2ef4aeda5 100644 --- a/arch/sh64/boot/compressed/vmlinux.lds.S +++ b/arch/sh/boot/compressed/vmlinux_64.lds | |||
diff --git a/arch/sh/cchips/voyagergx/Makefile b/arch/sh/cchips/voyagergx/Makefile deleted file mode 100644 index f73963cb3744..000000000000 --- a/arch/sh/cchips/voyagergx/Makefile +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | # | ||
2 | # Makefile for VoyagerGX | ||
3 | # | ||
4 | |||
5 | obj-y := irq.o setup.o | ||
6 | |||
7 | obj-$(CONFIG_USB_OHCI_HCD) += consistent.o | ||
8 | |||
9 | EXTRA_CFLAGS += -Werror | ||
diff --git a/arch/sh/cchips/voyagergx/consistent.c b/arch/sh/cchips/voyagergx/consistent.c deleted file mode 100644 index 07e8b9c5a531..000000000000 --- a/arch/sh/cchips/voyagergx/consistent.c +++ /dev/null | |||
@@ -1,121 +0,0 @@ | |||
1 | /* | ||
2 | * arch/sh/cchips/voyagergx/consistent.c | ||
3 | * | ||
4 | * Copyright (C) 2004 Paul Mundt | ||
5 | * | ||
6 | * This file is subject to the terms and conditions of the GNU General Public | ||
7 | * License. See the file "COPYING" in the main directory of this archive | ||
8 | * for more details. | ||
9 | */ | ||
10 | #include <linux/mm.h> | ||
11 | #include <linux/dma-mapping.h> | ||
12 | #include <linux/slab.h> | ||
13 | #include <linux/list.h> | ||
14 | #include <linux/types.h> | ||
15 | #include <linux/module.h> | ||
16 | #include <linux/device.h> | ||
17 | #include <asm/io.h> | ||
18 | |||
19 | |||
20 | struct voya_alloc_entry { | ||
21 | struct list_head list; | ||
22 | unsigned long ofs; | ||
23 | unsigned long len; | ||
24 | }; | ||
25 | |||
26 | static DEFINE_SPINLOCK(voya_list_lock); | ||
27 | static LIST_HEAD(voya_alloc_list); | ||
28 | |||
29 | #define OHCI_SRAM_START 0xb0000000 | ||
30 | #define OHCI_HCCA_SIZE 0x100 | ||
31 | #define OHCI_SRAM_SIZE 0x10000 | ||
32 | |||
33 | #define VOYAGER_OHCI_NAME "voyager-ohci" | ||
34 | |||
35 | void *voyagergx_consistent_alloc(struct device *dev, size_t size, | ||
36 | dma_addr_t *handle, gfp_t flag) | ||
37 | { | ||
38 | struct list_head *list = &voya_alloc_list; | ||
39 | struct voya_alloc_entry *entry; | ||
40 | unsigned long start, end; | ||
41 | unsigned long flags; | ||
42 | |||
43 | /* | ||
44 | * The SM501 contains an integrated 8051 with its own SRAM. | ||
45 | * Devices within the cchip can all hook into the 8051 SRAM. | ||
46 | * We presently use this for the OHCI. | ||
47 | * | ||
48 | * Everything else goes through consistent_alloc(). | ||
49 | */ | ||
50 | if (!dev || strcmp(dev->driver->name, VOYAGER_OHCI_NAME)) | ||
51 | return NULL; | ||
52 | |||
53 | start = OHCI_SRAM_START + OHCI_HCCA_SIZE; | ||
54 | |||
55 | entry = kmalloc(sizeof(struct voya_alloc_entry), GFP_ATOMIC); | ||
56 | if (!entry) | ||
57 | return ERR_PTR(-ENOMEM); | ||
58 | |||
59 | entry->len = (size + 15) & ~15; | ||
60 | |||
61 | /* | ||
62 | * The basis for this allocator is dwmw2's malloc.. the | ||
63 | * Matrox allocator :-) | ||
64 | */ | ||
65 | spin_lock_irqsave(&voya_list_lock, flags); | ||
66 | list_for_each(list, &voya_alloc_list) { | ||
67 | struct voya_alloc_entry *p; | ||
68 | |||
69 | p = list_entry(list, struct voya_alloc_entry, list); | ||
70 | |||
71 | if (p->ofs - start >= size) | ||
72 | goto out; | ||
73 | |||
74 | start = p->ofs + p->len; | ||
75 | } | ||
76 | |||
77 | end = start + (OHCI_SRAM_SIZE - OHCI_HCCA_SIZE); | ||
78 | list = &voya_alloc_list; | ||
79 | |||
80 | if (end - start >= size) { | ||
81 | out: | ||
82 | entry->ofs = start; | ||
83 | list_add_tail(&entry->list, list); | ||
84 | spin_unlock_irqrestore(&voya_list_lock, flags); | ||
85 | |||
86 | *handle = start; | ||
87 | return (void *)start; | ||
88 | } | ||
89 | |||
90 | kfree(entry); | ||
91 | spin_unlock_irqrestore(&voya_list_lock, flags); | ||
92 | |||
93 | return ERR_PTR(-EINVAL); | ||
94 | } | ||
95 | |||
96 | int voyagergx_consistent_free(struct device *dev, size_t size, | ||
97 | void *vaddr, dma_addr_t handle) | ||
98 | { | ||
99 | struct voya_alloc_entry *entry; | ||
100 | unsigned long flags; | ||
101 | |||
102 | if (!dev || strcmp(dev->driver->name, VOYAGER_OHCI_NAME)) | ||
103 | return -EINVAL; | ||
104 | |||
105 | spin_lock_irqsave(&voya_list_lock, flags); | ||
106 | list_for_each_entry(entry, &voya_alloc_list, list) { | ||
107 | if (entry->ofs != handle) | ||
108 | continue; | ||
109 | |||
110 | list_del(&entry->list); | ||
111 | kfree(entry); | ||
112 | |||
113 | break; | ||
114 | } | ||
115 | spin_unlock_irqrestore(&voya_list_lock, flags); | ||
116 | |||
117 | return 0; | ||
118 | } | ||
119 | |||
120 | EXPORT_SYMBOL(voyagergx_consistent_alloc); | ||
121 | EXPORT_SYMBOL(voyagergx_consistent_free); | ||
diff --git a/arch/sh/cchips/voyagergx/irq.c b/arch/sh/cchips/voyagergx/irq.c deleted file mode 100644 index ade303876841..000000000000 --- a/arch/sh/cchips/voyagergx/irq.c +++ /dev/null | |||
@@ -1,101 +0,0 @@ | |||
1 | /* -------------------------------------------------------------------- */ | ||
2 | /* setup_voyagergx.c: */ | ||
3 | /* -------------------------------------------------------------------- */ | ||
4 | /* This program is free software; you can redistribute it and/or modify | ||
5 | it under the terms of the GNU General Public License as published by | ||
6 | the Free Software Foundation; either version 2 of the License, or | ||
7 | (at your option) any later version. | ||
8 | |||
9 | This program is distributed in the hope that it will be useful, | ||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | GNU General Public License for more details. | ||
13 | |||
14 | You should have received a copy of the GNU General Public License | ||
15 | along with this program; if not, write to the Free Software | ||
16 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
17 | |||
18 | Copyright 2003 (c) Lineo uSolutions,Inc. | ||
19 | */ | ||
20 | #include <linux/interrupt.h> | ||
21 | #include <linux/init.h> | ||
22 | #include <linux/io.h> | ||
23 | #include <asm/voyagergx.h> | ||
24 | #include <asm/rts7751r2d.h> | ||
25 | |||
26 | enum { | ||
27 | UNUSED = 0, | ||
28 | |||
29 | /* voyager specific interrupt sources */ | ||
30 | UP, G54, G53, G52, G51, G50, G49, G48, | ||
31 | I2C, PW, DMA, PCI, I2S, AC, US, | ||
32 | U1, U0, CV, MC, S1, S0, | ||
33 | UH, TWOD, ZD, PV, CI, | ||
34 | }; | ||
35 | |||
36 | static struct intc_vect vectors[] __initdata = { | ||
37 | INTC_IRQ(UP, IRQ_SM501_UP), INTC_IRQ(G54, IRQ_SM501_G54), | ||
38 | INTC_IRQ(G53, IRQ_SM501_G53), INTC_IRQ(G52, IRQ_SM501_G52), | ||
39 | INTC_IRQ(G51, IRQ_SM501_G51), INTC_IRQ(G50, IRQ_SM501_G50), | ||
40 | INTC_IRQ(G49, IRQ_SM501_G49), INTC_IRQ(G48, IRQ_SM501_G48), | ||
41 | INTC_IRQ(I2C, IRQ_SM501_I2C), INTC_IRQ(PW, IRQ_SM501_PW), | ||
42 | INTC_IRQ(DMA, IRQ_SM501_DMA), INTC_IRQ(PCI, IRQ_SM501_PCI), | ||
43 | INTC_IRQ(I2S, IRQ_SM501_I2S), INTC_IRQ(AC, IRQ_SM501_AC), | ||
44 | INTC_IRQ(US, IRQ_SM501_US), INTC_IRQ(U1, IRQ_SM501_U1), | ||
45 | INTC_IRQ(U0, IRQ_SM501_U0), INTC_IRQ(CV, IRQ_SM501_CV), | ||
46 | INTC_IRQ(MC, IRQ_SM501_MC), INTC_IRQ(S1, IRQ_SM501_S1), | ||
47 | INTC_IRQ(S0, IRQ_SM501_S0), INTC_IRQ(UH, IRQ_SM501_UH), | ||
48 | INTC_IRQ(TWOD, IRQ_SM501_2D), INTC_IRQ(ZD, IRQ_SM501_ZD), | ||
49 | INTC_IRQ(PV, IRQ_SM501_PV), INTC_IRQ(CI, IRQ_SM501_CI), | ||
50 | }; | ||
51 | |||
52 | static struct intc_mask_reg mask_registers[] __initdata = { | ||
53 | { VOYAGER_INT_MASK, 0, 32, /* "Interrupt Mask", MMIO_base + 0x30 */ | ||
54 | { UP, G54, G53, G52, G51, G50, G49, G48, | ||
55 | I2C, PW, 0, DMA, PCI, I2S, AC, US, | ||
56 | 0, 0, U1, U0, CV, MC, S1, S0, | ||
57 | 0, UH, 0, 0, TWOD, ZD, PV, CI } }, | ||
58 | }; | ||
59 | |||
60 | static DECLARE_INTC_DESC(intc_desc, "voyagergx", vectors, | ||
61 | NULL, NULL, mask_registers, NULL, NULL); | ||
62 | |||
63 | static unsigned int voyagergx_stat2irq[32] = { | ||
64 | IRQ_SM501_CI, IRQ_SM501_PV, IRQ_SM501_ZD, IRQ_SM501_2D, | ||
65 | 0, 0, IRQ_SM501_UH, 0, | ||
66 | IRQ_SM501_S0, IRQ_SM501_S1, IRQ_SM501_MC, IRQ_SM501_CV, | ||
67 | IRQ_SM501_U0, IRQ_SM501_U1, 0, 0, | ||
68 | IRQ_SM501_US, IRQ_SM501_AC, IRQ_SM501_I2S, IRQ_SM501_PCI, | ||
69 | IRQ_SM501_DMA, 0, IRQ_SM501_PW, IRQ_SM501_I2C, | ||
70 | IRQ_SM501_G48, IRQ_SM501_G49, IRQ_SM501_G50, IRQ_SM501_G51, | ||
71 | IRQ_SM501_G52, IRQ_SM501_G53, IRQ_SM501_G54, IRQ_SM501_UP | ||
72 | }; | ||
73 | |||
74 | static void voyagergx_irq_demux(unsigned int irq, struct irq_desc *desc) | ||
75 | { | ||
76 | unsigned long intv = ctrl_inl(INT_STATUS); | ||
77 | struct irq_desc *ext_desc; | ||
78 | unsigned int ext_irq; | ||
79 | unsigned int k = 0; | ||
80 | |||
81 | while (intv) { | ||
82 | ext_irq = voyagergx_stat2irq[k]; | ||
83 | if (ext_irq && (intv & 1)) { | ||
84 | ext_desc = irq_desc + ext_irq; | ||
85 | handle_level_irq(ext_irq, ext_desc); | ||
86 | } | ||
87 | intv >>= 1; | ||
88 | k++; | ||
89 | } | ||
90 | } | ||
91 | |||
92 | void __init setup_voyagergx_irq(void) | ||
93 | { | ||
94 | printk(KERN_INFO "VoyagerGX on irq %d (mapped into %d to %d)\n", | ||
95 | IRQ_VOYAGER, | ||
96 | VOYAGER_IRQ_BASE, | ||
97 | VOYAGER_IRQ_BASE + VOYAGER_IRQ_NUM - 1); | ||
98 | |||
99 | register_intc_controller(&intc_desc); | ||
100 | set_irq_chained_handler(IRQ_VOYAGER, voyagergx_irq_demux); | ||
101 | } | ||
diff --git a/arch/sh/cchips/voyagergx/setup.c b/arch/sh/cchips/voyagergx/setup.c deleted file mode 100644 index 33f03027c193..000000000000 --- a/arch/sh/cchips/voyagergx/setup.c +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | /* | ||
2 | * arch/sh/cchips/voyagergx/setup.c | ||
3 | * | ||
4 | * Setup routines for VoyagerGX cchip. | ||
5 | * | ||
6 | * Copyright (C) 2003 Lineo uSolutions, Inc. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License as published by the | ||
10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
11 | * option) any later version. | ||
12 | */ | ||
13 | #include <linux/init.h> | ||
14 | #include <linux/module.h> | ||
15 | #include <asm/io.h> | ||
16 | #include <asm/voyagergx.h> | ||
17 | |||
18 | static int __init setup_voyagergx(void) | ||
19 | { | ||
20 | unsigned long val; | ||
21 | |||
22 | val = readl((void __iomem *)DRAM_CTRL); | ||
23 | val |= (DRAM_CTRL_CPU_COLUMN_SIZE_256 | | ||
24 | DRAM_CTRL_CPU_ACTIVE_PRECHARGE | | ||
25 | DRAM_CTRL_CPU_RESET | | ||
26 | DRAM_CTRL_REFRESH_COMMAND | | ||
27 | DRAM_CTRL_BLOCK_WRITE_TIME | | ||
28 | DRAM_CTRL_BLOCK_WRITE_PRECHARGE | | ||
29 | DRAM_CTRL_ACTIVE_PRECHARGE | | ||
30 | DRAM_CTRL_RESET | | ||
31 | DRAM_CTRL_REMAIN_ACTIVE); | ||
32 | writel(val, (void __iomem *)DRAM_CTRL); | ||
33 | |||
34 | return 0; | ||
35 | } | ||
36 | |||
37 | module_init(setup_voyagergx); | ||
diff --git a/arch/sh64/configs/cayman_defconfig b/arch/sh/configs/cayman_defconfig index 75552bb01405..a05b278d72f5 100644 --- a/arch/sh64/configs/cayman_defconfig +++ b/arch/sh/configs/cayman_defconfig | |||
@@ -1,18 +1,22 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.24-rc1 | 3 | # Linux kernel version: 2.6.24-rc3 |
4 | # Fri Nov 2 14:35:27 2007 | 4 | # Fri Nov 23 14:15:55 2007 |
5 | # | 5 | # |
6 | CONFIG_SUPERH=y | 6 | CONFIG_SUPERH=y |
7 | # CONFIG_SUPERH32 is not set | ||
7 | CONFIG_SUPERH64=y | 8 | CONFIG_SUPERH64=y |
8 | CONFIG_MMU=y | ||
9 | CONFIG_QUICKLIST=y | ||
10 | CONFIG_RWSEM_GENERIC_SPINLOCK=y | 9 | CONFIG_RWSEM_GENERIC_SPINLOCK=y |
11 | CONFIG_GENERIC_FIND_NEXT_BIT=y | 10 | CONFIG_GENERIC_FIND_NEXT_BIT=y |
12 | CONFIG_GENERIC_HWEIGHT=y | 11 | CONFIG_GENERIC_HWEIGHT=y |
13 | CONFIG_GENERIC_CALIBRATE_DELAY=y | ||
14 | CONFIG_GENERIC_HARDIRQS=y | 12 | CONFIG_GENERIC_HARDIRQS=y |
15 | CONFIG_GENERIC_IRQ_PROBE=y | 13 | CONFIG_GENERIC_IRQ_PROBE=y |
14 | CONFIG_GENERIC_CALIBRATE_DELAY=y | ||
15 | # CONFIG_GENERIC_TIME is not set | ||
16 | # CONFIG_GENERIC_CLOCKEVENTS is not set | ||
17 | CONFIG_SYS_SUPPORTS_PCI=y | ||
18 | CONFIG_STACKTRACE_SUPPORT=y | ||
19 | CONFIG_LOCKDEP_SUPPORT=y | ||
16 | # CONFIG_ARCH_HAS_ILOG2_U32 is not set | 20 | # CONFIG_ARCH_HAS_ILOG2_U32 is not set |
17 | # CONFIG_ARCH_HAS_ILOG2_U64 is not set | 21 | # CONFIG_ARCH_HAS_ILOG2_U64 is not set |
18 | CONFIG_ARCH_NO_VIRT_TO_BUS=y | 22 | CONFIG_ARCH_NO_VIRT_TO_BUS=y |
@@ -33,6 +37,7 @@ CONFIG_POSIX_MQUEUE=y | |||
33 | # CONFIG_BSD_PROCESS_ACCT is not set | 37 | # CONFIG_BSD_PROCESS_ACCT is not set |
34 | # CONFIG_TASKSTATS is not set | 38 | # CONFIG_TASKSTATS is not set |
35 | # CONFIG_USER_NS is not set | 39 | # CONFIG_USER_NS is not set |
40 | # CONFIG_PID_NS is not set | ||
36 | # CONFIG_AUDIT is not set | 41 | # CONFIG_AUDIT is not set |
37 | # CONFIG_IKCONFIG is not set | 42 | # CONFIG_IKCONFIG is not set |
38 | CONFIG_LOG_BUF_SHIFT=14 | 43 | CONFIG_LOG_BUF_SHIFT=14 |
@@ -45,7 +50,7 @@ CONFIG_SYSFS_DEPRECATED=y | |||
45 | # CONFIG_BLK_DEV_INITRD is not set | 50 | # CONFIG_BLK_DEV_INITRD is not set |
46 | # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set | 51 | # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set |
47 | CONFIG_SYSCTL=y | 52 | CONFIG_SYSCTL=y |
48 | # CONFIG_EMBEDDED is not set | 53 | CONFIG_EMBEDDED=y |
49 | CONFIG_UID16=y | 54 | CONFIG_UID16=y |
50 | CONFIG_SYSCTL_SYSCALL=y | 55 | CONFIG_SYSCTL_SYSCALL=y |
51 | CONFIG_KALLSYMS=y | 56 | CONFIG_KALLSYMS=y |
@@ -97,73 +102,153 @@ CONFIG_DEFAULT_IOSCHED="cfq" | |||
97 | # | 102 | # |
98 | # System type | 103 | # System type |
99 | # | 104 | # |
100 | # CONFIG_SH_SIMULATOR is not set | ||
101 | CONFIG_SH_CAYMAN=y | ||
102 | # CONFIG_SH_HARP is not set | ||
103 | CONFIG_CPU_SH5=y | 105 | CONFIG_CPU_SH5=y |
106 | # CONFIG_CPU_SUBTYPE_SH7619 is not set | ||
107 | # CONFIG_CPU_SUBTYPE_SH7206 is not set | ||
108 | # CONFIG_CPU_SUBTYPE_SH7705 is not set | ||
109 | # CONFIG_CPU_SUBTYPE_SH7706 is not set | ||
110 | # CONFIG_CPU_SUBTYPE_SH7707 is not set | ||
111 | # CONFIG_CPU_SUBTYPE_SH7708 is not set | ||
112 | # CONFIG_CPU_SUBTYPE_SH7709 is not set | ||
113 | # CONFIG_CPU_SUBTYPE_SH7710 is not set | ||
114 | # CONFIG_CPU_SUBTYPE_SH7712 is not set | ||
115 | # CONFIG_CPU_SUBTYPE_SH7720 is not set | ||
116 | # CONFIG_CPU_SUBTYPE_SH7750 is not set | ||
117 | # CONFIG_CPU_SUBTYPE_SH7091 is not set | ||
118 | # CONFIG_CPU_SUBTYPE_SH7750R is not set | ||
119 | # CONFIG_CPU_SUBTYPE_SH7750S is not set | ||
120 | # CONFIG_CPU_SUBTYPE_SH7751 is not set | ||
121 | # CONFIG_CPU_SUBTYPE_SH7751R is not set | ||
122 | # CONFIG_CPU_SUBTYPE_SH7760 is not set | ||
123 | # CONFIG_CPU_SUBTYPE_SH4_202 is not set | ||
124 | # CONFIG_CPU_SUBTYPE_SH7770 is not set | ||
125 | # CONFIG_CPU_SUBTYPE_SH7780 is not set | ||
126 | # CONFIG_CPU_SUBTYPE_SH7785 is not set | ||
127 | # CONFIG_CPU_SUBTYPE_SHX3 is not set | ||
128 | # CONFIG_CPU_SUBTYPE_SH7343 is not set | ||
129 | # CONFIG_CPU_SUBTYPE_SH7722 is not set | ||
104 | CONFIG_CPU_SUBTYPE_SH5_101=y | 130 | CONFIG_CPU_SUBTYPE_SH5_101=y |
105 | # CONFIG_CPU_SUBTYPE_SH5_103 is not set | 131 | # CONFIG_CPU_SUBTYPE_SH5_103 is not set |
106 | CONFIG_LITTLE_ENDIAN=y | 132 | |
107 | # CONFIG_BIG_ENDIAN is not set | 133 | # |
108 | CONFIG_SH_FPU=y | 134 | # Memory management options |
109 | # CONFIG_SH64_FPU_DENORM_FLUSH is not set | 135 | # |
110 | CONFIG_SH64_PGTABLE_2_LEVEL=y | 136 | CONFIG_QUICKLIST=y |
111 | # CONFIG_SH64_PGTABLE_3_LEVEL is not set | 137 | CONFIG_MMU=y |
138 | CONFIG_PAGE_OFFSET=0x20000000 | ||
139 | CONFIG_MEMORY_START=0x80000000 | ||
140 | CONFIG_MEMORY_SIZE=0x00400000 | ||
141 | CONFIG_32BIT=y | ||
142 | CONFIG_ARCH_FLATMEM_ENABLE=y | ||
143 | CONFIG_ARCH_SPARSEMEM_ENABLE=y | ||
144 | CONFIG_ARCH_SPARSEMEM_DEFAULT=y | ||
145 | CONFIG_MAX_ACTIVE_REGIONS=1 | ||
146 | CONFIG_ARCH_POPULATES_NODE_MAP=y | ||
147 | CONFIG_ARCH_SELECT_MEMORY_MODEL=y | ||
148 | CONFIG_PAGE_SIZE_4KB=y | ||
149 | # CONFIG_PAGE_SIZE_8KB is not set | ||
150 | # CONFIG_PAGE_SIZE_64KB is not set | ||
112 | CONFIG_HUGETLB_PAGE_SIZE_64K=y | 151 | CONFIG_HUGETLB_PAGE_SIZE_64K=y |
152 | # CONFIG_HUGETLB_PAGE_SIZE_256K is not set | ||
113 | # CONFIG_HUGETLB_PAGE_SIZE_1MB is not set | 153 | # CONFIG_HUGETLB_PAGE_SIZE_1MB is not set |
154 | # CONFIG_HUGETLB_PAGE_SIZE_4MB is not set | ||
155 | # CONFIG_HUGETLB_PAGE_SIZE_64MB is not set | ||
114 | # CONFIG_HUGETLB_PAGE_SIZE_512MB is not set | 156 | # CONFIG_HUGETLB_PAGE_SIZE_512MB is not set |
157 | CONFIG_SELECT_MEMORY_MODEL=y | ||
158 | CONFIG_FLATMEM_MANUAL=y | ||
159 | # CONFIG_DISCONTIGMEM_MANUAL is not set | ||
160 | # CONFIG_SPARSEMEM_MANUAL is not set | ||
161 | CONFIG_FLATMEM=y | ||
162 | CONFIG_FLAT_NODE_MEM_MAP=y | ||
163 | CONFIG_SPARSEMEM_STATIC=y | ||
164 | # CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set | ||
165 | CONFIG_SPLIT_PTLOCK_CPUS=4 | ||
166 | CONFIG_RESOURCES_64BIT=y | ||
167 | CONFIG_ZONE_DMA_FLAG=0 | ||
168 | CONFIG_NR_QUICK=2 | ||
169 | |||
170 | # | ||
171 | # Cache configuration | ||
172 | # | ||
173 | # CONFIG_SH_DIRECT_MAPPED is not set | ||
174 | # CONFIG_CACHE_WRITEBACK is not set | ||
175 | # CONFIG_CACHE_WRITETHROUGH is not set | ||
176 | CONFIG_CACHE_OFF=y | ||
177 | |||
178 | # | ||
179 | # Processor features | ||
180 | # | ||
181 | CONFIG_CPU_LITTLE_ENDIAN=y | ||
182 | # CONFIG_CPU_BIG_ENDIAN is not set | ||
183 | CONFIG_SH_FPU=y | ||
184 | # CONFIG_SH64_FPU_DENORM_FLUSH is not set | ||
115 | CONFIG_SH64_USER_MISALIGNED_FIXUP=y | 185 | CONFIG_SH64_USER_MISALIGNED_FIXUP=y |
186 | CONFIG_SH64_ID2815_WORKAROUND=y | ||
187 | CONFIG_CPU_HAS_FPU=y | ||
116 | 188 | ||
117 | # | 189 | # |
118 | # Memory options | 190 | # Board support |
119 | # | 191 | # |
120 | CONFIG_CACHED_MEMORY_OFFSET=0x20000000 | 192 | CONFIG_SH_CAYMAN=y |
121 | CONFIG_MEMORY_START=0x80000000 | ||
122 | CONFIG_MEMORY_SIZE_IN_MB=128 | ||
123 | 193 | ||
124 | # | 194 | # |
125 | # Cache options | 195 | # Timer and clock configuration |
126 | # | 196 | # |
127 | CONFIG_DCACHE_WRITE_BACK=y | 197 | CONFIG_SH_TIMER_IRQ=16 |
128 | # CONFIG_DCACHE_WRITE_THROUGH is not set | 198 | CONFIG_SH_PCLK_FREQ=50000000 |
129 | # CONFIG_DCACHE_DISABLED is not set | 199 | # CONFIG_TICK_ONESHOT is not set |
130 | # CONFIG_ICACHE_DISABLED is not set | ||
131 | CONFIG_PCIDEVICE_MEMORY_START=C0000000 | ||
132 | CONFIG_DEVICE_MEMORY_START=E0000000 | ||
133 | CONFIG_FLASH_MEMORY_START=0x00000000 | ||
134 | CONFIG_PCI_BLOCK_START=0x40000000 | ||
135 | 200 | ||
136 | # | 201 | # |
137 | # CPU Subtype specific options | 202 | # CPU Frequency scaling |
203 | # | ||
204 | # CONFIG_CPU_FREQ is not set | ||
205 | |||
206 | # | ||
207 | # DMA support | ||
138 | # | 208 | # |
139 | CONFIG_SH64_ID2815_WORKAROUND=y | ||
140 | 209 | ||
141 | # | 210 | # |
142 | # Misc options | 211 | # Companion Chips |
212 | # | ||
213 | |||
214 | # | ||
215 | # Additional SuperH Device Drivers | ||
143 | # | 216 | # |
144 | CONFIG_HEARTBEAT=y | 217 | CONFIG_HEARTBEAT=y |
145 | CONFIG_HDSP253_LED=y | 218 | # CONFIG_PUSH_SWITCH is not set |
146 | # CONFIG_SH_DMA is not set | 219 | |
220 | # | ||
221 | # Kernel features | ||
222 | # | ||
223 | # CONFIG_HZ_100 is not set | ||
224 | CONFIG_HZ_250=y | ||
225 | # CONFIG_HZ_300 is not set | ||
226 | # CONFIG_HZ_1000 is not set | ||
227 | CONFIG_HZ=250 | ||
228 | # CONFIG_KEXEC is not set | ||
229 | # CONFIG_CRASH_DUMP is not set | ||
230 | # CONFIG_PREEMPT_NONE is not set | ||
231 | # CONFIG_PREEMPT_VOLUNTARY is not set | ||
147 | CONFIG_PREEMPT=y | 232 | CONFIG_PREEMPT=y |
148 | CONFIG_SELECT_MEMORY_MODEL=y | 233 | CONFIG_PREEMPT_BKL=y |
149 | CONFIG_FLATMEM_MANUAL=y | 234 | CONFIG_GUSA=y |
150 | # CONFIG_DISCONTIGMEM_MANUAL is not set | 235 | |
151 | # CONFIG_SPARSEMEM_MANUAL is not set | 236 | # |
152 | CONFIG_FLATMEM=y | 237 | # Boot options |
153 | CONFIG_FLAT_NODE_MEM_MAP=y | 238 | # |
154 | # CONFIG_SPARSEMEM_STATIC is not set | 239 | CONFIG_ZERO_PAGE_OFFSET=0x00001000 |
155 | # CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set | 240 | CONFIG_BOOT_LINK_OFFSET=0x00800000 |
156 | CONFIG_SPLIT_PTLOCK_CPUS=4 | 241 | # CONFIG_CMDLINE_BOOL is not set |
157 | # CONFIG_RESOURCES_64BIT is not set | ||
158 | CONFIG_ZONE_DMA_FLAG=0 | ||
159 | CONFIG_NR_QUICK=1 | ||
160 | 242 | ||
161 | # | 243 | # |
162 | # Bus options (PCI, PCMCIA, EISA, MCA, ISA) | 244 | # Bus options |
163 | # | 245 | # |
164 | CONFIG_PCI=y | 246 | CONFIG_PCI=y |
165 | CONFIG_SH_PCIDMA_NONCOHERENT=y | 247 | CONFIG_SH_PCIDMA_NONCOHERENT=y |
248 | CONFIG_PCI_AUTO=y | ||
249 | CONFIG_PCI_AUTO_UPDATE_RESOURCES=y | ||
166 | # CONFIG_ARCH_SUPPORTS_MSI is not set | 250 | # CONFIG_ARCH_SUPPORTS_MSI is not set |
251 | CONFIG_PCI_LEGACY=y | ||
167 | # CONFIG_PCI_DEBUG is not set | 252 | # CONFIG_PCI_DEBUG is not set |
168 | # CONFIG_PCCARD is not set | 253 | # CONFIG_PCCARD is not set |
169 | # CONFIG_HOTPLUG_PCI is not set | 254 | # CONFIG_HOTPLUG_PCI is not set |
@@ -354,11 +439,7 @@ CONFIG_SCSI_LOWLEVEL=y | |||
354 | # CONFIG_SCSI_INITIO is not set | 439 | # CONFIG_SCSI_INITIO is not set |
355 | # CONFIG_SCSI_INIA100 is not set | 440 | # CONFIG_SCSI_INIA100 is not set |
356 | # CONFIG_SCSI_STEX is not set | 441 | # CONFIG_SCSI_STEX is not set |
357 | CONFIG_SCSI_SYM53C8XX_2=y | 442 | # CONFIG_SCSI_SYM53C8XX_2 is not set |
358 | CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0 | ||
359 | CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 | ||
360 | CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 | ||
361 | CONFIG_SCSI_SYM53C8XX_MMIO=y | ||
362 | # CONFIG_SCSI_QLOGIC_1280 is not set | 443 | # CONFIG_SCSI_QLOGIC_1280 is not set |
363 | # CONFIG_SCSI_QLA_FC is not set | 444 | # CONFIG_SCSI_QLA_FC is not set |
364 | # CONFIG_SCSI_QLA_ISCSI is not set | 445 | # CONFIG_SCSI_QLA_ISCSI is not set |
@@ -391,6 +472,7 @@ CONFIG_NETDEVICES=y | |||
391 | # CONFIG_PHYLIB is not set | 472 | # CONFIG_PHYLIB is not set |
392 | CONFIG_NET_ETHERNET=y | 473 | CONFIG_NET_ETHERNET=y |
393 | # CONFIG_MII is not set | 474 | # CONFIG_MII is not set |
475 | # CONFIG_AX88796 is not set | ||
394 | # CONFIG_STNIC is not set | 476 | # CONFIG_STNIC is not set |
395 | # CONFIG_HAPPYMEAL is not set | 477 | # CONFIG_HAPPYMEAL is not set |
396 | # CONFIG_SUNGEM is not set | 478 | # CONFIG_SUNGEM is not set |
@@ -398,40 +480,14 @@ CONFIG_NET_ETHERNET=y | |||
398 | # CONFIG_NET_VENDOR_3COM is not set | 480 | # CONFIG_NET_VENDOR_3COM is not set |
399 | # CONFIG_SMC91X is not set | 481 | # CONFIG_SMC91X is not set |
400 | # CONFIG_SMC911X is not set | 482 | # CONFIG_SMC911X is not set |
401 | CONFIG_NET_TULIP=y | 483 | # CONFIG_NET_TULIP is not set |
402 | # CONFIG_DE2104X is not set | ||
403 | CONFIG_TULIP=y | ||
404 | # CONFIG_TULIP_MWI is not set | ||
405 | # CONFIG_TULIP_MMIO is not set | ||
406 | # CONFIG_TULIP_NAPI is not set | ||
407 | # CONFIG_DE4X5 is not set | ||
408 | # CONFIG_WINBOND_840 is not set | ||
409 | # CONFIG_DM9102 is not set | ||
410 | # CONFIG_ULI526X is not set | ||
411 | # CONFIG_HP100 is not set | 484 | # CONFIG_HP100 is not set |
412 | # CONFIG_IBM_NEW_EMAC_ZMII is not set | 485 | # CONFIG_IBM_NEW_EMAC_ZMII is not set |
413 | # CONFIG_IBM_NEW_EMAC_RGMII is not set | 486 | # CONFIG_IBM_NEW_EMAC_RGMII is not set |
414 | # CONFIG_IBM_NEW_EMAC_TAH is not set | 487 | # CONFIG_IBM_NEW_EMAC_TAH is not set |
415 | # CONFIG_IBM_NEW_EMAC_EMAC4 is not set | 488 | # CONFIG_IBM_NEW_EMAC_EMAC4 is not set |
416 | CONFIG_NET_PCI=y | 489 | # CONFIG_NET_PCI is not set |
417 | # CONFIG_PCNET32 is not set | ||
418 | # CONFIG_AMD8111_ETH is not set | ||
419 | # CONFIG_ADAPTEC_STARFIRE is not set | ||
420 | # CONFIG_B44 is not set | 490 | # CONFIG_B44 is not set |
421 | # CONFIG_FORCEDETH is not set | ||
422 | # CONFIG_EEPRO100 is not set | ||
423 | # CONFIG_E100 is not set | ||
424 | # CONFIG_FEALNX is not set | ||
425 | # CONFIG_NATSEMI is not set | ||
426 | # CONFIG_NE2K_PCI is not set | ||
427 | # CONFIG_8139CP is not set | ||
428 | # CONFIG_8139TOO is not set | ||
429 | # CONFIG_SIS900 is not set | ||
430 | # CONFIG_EPIC100 is not set | ||
431 | # CONFIG_SUNDANCE is not set | ||
432 | # CONFIG_TLAN is not set | ||
433 | # CONFIG_VIA_RHINE is not set | ||
434 | # CONFIG_SC92031 is not set | ||
435 | CONFIG_NETDEV_1000=y | 491 | CONFIG_NETDEV_1000=y |
436 | # CONFIG_ACENIC is not set | 492 | # CONFIG_ACENIC is not set |
437 | # CONFIG_DL2K is not set | 493 | # CONFIG_DL2K is not set |
@@ -492,7 +548,7 @@ CONFIG_INPUT=y | |||
492 | # Userland interfaces | 548 | # Userland interfaces |
493 | # | 549 | # |
494 | CONFIG_INPUT_MOUSEDEV=y | 550 | CONFIG_INPUT_MOUSEDEV=y |
495 | CONFIG_INPUT_MOUSEDEV_PSAUX=y | 551 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set |
496 | CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 | 552 | CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 |
497 | CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 | 553 | CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 |
498 | # CONFIG_INPUT_JOYDEV is not set | 554 | # CONFIG_INPUT_JOYDEV is not set |
@@ -502,24 +558,8 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 | |||
502 | # | 558 | # |
503 | # Input Device Drivers | 559 | # Input Device Drivers |
504 | # | 560 | # |
505 | CONFIG_INPUT_KEYBOARD=y | 561 | # CONFIG_INPUT_KEYBOARD is not set |
506 | CONFIG_KEYBOARD_ATKBD=y | 562 | # CONFIG_INPUT_MOUSE is not set |
507 | # CONFIG_KEYBOARD_SUNKBD is not set | ||
508 | # CONFIG_KEYBOARD_LKKBD is not set | ||
509 | # CONFIG_KEYBOARD_XTKBD is not set | ||
510 | # CONFIG_KEYBOARD_NEWTON is not set | ||
511 | # CONFIG_KEYBOARD_STOWAWAY is not set | ||
512 | CONFIG_INPUT_MOUSE=y | ||
513 | CONFIG_MOUSE_PS2=y | ||
514 | CONFIG_MOUSE_PS2_ALPS=y | ||
515 | CONFIG_MOUSE_PS2_LOGIPS2PP=y | ||
516 | CONFIG_MOUSE_PS2_SYNAPTICS=y | ||
517 | CONFIG_MOUSE_PS2_LIFEBOOK=y | ||
518 | CONFIG_MOUSE_PS2_TRACKPOINT=y | ||
519 | # CONFIG_MOUSE_PS2_TOUCHKIT is not set | ||
520 | # CONFIG_MOUSE_SERIAL is not set | ||
521 | # CONFIG_MOUSE_APPLETOUCH is not set | ||
522 | # CONFIG_MOUSE_VSXXXAA is not set | ||
523 | # CONFIG_INPUT_JOYSTICK is not set | 563 | # CONFIG_INPUT_JOYSTICK is not set |
524 | # CONFIG_INPUT_TABLET is not set | 564 | # CONFIG_INPUT_TABLET is not set |
525 | # CONFIG_INPUT_TOUCHSCREEN is not set | 565 | # CONFIG_INPUT_TOUCHSCREEN is not set |
@@ -528,12 +568,7 @@ CONFIG_MOUSE_PS2_TRACKPOINT=y | |||
528 | # | 568 | # |
529 | # Hardware I/O ports | 569 | # Hardware I/O ports |
530 | # | 570 | # |
531 | CONFIG_SERIO=y | 571 | # CONFIG_SERIO is not set |
532 | CONFIG_SERIO_I8042=y | ||
533 | CONFIG_SERIO_SERPORT=y | ||
534 | # CONFIG_SERIO_PCIPS2 is not set | ||
535 | CONFIG_SERIO_LIBPS2=y | ||
536 | # CONFIG_SERIO_RAW is not set | ||
537 | # CONFIG_GAMEPORT is not set | 572 | # CONFIG_GAMEPORT is not set |
538 | 573 | ||
539 | # | 574 | # |
@@ -553,11 +588,7 @@ CONFIG_HW_CONSOLE=y | |||
553 | # | 588 | # |
554 | # Non-8250 serial port support | 589 | # Non-8250 serial port support |
555 | # | 590 | # |
556 | CONFIG_SERIAL_SH_SCI=y | 591 | # CONFIG_SERIAL_SH_SCI is not set |
557 | CONFIG_SERIAL_SH_SCI_NR_UARTS=2 | ||
558 | CONFIG_SERIAL_SH_SCI_CONSOLE=y | ||
559 | CONFIG_SERIAL_CORE=y | ||
560 | CONFIG_SERIAL_CORE_CONSOLE=y | ||
561 | # CONFIG_SERIAL_JSM is not set | 592 | # CONFIG_SERIAL_JSM is not set |
562 | CONFIG_UNIX98_PTYS=y | 593 | CONFIG_UNIX98_PTYS=y |
563 | CONFIG_LEGACY_PTYS=y | 594 | CONFIG_LEGACY_PTYS=y |
@@ -642,6 +673,7 @@ CONFIG_HWMON=y | |||
642 | # CONFIG_SENSORS_ADT7470 is not set | 673 | # CONFIG_SENSORS_ADT7470 is not set |
643 | # CONFIG_SENSORS_ATXP1 is not set | 674 | # CONFIG_SENSORS_ATXP1 is not set |
644 | # CONFIG_SENSORS_DS1621 is not set | 675 | # CONFIG_SENSORS_DS1621 is not set |
676 | # CONFIG_SENSORS_I5K_AMB is not set | ||
645 | # CONFIG_SENSORS_F71805F is not set | 677 | # CONFIG_SENSORS_F71805F is not set |
646 | # CONFIG_SENSORS_F71882FG is not set | 678 | # CONFIG_SENSORS_F71882FG is not set |
647 | # CONFIG_SENSORS_F75375S is not set | 679 | # CONFIG_SENSORS_F75375S is not set |
@@ -832,9 +864,9 @@ CONFIG_VIDEO_OUTPUT_CONTROL=y | |||
832 | CONFIG_FB=y | 864 | CONFIG_FB=y |
833 | CONFIG_FIRMWARE_EDID=y | 865 | CONFIG_FIRMWARE_EDID=y |
834 | # CONFIG_FB_DDC is not set | 866 | # CONFIG_FB_DDC is not set |
835 | CONFIG_FB_CFB_FILLRECT=y | 867 | # CONFIG_FB_CFB_FILLRECT is not set |
836 | CONFIG_FB_CFB_COPYAREA=y | 868 | # CONFIG_FB_CFB_COPYAREA is not set |
837 | CONFIG_FB_CFB_IMAGEBLIT=y | 869 | # CONFIG_FB_CFB_IMAGEBLIT is not set |
838 | # CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set | 870 | # CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set |
839 | # CONFIG_FB_SYS_FILLRECT is not set | 871 | # CONFIG_FB_SYS_FILLRECT is not set |
840 | # CONFIG_FB_SYS_COPYAREA is not set | 872 | # CONFIG_FB_SYS_COPYAREA is not set |
@@ -866,7 +898,7 @@ CONFIG_FB_MODE_HELPERS=y | |||
866 | # CONFIG_FB_SAVAGE is not set | 898 | # CONFIG_FB_SAVAGE is not set |
867 | # CONFIG_FB_SIS is not set | 899 | # CONFIG_FB_SIS is not set |
868 | # CONFIG_FB_NEOMAGIC is not set | 900 | # CONFIG_FB_NEOMAGIC is not set |
869 | CONFIG_FB_KYRO=y | 901 | # CONFIG_FB_KYRO is not set |
870 | # CONFIG_FB_3DFX is not set | 902 | # CONFIG_FB_3DFX is not set |
871 | # CONFIG_FB_VOODOO1 is not set | 903 | # CONFIG_FB_VOODOO1 is not set |
872 | # CONFIG_FB_VT8623 is not set | 904 | # CONFIG_FB_VT8623 is not set |
@@ -1062,6 +1094,7 @@ CONFIG_INSTRUMENTATION=y | |||
1062 | # | 1094 | # |
1063 | # Kernel hacking | 1095 | # Kernel hacking |
1064 | # | 1096 | # |
1097 | CONFIG_TRACE_IRQFLAGS_SUPPORT=y | ||
1065 | # CONFIG_PRINTK_TIME is not set | 1098 | # CONFIG_PRINTK_TIME is not set |
1066 | CONFIG_ENABLE_WARN_DEPRECATED=y | 1099 | CONFIG_ENABLE_WARN_DEPRECATED=y |
1067 | CONFIG_ENABLE_MUST_CHECK=y | 1100 | CONFIG_ENABLE_MUST_CHECK=y |
@@ -1076,10 +1109,14 @@ CONFIG_SCHED_DEBUG=y | |||
1076 | CONFIG_SCHEDSTATS=y | 1109 | CONFIG_SCHEDSTATS=y |
1077 | # CONFIG_TIMER_STATS is not set | 1110 | # CONFIG_TIMER_STATS is not set |
1078 | # CONFIG_DEBUG_SLAB is not set | 1111 | # CONFIG_DEBUG_SLAB is not set |
1112 | CONFIG_DEBUG_PREEMPT=y | ||
1079 | # CONFIG_DEBUG_RT_MUTEXES is not set | 1113 | # CONFIG_DEBUG_RT_MUTEXES is not set |
1080 | # CONFIG_RT_MUTEX_TESTER is not set | 1114 | # CONFIG_RT_MUTEX_TESTER is not set |
1081 | # CONFIG_DEBUG_SPINLOCK is not set | 1115 | # CONFIG_DEBUG_SPINLOCK is not set |
1082 | # CONFIG_DEBUG_MUTEXES is not set | 1116 | # CONFIG_DEBUG_MUTEXES is not set |
1117 | # CONFIG_DEBUG_LOCK_ALLOC is not set | ||
1118 | # CONFIG_PROVE_LOCKING is not set | ||
1119 | # CONFIG_LOCK_STAT is not set | ||
1083 | # CONFIG_DEBUG_SPINLOCK_SLEEP is not set | 1120 | # CONFIG_DEBUG_SPINLOCK_SLEEP is not set |
1084 | # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set | 1121 | # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set |
1085 | # CONFIG_DEBUG_KOBJECT is not set | 1122 | # CONFIG_DEBUG_KOBJECT is not set |
@@ -1094,8 +1131,11 @@ CONFIG_FORCED_INLINING=y | |||
1094 | # CONFIG_RCU_TORTURE_TEST is not set | 1131 | # CONFIG_RCU_TORTURE_TEST is not set |
1095 | # CONFIG_FAULT_INJECTION is not set | 1132 | # CONFIG_FAULT_INJECTION is not set |
1096 | # CONFIG_SAMPLES is not set | 1133 | # CONFIG_SAMPLES is not set |
1097 | # CONFIG_EARLY_PRINTK is not set | 1134 | # CONFIG_SH_STANDARD_BIOS is not set |
1098 | CONFIG_SH64_PROC_TLB=y | 1135 | # CONFIG_EARLY_SCIF_CONSOLE is not set |
1136 | # CONFIG_DEBUG_BOOTMEM is not set | ||
1137 | # CONFIG_DEBUG_STACK_USAGE is not set | ||
1138 | # CONFIG_4KSTACKS is not set | ||
1099 | CONFIG_SH64_PROC_ASIDS=y | 1139 | CONFIG_SH64_PROC_ASIDS=y |
1100 | CONFIG_SH64_SR_WATCH=y | 1140 | CONFIG_SH64_SR_WATCH=y |
1101 | # CONFIG_POOR_MANS_STRACE is not set | 1141 | # CONFIG_POOR_MANS_STRACE is not set |
diff --git a/arch/sh/configs/hs7751rvoip_defconfig b/arch/sh/configs/hs7751rvoip_defconfig deleted file mode 100644 index 5d9da5a02759..000000000000 --- a/arch/sh/configs/hs7751rvoip_defconfig +++ /dev/null | |||
@@ -1,908 +0,0 @@ | |||
1 | # | ||
2 | # Automatically generated make config: don't edit | ||
3 | # Linux kernel version: 2.6.18 | ||
4 | # Tue Oct 3 13:04:52 2006 | ||
5 | # | ||
6 | CONFIG_SUPERH=y | ||
7 | CONFIG_RWSEM_GENERIC_SPINLOCK=y | ||
8 | CONFIG_GENERIC_FIND_NEXT_BIT=y | ||
9 | CONFIG_GENERIC_HWEIGHT=y | ||
10 | CONFIG_GENERIC_HARDIRQS=y | ||
11 | CONFIG_GENERIC_IRQ_PROBE=y | ||
12 | CONFIG_GENERIC_CALIBRATE_DELAY=y | ||
13 | CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" | ||
14 | |||
15 | # | ||
16 | # Code maturity level options | ||
17 | # | ||
18 | CONFIG_EXPERIMENTAL=y | ||
19 | CONFIG_BROKEN_ON_SMP=y | ||
20 | CONFIG_LOCK_KERNEL=y | ||
21 | CONFIG_INIT_ENV_ARG_LIMIT=32 | ||
22 | |||
23 | # | ||
24 | # General setup | ||
25 | # | ||
26 | CONFIG_LOCALVERSION="" | ||
27 | CONFIG_LOCALVERSION_AUTO=y | ||
28 | CONFIG_SWAP=y | ||
29 | CONFIG_SYSVIPC=y | ||
30 | # CONFIG_IPC_NS is not set | ||
31 | CONFIG_POSIX_MQUEUE=y | ||
32 | CONFIG_BSD_PROCESS_ACCT=y | ||
33 | # CONFIG_BSD_PROCESS_ACCT_V3 is not set | ||
34 | # CONFIG_TASKSTATS is not set | ||
35 | # CONFIG_UTS_NS is not set | ||
36 | # CONFIG_AUDIT is not set | ||
37 | # CONFIG_IKCONFIG is not set | ||
38 | # CONFIG_RELAY is not set | ||
39 | CONFIG_INITRAMFS_SOURCE="" | ||
40 | # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set | ||
41 | CONFIG_SYSCTL=y | ||
42 | CONFIG_EMBEDDED=y | ||
43 | CONFIG_UID16=y | ||
44 | # CONFIG_SYSCTL_SYSCALL is not set | ||
45 | # CONFIG_KALLSYMS is not set | ||
46 | CONFIG_HOTPLUG=y | ||
47 | CONFIG_PRINTK=y | ||
48 | CONFIG_BUG=y | ||
49 | CONFIG_ELF_CORE=y | ||
50 | CONFIG_BASE_FULL=y | ||
51 | CONFIG_FUTEX=y | ||
52 | CONFIG_EPOLL=y | ||
53 | CONFIG_SHMEM=y | ||
54 | CONFIG_SLAB=y | ||
55 | CONFIG_VM_EVENT_COUNTERS=y | ||
56 | CONFIG_RT_MUTEXES=y | ||
57 | # CONFIG_TINY_SHMEM is not set | ||
58 | CONFIG_BASE_SMALL=0 | ||
59 | # CONFIG_SLOB is not set | ||
60 | |||
61 | # | ||
62 | # Loadable module support | ||
63 | # | ||
64 | CONFIG_MODULES=y | ||
65 | CONFIG_MODULE_UNLOAD=y | ||
66 | # CONFIG_MODULE_FORCE_UNLOAD is not set | ||
67 | # CONFIG_MODVERSIONS is not set | ||
68 | # CONFIG_MODULE_SRCVERSION_ALL is not set | ||
69 | CONFIG_KMOD=y | ||
70 | |||
71 | # | ||
72 | # Block layer | ||
73 | # | ||
74 | CONFIG_BLOCK=y | ||
75 | # CONFIG_LBD is not set | ||
76 | # CONFIG_BLK_DEV_IO_TRACE is not set | ||
77 | # CONFIG_LSF is not set | ||
78 | |||
79 | # | ||
80 | # IO Schedulers | ||
81 | # | ||
82 | CONFIG_IOSCHED_NOOP=y | ||
83 | CONFIG_IOSCHED_AS=y | ||
84 | CONFIG_IOSCHED_DEADLINE=y | ||
85 | CONFIG_IOSCHED_CFQ=y | ||
86 | CONFIG_DEFAULT_AS=y | ||
87 | # CONFIG_DEFAULT_DEADLINE is not set | ||
88 | # CONFIG_DEFAULT_CFQ is not set | ||
89 | # CONFIG_DEFAULT_NOOP is not set | ||
90 | CONFIG_DEFAULT_IOSCHED="anticipatory" | ||
91 | |||
92 | # | ||
93 | # System type | ||
94 | # | ||
95 | # CONFIG_SH_SOLUTION_ENGINE is not set | ||
96 | # CONFIG_SH_7751_SOLUTION_ENGINE is not set | ||
97 | # CONFIG_SH_7300_SOLUTION_ENGINE is not set | ||
98 | # CONFIG_SH_7343_SOLUTION_ENGINE is not set | ||
99 | # CONFIG_SH_73180_SOLUTION_ENGINE is not set | ||
100 | # CONFIG_SH_7751_SYSTEMH is not set | ||
101 | # CONFIG_SH_HP6XX is not set | ||
102 | # CONFIG_SH_EC3104 is not set | ||
103 | # CONFIG_SH_SATURN is not set | ||
104 | # CONFIG_SH_DREAMCAST is not set | ||
105 | # CONFIG_SH_BIGSUR is not set | ||
106 | # CONFIG_SH_MPC1211 is not set | ||
107 | # CONFIG_SH_SH03 is not set | ||
108 | # CONFIG_SH_SECUREEDGE5410 is not set | ||
109 | CONFIG_SH_HS7751RVOIP=y | ||
110 | # CONFIG_SH_7710VOIPGW is not set | ||
111 | # CONFIG_SH_RTS7751R2D is not set | ||
112 | # CONFIG_SH_R7780RP is not set | ||
113 | # CONFIG_SH_EDOSK7705 is not set | ||
114 | # CONFIG_SH_SH4202_MICRODEV is not set | ||
115 | # CONFIG_SH_LANDISK is not set | ||
116 | # CONFIG_SH_TITAN is not set | ||
117 | # CONFIG_SH_SHMIN is not set | ||
118 | # CONFIG_SH_UNKNOWN is not set | ||
119 | |||
120 | # | ||
121 | # Processor selection | ||
122 | # | ||
123 | CONFIG_CPU_SH4=y | ||
124 | |||
125 | # | ||
126 | # SH-2 Processor Support | ||
127 | # | ||
128 | # CONFIG_CPU_SUBTYPE_SH7604 is not set | ||
129 | |||
130 | # | ||
131 | # SH-3 Processor Support | ||
132 | # | ||
133 | # CONFIG_CPU_SUBTYPE_SH7300 is not set | ||
134 | # CONFIG_CPU_SUBTYPE_SH7705 is not set | ||
135 | # CONFIG_CPU_SUBTYPE_SH7706 is not set | ||
136 | # CONFIG_CPU_SUBTYPE_SH7707 is not set | ||
137 | # CONFIG_CPU_SUBTYPE_SH7708 is not set | ||
138 | # CONFIG_CPU_SUBTYPE_SH7709 is not set | ||
139 | # CONFIG_CPU_SUBTYPE_SH7710 is not set | ||
140 | |||
141 | # | ||
142 | # SH-4 Processor Support | ||
143 | # | ||
144 | # CONFIG_CPU_SUBTYPE_SH7750 is not set | ||
145 | # CONFIG_CPU_SUBTYPE_SH7091 is not set | ||
146 | # CONFIG_CPU_SUBTYPE_SH7750R is not set | ||
147 | # CONFIG_CPU_SUBTYPE_SH7750S is not set | ||
148 | # CONFIG_CPU_SUBTYPE_SH7751 is not set | ||
149 | CONFIG_CPU_SUBTYPE_SH7751R=y | ||
150 | # CONFIG_CPU_SUBTYPE_SH7760 is not set | ||
151 | # CONFIG_CPU_SUBTYPE_SH4_202 is not set | ||
152 | |||
153 | # | ||
154 | # ST40 Processor Support | ||
155 | # | ||
156 | # CONFIG_CPU_SUBTYPE_ST40STB1 is not set | ||
157 | # CONFIG_CPU_SUBTYPE_ST40GX1 is not set | ||
158 | |||
159 | # | ||
160 | # SH-4A Processor Support | ||
161 | # | ||
162 | # CONFIG_CPU_SUBTYPE_SH7770 is not set | ||
163 | # CONFIG_CPU_SUBTYPE_SH7780 is not set | ||
164 | |||
165 | # | ||
166 | # SH4AL-DSP Processor Support | ||
167 | # | ||
168 | # CONFIG_CPU_SUBTYPE_SH73180 is not set | ||
169 | # CONFIG_CPU_SUBTYPE_SH7343 is not set | ||
170 | |||
171 | # | ||
172 | # Memory management options | ||
173 | # | ||
174 | CONFIG_MMU=y | ||
175 | CONFIG_PAGE_OFFSET=0x80000000 | ||
176 | CONFIG_MEMORY_START=0x0c000000 | ||
177 | CONFIG_MEMORY_SIZE=0x04000000 | ||
178 | CONFIG_VSYSCALL=y | ||
179 | CONFIG_SELECT_MEMORY_MODEL=y | ||
180 | CONFIG_FLATMEM_MANUAL=y | ||
181 | # CONFIG_DISCONTIGMEM_MANUAL is not set | ||
182 | # CONFIG_SPARSEMEM_MANUAL is not set | ||
183 | CONFIG_FLATMEM=y | ||
184 | CONFIG_FLAT_NODE_MEM_MAP=y | ||
185 | # CONFIG_SPARSEMEM_STATIC is not set | ||
186 | CONFIG_SPLIT_PTLOCK_CPUS=4 | ||
187 | # CONFIG_RESOURCES_64BIT is not set | ||
188 | |||
189 | # | ||
190 | # Cache configuration | ||
191 | # | ||
192 | # CONFIG_SH_DIRECT_MAPPED is not set | ||
193 | # CONFIG_SH_WRITETHROUGH is not set | ||
194 | # CONFIG_SH_OCRAM is not set | ||
195 | |||
196 | # | ||
197 | # Processor features | ||
198 | # | ||
199 | CONFIG_CPU_LITTLE_ENDIAN=y | ||
200 | CONFIG_SH_FPU=y | ||
201 | # CONFIG_SH_DSP is not set | ||
202 | # CONFIG_SH_STORE_QUEUES is not set | ||
203 | CONFIG_CPU_HAS_INTEVT=y | ||
204 | CONFIG_CPU_HAS_SR_RB=y | ||
205 | |||
206 | # | ||
207 | # Timer support | ||
208 | # | ||
209 | CONFIG_SH_TMU=y | ||
210 | |||
211 | # | ||
212 | # HS7751RVoIP options | ||
213 | # | ||
214 | CONFIG_HS7751RVOIP_CODEC=y | ||
215 | CONFIG_SH_PCLK_FREQ=60000000 | ||
216 | |||
217 | # | ||
218 | # CPU Frequency scaling | ||
219 | # | ||
220 | # CONFIG_CPU_FREQ is not set | ||
221 | |||
222 | # | ||
223 | # DMA support | ||
224 | # | ||
225 | # CONFIG_SH_DMA is not set | ||
226 | |||
227 | # | ||
228 | # Companion Chips | ||
229 | # | ||
230 | # CONFIG_HD6446X_SERIES is not set | ||
231 | |||
232 | # | ||
233 | # Kernel features | ||
234 | # | ||
235 | # CONFIG_HZ_100 is not set | ||
236 | CONFIG_HZ_250=y | ||
237 | # CONFIG_HZ_1000 is not set | ||
238 | CONFIG_HZ=250 | ||
239 | # CONFIG_KEXEC is not set | ||
240 | # CONFIG_SMP is not set | ||
241 | # CONFIG_PREEMPT_NONE is not set | ||
242 | # CONFIG_PREEMPT_VOLUNTARY is not set | ||
243 | CONFIG_PREEMPT=y | ||
244 | CONFIG_PREEMPT_BKL=y | ||
245 | |||
246 | # | ||
247 | # Boot options | ||
248 | # | ||
249 | CONFIG_ZERO_PAGE_OFFSET=0x00001000 | ||
250 | CONFIG_BOOT_LINK_OFFSET=0x00800000 | ||
251 | # CONFIG_UBC_WAKEUP is not set | ||
252 | CONFIG_CMDLINE_BOOL=y | ||
253 | CONFIG_CMDLINE="mem=64M console=ttySC1,115200 root=/dev/hda1" | ||
254 | |||
255 | # | ||
256 | # Bus options | ||
257 | # | ||
258 | # CONFIG_PCI is not set | ||
259 | |||
260 | # | ||
261 | # PCCARD (PCMCIA/CardBus) support | ||
262 | # | ||
263 | # CONFIG_PCCARD is not set | ||
264 | |||
265 | # | ||
266 | # PCI Hotplug Support | ||
267 | # | ||
268 | |||
269 | # | ||
270 | # Executable file formats | ||
271 | # | ||
272 | CONFIG_BINFMT_ELF=y | ||
273 | # CONFIG_BINFMT_FLAT is not set | ||
274 | # CONFIG_BINFMT_MISC is not set | ||
275 | |||
276 | # | ||
277 | # Power management options (EXPERIMENTAL) | ||
278 | # | ||
279 | # CONFIG_PM is not set | ||
280 | |||
281 | # | ||
282 | # Networking | ||
283 | # | ||
284 | CONFIG_NET=y | ||
285 | |||
286 | # | ||
287 | # Networking options | ||
288 | # | ||
289 | # CONFIG_NETDEBUG is not set | ||
290 | CONFIG_PACKET=y | ||
291 | CONFIG_PACKET_MMAP=y | ||
292 | CONFIG_UNIX=y | ||
293 | CONFIG_XFRM=y | ||
294 | # CONFIG_XFRM_USER is not set | ||
295 | # CONFIG_XFRM_SUB_POLICY is not set | ||
296 | # CONFIG_NET_KEY is not set | ||
297 | CONFIG_INET=y | ||
298 | CONFIG_IP_MULTICAST=y | ||
299 | CONFIG_IP_ADVANCED_ROUTER=y | ||
300 | CONFIG_ASK_IP_FIB_HASH=y | ||
301 | # CONFIG_IP_FIB_TRIE is not set | ||
302 | CONFIG_IP_FIB_HASH=y | ||
303 | # CONFIG_IP_MULTIPLE_TABLES is not set | ||
304 | # CONFIG_IP_ROUTE_MULTIPATH is not set | ||
305 | # CONFIG_IP_ROUTE_VERBOSE is not set | ||
306 | # CONFIG_IP_PNP is not set | ||
307 | # CONFIG_NET_IPIP is not set | ||
308 | # CONFIG_NET_IPGRE is not set | ||
309 | # CONFIG_IP_MROUTE is not set | ||
310 | # CONFIG_ARPD is not set | ||
311 | # CONFIG_SYN_COOKIES is not set | ||
312 | # CONFIG_INET_AH is not set | ||
313 | # CONFIG_INET_ESP is not set | ||
314 | # CONFIG_INET_IPCOMP is not set | ||
315 | # CONFIG_INET_XFRM_TUNNEL is not set | ||
316 | # CONFIG_INET_TUNNEL is not set | ||
317 | CONFIG_INET_XFRM_MODE_TRANSPORT=y | ||
318 | CONFIG_INET_XFRM_MODE_TUNNEL=y | ||
319 | CONFIG_INET_DIAG=y | ||
320 | CONFIG_INET_TCP_DIAG=y | ||
321 | # CONFIG_TCP_CONG_ADVANCED is not set | ||
322 | CONFIG_TCP_CONG_CUBIC=y | ||
323 | CONFIG_DEFAULT_TCP_CONG="cubic" | ||
324 | # CONFIG_IPV6 is not set | ||
325 | # CONFIG_INET6_XFRM_TUNNEL is not set | ||
326 | # CONFIG_INET6_TUNNEL is not set | ||
327 | # CONFIG_NETWORK_SECMARK is not set | ||
328 | # CONFIG_NETFILTER is not set | ||
329 | |||
330 | # | ||
331 | # DCCP Configuration (EXPERIMENTAL) | ||
332 | # | ||
333 | # CONFIG_IP_DCCP is not set | ||
334 | |||
335 | # | ||
336 | # SCTP Configuration (EXPERIMENTAL) | ||
337 | # | ||
338 | # CONFIG_IP_SCTP is not set | ||
339 | |||
340 | # | ||
341 | # TIPC Configuration (EXPERIMENTAL) | ||
342 | # | ||
343 | # CONFIG_TIPC is not set | ||
344 | # CONFIG_ATM is not set | ||
345 | # CONFIG_BRIDGE is not set | ||
346 | # CONFIG_VLAN_8021Q is not set | ||
347 | # CONFIG_DECNET is not set | ||
348 | # CONFIG_LLC2 is not set | ||
349 | # CONFIG_IPX is not set | ||
350 | # CONFIG_ATALK is not set | ||
351 | # CONFIG_X25 is not set | ||
352 | # CONFIG_LAPB is not set | ||
353 | # CONFIG_ECONET is not set | ||
354 | # CONFIG_WAN_ROUTER is not set | ||
355 | |||
356 | # | ||
357 | # QoS and/or fair queueing | ||
358 | # | ||
359 | # CONFIG_NET_SCHED is not set | ||
360 | |||
361 | # | ||
362 | # Network testing | ||
363 | # | ||
364 | # CONFIG_NET_PKTGEN is not set | ||
365 | # CONFIG_HAMRADIO is not set | ||
366 | # CONFIG_IRDA is not set | ||
367 | # CONFIG_BT is not set | ||
368 | # CONFIG_IEEE80211 is not set | ||
369 | |||
370 | # | ||
371 | # Device Drivers | ||
372 | # | ||
373 | |||
374 | # | ||
375 | # Generic Driver Options | ||
376 | # | ||
377 | CONFIG_STANDALONE=y | ||
378 | CONFIG_PREVENT_FIRMWARE_BUILD=y | ||
379 | CONFIG_FW_LOADER=m | ||
380 | # CONFIG_SYS_HYPERVISOR is not set | ||
381 | |||
382 | # | ||
383 | # Connector - unified userspace <-> kernelspace linker | ||
384 | # | ||
385 | # CONFIG_CONNECTOR is not set | ||
386 | |||
387 | # | ||
388 | # Memory Technology Devices (MTD) | ||
389 | # | ||
390 | # CONFIG_MTD is not set | ||
391 | |||
392 | # | ||
393 | # Parallel port support | ||
394 | # | ||
395 | # CONFIG_PARPORT is not set | ||
396 | |||
397 | # | ||
398 | # Plug and Play support | ||
399 | # | ||
400 | |||
401 | # | ||
402 | # Block devices | ||
403 | # | ||
404 | # CONFIG_BLK_DEV_COW_COMMON is not set | ||
405 | # CONFIG_BLK_DEV_LOOP is not set | ||
406 | # CONFIG_BLK_DEV_NBD is not set | ||
407 | # CONFIG_BLK_DEV_RAM is not set | ||
408 | # CONFIG_BLK_DEV_INITRD is not set | ||
409 | # CONFIG_CDROM_PKTCDVD is not set | ||
410 | # CONFIG_ATA_OVER_ETH is not set | ||
411 | |||
412 | # | ||
413 | # ATA/ATAPI/MFM/RLL support | ||
414 | # | ||
415 | CONFIG_IDE=y | ||
416 | CONFIG_IDE_MAX_HWIFS=1 | ||
417 | CONFIG_BLK_DEV_IDE=y | ||
418 | |||
419 | # | ||
420 | # Please see Documentation/ide.txt for help/info on IDE drives | ||
421 | # | ||
422 | # CONFIG_BLK_DEV_IDE_SATA is not set | ||
423 | CONFIG_BLK_DEV_IDEDISK=y | ||
424 | # CONFIG_IDEDISK_MULTI_MODE is not set | ||
425 | # CONFIG_BLK_DEV_IDECD is not set | ||
426 | # CONFIG_BLK_DEV_IDETAPE is not set | ||
427 | # CONFIG_BLK_DEV_IDEFLOPPY is not set | ||
428 | # CONFIG_IDE_TASK_IOCTL is not set | ||
429 | |||
430 | # | ||
431 | # IDE chipset support/bugfixes | ||
432 | # | ||
433 | CONFIG_IDE_GENERIC=y | ||
434 | # CONFIG_IDE_ARM is not set | ||
435 | # CONFIG_BLK_DEV_IDEDMA is not set | ||
436 | # CONFIG_IDEDMA_AUTO is not set | ||
437 | # CONFIG_BLK_DEV_HD is not set | ||
438 | |||
439 | # | ||
440 | # SCSI device support | ||
441 | # | ||
442 | # CONFIG_RAID_ATTRS is not set | ||
443 | # CONFIG_SCSI is not set | ||
444 | # CONFIG_SCSI_NETLINK is not set | ||
445 | |||
446 | # | ||
447 | # Serial ATA (prod) and Parallel ATA (experimental) drivers | ||
448 | # | ||
449 | # CONFIG_ATA is not set | ||
450 | |||
451 | # | ||
452 | # Multi-device support (RAID and LVM) | ||
453 | # | ||
454 | # CONFIG_MD is not set | ||
455 | |||
456 | # | ||
457 | # Fusion MPT device support | ||
458 | # | ||
459 | # CONFIG_FUSION is not set | ||
460 | |||
461 | # | ||
462 | # IEEE 1394 (FireWire) support | ||
463 | # | ||
464 | |||
465 | # | ||
466 | # I2O device support | ||
467 | # | ||
468 | |||
469 | # | ||
470 | # Network device support | ||
471 | # | ||
472 | CONFIG_NETDEVICES=y | ||
473 | # CONFIG_DUMMY is not set | ||
474 | # CONFIG_BONDING is not set | ||
475 | # CONFIG_EQUALIZER is not set | ||
476 | # CONFIG_TUN is not set | ||
477 | |||
478 | # | ||
479 | # PHY device support | ||
480 | # | ||
481 | # CONFIG_PHYLIB is not set | ||
482 | |||
483 | # | ||
484 | # Ethernet (10 or 100Mbit) | ||
485 | # | ||
486 | CONFIG_NET_ETHERNET=y | ||
487 | CONFIG_MII=y | ||
488 | # CONFIG_STNIC is not set | ||
489 | # CONFIG_SMC91X is not set | ||
490 | |||
491 | # | ||
492 | # Ethernet (1000 Mbit) | ||
493 | # | ||
494 | |||
495 | # | ||
496 | # Ethernet (10000 Mbit) | ||
497 | # | ||
498 | |||
499 | # | ||
500 | # Token Ring devices | ||
501 | # | ||
502 | |||
503 | # | ||
504 | # Wireless LAN (non-hamradio) | ||
505 | # | ||
506 | # CONFIG_NET_RADIO is not set | ||
507 | |||
508 | # | ||
509 | # Wan interfaces | ||
510 | # | ||
511 | # CONFIG_WAN is not set | ||
512 | # CONFIG_PPP is not set | ||
513 | # CONFIG_SLIP is not set | ||
514 | # CONFIG_SHAPER is not set | ||
515 | # CONFIG_NETCONSOLE is not set | ||
516 | # CONFIG_NETPOLL is not set | ||
517 | # CONFIG_NET_POLL_CONTROLLER is not set | ||
518 | |||
519 | # | ||
520 | # ISDN subsystem | ||
521 | # | ||
522 | # CONFIG_ISDN is not set | ||
523 | |||
524 | # | ||
525 | # Telephony Support | ||
526 | # | ||
527 | # CONFIG_PHONE is not set | ||
528 | |||
529 | # | ||
530 | # Input device support | ||
531 | # | ||
532 | CONFIG_INPUT=y | ||
533 | # CONFIG_INPUT_FF_MEMLESS is not set | ||
534 | |||
535 | # | ||
536 | # Userland interfaces | ||
537 | # | ||
538 | # CONFIG_INPUT_MOUSEDEV is not set | ||
539 | # CONFIG_INPUT_JOYDEV is not set | ||
540 | # CONFIG_INPUT_TSDEV is not set | ||
541 | # CONFIG_INPUT_EVDEV is not set | ||
542 | # CONFIG_INPUT_EVBUG is not set | ||
543 | |||
544 | # | ||
545 | # Input Device Drivers | ||
546 | # | ||
547 | # CONFIG_INPUT_KEYBOARD is not set | ||
548 | # CONFIG_INPUT_MOUSE is not set | ||
549 | # CONFIG_INPUT_JOYSTICK is not set | ||
550 | # CONFIG_INPUT_TOUCHSCREEN is not set | ||
551 | # CONFIG_INPUT_MISC is not set | ||
552 | |||
553 | # | ||
554 | # Hardware I/O ports | ||
555 | # | ||
556 | CONFIG_SERIO=y | ||
557 | CONFIG_SERIO_I8042=y | ||
558 | CONFIG_SERIO_SERPORT=y | ||
559 | # CONFIG_SERIO_LIBPS2 is not set | ||
560 | # CONFIG_SERIO_RAW is not set | ||
561 | # CONFIG_GAMEPORT is not set | ||
562 | |||
563 | # | ||
564 | # Character devices | ||
565 | # | ||
566 | # CONFIG_VT is not set | ||
567 | # CONFIG_SERIAL_NONSTANDARD is not set | ||
568 | |||
569 | # | ||
570 | # Serial drivers | ||
571 | # | ||
572 | # CONFIG_SERIAL_8250 is not set | ||
573 | |||
574 | # | ||
575 | # Non-8250 serial port support | ||
576 | # | ||
577 | CONFIG_SERIAL_SH_SCI=y | ||
578 | CONFIG_SERIAL_SH_SCI_NR_UARTS=2 | ||
579 | CONFIG_SERIAL_SH_SCI_CONSOLE=y | ||
580 | CONFIG_SERIAL_CORE=y | ||
581 | CONFIG_SERIAL_CORE_CONSOLE=y | ||
582 | CONFIG_UNIX98_PTYS=y | ||
583 | # CONFIG_LEGACY_PTYS is not set | ||
584 | |||
585 | # | ||
586 | # IPMI | ||
587 | # | ||
588 | # CONFIG_IPMI_HANDLER is not set | ||
589 | |||
590 | # | ||
591 | # Watchdog Cards | ||
592 | # | ||
593 | # CONFIG_WATCHDOG is not set | ||
594 | CONFIG_HW_RANDOM=y | ||
595 | # CONFIG_GEN_RTC is not set | ||
596 | # CONFIG_DTLK is not set | ||
597 | # CONFIG_R3964 is not set | ||
598 | |||
599 | # | ||
600 | # Ftape, the floppy tape device driver | ||
601 | # | ||
602 | # CONFIG_RAW_DRIVER is not set | ||
603 | |||
604 | # | ||
605 | # TPM devices | ||
606 | # | ||
607 | # CONFIG_TCG_TPM is not set | ||
608 | # CONFIG_TELCLOCK is not set | ||
609 | |||
610 | # | ||
611 | # I2C support | ||
612 | # | ||
613 | # CONFIG_I2C is not set | ||
614 | |||
615 | # | ||
616 | # SPI support | ||
617 | # | ||
618 | # CONFIG_SPI is not set | ||
619 | # CONFIG_SPI_MASTER is not set | ||
620 | |||
621 | # | ||
622 | # Dallas's 1-wire bus | ||
623 | # | ||
624 | |||
625 | # | ||
626 | # Hardware Monitoring support | ||
627 | # | ||
628 | CONFIG_HWMON=y | ||
629 | # CONFIG_HWMON_VID is not set | ||
630 | # CONFIG_SENSORS_ABITUGURU is not set | ||
631 | # CONFIG_SENSORS_F71805F is not set | ||
632 | # CONFIG_SENSORS_VT1211 is not set | ||
633 | # CONFIG_HWMON_DEBUG_CHIP is not set | ||
634 | |||
635 | # | ||
636 | # Misc devices | ||
637 | # | ||
638 | |||
639 | # | ||
640 | # Multimedia devices | ||
641 | # | ||
642 | # CONFIG_VIDEO_DEV is not set | ||
643 | CONFIG_VIDEO_V4L2=y | ||
644 | |||
645 | # | ||
646 | # Digital Video Broadcasting Devices | ||
647 | # | ||
648 | # CONFIG_DVB is not set | ||
649 | |||
650 | # | ||
651 | # Graphics support | ||
652 | # | ||
653 | CONFIG_FIRMWARE_EDID=y | ||
654 | # CONFIG_FB is not set | ||
655 | # CONFIG_BACKLIGHT_LCD_SUPPORT is not set | ||
656 | |||
657 | # | ||
658 | # Sound | ||
659 | # | ||
660 | # CONFIG_SOUND is not set | ||
661 | |||
662 | # | ||
663 | # USB support | ||
664 | # | ||
665 | # CONFIG_USB_ARCH_HAS_HCD is not set | ||
666 | # CONFIG_USB_ARCH_HAS_OHCI is not set | ||
667 | # CONFIG_USB_ARCH_HAS_EHCI is not set | ||
668 | |||
669 | # | ||
670 | # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' | ||
671 | # | ||
672 | |||
673 | # | ||
674 | # USB Gadget Support | ||
675 | # | ||
676 | # CONFIG_USB_GADGET is not set | ||
677 | |||
678 | # | ||
679 | # MMC/SD Card support | ||
680 | # | ||
681 | # CONFIG_MMC is not set | ||
682 | |||
683 | # | ||
684 | # LED devices | ||
685 | # | ||
686 | # CONFIG_NEW_LEDS is not set | ||
687 | |||
688 | # | ||
689 | # LED drivers | ||
690 | # | ||
691 | |||
692 | # | ||
693 | # LED Triggers | ||
694 | # | ||
695 | |||
696 | # | ||
697 | # InfiniBand support | ||
698 | # | ||
699 | |||
700 | # | ||
701 | # EDAC - error detection and reporting (RAS) (EXPERIMENTAL) | ||
702 | # | ||
703 | |||
704 | # | ||
705 | # Real Time Clock | ||
706 | # | ||
707 | # CONFIG_RTC_CLASS is not set | ||
708 | |||
709 | # | ||
710 | # DMA Engine support | ||
711 | # | ||
712 | # CONFIG_DMA_ENGINE is not set | ||
713 | |||
714 | # | ||
715 | # DMA Clients | ||
716 | # | ||
717 | |||
718 | # | ||
719 | # DMA Devices | ||
720 | # | ||
721 | |||
722 | # | ||
723 | # File systems | ||
724 | # | ||
725 | CONFIG_EXT2_FS=y | ||
726 | # CONFIG_EXT2_FS_XATTR is not set | ||
727 | # CONFIG_EXT2_FS_XIP is not set | ||
728 | # CONFIG_EXT3_FS is not set | ||
729 | # CONFIG_REISERFS_FS is not set | ||
730 | # CONFIG_JFS_FS is not set | ||
731 | # CONFIG_FS_POSIX_ACL is not set | ||
732 | # CONFIG_XFS_FS is not set | ||
733 | # CONFIG_OCFS2_FS is not set | ||
734 | # CONFIG_MINIX_FS is not set | ||
735 | # CONFIG_ROMFS_FS is not set | ||
736 | CONFIG_INOTIFY=y | ||
737 | CONFIG_INOTIFY_USER=y | ||
738 | # CONFIG_QUOTA is not set | ||
739 | CONFIG_DNOTIFY=y | ||
740 | # CONFIG_AUTOFS_FS is not set | ||
741 | # CONFIG_AUTOFS4_FS is not set | ||
742 | # CONFIG_FUSE_FS is not set | ||
743 | |||
744 | # | ||
745 | # CD-ROM/DVD Filesystems | ||
746 | # | ||
747 | # CONFIG_ISO9660_FS is not set | ||
748 | # CONFIG_UDF_FS is not set | ||
749 | |||
750 | # | ||
751 | # DOS/FAT/NT Filesystems | ||
752 | # | ||
753 | # CONFIG_MSDOS_FS is not set | ||
754 | # CONFIG_VFAT_FS is not set | ||
755 | # CONFIG_NTFS_FS is not set | ||
756 | |||
757 | # | ||
758 | # Pseudo filesystems | ||
759 | # | ||
760 | CONFIG_PROC_FS=y | ||
761 | CONFIG_PROC_KCORE=y | ||
762 | CONFIG_PROC_SYSCTL=y | ||
763 | CONFIG_SYSFS=y | ||
764 | CONFIG_TMPFS=y | ||
765 | # CONFIG_TMPFS_POSIX_ACL is not set | ||
766 | # CONFIG_HUGETLBFS is not set | ||
767 | # CONFIG_HUGETLB_PAGE is not set | ||
768 | CONFIG_RAMFS=y | ||
769 | # CONFIG_CONFIGFS_FS is not set | ||
770 | |||
771 | # | ||
772 | # Miscellaneous filesystems | ||
773 | # | ||
774 | # CONFIG_ADFS_FS is not set | ||
775 | # CONFIG_AFFS_FS is not set | ||
776 | # CONFIG_HFS_FS is not set | ||
777 | # CONFIG_HFSPLUS_FS is not set | ||
778 | # CONFIG_BEFS_FS is not set | ||
779 | # CONFIG_BFS_FS is not set | ||
780 | # CONFIG_EFS_FS is not set | ||
781 | # CONFIG_CRAMFS is not set | ||
782 | # CONFIG_VXFS_FS is not set | ||
783 | # CONFIG_HPFS_FS is not set | ||
784 | # CONFIG_QNX4FS_FS is not set | ||
785 | # CONFIG_SYSV_FS is not set | ||
786 | # CONFIG_UFS_FS is not set | ||
787 | |||
788 | # | ||
789 | # Network File Systems | ||
790 | # | ||
791 | CONFIG_NFS_FS=y | ||
792 | CONFIG_NFS_V3=y | ||
793 | # CONFIG_NFS_V3_ACL is not set | ||
794 | CONFIG_NFS_V4=y | ||
795 | CONFIG_NFS_DIRECTIO=y | ||
796 | # CONFIG_NFSD is not set | ||
797 | CONFIG_LOCKD=y | ||
798 | CONFIG_LOCKD_V4=y | ||
799 | CONFIG_NFS_COMMON=y | ||
800 | CONFIG_SUNRPC=y | ||
801 | CONFIG_SUNRPC_GSS=y | ||
802 | CONFIG_RPCSEC_GSS_KRB5=y | ||
803 | # CONFIG_RPCSEC_GSS_SPKM3 is not set | ||
804 | # CONFIG_SMB_FS is not set | ||
805 | # CONFIG_CIFS is not set | ||
806 | # CONFIG_NCP_FS is not set | ||
807 | # CONFIG_CODA_FS is not set | ||
808 | # CONFIG_AFS_FS is not set | ||
809 | # CONFIG_9P_FS is not set | ||
810 | |||
811 | # | ||
812 | # Partition Types | ||
813 | # | ||
814 | CONFIG_PARTITION_ADVANCED=y | ||
815 | # CONFIG_ACORN_PARTITION is not set | ||
816 | # CONFIG_OSF_PARTITION is not set | ||
817 | # CONFIG_AMIGA_PARTITION is not set | ||
818 | # CONFIG_ATARI_PARTITION is not set | ||
819 | # CONFIG_MAC_PARTITION is not set | ||
820 | CONFIG_MSDOS_PARTITION=y | ||
821 | # CONFIG_BSD_DISKLABEL is not set | ||
822 | # CONFIG_MINIX_SUBPARTITION is not set | ||
823 | # CONFIG_SOLARIS_X86_PARTITION is not set | ||
824 | # CONFIG_UNIXWARE_DISKLABEL is not set | ||
825 | # CONFIG_LDM_PARTITION is not set | ||
826 | # CONFIG_SGI_PARTITION is not set | ||
827 | # CONFIG_ULTRIX_PARTITION is not set | ||
828 | # CONFIG_SUN_PARTITION is not set | ||
829 | # CONFIG_KARMA_PARTITION is not set | ||
830 | # CONFIG_EFI_PARTITION is not set | ||
831 | |||
832 | # | ||
833 | # Native Language Support | ||
834 | # | ||
835 | # CONFIG_NLS is not set | ||
836 | |||
837 | # | ||
838 | # Profiling support | ||
839 | # | ||
840 | # CONFIG_PROFILING is not set | ||
841 | |||
842 | # | ||
843 | # Kernel hacking | ||
844 | # | ||
845 | # CONFIG_PRINTK_TIME is not set | ||
846 | CONFIG_ENABLE_MUST_CHECK=y | ||
847 | # CONFIG_MAGIC_SYSRQ is not set | ||
848 | # CONFIG_UNUSED_SYMBOLS is not set | ||
849 | # CONFIG_DEBUG_KERNEL is not set | ||
850 | CONFIG_LOG_BUF_SHIFT=14 | ||
851 | # CONFIG_DEBUG_BUGVERBOSE is not set | ||
852 | # CONFIG_DEBUG_FS is not set | ||
853 | # CONFIG_SH_STANDARD_BIOS is not set | ||
854 | # CONFIG_EARLY_SCIF_CONSOLE is not set | ||
855 | # CONFIG_KGDB is not set | ||
856 | |||
857 | # | ||
858 | # Security options | ||
859 | # | ||
860 | # CONFIG_KEYS is not set | ||
861 | # CONFIG_SECURITY is not set | ||
862 | |||
863 | # | ||
864 | # Cryptographic options | ||
865 | # | ||
866 | CONFIG_CRYPTO=y | ||
867 | CONFIG_CRYPTO_ALGAPI=y | ||
868 | CONFIG_CRYPTO_BLKCIPHER=m | ||
869 | CONFIG_CRYPTO_MANAGER=m | ||
870 | # CONFIG_CRYPTO_HMAC is not set | ||
871 | # CONFIG_CRYPTO_NULL is not set | ||
872 | # CONFIG_CRYPTO_MD4 is not set | ||
873 | CONFIG_CRYPTO_MD5=y | ||
874 | # CONFIG_CRYPTO_SHA1 is not set | ||
875 | # CONFIG_CRYPTO_SHA256 is not set | ||
876 | # CONFIG_CRYPTO_SHA512 is not set | ||
877 | # CONFIG_CRYPTO_WP512 is not set | ||
878 | # CONFIG_CRYPTO_TGR192 is not set | ||
879 | CONFIG_CRYPTO_ECB=m | ||
880 | CONFIG_CRYPTO_CBC=m | ||
881 | CONFIG_CRYPTO_DES=y | ||
882 | # CONFIG_CRYPTO_BLOWFISH is not set | ||
883 | # CONFIG_CRYPTO_TWOFISH is not set | ||
884 | # CONFIG_CRYPTO_SERPENT is not set | ||
885 | # CONFIG_CRYPTO_AES is not set | ||
886 | # CONFIG_CRYPTO_CAST5 is not set | ||
887 | # CONFIG_CRYPTO_CAST6 is not set | ||
888 | # CONFIG_CRYPTO_TEA is not set | ||
889 | # CONFIG_CRYPTO_ARC4 is not set | ||
890 | # CONFIG_CRYPTO_KHAZAD is not set | ||
891 | # CONFIG_CRYPTO_ANUBIS is not set | ||
892 | # CONFIG_CRYPTO_DEFLATE is not set | ||
893 | # CONFIG_CRYPTO_MICHAEL_MIC is not set | ||
894 | # CONFIG_CRYPTO_CRC32C is not set | ||
895 | # CONFIG_CRYPTO_TEST is not set | ||
896 | |||
897 | # | ||
898 | # Hardware crypto devices | ||
899 | # | ||
900 | |||
901 | # | ||
902 | # Library routines | ||
903 | # | ||
904 | # CONFIG_CRC_CCITT is not set | ||
905 | # CONFIG_CRC16 is not set | ||
906 | CONFIG_CRC32=y | ||
907 | # CONFIG_LIBCRC32C is not set | ||
908 | CONFIG_PLIST=y | ||
diff --git a/arch/sh/configs/r7785rp_defconfig b/arch/sh/configs/r7785rp_defconfig index 2e43a2a971a9..0dc1ce7b9349 100644 --- a/arch/sh/configs/r7785rp_defconfig +++ b/arch/sh/configs/r7785rp_defconfig | |||
@@ -1,9 +1,10 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.24-rc2 | 3 | # Linux kernel version: 2.6.24-rc3 |
4 | # Tue Nov 13 20:34:57 2007 | 4 | # Fri Nov 23 14:03:57 2007 |
5 | # | 5 | # |
6 | CONFIG_SUPERH=y | 6 | CONFIG_SUPERH=y |
7 | CONFIG_SUPERH32=y | ||
7 | CONFIG_RWSEM_GENERIC_SPINLOCK=y | 8 | CONFIG_RWSEM_GENERIC_SPINLOCK=y |
8 | CONFIG_GENERIC_BUG=y | 9 | CONFIG_GENERIC_BUG=y |
9 | CONFIG_GENERIC_FIND_NEXT_BIT=y | 10 | CONFIG_GENERIC_FIND_NEXT_BIT=y |
@@ -39,6 +40,7 @@ CONFIG_BSD_PROCESS_ACCT=y | |||
39 | # CONFIG_BSD_PROCESS_ACCT_V3 is not set | 40 | # CONFIG_BSD_PROCESS_ACCT_V3 is not set |
40 | # CONFIG_TASKSTATS is not set | 41 | # CONFIG_TASKSTATS is not set |
41 | # CONFIG_USER_NS is not set | 42 | # CONFIG_USER_NS is not set |
43 | # CONFIG_PID_NS is not set | ||
42 | # CONFIG_AUDIT is not set | 44 | # CONFIG_AUDIT is not set |
43 | CONFIG_IKCONFIG=y | 45 | CONFIG_IKCONFIG=y |
44 | CONFIG_IKCONFIG_PROC=y | 46 | CONFIG_IKCONFIG_PROC=y |
@@ -130,6 +132,8 @@ CONFIG_CPU_SUBTYPE_SH7785=y | |||
130 | # CONFIG_CPU_SUBTYPE_SHX3 is not set | 132 | # CONFIG_CPU_SUBTYPE_SHX3 is not set |
131 | # CONFIG_CPU_SUBTYPE_SH7343 is not set | 133 | # CONFIG_CPU_SUBTYPE_SH7343 is not set |
132 | # CONFIG_CPU_SUBTYPE_SH7722 is not set | 134 | # CONFIG_CPU_SUBTYPE_SH7722 is not set |
135 | # CONFIG_CPU_SUBTYPE_SH5_101 is not set | ||
136 | # CONFIG_CPU_SUBTYPE_SH5_103 is not set | ||
133 | 137 | ||
134 | # | 138 | # |
135 | # Memory management options | 139 | # Memory management options |
@@ -139,7 +143,8 @@ CONFIG_MMU=y | |||
139 | CONFIG_PAGE_OFFSET=0x80000000 | 143 | CONFIG_PAGE_OFFSET=0x80000000 |
140 | CONFIG_MEMORY_START=0x08000000 | 144 | CONFIG_MEMORY_START=0x08000000 |
141 | CONFIG_MEMORY_SIZE=0x08000000 | 145 | CONFIG_MEMORY_SIZE=0x08000000 |
142 | # CONFIG_32BIT is not set | 146 | CONFIG_29BIT=y |
147 | # CONFIG_PMB is not set | ||
143 | # CONFIG_X2TLB is not set | 148 | # CONFIG_X2TLB is not set |
144 | CONFIG_VSYSCALL=y | 149 | CONFIG_VSYSCALL=y |
145 | # CONFIG_NUMA is not set | 150 | # CONFIG_NUMA is not set |
@@ -158,6 +163,7 @@ CONFIG_PAGE_SIZE_4KB=y | |||
158 | CONFIG_HUGETLB_PAGE_SIZE_1MB=y | 163 | CONFIG_HUGETLB_PAGE_SIZE_1MB=y |
159 | # CONFIG_HUGETLB_PAGE_SIZE_4MB is not set | 164 | # CONFIG_HUGETLB_PAGE_SIZE_4MB is not set |
160 | # CONFIG_HUGETLB_PAGE_SIZE_64MB is not set | 165 | # CONFIG_HUGETLB_PAGE_SIZE_64MB is not set |
166 | # CONFIG_HUGETLB_PAGE_SIZE_512MB is not set | ||
161 | CONFIG_SELECT_MEMORY_MODEL=y | 167 | CONFIG_SELECT_MEMORY_MODEL=y |
162 | # CONFIG_FLATMEM_MANUAL is not set | 168 | # CONFIG_FLATMEM_MANUAL is not set |
163 | # CONFIG_DISCONTIGMEM_MANUAL is not set | 169 | # CONFIG_DISCONTIGMEM_MANUAL is not set |
@@ -701,6 +707,7 @@ CONFIG_DEVPORT=y | |||
701 | # CONFIG_POWER_SUPPLY is not set | 707 | # CONFIG_POWER_SUPPLY is not set |
702 | CONFIG_HWMON=y | 708 | CONFIG_HWMON=y |
703 | # CONFIG_HWMON_VID is not set | 709 | # CONFIG_HWMON_VID is not set |
710 | # CONFIG_SENSORS_I5K_AMB is not set | ||
704 | # CONFIG_SENSORS_F71805F is not set | 711 | # CONFIG_SENSORS_F71805F is not set |
705 | # CONFIG_SENSORS_F71882FG is not set | 712 | # CONFIG_SENSORS_F71882FG is not set |
706 | # CONFIG_SENSORS_IT87 is not set | 713 | # CONFIG_SENSORS_IT87 is not set |
diff --git a/arch/sh/configs/r7780rp_defconfig b/arch/sh/configs/sdk7780_defconfig index 12cc01910cf8..bb9bcd6591ab 100644 --- a/arch/sh/configs/r7780rp_defconfig +++ b/arch/sh/configs/sdk7780_defconfig | |||
@@ -1,9 +1,10 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.21-rc7 | 3 | # Linux kernel version: 2.6.24-rc7 |
4 | # Tue May 1 12:28:39 2007 | 4 | # Tue Jan 22 11:34:03 2008 |
5 | # | 5 | # |
6 | CONFIG_SUPERH=y | 6 | CONFIG_SUPERH=y |
7 | CONFIG_SUPERH32=y | ||
7 | CONFIG_RWSEM_GENERIC_SPINLOCK=y | 8 | CONFIG_RWSEM_GENERIC_SPINLOCK=y |
8 | CONFIG_GENERIC_BUG=y | 9 | CONFIG_GENERIC_BUG=y |
9 | CONFIG_GENERIC_FIND_NEXT_BIT=y | 10 | CONFIG_GENERIC_FIND_NEXT_BIT=y |
@@ -11,149 +12,107 @@ CONFIG_GENERIC_HWEIGHT=y | |||
11 | CONFIG_GENERIC_HARDIRQS=y | 12 | CONFIG_GENERIC_HARDIRQS=y |
12 | CONFIG_GENERIC_IRQ_PROBE=y | 13 | CONFIG_GENERIC_IRQ_PROBE=y |
13 | CONFIG_GENERIC_CALIBRATE_DELAY=y | 14 | CONFIG_GENERIC_CALIBRATE_DELAY=y |
14 | # CONFIG_GENERIC_TIME is not set | 15 | CONFIG_GENERIC_TIME=y |
16 | CONFIG_GENERIC_CLOCKEVENTS=y | ||
17 | CONFIG_SYS_SUPPORTS_PCI=y | ||
15 | CONFIG_STACKTRACE_SUPPORT=y | 18 | CONFIG_STACKTRACE_SUPPORT=y |
16 | CONFIG_LOCKDEP_SUPPORT=y | 19 | CONFIG_LOCKDEP_SUPPORT=y |
17 | # CONFIG_ARCH_HAS_ILOG2_U32 is not set | 20 | # CONFIG_ARCH_HAS_ILOG2_U32 is not set |
18 | # CONFIG_ARCH_HAS_ILOG2_U64 is not set | 21 | # CONFIG_ARCH_HAS_ILOG2_U64 is not set |
22 | CONFIG_ARCH_NO_VIRT_TO_BUS=y | ||
19 | CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" | 23 | CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" |
20 | 24 | ||
21 | # | 25 | # |
22 | # Code maturity level options | 26 | # General setup |
23 | # | 27 | # |
24 | CONFIG_EXPERIMENTAL=y | 28 | CONFIG_EXPERIMENTAL=y |
25 | CONFIG_BROKEN_ON_SMP=y | 29 | CONFIG_BROKEN_ON_SMP=y |
26 | CONFIG_LOCK_KERNEL=y | 30 | CONFIG_LOCK_KERNEL=y |
27 | CONFIG_INIT_ENV_ARG_LIMIT=32 | 31 | CONFIG_INIT_ENV_ARG_LIMIT=32 |
28 | 32 | CONFIG_LOCALVERSION="_SDK7780" | |
29 | # | ||
30 | # General setup | ||
31 | # | ||
32 | CONFIG_LOCALVERSION="" | ||
33 | CONFIG_LOCALVERSION_AUTO=y | 33 | CONFIG_LOCALVERSION_AUTO=y |
34 | CONFIG_SWAP=y | 34 | CONFIG_SWAP=y |
35 | CONFIG_SYSVIPC=y | 35 | CONFIG_SYSVIPC=y |
36 | # CONFIG_IPC_NS is not set | ||
37 | CONFIG_SYSVIPC_SYSCTL=y | 36 | CONFIG_SYSVIPC_SYSCTL=y |
38 | # CONFIG_POSIX_MQUEUE is not set | 37 | CONFIG_POSIX_MQUEUE=y |
39 | CONFIG_BSD_PROCESS_ACCT=y | 38 | CONFIG_BSD_PROCESS_ACCT=y |
40 | # CONFIG_BSD_PROCESS_ACCT_V3 is not set | 39 | # CONFIG_BSD_PROCESS_ACCT_V3 is not set |
41 | # CONFIG_TASKSTATS is not set | 40 | # CONFIG_TASKSTATS is not set |
42 | # CONFIG_UTS_NS is not set | 41 | # CONFIG_USER_NS is not set |
42 | # CONFIG_PID_NS is not set | ||
43 | # CONFIG_AUDIT is not set | 43 | # CONFIG_AUDIT is not set |
44 | CONFIG_IKCONFIG=y | 44 | CONFIG_IKCONFIG=y |
45 | CONFIG_IKCONFIG_PROC=y | 45 | CONFIG_IKCONFIG_PROC=y |
46 | # CONFIG_SYSFS_DEPRECATED is not set | 46 | CONFIG_LOG_BUF_SHIFT=18 |
47 | # CONFIG_RELAY is not set | 47 | # CONFIG_CGROUPS is not set |
48 | CONFIG_FAIR_GROUP_SCHED=y | ||
49 | CONFIG_FAIR_USER_SCHED=y | ||
50 | # CONFIG_FAIR_CGROUP_SCHED is not set | ||
51 | CONFIG_SYSFS_DEPRECATED=y | ||
52 | CONFIG_RELAY=y | ||
48 | # CONFIG_BLK_DEV_INITRD is not set | 53 | # CONFIG_BLK_DEV_INITRD is not set |
49 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | 54 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y |
50 | CONFIG_SYSCTL=y | 55 | CONFIG_SYSCTL=y |
51 | CONFIG_EMBEDDED=y | 56 | CONFIG_EMBEDDED=y |
52 | CONFIG_UID16=y | 57 | CONFIG_UID16=y |
53 | # CONFIG_SYSCTL_SYSCALL is not set | 58 | CONFIG_SYSCTL_SYSCALL=y |
54 | CONFIG_KALLSYMS=y | 59 | CONFIG_KALLSYMS=y |
55 | # CONFIG_KALLSYMS_ALL is not set | 60 | CONFIG_KALLSYMS_ALL=y |
56 | # CONFIG_KALLSYMS_EXTRA_PASS is not set | 61 | # CONFIG_KALLSYMS_EXTRA_PASS is not set |
57 | CONFIG_HOTPLUG=y | 62 | CONFIG_HOTPLUG=y |
58 | CONFIG_PRINTK=y | 63 | CONFIG_PRINTK=y |
59 | CONFIG_BUG=y | 64 | CONFIG_BUG=y |
60 | CONFIG_ELF_CORE=y | 65 | CONFIG_ELF_CORE=y |
61 | CONFIG_BASE_FULL=y | 66 | CONFIG_BASE_FULL=y |
62 | # CONFIG_FUTEX is not set | 67 | CONFIG_FUTEX=y |
63 | # CONFIG_EPOLL is not set | 68 | CONFIG_ANON_INODES=y |
69 | CONFIG_EPOLL=y | ||
70 | CONFIG_SIGNALFD=y | ||
71 | CONFIG_EVENTFD=y | ||
64 | CONFIG_SHMEM=y | 72 | CONFIG_SHMEM=y |
65 | CONFIG_SLAB=y | ||
66 | CONFIG_VM_EVENT_COUNTERS=y | 73 | CONFIG_VM_EVENT_COUNTERS=y |
74 | CONFIG_SLUB_DEBUG=y | ||
75 | # CONFIG_SLAB is not set | ||
76 | CONFIG_SLUB=y | ||
77 | # CONFIG_SLOB is not set | ||
78 | CONFIG_SLABINFO=y | ||
79 | CONFIG_RT_MUTEXES=y | ||
67 | # CONFIG_TINY_SHMEM is not set | 80 | # CONFIG_TINY_SHMEM is not set |
68 | CONFIG_BASE_SMALL=0 | 81 | CONFIG_BASE_SMALL=0 |
69 | # CONFIG_SLOB is not set | ||
70 | |||
71 | # | ||
72 | # Loadable module support | ||
73 | # | ||
74 | CONFIG_MODULES=y | 82 | CONFIG_MODULES=y |
75 | CONFIG_MODULE_UNLOAD=y | 83 | CONFIG_MODULE_UNLOAD=y |
76 | # CONFIG_MODULE_FORCE_UNLOAD is not set | 84 | CONFIG_MODULE_FORCE_UNLOAD=y |
77 | # CONFIG_MODVERSIONS is not set | 85 | # CONFIG_MODVERSIONS is not set |
78 | # CONFIG_MODULE_SRCVERSION_ALL is not set | 86 | # CONFIG_MODULE_SRCVERSION_ALL is not set |
79 | CONFIG_KMOD=y | 87 | CONFIG_KMOD=y |
80 | |||
81 | # | ||
82 | # Block layer | ||
83 | # | ||
84 | CONFIG_BLOCK=y | 88 | CONFIG_BLOCK=y |
85 | # CONFIG_LBD is not set | 89 | CONFIG_LBD=y |
86 | # CONFIG_BLK_DEV_IO_TRACE is not set | 90 | # CONFIG_BLK_DEV_IO_TRACE is not set |
87 | # CONFIG_LSF is not set | 91 | # CONFIG_LSF is not set |
92 | # CONFIG_BLK_DEV_BSG is not set | ||
88 | 93 | ||
89 | # | 94 | # |
90 | # IO Schedulers | 95 | # IO Schedulers |
91 | # | 96 | # |
92 | CONFIG_IOSCHED_NOOP=y | 97 | CONFIG_IOSCHED_NOOP=y |
93 | # CONFIG_IOSCHED_AS is not set | 98 | CONFIG_IOSCHED_AS=y |
94 | # CONFIG_IOSCHED_DEADLINE is not set | 99 | CONFIG_IOSCHED_DEADLINE=y |
95 | # CONFIG_IOSCHED_CFQ is not set | 100 | CONFIG_IOSCHED_CFQ=y |
96 | # CONFIG_DEFAULT_AS is not set | 101 | CONFIG_DEFAULT_AS=y |
97 | # CONFIG_DEFAULT_DEADLINE is not set | 102 | # CONFIG_DEFAULT_DEADLINE is not set |
98 | # CONFIG_DEFAULT_CFQ is not set | 103 | # CONFIG_DEFAULT_CFQ is not set |
99 | CONFIG_DEFAULT_NOOP=y | 104 | # CONFIG_DEFAULT_NOOP is not set |
100 | CONFIG_DEFAULT_IOSCHED="noop" | 105 | CONFIG_DEFAULT_IOSCHED="anticipatory" |
101 | 106 | ||
102 | # | 107 | # |
103 | # System type | 108 | # System type |
104 | # | 109 | # |
105 | # CONFIG_SH_SOLUTION_ENGINE is not set | ||
106 | # CONFIG_SH_7722_SOLUTION_ENGINE is not set | ||
107 | # CONFIG_SH_7751_SOLUTION_ENGINE is not set | ||
108 | # CONFIG_SH_7780_SOLUTION_ENGINE is not set | ||
109 | # CONFIG_SH_7300_SOLUTION_ENGINE is not set | ||
110 | # CONFIG_SH_7343_SOLUTION_ENGINE is not set | ||
111 | # CONFIG_SH_73180_SOLUTION_ENGINE is not set | ||
112 | # CONFIG_SH_7751_SYSTEMH is not set | ||
113 | # CONFIG_SH_HP6XX is not set | ||
114 | # CONFIG_SH_SATURN is not set | ||
115 | # CONFIG_SH_DREAMCAST is not set | ||
116 | # CONFIG_SH_MPC1211 is not set | ||
117 | # CONFIG_SH_SH03 is not set | ||
118 | # CONFIG_SH_SECUREEDGE5410 is not set | ||
119 | # CONFIG_SH_HS7751RVOIP is not set | ||
120 | # CONFIG_SH_7710VOIPGW is not set | ||
121 | # CONFIG_SH_RTS7751R2D is not set | ||
122 | CONFIG_SH_HIGHLANDER=y | ||
123 | # CONFIG_SH_EDOSK7705 is not set | ||
124 | # CONFIG_SH_SH4202_MICRODEV is not set | ||
125 | # CONFIG_SH_LANDISK is not set | ||
126 | # CONFIG_SH_TITAN is not set | ||
127 | # CONFIG_SH_SHMIN is not set | ||
128 | # CONFIG_SH_7206_SOLUTION_ENGINE is not set | ||
129 | # CONFIG_SH_7619_SOLUTION_ENGINE is not set | ||
130 | # CONFIG_SH_LBOX_RE2 is not set | ||
131 | # CONFIG_SH_UNKNOWN is not set | ||
132 | CONFIG_SH_R7780RP=y | ||
133 | # CONFIG_SH_R7780MP is not set | ||
134 | # CONFIG_SH_R7785RP is not set | ||
135 | |||
136 | # | ||
137 | # Processor selection | ||
138 | # | ||
139 | CONFIG_CPU_SH4=y | 110 | CONFIG_CPU_SH4=y |
140 | CONFIG_CPU_SH4A=y | 111 | CONFIG_CPU_SH4A=y |
141 | |||
142 | # | ||
143 | # SH-2 Processor Support | ||
144 | # | ||
145 | # CONFIG_CPU_SUBTYPE_SH7604 is not set | ||
146 | # CONFIG_CPU_SUBTYPE_SH7619 is not set | 112 | # CONFIG_CPU_SUBTYPE_SH7619 is not set |
147 | 113 | # CONFIG_CPU_SUBTYPE_SH7203 is not set | |
148 | # | ||
149 | # SH-2A Processor Support | ||
150 | # | ||
151 | # CONFIG_CPU_SUBTYPE_SH7206 is not set | 114 | # CONFIG_CPU_SUBTYPE_SH7206 is not set |
152 | 115 | # CONFIG_CPU_SUBTYPE_SH7263 is not set | |
153 | # | ||
154 | # SH-3 Processor Support | ||
155 | # | ||
156 | # CONFIG_CPU_SUBTYPE_SH7300 is not set | ||
157 | # CONFIG_CPU_SUBTYPE_SH7705 is not set | 116 | # CONFIG_CPU_SUBTYPE_SH7705 is not set |
158 | # CONFIG_CPU_SUBTYPE_SH7706 is not set | 117 | # CONFIG_CPU_SUBTYPE_SH7706 is not set |
159 | # CONFIG_CPU_SUBTYPE_SH7707 is not set | 118 | # CONFIG_CPU_SUBTYPE_SH7707 is not set |
@@ -161,10 +120,8 @@ CONFIG_CPU_SH4A=y | |||
161 | # CONFIG_CPU_SUBTYPE_SH7709 is not set | 120 | # CONFIG_CPU_SUBTYPE_SH7709 is not set |
162 | # CONFIG_CPU_SUBTYPE_SH7710 is not set | 121 | # CONFIG_CPU_SUBTYPE_SH7710 is not set |
163 | # CONFIG_CPU_SUBTYPE_SH7712 is not set | 122 | # CONFIG_CPU_SUBTYPE_SH7712 is not set |
164 | 123 | # CONFIG_CPU_SUBTYPE_SH7720 is not set | |
165 | # | 124 | # CONFIG_CPU_SUBTYPE_SH7721 is not set |
166 | # SH-4 Processor Support | ||
167 | # | ||
168 | # CONFIG_CPU_SUBTYPE_SH7750 is not set | 125 | # CONFIG_CPU_SUBTYPE_SH7750 is not set |
169 | # CONFIG_CPU_SUBTYPE_SH7091 is not set | 126 | # CONFIG_CPU_SUBTYPE_SH7091 is not set |
170 | # CONFIG_CPU_SUBTYPE_SH7750R is not set | 127 | # CONFIG_CPU_SUBTYPE_SH7750R is not set |
@@ -173,38 +130,33 @@ CONFIG_CPU_SH4A=y | |||
173 | # CONFIG_CPU_SUBTYPE_SH7751R is not set | 130 | # CONFIG_CPU_SUBTYPE_SH7751R is not set |
174 | # CONFIG_CPU_SUBTYPE_SH7760 is not set | 131 | # CONFIG_CPU_SUBTYPE_SH7760 is not set |
175 | # CONFIG_CPU_SUBTYPE_SH4_202 is not set | 132 | # CONFIG_CPU_SUBTYPE_SH4_202 is not set |
176 | 133 | # CONFIG_CPU_SUBTYPE_SH7763 is not set | |
177 | # | ||
178 | # ST40 Processor Support | ||
179 | # | ||
180 | # CONFIG_CPU_SUBTYPE_ST40STB1 is not set | ||
181 | # CONFIG_CPU_SUBTYPE_ST40GX1 is not set | ||
182 | |||
183 | # | ||
184 | # SH-4A Processor Support | ||
185 | # | ||
186 | # CONFIG_CPU_SUBTYPE_SH7770 is not set | 134 | # CONFIG_CPU_SUBTYPE_SH7770 is not set |
187 | CONFIG_CPU_SUBTYPE_SH7780=y | 135 | CONFIG_CPU_SUBTYPE_SH7780=y |
188 | # CONFIG_CPU_SUBTYPE_SH7785 is not set | 136 | # CONFIG_CPU_SUBTYPE_SH7785 is not set |
189 | 137 | # CONFIG_CPU_SUBTYPE_SHX3 is not set | |
190 | # | ||
191 | # SH4AL-DSP Processor Support | ||
192 | # | ||
193 | # CONFIG_CPU_SUBTYPE_SH73180 is not set | ||
194 | # CONFIG_CPU_SUBTYPE_SH7343 is not set | 138 | # CONFIG_CPU_SUBTYPE_SH7343 is not set |
195 | # CONFIG_CPU_SUBTYPE_SH7722 is not set | 139 | # CONFIG_CPU_SUBTYPE_SH7722 is not set |
140 | # CONFIG_CPU_SUBTYPE_SH5_101 is not set | ||
141 | # CONFIG_CPU_SUBTYPE_SH5_103 is not set | ||
196 | 142 | ||
197 | # | 143 | # |
198 | # Memory management options | 144 | # Memory management options |
199 | # | 145 | # |
146 | CONFIG_QUICKLIST=y | ||
200 | CONFIG_MMU=y | 147 | CONFIG_MMU=y |
201 | CONFIG_PAGE_OFFSET=0x80000000 | 148 | CONFIG_PAGE_OFFSET=0x80000000 |
202 | CONFIG_MEMORY_START=0x08000000 | 149 | CONFIG_MEMORY_START=0x08000000 |
203 | CONFIG_MEMORY_SIZE=0x08000000 | 150 | CONFIG_MEMORY_SIZE=0x08000000 |
204 | # CONFIG_32BIT is not set | 151 | CONFIG_29BIT=y |
152 | # CONFIG_PMB is not set | ||
205 | CONFIG_VSYSCALL=y | 153 | CONFIG_VSYSCALL=y |
206 | CONFIG_ARCH_FLATMEM_ENABLE=y | 154 | CONFIG_ARCH_FLATMEM_ENABLE=y |
155 | CONFIG_ARCH_SPARSEMEM_ENABLE=y | ||
156 | CONFIG_ARCH_SPARSEMEM_DEFAULT=y | ||
157 | CONFIG_MAX_ACTIVE_REGIONS=1 | ||
207 | CONFIG_ARCH_POPULATES_NODE_MAP=y | 158 | CONFIG_ARCH_POPULATES_NODE_MAP=y |
159 | CONFIG_ARCH_SELECT_MEMORY_MODEL=y | ||
208 | CONFIG_PAGE_SIZE_4KB=y | 160 | CONFIG_PAGE_SIZE_4KB=y |
209 | # CONFIG_PAGE_SIZE_8KB is not set | 161 | # CONFIG_PAGE_SIZE_8KB is not set |
210 | # CONFIG_PAGE_SIZE_64KB is not set | 162 | # CONFIG_PAGE_SIZE_64KB is not set |
@@ -213,23 +165,27 @@ CONFIG_HUGETLB_PAGE_SIZE_64K=y | |||
213 | # CONFIG_HUGETLB_PAGE_SIZE_1MB is not set | 165 | # CONFIG_HUGETLB_PAGE_SIZE_1MB is not set |
214 | # CONFIG_HUGETLB_PAGE_SIZE_4MB is not set | 166 | # CONFIG_HUGETLB_PAGE_SIZE_4MB is not set |
215 | # CONFIG_HUGETLB_PAGE_SIZE_64MB is not set | 167 | # CONFIG_HUGETLB_PAGE_SIZE_64MB is not set |
168 | # CONFIG_HUGETLB_PAGE_SIZE_512MB is not set | ||
216 | CONFIG_SELECT_MEMORY_MODEL=y | 169 | CONFIG_SELECT_MEMORY_MODEL=y |
217 | CONFIG_FLATMEM_MANUAL=y | 170 | CONFIG_FLATMEM_MANUAL=y |
218 | # CONFIG_DISCONTIGMEM_MANUAL is not set | 171 | # CONFIG_DISCONTIGMEM_MANUAL is not set |
219 | # CONFIG_SPARSEMEM_MANUAL is not set | 172 | # CONFIG_SPARSEMEM_MANUAL is not set |
220 | CONFIG_FLATMEM=y | 173 | CONFIG_FLATMEM=y |
221 | CONFIG_FLAT_NODE_MEM_MAP=y | 174 | CONFIG_FLAT_NODE_MEM_MAP=y |
222 | # CONFIG_SPARSEMEM_STATIC is not set | 175 | CONFIG_SPARSEMEM_STATIC=y |
176 | # CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set | ||
223 | CONFIG_SPLIT_PTLOCK_CPUS=4 | 177 | CONFIG_SPLIT_PTLOCK_CPUS=4 |
224 | # CONFIG_RESOURCES_64BIT is not set | 178 | CONFIG_RESOURCES_64BIT=y |
225 | CONFIG_ZONE_DMA_FLAG=0 | 179 | CONFIG_ZONE_DMA_FLAG=0 |
180 | CONFIG_NR_QUICK=2 | ||
226 | 181 | ||
227 | # | 182 | # |
228 | # Cache configuration | 183 | # Cache configuration |
229 | # | 184 | # |
230 | # CONFIG_SH_DIRECT_MAPPED is not set | 185 | # CONFIG_SH_DIRECT_MAPPED is not set |
231 | # CONFIG_SH_WRITETHROUGH is not set | 186 | CONFIG_CACHE_WRITEBACK=y |
232 | # CONFIG_SH_OCRAM is not set | 187 | # CONFIG_CACHE_WRITETHROUGH is not set |
188 | # CONFIG_CACHE_OFF is not set | ||
233 | 189 | ||
234 | # | 190 | # |
235 | # Processor features | 191 | # Processor features |
@@ -237,20 +193,31 @@ CONFIG_ZONE_DMA_FLAG=0 | |||
237 | CONFIG_CPU_LITTLE_ENDIAN=y | 193 | CONFIG_CPU_LITTLE_ENDIAN=y |
238 | # CONFIG_CPU_BIG_ENDIAN is not set | 194 | # CONFIG_CPU_BIG_ENDIAN is not set |
239 | CONFIG_SH_FPU=y | 195 | CONFIG_SH_FPU=y |
240 | # CONFIG_SH_DSP is not set | ||
241 | CONFIG_SH_STORE_QUEUES=y | 196 | CONFIG_SH_STORE_QUEUES=y |
242 | CONFIG_SPECULATIVE_EXECUTION=y | 197 | # CONFIG_SPECULATIVE_EXECUTION is not set |
243 | CONFIG_CPU_HAS_INTEVT=y | 198 | CONFIG_CPU_HAS_INTEVT=y |
244 | CONFIG_CPU_HAS_INTC_IRQ=y | ||
245 | CONFIG_CPU_HAS_SR_RB=y | 199 | CONFIG_CPU_HAS_SR_RB=y |
200 | CONFIG_CPU_HAS_FPU=y | ||
201 | |||
202 | # | ||
203 | # Board support | ||
204 | # | ||
205 | # CONFIG_SH_7780_SOLUTION_ENGINE is not set | ||
206 | CONFIG_SH_SDK7780=y | ||
207 | # CONFIG_SH_HIGHLANDER is not set | ||
208 | # CONFIG_SH_SDK7780_STANDALONE is not set | ||
209 | CONFIG_SH_SDK7780_BASE=y | ||
246 | 210 | ||
247 | # | 211 | # |
248 | # Timer and clock configuration | 212 | # Timer and clock configuration |
249 | # | 213 | # |
250 | CONFIG_SH_TMU=y | 214 | CONFIG_SH_TMU=y |
251 | CONFIG_SH_TIMER_IRQ=28 | 215 | CONFIG_SH_TIMER_IRQ=28 |
252 | CONFIG_NO_IDLE_HZ=y | 216 | CONFIG_SH_PCLK_FREQ=33333333 |
253 | CONFIG_SH_PCLK_FREQ=32000000 | 217 | CONFIG_TICK_ONESHOT=y |
218 | # CONFIG_NO_HZ is not set | ||
219 | CONFIG_HIGH_RES_TIMERS=y | ||
220 | CONFIG_GENERIC_CLOCKEVENTS_BUILD=y | ||
254 | 221 | ||
255 | # | 222 | # |
256 | # CPU Frequency scaling | 223 | # CPU Frequency scaling |
@@ -260,18 +227,20 @@ CONFIG_SH_PCLK_FREQ=32000000 | |||
260 | # | 227 | # |
261 | # DMA support | 228 | # DMA support |
262 | # | 229 | # |
263 | # CONFIG_SH_DMA is not set | 230 | CONFIG_SH_DMA_API=y |
231 | CONFIG_SH_DMA=y | ||
232 | CONFIG_NR_ONCHIP_DMA_CHANNELS=12 | ||
233 | # CONFIG_NR_DMA_CHANNELS_BOOL is not set | ||
264 | 234 | ||
265 | # | 235 | # |
266 | # Companion Chips | 236 | # Companion Chips |
267 | # | 237 | # |
268 | # CONFIG_HD6446X_SERIES is not set | ||
269 | 238 | ||
270 | # | 239 | # |
271 | # Additional SuperH Device Drivers | 240 | # Additional SuperH Device Drivers |
272 | # | 241 | # |
273 | # CONFIG_HEARTBEAT is not set | 242 | CONFIG_HEARTBEAT=y |
274 | CONFIG_PUSH_SWITCH=y | 243 | # CONFIG_PUSH_SWITCH is not set |
275 | 244 | ||
276 | # | 245 | # |
277 | # Kernel features | 246 | # Kernel features |
@@ -281,22 +250,21 @@ CONFIG_HZ_250=y | |||
281 | # CONFIG_HZ_300 is not set | 250 | # CONFIG_HZ_300 is not set |
282 | # CONFIG_HZ_1000 is not set | 251 | # CONFIG_HZ_1000 is not set |
283 | CONFIG_HZ=250 | 252 | CONFIG_HZ=250 |
284 | CONFIG_KEXEC=y | 253 | # CONFIG_KEXEC is not set |
285 | # CONFIG_CRASH_DUMP is not set | 254 | # CONFIG_CRASH_DUMP is not set |
286 | # CONFIG_SMP is not set | ||
287 | # CONFIG_PREEMPT_NONE is not set | 255 | # CONFIG_PREEMPT_NONE is not set |
288 | # CONFIG_PREEMPT_VOLUNTARY is not set | 256 | # CONFIG_PREEMPT_VOLUNTARY is not set |
289 | CONFIG_PREEMPT=y | 257 | CONFIG_PREEMPT=y |
290 | CONFIG_PREEMPT_BKL=y | 258 | CONFIG_PREEMPT_BKL=y |
259 | CONFIG_GUSA=y | ||
291 | 260 | ||
292 | # | 261 | # |
293 | # Boot options | 262 | # Boot options |
294 | # | 263 | # |
295 | CONFIG_ZERO_PAGE_OFFSET=0x00001000 | 264 | CONFIG_ZERO_PAGE_OFFSET=0x00001000 |
296 | CONFIG_BOOT_LINK_OFFSET=0x00800000 | 265 | CONFIG_BOOT_LINK_OFFSET=0x01800000 |
297 | # CONFIG_UBC_WAKEUP is not set | ||
298 | CONFIG_CMDLINE_BOOL=y | 266 | CONFIG_CMDLINE_BOOL=y |
299 | CONFIG_CMDLINE="mem=128M console=ttySC0,115200 root=/dev/sda1" | 267 | CONFIG_CMDLINE="mem=128M console=tty0 console=ttySC0,115200 ip=bootp root=/dev/nfs nfsroot=192.168.0.1:/home/rootfs" |
300 | 268 | ||
301 | # | 269 | # |
302 | # Bus options | 270 | # Bus options |
@@ -305,31 +273,40 @@ CONFIG_PCI=y | |||
305 | CONFIG_SH_PCIDMA_NONCOHERENT=y | 273 | CONFIG_SH_PCIDMA_NONCOHERENT=y |
306 | CONFIG_PCI_AUTO=y | 274 | CONFIG_PCI_AUTO=y |
307 | CONFIG_PCI_AUTO_UPDATE_RESOURCES=y | 275 | CONFIG_PCI_AUTO_UPDATE_RESOURCES=y |
308 | # CONFIG_PCI_DEBUG is not set | 276 | # CONFIG_ARCH_SUPPORTS_MSI is not set |
309 | 277 | # CONFIG_PCI_LEGACY is not set | |
310 | # | 278 | CONFIG_PCI_DEBUG=y |
311 | # PCCARD (PCMCIA/CardBus) support | 279 | CONFIG_PCCARD=y |
312 | # | 280 | # CONFIG_PCMCIA_DEBUG is not set |
313 | # CONFIG_PCCARD is not set | 281 | CONFIG_PCMCIA=y |
314 | 282 | CONFIG_PCMCIA_LOAD_CIS=y | |
315 | # | 283 | CONFIG_PCMCIA_IOCTL=y |
316 | # PCI Hotplug Support | 284 | CONFIG_CARDBUS=y |
317 | # | 285 | |
318 | # CONFIG_HOTPLUG_PCI is not set | 286 | # |
287 | # PC-card bridges | ||
288 | # | ||
289 | CONFIG_YENTA=y | ||
290 | CONFIG_YENTA_O2=y | ||
291 | CONFIG_YENTA_RICOH=y | ||
292 | CONFIG_YENTA_TI=y | ||
293 | CONFIG_YENTA_ENE_TUNE=y | ||
294 | CONFIG_YENTA_TOSHIBA=y | ||
295 | # CONFIG_PD6729 is not set | ||
296 | # CONFIG_I82092 is not set | ||
297 | CONFIG_PCCARD_NONSTATIC=y | ||
298 | CONFIG_HOTPLUG_PCI=y | ||
299 | # CONFIG_HOTPLUG_PCI_FAKE is not set | ||
300 | # CONFIG_HOTPLUG_PCI_CPCI is not set | ||
301 | # CONFIG_HOTPLUG_PCI_SHPC is not set | ||
319 | 302 | ||
320 | # | 303 | # |
321 | # Executable file formats | 304 | # Executable file formats |
322 | # | 305 | # |
323 | CONFIG_BINFMT_ELF=y | 306 | CONFIG_BINFMT_ELF=y |
324 | # CONFIG_BINFMT_FLAT is not set | ||
325 | # CONFIG_BINFMT_MISC is not set | 307 | # CONFIG_BINFMT_MISC is not set |
326 | 308 | ||
327 | # | 309 | # |
328 | # Power management options (EXPERIMENTAL) | ||
329 | # | ||
330 | # CONFIG_PM is not set | ||
331 | |||
332 | # | ||
333 | # Networking | 310 | # Networking |
334 | # | 311 | # |
335 | CONFIG_NET=y | 312 | CONFIG_NET=y |
@@ -337,7 +314,6 @@ CONFIG_NET=y | |||
337 | # | 314 | # |
338 | # Networking options | 315 | # Networking options |
339 | # | 316 | # |
340 | # CONFIG_NETDEBUG is not set | ||
341 | CONFIG_PACKET=y | 317 | CONFIG_PACKET=y |
342 | # CONFIG_PACKET_MMAP is not set | 318 | # CONFIG_PACKET_MMAP is not set |
343 | CONFIG_UNIX=y | 319 | CONFIG_UNIX=y |
@@ -347,7 +323,7 @@ CONFIG_XFRM=y | |||
347 | # CONFIG_XFRM_MIGRATE is not set | 323 | # CONFIG_XFRM_MIGRATE is not set |
348 | # CONFIG_NET_KEY is not set | 324 | # CONFIG_NET_KEY is not set |
349 | CONFIG_INET=y | 325 | CONFIG_INET=y |
350 | # CONFIG_IP_MULTICAST is not set | 326 | CONFIG_IP_MULTICAST=y |
351 | CONFIG_IP_ADVANCED_ROUTER=y | 327 | CONFIG_IP_ADVANCED_ROUTER=y |
352 | CONFIG_ASK_IP_FIB_HASH=y | 328 | CONFIG_ASK_IP_FIB_HASH=y |
353 | # CONFIG_IP_FIB_TRIE is not set | 329 | # CONFIG_IP_FIB_TRIE is not set |
@@ -356,52 +332,55 @@ CONFIG_IP_FIB_HASH=y | |||
356 | # CONFIG_IP_ROUTE_MULTIPATH is not set | 332 | # CONFIG_IP_ROUTE_MULTIPATH is not set |
357 | # CONFIG_IP_ROUTE_VERBOSE is not set | 333 | # CONFIG_IP_ROUTE_VERBOSE is not set |
358 | CONFIG_IP_PNP=y | 334 | CONFIG_IP_PNP=y |
359 | CONFIG_IP_PNP_DHCP=y | 335 | # CONFIG_IP_PNP_DHCP is not set |
360 | # CONFIG_IP_PNP_BOOTP is not set | 336 | CONFIG_IP_PNP_BOOTP=y |
361 | # CONFIG_IP_PNP_RARP is not set | 337 | # CONFIG_IP_PNP_RARP is not set |
362 | # CONFIG_NET_IPIP is not set | 338 | # CONFIG_NET_IPIP is not set |
363 | # CONFIG_NET_IPGRE is not set | 339 | # CONFIG_NET_IPGRE is not set |
340 | # CONFIG_IP_MROUTE is not set | ||
364 | # CONFIG_ARPD is not set | 341 | # CONFIG_ARPD is not set |
365 | # CONFIG_SYN_COOKIES is not set | 342 | # CONFIG_SYN_COOKIES is not set |
366 | # CONFIG_INET_AH is not set | 343 | # CONFIG_INET_AH is not set |
367 | # CONFIG_INET_ESP is not set | 344 | # CONFIG_INET_ESP is not set |
368 | # CONFIG_INET_IPCOMP is not set | 345 | # CONFIG_INET_IPCOMP is not set |
369 | # CONFIG_INET_XFRM_TUNNEL is not set | 346 | # CONFIG_INET_XFRM_TUNNEL is not set |
370 | # CONFIG_INET_TUNNEL is not set | 347 | CONFIG_INET_TUNNEL=y |
371 | CONFIG_INET_XFRM_MODE_TRANSPORT=y | 348 | CONFIG_INET_XFRM_MODE_TRANSPORT=y |
372 | CONFIG_INET_XFRM_MODE_TUNNEL=y | 349 | CONFIG_INET_XFRM_MODE_TUNNEL=y |
373 | CONFIG_INET_XFRM_MODE_BEET=y | 350 | # CONFIG_INET_XFRM_MODE_BEET is not set |
351 | # CONFIG_INET_LRO is not set | ||
374 | CONFIG_INET_DIAG=y | 352 | CONFIG_INET_DIAG=y |
375 | CONFIG_INET_TCP_DIAG=y | 353 | CONFIG_INET_TCP_DIAG=y |
376 | # CONFIG_TCP_CONG_ADVANCED is not set | 354 | # CONFIG_TCP_CONG_ADVANCED is not set |
377 | CONFIG_TCP_CONG_CUBIC=y | 355 | CONFIG_TCP_CONG_CUBIC=y |
378 | CONFIG_DEFAULT_TCP_CONG="cubic" | 356 | CONFIG_DEFAULT_TCP_CONG="cubic" |
379 | # CONFIG_TCP_MD5SIG is not set | 357 | # CONFIG_TCP_MD5SIG is not set |
380 | # CONFIG_IPV6 is not set | 358 | CONFIG_IPV6=y |
359 | # CONFIG_IPV6_PRIVACY is not set | ||
360 | # CONFIG_IPV6_ROUTER_PREF is not set | ||
361 | # CONFIG_IPV6_OPTIMISTIC_DAD is not set | ||
362 | # CONFIG_INET6_AH is not set | ||
363 | # CONFIG_INET6_ESP is not set | ||
364 | # CONFIG_INET6_IPCOMP is not set | ||
365 | # CONFIG_IPV6_MIP6 is not set | ||
381 | # CONFIG_INET6_XFRM_TUNNEL is not set | 366 | # CONFIG_INET6_XFRM_TUNNEL is not set |
382 | # CONFIG_INET6_TUNNEL is not set | 367 | # CONFIG_INET6_TUNNEL is not set |
368 | CONFIG_INET6_XFRM_MODE_TRANSPORT=y | ||
369 | CONFIG_INET6_XFRM_MODE_TUNNEL=y | ||
370 | # CONFIG_INET6_XFRM_MODE_BEET is not set | ||
371 | # CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set | ||
372 | CONFIG_IPV6_SIT=y | ||
373 | # CONFIG_IPV6_TUNNEL is not set | ||
374 | # CONFIG_IPV6_MULTIPLE_TABLES is not set | ||
383 | # CONFIG_NETWORK_SECMARK is not set | 375 | # CONFIG_NETWORK_SECMARK is not set |
384 | # CONFIG_NETFILTER is not set | 376 | # CONFIG_NETFILTER is not set |
385 | |||
386 | # | ||
387 | # DCCP Configuration (EXPERIMENTAL) | ||
388 | # | ||
389 | # CONFIG_IP_DCCP is not set | 377 | # CONFIG_IP_DCCP is not set |
390 | |||
391 | # | ||
392 | # SCTP Configuration (EXPERIMENTAL) | ||
393 | # | ||
394 | # CONFIG_IP_SCTP is not set | 378 | # CONFIG_IP_SCTP is not set |
395 | |||
396 | # | ||
397 | # TIPC Configuration (EXPERIMENTAL) | ||
398 | # | ||
399 | # CONFIG_TIPC is not set | 379 | # CONFIG_TIPC is not set |
400 | # CONFIG_ATM is not set | 380 | # CONFIG_ATM is not set |
401 | CONFIG_BRIDGE=m | 381 | # CONFIG_BRIDGE is not set |
402 | # CONFIG_VLAN_8021Q is not set | 382 | # CONFIG_VLAN_8021Q is not set |
403 | # CONFIG_DECNET is not set | 383 | # CONFIG_DECNET is not set |
404 | CONFIG_LLC=m | ||
405 | # CONFIG_LLC2 is not set | 384 | # CONFIG_LLC2 is not set |
406 | # CONFIG_IPX is not set | 385 | # CONFIG_IPX is not set |
407 | # CONFIG_ATALK is not set | 386 | # CONFIG_ATALK is not set |
@@ -409,11 +388,39 @@ CONFIG_LLC=m | |||
409 | # CONFIG_LAPB is not set | 388 | # CONFIG_LAPB is not set |
410 | # CONFIG_ECONET is not set | 389 | # CONFIG_ECONET is not set |
411 | # CONFIG_WAN_ROUTER is not set | 390 | # CONFIG_WAN_ROUTER is not set |
391 | CONFIG_NET_SCHED=y | ||
392 | |||
393 | # | ||
394 | # Queueing/Scheduling | ||
395 | # | ||
396 | # CONFIG_NET_SCH_CBQ is not set | ||
397 | # CONFIG_NET_SCH_HTB is not set | ||
398 | # CONFIG_NET_SCH_HFSC is not set | ||
399 | # CONFIG_NET_SCH_PRIO is not set | ||
400 | # CONFIG_NET_SCH_RR is not set | ||
401 | # CONFIG_NET_SCH_RED is not set | ||
402 | # CONFIG_NET_SCH_SFQ is not set | ||
403 | # CONFIG_NET_SCH_TEQL is not set | ||
404 | # CONFIG_NET_SCH_TBF is not set | ||
405 | # CONFIG_NET_SCH_GRED is not set | ||
406 | # CONFIG_NET_SCH_DSMARK is not set | ||
407 | # CONFIG_NET_SCH_NETEM is not set | ||
408 | # CONFIG_NET_SCH_INGRESS is not set | ||
412 | 409 | ||
413 | # | 410 | # |
414 | # QoS and/or fair queueing | 411 | # Classification |
415 | # | 412 | # |
416 | # CONFIG_NET_SCHED is not set | 413 | # CONFIG_NET_CLS_BASIC is not set |
414 | # CONFIG_NET_CLS_TCINDEX is not set | ||
415 | # CONFIG_NET_CLS_ROUTE4 is not set | ||
416 | # CONFIG_NET_CLS_FW is not set | ||
417 | # CONFIG_NET_CLS_U32 is not set | ||
418 | # CONFIG_NET_CLS_RSVP is not set | ||
419 | # CONFIG_NET_CLS_RSVP6 is not set | ||
420 | # CONFIG_NET_EMATCH is not set | ||
421 | # CONFIG_NET_CLS_ACT is not set | ||
422 | # CONFIG_NET_CLS_POLICE is not set | ||
423 | CONFIG_NET_SCH_FIFO=y | ||
417 | 424 | ||
418 | # | 425 | # |
419 | # Network testing | 426 | # Network testing |
@@ -422,8 +429,17 @@ CONFIG_LLC=m | |||
422 | # CONFIG_HAMRADIO is not set | 429 | # CONFIG_HAMRADIO is not set |
423 | # CONFIG_IRDA is not set | 430 | # CONFIG_IRDA is not set |
424 | # CONFIG_BT is not set | 431 | # CONFIG_BT is not set |
432 | # CONFIG_AF_RXRPC is not set | ||
433 | |||
434 | # | ||
435 | # Wireless | ||
436 | # | ||
437 | # CONFIG_CFG80211 is not set | ||
438 | # CONFIG_WIRELESS_EXT is not set | ||
439 | # CONFIG_MAC80211 is not set | ||
425 | # CONFIG_IEEE80211 is not set | 440 | # CONFIG_IEEE80211 is not set |
426 | CONFIG_WIRELESS_EXT=y | 441 | # CONFIG_RFKILL is not set |
442 | # CONFIG_NET_9P is not set | ||
427 | 443 | ||
428 | # | 444 | # |
429 | # Device Drivers | 445 | # Device Drivers |
@@ -432,69 +448,108 @@ CONFIG_WIRELESS_EXT=y | |||
432 | # | 448 | # |
433 | # Generic Driver Options | 449 | # Generic Driver Options |
434 | # | 450 | # |
451 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | ||
435 | CONFIG_STANDALONE=y | 452 | CONFIG_STANDALONE=y |
436 | CONFIG_PREVENT_FIRMWARE_BUILD=y | 453 | CONFIG_PREVENT_FIRMWARE_BUILD=y |
437 | CONFIG_FW_LOADER=m | 454 | CONFIG_FW_LOADER=y |
438 | # CONFIG_DEBUG_DRIVER is not set | 455 | # CONFIG_DEBUG_DRIVER is not set |
439 | # CONFIG_DEBUG_DEVRES is not set | 456 | # CONFIG_DEBUG_DEVRES is not set |
440 | # CONFIG_SYS_HYPERVISOR is not set | 457 | # CONFIG_SYS_HYPERVISOR is not set |
441 | |||
442 | # | ||
443 | # Connector - unified userspace <-> kernelspace linker | ||
444 | # | ||
445 | # CONFIG_CONNECTOR is not set | 458 | # CONFIG_CONNECTOR is not set |
446 | |||
447 | # | ||
448 | # Memory Technology Devices (MTD) | ||
449 | # | ||
450 | # CONFIG_MTD is not set | 459 | # CONFIG_MTD is not set |
451 | 460 | CONFIG_PARPORT=y | |
452 | # | 461 | # CONFIG_PARPORT_PC is not set |
453 | # Parallel port support | 462 | # CONFIG_PARPORT_GSC is not set |
454 | # | 463 | # CONFIG_PARPORT_AX88796 is not set |
455 | # CONFIG_PARPORT is not set | 464 | # CONFIG_PARPORT_1284 is not set |
456 | 465 | CONFIG_BLK_DEV=y | |
457 | # | ||
458 | # Plug and Play support | ||
459 | # | ||
460 | # CONFIG_PNPACPI is not set | ||
461 | |||
462 | # | ||
463 | # Block devices | ||
464 | # | ||
465 | # CONFIG_BLK_CPQ_DA is not set | ||
466 | # CONFIG_BLK_CPQ_CISS_DA is not set | 466 | # CONFIG_BLK_CPQ_CISS_DA is not set |
467 | # CONFIG_BLK_DEV_DAC960 is not set | 467 | # CONFIG_BLK_DEV_DAC960 is not set |
468 | # CONFIG_BLK_DEV_UMEM is not set | 468 | # CONFIG_BLK_DEV_UMEM is not set |
469 | # CONFIG_BLK_DEV_COW_COMMON is not set | 469 | # CONFIG_BLK_DEV_COW_COMMON is not set |
470 | # CONFIG_BLK_DEV_LOOP is not set | 470 | CONFIG_BLK_DEV_LOOP=y |
471 | # CONFIG_BLK_DEV_CRYPTOLOOP is not set | ||
471 | # CONFIG_BLK_DEV_NBD is not set | 472 | # CONFIG_BLK_DEV_NBD is not set |
472 | # CONFIG_BLK_DEV_SX8 is not set | 473 | # CONFIG_BLK_DEV_SX8 is not set |
474 | # CONFIG_BLK_DEV_UB is not set | ||
473 | CONFIG_BLK_DEV_RAM=y | 475 | CONFIG_BLK_DEV_RAM=y |
474 | CONFIG_BLK_DEV_RAM_COUNT=16 | 476 | CONFIG_BLK_DEV_RAM_COUNT=16 |
475 | CONFIG_BLK_DEV_RAM_SIZE=4096 | 477 | CONFIG_BLK_DEV_RAM_SIZE=4096 |
476 | CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 | 478 | CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 |
477 | # CONFIG_CDROM_PKTCDVD is not set | 479 | # CONFIG_CDROM_PKTCDVD is not set |
478 | # CONFIG_ATA_OVER_ETH is not set | 480 | # CONFIG_ATA_OVER_ETH is not set |
479 | 481 | # CONFIG_MISC_DEVICES is not set | |
480 | # | 482 | CONFIG_IDE=y |
481 | # Misc devices | 483 | CONFIG_IDE_MAX_HWIFS=4 |
482 | # | 484 | CONFIG_BLK_DEV_IDE=y |
483 | # CONFIG_SGI_IOC4 is not set | 485 | |
484 | # CONFIG_TIFM_CORE is not set | 486 | # |
485 | 487 | # Please see Documentation/ide.txt for help/info on IDE drives | |
486 | # | 488 | # |
487 | # ATA/ATAPI/MFM/RLL support | 489 | # CONFIG_BLK_DEV_IDE_SATA is not set |
488 | # | 490 | CONFIG_BLK_DEV_IDEDISK=y |
489 | # CONFIG_IDE is not set | 491 | CONFIG_IDEDISK_MULTI_MODE=y |
492 | # CONFIG_BLK_DEV_IDECS is not set | ||
493 | # CONFIG_BLK_DEV_DELKIN is not set | ||
494 | CONFIG_BLK_DEV_IDECD=y | ||
495 | # CONFIG_BLK_DEV_IDETAPE is not set | ||
496 | # CONFIG_BLK_DEV_IDEFLOPPY is not set | ||
497 | # CONFIG_BLK_DEV_IDESCSI is not set | ||
498 | # CONFIG_IDE_TASK_IOCTL is not set | ||
499 | CONFIG_IDE_PROC_FS=y | ||
500 | |||
501 | # | ||
502 | # IDE chipset support/bugfixes | ||
503 | # | ||
504 | CONFIG_IDE_GENERIC=y | ||
505 | CONFIG_BLK_DEV_PLATFORM=y | ||
506 | |||
507 | # | ||
508 | # PCI IDE chipsets support | ||
509 | # | ||
510 | CONFIG_BLK_DEV_IDEPCI=y | ||
511 | # CONFIG_IDEPCI_SHARE_IRQ is not set | ||
512 | CONFIG_IDEPCI_PCIBUS_ORDER=y | ||
513 | # CONFIG_BLK_DEV_OFFBOARD is not set | ||
514 | CONFIG_BLK_DEV_GENERIC=y | ||
515 | # CONFIG_BLK_DEV_OPTI621 is not set | ||
516 | # CONFIG_BLK_DEV_AEC62XX is not set | ||
517 | # CONFIG_BLK_DEV_ALI15X3 is not set | ||
518 | # CONFIG_BLK_DEV_AMD74XX is not set | ||
519 | # CONFIG_BLK_DEV_CMD64X is not set | ||
520 | # CONFIG_BLK_DEV_TRIFLEX is not set | ||
521 | # CONFIG_BLK_DEV_CY82C693 is not set | ||
522 | # CONFIG_BLK_DEV_CS5520 is not set | ||
523 | # CONFIG_BLK_DEV_CS5530 is not set | ||
524 | # CONFIG_BLK_DEV_HPT34X is not set | ||
525 | # CONFIG_BLK_DEV_HPT366 is not set | ||
526 | # CONFIG_BLK_DEV_JMICRON is not set | ||
527 | # CONFIG_BLK_DEV_SC1200 is not set | ||
528 | # CONFIG_BLK_DEV_PIIX is not set | ||
529 | # CONFIG_BLK_DEV_IT8213 is not set | ||
530 | # CONFIG_BLK_DEV_IT821X is not set | ||
531 | # CONFIG_BLK_DEV_NS87415 is not set | ||
532 | # CONFIG_BLK_DEV_PDC202XX_OLD is not set | ||
533 | # CONFIG_BLK_DEV_PDC202XX_NEW is not set | ||
534 | # CONFIG_BLK_DEV_SVWKS is not set | ||
535 | # CONFIG_BLK_DEV_SIIMAGE is not set | ||
536 | # CONFIG_BLK_DEV_SLC90E66 is not set | ||
537 | # CONFIG_BLK_DEV_TRM290 is not set | ||
538 | # CONFIG_BLK_DEV_VIA82CXXX is not set | ||
539 | # CONFIG_BLK_DEV_TC86C001 is not set | ||
540 | # CONFIG_IDE_ARM is not set | ||
541 | # CONFIG_BLK_DEV_IDEDMA is not set | ||
542 | # CONFIG_IDE_ARCH_OBSOLETE_INIT is not set | ||
543 | # CONFIG_BLK_DEV_HD is not set | ||
490 | 544 | ||
491 | # | 545 | # |
492 | # SCSI device support | 546 | # SCSI device support |
493 | # | 547 | # |
494 | # CONFIG_RAID_ATTRS is not set | 548 | # CONFIG_RAID_ATTRS is not set |
495 | CONFIG_SCSI=y | 549 | CONFIG_SCSI=y |
550 | CONFIG_SCSI_DMA=y | ||
496 | # CONFIG_SCSI_TGT is not set | 551 | # CONFIG_SCSI_TGT is not set |
497 | # CONFIG_SCSI_NETLINK is not set | 552 | CONFIG_SCSI_NETLINK=y |
498 | CONFIG_SCSI_PROC_FS=y | 553 | CONFIG_SCSI_PROC_FS=y |
499 | 554 | ||
500 | # | 555 | # |
@@ -503,8 +558,9 @@ CONFIG_SCSI_PROC_FS=y | |||
503 | CONFIG_BLK_DEV_SD=y | 558 | CONFIG_BLK_DEV_SD=y |
504 | # CONFIG_CHR_DEV_ST is not set | 559 | # CONFIG_CHR_DEV_ST is not set |
505 | # CONFIG_CHR_DEV_OSST is not set | 560 | # CONFIG_CHR_DEV_OSST is not set |
506 | # CONFIG_BLK_DEV_SR is not set | 561 | CONFIG_BLK_DEV_SR=y |
507 | CONFIG_CHR_DEV_SG=m | 562 | # CONFIG_BLK_DEV_SR_VENDOR is not set |
563 | CONFIG_CHR_DEV_SG=y | ||
508 | # CONFIG_CHR_DEV_SCH is not set | 564 | # CONFIG_CHR_DEV_SCH is not set |
509 | 565 | ||
510 | # | 566 | # |
@@ -514,19 +570,17 @@ CONFIG_CHR_DEV_SG=m | |||
514 | # CONFIG_SCSI_CONSTANTS is not set | 570 | # CONFIG_SCSI_CONSTANTS is not set |
515 | # CONFIG_SCSI_LOGGING is not set | 571 | # CONFIG_SCSI_LOGGING is not set |
516 | # CONFIG_SCSI_SCAN_ASYNC is not set | 572 | # CONFIG_SCSI_SCAN_ASYNC is not set |
573 | CONFIG_SCSI_WAIT_SCAN=m | ||
517 | 574 | ||
518 | # | 575 | # |
519 | # SCSI Transports | 576 | # SCSI Transports |
520 | # | 577 | # |
521 | # CONFIG_SCSI_SPI_ATTRS is not set | 578 | CONFIG_SCSI_SPI_ATTRS=y |
522 | # CONFIG_SCSI_FC_ATTRS is not set | 579 | CONFIG_SCSI_FC_ATTRS=y |
523 | # CONFIG_SCSI_ISCSI_ATTRS is not set | 580 | # CONFIG_SCSI_ISCSI_ATTRS is not set |
524 | # CONFIG_SCSI_SAS_ATTRS is not set | ||
525 | # CONFIG_SCSI_SAS_LIBSAS is not set | 581 | # CONFIG_SCSI_SAS_LIBSAS is not set |
526 | 582 | # CONFIG_SCSI_SRP_ATTRS is not set | |
527 | # | 583 | CONFIG_SCSI_LOWLEVEL=y |
528 | # SCSI low-level drivers | ||
529 | # | ||
530 | # CONFIG_ISCSI_TCP is not set | 584 | # CONFIG_ISCSI_TCP is not set |
531 | # CONFIG_BLK_DEV_3W_XXXX_RAID is not set | 585 | # CONFIG_BLK_DEV_3W_XXXX_RAID is not set |
532 | # CONFIG_SCSI_3W_9XXX is not set | 586 | # CONFIG_SCSI_3W_9XXX is not set |
@@ -536,7 +590,6 @@ CONFIG_CHR_DEV_SG=m | |||
536 | # CONFIG_SCSI_AIC7XXX_OLD is not set | 590 | # CONFIG_SCSI_AIC7XXX_OLD is not set |
537 | # CONFIG_SCSI_AIC79XX is not set | 591 | # CONFIG_SCSI_AIC79XX is not set |
538 | # CONFIG_SCSI_AIC94XX is not set | 592 | # CONFIG_SCSI_AIC94XX is not set |
539 | # CONFIG_SCSI_DPT_I2O is not set | ||
540 | # CONFIG_SCSI_ARCMSR is not set | 593 | # CONFIG_SCSI_ARCMSR is not set |
541 | # CONFIG_MEGARAID_NEWGEN is not set | 594 | # CONFIG_MEGARAID_NEWGEN is not set |
542 | # CONFIG_MEGARAID_LEGACY is not set | 595 | # CONFIG_MEGARAID_LEGACY is not set |
@@ -559,10 +612,7 @@ CONFIG_CHR_DEV_SG=m | |||
559 | # CONFIG_SCSI_NSP32 is not set | 612 | # CONFIG_SCSI_NSP32 is not set |
560 | # CONFIG_SCSI_DEBUG is not set | 613 | # CONFIG_SCSI_DEBUG is not set |
561 | # CONFIG_SCSI_SRP is not set | 614 | # CONFIG_SCSI_SRP is not set |
562 | 615 | # CONFIG_SCSI_LOWLEVEL_PCMCIA is not set | |
563 | # | ||
564 | # Serial ATA (prod) and Parallel ATA (experimental) drivers | ||
565 | # | ||
566 | CONFIG_ATA=y | 616 | CONFIG_ATA=y |
567 | # CONFIG_ATA_NONSTANDARD is not set | 617 | # CONFIG_ATA_NONSTANDARD is not set |
568 | # CONFIG_SATA_AHCI is not set | 618 | # CONFIG_SATA_AHCI is not set |
@@ -574,7 +624,7 @@ CONFIG_ATA=y | |||
574 | # CONFIG_SATA_QSTOR is not set | 624 | # CONFIG_SATA_QSTOR is not set |
575 | # CONFIG_SATA_PROMISE is not set | 625 | # CONFIG_SATA_PROMISE is not set |
576 | # CONFIG_SATA_SX4 is not set | 626 | # CONFIG_SATA_SX4 is not set |
577 | CONFIG_SATA_SIL=y | 627 | # CONFIG_SATA_SIL is not set |
578 | # CONFIG_SATA_SIL24 is not set | 628 | # CONFIG_SATA_SIL24 is not set |
579 | # CONFIG_SATA_SIS is not set | 629 | # CONFIG_SATA_SIS is not set |
580 | # CONFIG_SATA_ULI is not set | 630 | # CONFIG_SATA_ULI is not set |
@@ -585,6 +635,7 @@ CONFIG_SATA_SIL=y | |||
585 | # CONFIG_PATA_AMD is not set | 635 | # CONFIG_PATA_AMD is not set |
586 | # CONFIG_PATA_ARTOP is not set | 636 | # CONFIG_PATA_ARTOP is not set |
587 | # CONFIG_PATA_ATIIXP is not set | 637 | # CONFIG_PATA_ATIIXP is not set |
638 | # CONFIG_PATA_CMD640_PCI is not set | ||
588 | # CONFIG_PATA_CMD64X is not set | 639 | # CONFIG_PATA_CMD64X is not set |
589 | # CONFIG_PATA_CS5520 is not set | 640 | # CONFIG_PATA_CS5520 is not set |
590 | # CONFIG_PATA_CS5530 is not set | 641 | # CONFIG_PATA_CS5530 is not set |
@@ -604,8 +655,10 @@ CONFIG_SATA_SIL=y | |||
604 | # CONFIG_PATA_OLDPIIX is not set | 655 | # CONFIG_PATA_OLDPIIX is not set |
605 | # CONFIG_PATA_NETCELL is not set | 656 | # CONFIG_PATA_NETCELL is not set |
606 | # CONFIG_PATA_NS87410 is not set | 657 | # CONFIG_PATA_NS87410 is not set |
658 | # CONFIG_PATA_NS87415 is not set | ||
607 | # CONFIG_PATA_OPTI is not set | 659 | # CONFIG_PATA_OPTI is not set |
608 | # CONFIG_PATA_OPTIDMA is not set | 660 | # CONFIG_PATA_OPTIDMA is not set |
661 | # CONFIG_PATA_PCMCIA is not set | ||
609 | # CONFIG_PATA_PDC_OLD is not set | 662 | # CONFIG_PATA_PDC_OLD is not set |
610 | # CONFIG_PATA_RADISYS is not set | 663 | # CONFIG_PATA_RADISYS is not set |
611 | # CONFIG_PATA_RZ1000 is not set | 664 | # CONFIG_PATA_RZ1000 is not set |
@@ -616,185 +669,87 @@ CONFIG_SATA_SIL=y | |||
616 | # CONFIG_PATA_SIS is not set | 669 | # CONFIG_PATA_SIS is not set |
617 | # CONFIG_PATA_VIA is not set | 670 | # CONFIG_PATA_VIA is not set |
618 | # CONFIG_PATA_WINBOND is not set | 671 | # CONFIG_PATA_WINBOND is not set |
619 | CONFIG_PATA_PLATFORM=y | 672 | # CONFIG_PATA_PLATFORM is not set |
620 | 673 | CONFIG_MD=y | |
621 | # | 674 | # CONFIG_BLK_DEV_MD is not set |
622 | # Multi-device support (RAID and LVM) | 675 | CONFIG_BLK_DEV_DM=y |
623 | # | 676 | # CONFIG_DM_DEBUG is not set |
624 | # CONFIG_MD is not set | 677 | # CONFIG_DM_CRYPT is not set |
625 | 678 | # CONFIG_DM_SNAPSHOT is not set | |
626 | # | 679 | # CONFIG_DM_MIRROR is not set |
627 | # Fusion MPT device support | 680 | # CONFIG_DM_ZERO is not set |
628 | # | 681 | # CONFIG_DM_MULTIPATH is not set |
682 | # CONFIG_DM_DELAY is not set | ||
683 | # CONFIG_DM_UEVENT is not set | ||
629 | # CONFIG_FUSION is not set | 684 | # CONFIG_FUSION is not set |
630 | # CONFIG_FUSION_SPI is not set | ||
631 | # CONFIG_FUSION_FC is not set | ||
632 | # CONFIG_FUSION_SAS is not set | ||
633 | 685 | ||
634 | # | 686 | # |
635 | # IEEE 1394 (FireWire) support | 687 | # IEEE 1394 (FireWire) support |
636 | # | 688 | # |
689 | # CONFIG_FIREWIRE is not set | ||
637 | # CONFIG_IEEE1394 is not set | 690 | # CONFIG_IEEE1394 is not set |
638 | |||
639 | # | ||
640 | # I2O device support | ||
641 | # | ||
642 | # CONFIG_I2O is not set | 691 | # CONFIG_I2O is not set |
643 | |||
644 | # | ||
645 | # Network device support | ||
646 | # | ||
647 | CONFIG_NETDEVICES=y | 692 | CONFIG_NETDEVICES=y |
693 | # CONFIG_NETDEVICES_MULTIQUEUE is not set | ||
648 | # CONFIG_DUMMY is not set | 694 | # CONFIG_DUMMY is not set |
649 | # CONFIG_BONDING is not set | 695 | # CONFIG_BONDING is not set |
696 | # CONFIG_MACVLAN is not set | ||
650 | # CONFIG_EQUALIZER is not set | 697 | # CONFIG_EQUALIZER is not set |
651 | # CONFIG_TUN is not set | 698 | # CONFIG_TUN is not set |
652 | 699 | # CONFIG_VETH is not set | |
653 | # | ||
654 | # ARCnet devices | ||
655 | # | ||
656 | # CONFIG_ARCNET is not set | 700 | # CONFIG_ARCNET is not set |
657 | |||
658 | # | ||
659 | # PHY device support | ||
660 | # | ||
661 | # CONFIG_PHYLIB is not set | 701 | # CONFIG_PHYLIB is not set |
662 | |||
663 | # | ||
664 | # Ethernet (10 or 100Mbit) | ||
665 | # | ||
666 | CONFIG_NET_ETHERNET=y | 702 | CONFIG_NET_ETHERNET=y |
667 | CONFIG_MII=y | 703 | CONFIG_MII=y |
704 | # CONFIG_AX88796 is not set | ||
668 | # CONFIG_STNIC is not set | 705 | # CONFIG_STNIC is not set |
669 | # CONFIG_HAPPYMEAL is not set | 706 | # CONFIG_HAPPYMEAL is not set |
670 | # CONFIG_SUNGEM is not set | 707 | # CONFIG_SUNGEM is not set |
671 | # CONFIG_CASSINI is not set | 708 | # CONFIG_CASSINI is not set |
672 | # CONFIG_NET_VENDOR_3COM is not set | 709 | # CONFIG_NET_VENDOR_3COM is not set |
673 | # CONFIG_SMC91X is not set | 710 | CONFIG_SMC91X=y |
674 | |||
675 | # | ||
676 | # Tulip family network device support | ||
677 | # | ||
678 | # CONFIG_NET_TULIP is not set | 711 | # CONFIG_NET_TULIP is not set |
679 | # CONFIG_HP100 is not set | 712 | # CONFIG_HP100 is not set |
680 | CONFIG_NET_PCI=y | 713 | # CONFIG_IBM_NEW_EMAC_ZMII is not set |
681 | CONFIG_PCNET32=m | 714 | # CONFIG_IBM_NEW_EMAC_RGMII is not set |
682 | # CONFIG_PCNET32_NAPI is not set | 715 | # CONFIG_IBM_NEW_EMAC_TAH is not set |
683 | # CONFIG_AMD8111_ETH is not set | 716 | # CONFIG_IBM_NEW_EMAC_EMAC4 is not set |
684 | # CONFIG_ADAPTEC_STARFIRE is not set | 717 | # CONFIG_NET_PCI is not set |
685 | # CONFIG_B44 is not set | 718 | # CONFIG_B44 is not set |
686 | # CONFIG_FORCEDETH is not set | 719 | # CONFIG_NET_POCKET is not set |
687 | # CONFIG_DGRS is not set | 720 | # CONFIG_NETDEV_1000 is not set |
688 | # CONFIG_EEPRO100 is not set | 721 | # CONFIG_NETDEV_10000 is not set |
689 | # CONFIG_E100 is not set | ||
690 | # CONFIG_FEALNX is not set | ||
691 | # CONFIG_NATSEMI is not set | ||
692 | # CONFIG_NE2K_PCI is not set | ||
693 | CONFIG_8139CP=m | ||
694 | CONFIG_8139TOO=m | ||
695 | # CONFIG_8139TOO_PIO is not set | ||
696 | # CONFIG_8139TOO_TUNE_TWISTER is not set | ||
697 | CONFIG_8139TOO_8129=y | ||
698 | # CONFIG_8139_OLD_RX_RESET is not set | ||
699 | # CONFIG_SIS900 is not set | ||
700 | # CONFIG_EPIC100 is not set | ||
701 | # CONFIG_SUNDANCE is not set | ||
702 | # CONFIG_TLAN is not set | ||
703 | CONFIG_VIA_RHINE=m | ||
704 | CONFIG_VIA_RHINE_MMIO=y | ||
705 | # CONFIG_VIA_RHINE_NAPI is not set | ||
706 | # CONFIG_SC92031 is not set | ||
707 | |||
708 | # | ||
709 | # Ethernet (1000 Mbit) | ||
710 | # | ||
711 | # CONFIG_ACENIC is not set | ||
712 | # CONFIG_DL2K is not set | ||
713 | CONFIG_E1000=m | ||
714 | # CONFIG_E1000_NAPI is not set | ||
715 | # CONFIG_E1000_DISABLE_PACKET_SPLIT is not set | ||
716 | # CONFIG_NS83820 is not set | ||
717 | # CONFIG_HAMACHI is not set | ||
718 | # CONFIG_YELLOWFIN is not set | ||
719 | CONFIG_R8169=y | ||
720 | # CONFIG_R8169_NAPI is not set | ||
721 | # CONFIG_SIS190 is not set | ||
722 | # CONFIG_SKGE is not set | ||
723 | # CONFIG_SKY2 is not set | ||
724 | # CONFIG_SK98LIN is not set | ||
725 | # CONFIG_VIA_VELOCITY is not set | ||
726 | # CONFIG_TIGON3 is not set | ||
727 | # CONFIG_BNX2 is not set | ||
728 | # CONFIG_QLA3XXX is not set | ||
729 | # CONFIG_ATL1 is not set | ||
730 | |||
731 | # | ||
732 | # Ethernet (10000 Mbit) | ||
733 | # | ||
734 | # CONFIG_CHELSIO_T1 is not set | ||
735 | # CONFIG_CHELSIO_T3 is not set | ||
736 | # CONFIG_IXGB is not set | ||
737 | # CONFIG_S2IO is not set | ||
738 | # CONFIG_MYRI10GE is not set | ||
739 | # CONFIG_NETXEN_NIC is not set | ||
740 | |||
741 | # | ||
742 | # Token Ring devices | ||
743 | # | ||
744 | # CONFIG_TR is not set | 722 | # CONFIG_TR is not set |
745 | 723 | ||
746 | # | 724 | # |
747 | # Wireless LAN (non-hamradio) | 725 | # Wireless LAN |
748 | # | ||
749 | CONFIG_NET_RADIO=y | ||
750 | # CONFIG_NET_WIRELESS_RTNETLINK is not set | ||
751 | |||
752 | # | ||
753 | # Obsolete Wireless cards support (pre-802.11) | ||
754 | # | ||
755 | # CONFIG_STRIP is not set | ||
756 | |||
757 | # | ||
758 | # Wireless 802.11b ISA/PCI cards support | ||
759 | # | ||
760 | # CONFIG_IPW2100 is not set | ||
761 | # CONFIG_IPW2200 is not set | ||
762 | CONFIG_HERMES=m | ||
763 | # CONFIG_PLX_HERMES is not set | ||
764 | # CONFIG_TMD_HERMES is not set | ||
765 | # CONFIG_NORTEL_HERMES is not set | ||
766 | # CONFIG_PCI_HERMES is not set | ||
767 | # CONFIG_ATMEL is not set | ||
768 | |||
769 | # | ||
770 | # Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support | ||
771 | # | 726 | # |
772 | CONFIG_PRISM54=m | 727 | # CONFIG_WLAN_PRE80211 is not set |
773 | # CONFIG_HOSTAP is not set | 728 | # CONFIG_WLAN_80211 is not set |
774 | CONFIG_NET_WIRELESS=y | ||
775 | 729 | ||
776 | # | 730 | # |
777 | # Wan interfaces | 731 | # USB Network Adapters |
778 | # | 732 | # |
733 | # CONFIG_USB_CATC is not set | ||
734 | # CONFIG_USB_KAWETH is not set | ||
735 | # CONFIG_USB_PEGASUS is not set | ||
736 | # CONFIG_USB_RTL8150 is not set | ||
737 | # CONFIG_USB_USBNET is not set | ||
738 | # CONFIG_NET_PCMCIA is not set | ||
779 | # CONFIG_WAN is not set | 739 | # CONFIG_WAN is not set |
780 | # CONFIG_FDDI is not set | 740 | # CONFIG_FDDI is not set |
781 | # CONFIG_HIPPI is not set | 741 | # CONFIG_HIPPI is not set |
742 | # CONFIG_PLIP is not set | ||
782 | # CONFIG_PPP is not set | 743 | # CONFIG_PPP is not set |
783 | # CONFIG_SLIP is not set | 744 | # CONFIG_SLIP is not set |
784 | # CONFIG_NET_FC is not set | 745 | # CONFIG_NET_FC is not set |
785 | # CONFIG_SHAPER is not set | 746 | # CONFIG_SHAPER is not set |
786 | # CONFIG_NETCONSOLE is not set | 747 | CONFIG_NETCONSOLE=y |
787 | # CONFIG_NETPOLL is not set | 748 | # CONFIG_NETCONSOLE_DYNAMIC is not set |
788 | # CONFIG_NET_POLL_CONTROLLER is not set | 749 | CONFIG_NETPOLL=y |
789 | 750 | # CONFIG_NETPOLL_TRAP is not set | |
790 | # | 751 | CONFIG_NET_POLL_CONTROLLER=y |
791 | # ISDN subsystem | ||
792 | # | ||
793 | # CONFIG_ISDN is not set | 752 | # CONFIG_ISDN is not set |
794 | |||
795 | # | ||
796 | # Telephony Support | ||
797 | # | ||
798 | # CONFIG_PHONE is not set | 753 | # CONFIG_PHONE is not set |
799 | 754 | ||
800 | # | 755 | # |
@@ -802,17 +757,17 @@ CONFIG_NET_WIRELESS=y | |||
802 | # | 757 | # |
803 | CONFIG_INPUT=y | 758 | CONFIG_INPUT=y |
804 | # CONFIG_INPUT_FF_MEMLESS is not set | 759 | # CONFIG_INPUT_FF_MEMLESS is not set |
760 | # CONFIG_INPUT_POLLDEV is not set | ||
805 | 761 | ||
806 | # | 762 | # |
807 | # Userland interfaces | 763 | # Userland interfaces |
808 | # | 764 | # |
809 | CONFIG_INPUT_MOUSEDEV=y | 765 | CONFIG_INPUT_MOUSEDEV=y |
810 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set | 766 | CONFIG_INPUT_MOUSEDEV_PSAUX=y |
811 | CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 | 767 | CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 |
812 | CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 | 768 | CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 |
813 | # CONFIG_INPUT_JOYDEV is not set | 769 | # CONFIG_INPUT_JOYDEV is not set |
814 | # CONFIG_INPUT_TSDEV is not set | 770 | CONFIG_INPUT_EVDEV=y |
815 | # CONFIG_INPUT_EVDEV is not set | ||
816 | # CONFIG_INPUT_EVBUG is not set | 771 | # CONFIG_INPUT_EVBUG is not set |
817 | 772 | ||
818 | # | 773 | # |
@@ -825,8 +780,19 @@ CONFIG_KEYBOARD_ATKBD=y | |||
825 | # CONFIG_KEYBOARD_XTKBD is not set | 780 | # CONFIG_KEYBOARD_XTKBD is not set |
826 | # CONFIG_KEYBOARD_NEWTON is not set | 781 | # CONFIG_KEYBOARD_NEWTON is not set |
827 | # CONFIG_KEYBOARD_STOWAWAY is not set | 782 | # CONFIG_KEYBOARD_STOWAWAY is not set |
828 | # CONFIG_INPUT_MOUSE is not set | 783 | CONFIG_INPUT_MOUSE=y |
784 | CONFIG_MOUSE_PS2=y | ||
785 | CONFIG_MOUSE_PS2_ALPS=y | ||
786 | CONFIG_MOUSE_PS2_LOGIPS2PP=y | ||
787 | CONFIG_MOUSE_PS2_SYNAPTICS=y | ||
788 | CONFIG_MOUSE_PS2_LIFEBOOK=y | ||
789 | CONFIG_MOUSE_PS2_TRACKPOINT=y | ||
790 | # CONFIG_MOUSE_PS2_TOUCHKIT is not set | ||
791 | # CONFIG_MOUSE_SERIAL is not set | ||
792 | # CONFIG_MOUSE_APPLETOUCH is not set | ||
793 | # CONFIG_MOUSE_VSXXXAA is not set | ||
829 | # CONFIG_INPUT_JOYSTICK is not set | 794 | # CONFIG_INPUT_JOYSTICK is not set |
795 | # CONFIG_INPUT_TABLET is not set | ||
830 | # CONFIG_INPUT_TOUCHSCREEN is not set | 796 | # CONFIG_INPUT_TOUCHSCREEN is not set |
831 | # CONFIG_INPUT_MISC is not set | 797 | # CONFIG_INPUT_MISC is not set |
832 | 798 | ||
@@ -836,6 +802,7 @@ CONFIG_KEYBOARD_ATKBD=y | |||
836 | CONFIG_SERIO=y | 802 | CONFIG_SERIO=y |
837 | # CONFIG_SERIO_I8042 is not set | 803 | # CONFIG_SERIO_I8042 is not set |
838 | # CONFIG_SERIO_SERPORT is not set | 804 | # CONFIG_SERIO_SERPORT is not set |
805 | # CONFIG_SERIO_PARKBD is not set | ||
839 | # CONFIG_SERIO_PCIPS2 is not set | 806 | # CONFIG_SERIO_PCIPS2 is not set |
840 | CONFIG_SERIO_LIBPS2=y | 807 | CONFIG_SERIO_LIBPS2=y |
841 | # CONFIG_SERIO_RAW is not set | 808 | # CONFIG_SERIO_RAW is not set |
@@ -844,7 +811,10 @@ CONFIG_SERIO_LIBPS2=y | |||
844 | # | 811 | # |
845 | # Character devices | 812 | # Character devices |
846 | # | 813 | # |
847 | # CONFIG_VT is not set | 814 | CONFIG_VT=y |
815 | CONFIG_VT_CONSOLE=y | ||
816 | CONFIG_HW_CONSOLE=y | ||
817 | # CONFIG_VT_HW_CONSOLE_BINDING is not set | ||
848 | # CONFIG_SERIAL_NONSTANDARD is not set | 818 | # CONFIG_SERIAL_NONSTANDARD is not set |
849 | 819 | ||
850 | # | 820 | # |
@@ -864,32 +834,22 @@ CONFIG_SERIAL_CORE_CONSOLE=y | |||
864 | CONFIG_UNIX98_PTYS=y | 834 | CONFIG_UNIX98_PTYS=y |
865 | CONFIG_LEGACY_PTYS=y | 835 | CONFIG_LEGACY_PTYS=y |
866 | CONFIG_LEGACY_PTY_COUNT=256 | 836 | CONFIG_LEGACY_PTY_COUNT=256 |
867 | 837 | # CONFIG_PRINTER is not set | |
868 | # | 838 | # CONFIG_PPDEV is not set |
869 | # IPMI | ||
870 | # | ||
871 | # CONFIG_IPMI_HANDLER is not set | 839 | # CONFIG_IPMI_HANDLER is not set |
872 | |||
873 | # | ||
874 | # Watchdog Cards | ||
875 | # | ||
876 | # CONFIG_WATCHDOG is not set | ||
877 | CONFIG_HW_RANDOM=y | 840 | CONFIG_HW_RANDOM=y |
878 | # CONFIG_GEN_RTC is not set | ||
879 | # CONFIG_DTLK is not set | ||
880 | # CONFIG_R3964 is not set | 841 | # CONFIG_R3964 is not set |
881 | # CONFIG_APPLICOM is not set | 842 | # CONFIG_APPLICOM is not set |
882 | # CONFIG_DRM is not set | ||
883 | # CONFIG_RAW_DRIVER is not set | ||
884 | 843 | ||
885 | # | 844 | # |
886 | # TPM devices | 845 | # PCMCIA character devices |
887 | # | 846 | # |
847 | # CONFIG_SYNCLINK_CS is not set | ||
848 | # CONFIG_CARDMAN_4000 is not set | ||
849 | # CONFIG_CARDMAN_4040 is not set | ||
850 | # CONFIG_RAW_DRIVER is not set | ||
888 | # CONFIG_TCG_TPM is not set | 851 | # CONFIG_TCG_TPM is not set |
889 | 852 | CONFIG_DEVPORT=y | |
890 | # | ||
891 | # I2C support | ||
892 | # | ||
893 | # CONFIG_I2C is not set | 853 | # CONFIG_I2C is not set |
894 | 854 | ||
895 | # | 855 | # |
@@ -897,22 +857,27 @@ CONFIG_HW_RANDOM=y | |||
897 | # | 857 | # |
898 | # CONFIG_SPI is not set | 858 | # CONFIG_SPI is not set |
899 | # CONFIG_SPI_MASTER is not set | 859 | # CONFIG_SPI_MASTER is not set |
900 | |||
901 | # | ||
902 | # Dallas's 1-wire bus | ||
903 | # | ||
904 | # CONFIG_W1 is not set | 860 | # CONFIG_W1 is not set |
861 | CONFIG_POWER_SUPPLY=y | ||
862 | # CONFIG_POWER_SUPPLY_DEBUG is not set | ||
863 | # CONFIG_PDA_POWER is not set | ||
864 | # CONFIG_BATTERY_DS2760 is not set | ||
865 | # CONFIG_HWMON is not set | ||
866 | # CONFIG_WATCHDOG is not set | ||
905 | 867 | ||
906 | # | 868 | # |
907 | # Hardware Monitoring support | 869 | # Sonics Silicon Backplane |
908 | # | 870 | # |
909 | CONFIG_HWMON=y | 871 | CONFIG_SSB_POSSIBLE=y |
910 | # CONFIG_HWMON_VID is not set | 872 | CONFIG_SSB=y |
911 | # CONFIG_SENSORS_ABITUGURU is not set | 873 | CONFIG_SSB_PCIHOST_POSSIBLE=y |
912 | # CONFIG_SENSORS_F71805F is not set | 874 | CONFIG_SSB_PCIHOST=y |
913 | # CONFIG_SENSORS_PC87427 is not set | 875 | CONFIG_SSB_PCMCIAHOST_POSSIBLE=y |
914 | # CONFIG_SENSORS_VT1211 is not set | 876 | # CONFIG_SSB_PCMCIAHOST is not set |
915 | # CONFIG_HWMON_DEBUG_CHIP is not set | 877 | # CONFIG_SSB_SILENT is not set |
878 | # CONFIG_SSB_DEBUG is not set | ||
879 | CONFIG_SSB_DRIVER_PCICORE_POSSIBLE=y | ||
880 | CONFIG_SSB_DRIVER_PCICORE=y | ||
916 | 881 | ||
917 | # | 882 | # |
918 | # Multifunction device drivers | 883 | # Multifunction device drivers |
@@ -923,22 +888,93 @@ CONFIG_HWMON=y | |||
923 | # Multimedia devices | 888 | # Multimedia devices |
924 | # | 889 | # |
925 | # CONFIG_VIDEO_DEV is not set | 890 | # CONFIG_VIDEO_DEV is not set |
891 | # CONFIG_DVB_CORE is not set | ||
892 | # CONFIG_DAB is not set | ||
893 | |||
894 | # | ||
895 | # Graphics support | ||
896 | # | ||
897 | # CONFIG_DRM is not set | ||
898 | # CONFIG_VGASTATE is not set | ||
899 | # CONFIG_VIDEO_OUTPUT_CONTROL is not set | ||
900 | CONFIG_FB=y | ||
901 | # CONFIG_FIRMWARE_EDID is not set | ||
902 | # CONFIG_FB_DDC is not set | ||
903 | # CONFIG_FB_CFB_FILLRECT is not set | ||
904 | # CONFIG_FB_CFB_COPYAREA is not set | ||
905 | # CONFIG_FB_CFB_IMAGEBLIT is not set | ||
906 | # CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set | ||
907 | # CONFIG_FB_SYS_FILLRECT is not set | ||
908 | # CONFIG_FB_SYS_COPYAREA is not set | ||
909 | # CONFIG_FB_SYS_IMAGEBLIT is not set | ||
910 | # CONFIG_FB_SYS_FOPS is not set | ||
911 | CONFIG_FB_DEFERRED_IO=y | ||
912 | # CONFIG_FB_SVGALIB is not set | ||
913 | # CONFIG_FB_MACMODES is not set | ||
914 | # CONFIG_FB_BACKLIGHT is not set | ||
915 | # CONFIG_FB_MODE_HELPERS is not set | ||
916 | # CONFIG_FB_TILEBLITTING is not set | ||
917 | |||
918 | # | ||
919 | # Frame buffer hardware drivers | ||
920 | # | ||
921 | # CONFIG_FB_CIRRUS is not set | ||
922 | # CONFIG_FB_PM2 is not set | ||
923 | # CONFIG_FB_CYBER2000 is not set | ||
924 | # CONFIG_FB_ASILIANT is not set | ||
925 | # CONFIG_FB_IMSTT is not set | ||
926 | # CONFIG_FB_S1D13XXX is not set | ||
927 | # CONFIG_FB_NVIDIA is not set | ||
928 | # CONFIG_FB_RIVA is not set | ||
929 | # CONFIG_FB_MATROX is not set | ||
930 | # CONFIG_FB_RADEON is not set | ||
931 | # CONFIG_FB_ATY128 is not set | ||
932 | # CONFIG_FB_ATY is not set | ||
933 | # CONFIG_FB_S3 is not set | ||
934 | # CONFIG_FB_SAVAGE is not set | ||
935 | # CONFIG_FB_SIS is not set | ||
936 | # CONFIG_FB_NEOMAGIC is not set | ||
937 | # CONFIG_FB_KYRO is not set | ||
938 | # CONFIG_FB_3DFX is not set | ||
939 | # CONFIG_FB_VOODOO1 is not set | ||
940 | # CONFIG_FB_VT8623 is not set | ||
941 | # CONFIG_FB_TRIDENT is not set | ||
942 | # CONFIG_FB_ARK is not set | ||
943 | # CONFIG_FB_PM3 is not set | ||
944 | # CONFIG_FB_VIRTUAL is not set | ||
945 | # CONFIG_BACKLIGHT_LCD_SUPPORT is not set | ||
926 | 946 | ||
927 | # | 947 | # |
928 | # Digital Video Broadcasting Devices | 948 | # Display device support |
929 | # | 949 | # |
930 | # CONFIG_DVB is not set | 950 | CONFIG_DISPLAY_SUPPORT=y |
931 | 951 | ||
932 | # | 952 | # |
933 | # Graphics support | 953 | # Display hardware drivers |
934 | # | 954 | # |
935 | # CONFIG_BACKLIGHT_LCD_SUPPORT is not set | 955 | |
936 | # CONFIG_FB is not set | 956 | # |
957 | # Console display driver support | ||
958 | # | ||
959 | CONFIG_DUMMY_CONSOLE=y | ||
960 | CONFIG_FRAMEBUFFER_CONSOLE=y | ||
961 | CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y | ||
962 | # CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set | ||
963 | # CONFIG_FONTS is not set | ||
964 | CONFIG_FONT_8x8=y | ||
965 | CONFIG_FONT_8x16=y | ||
966 | CONFIG_LOGO=y | ||
967 | CONFIG_LOGO_LINUX_MONO=y | ||
968 | CONFIG_LOGO_LINUX_VGA16=y | ||
969 | CONFIG_LOGO_LINUX_CLUT224=y | ||
970 | CONFIG_LOGO_SUPERH_MONO=y | ||
971 | CONFIG_LOGO_SUPERH_VGA16=y | ||
972 | CONFIG_LOGO_SUPERH_CLUT224=y | ||
937 | 973 | ||
938 | # | 974 | # |
939 | # Sound | 975 | # Sound |
940 | # | 976 | # |
941 | CONFIG_SOUND=m | 977 | CONFIG_SOUND=y |
942 | 978 | ||
943 | # | 979 | # |
944 | # Advanced Linux Sound Architecture | 980 | # Advanced Linux Sound Architecture |
@@ -948,126 +984,162 @@ CONFIG_SOUND=m | |||
948 | # | 984 | # |
949 | # Open Sound System | 985 | # Open Sound System |
950 | # | 986 | # |
951 | CONFIG_SOUND_PRIME=m | 987 | CONFIG_SOUND_PRIME=y |
952 | # CONFIG_OBSOLETE_OSS is not set | ||
953 | # CONFIG_SOUND_BT878 is not set | ||
954 | # CONFIG_SOUND_ICH is not set | ||
955 | # CONFIG_SOUND_TRIDENT is not set | 988 | # CONFIG_SOUND_TRIDENT is not set |
956 | # CONFIG_SOUND_MSNDCLAS is not set | 989 | # CONFIG_SOUND_MSNDCLAS is not set |
957 | # CONFIG_SOUND_MSNDPIN is not set | 990 | # CONFIG_SOUND_MSNDPIN is not set |
958 | # CONFIG_SOUND_VIA82CXXX is not set | 991 | CONFIG_HID_SUPPORT=y |
959 | |||
960 | # | ||
961 | # HID Devices | ||
962 | # | ||
963 | CONFIG_HID=y | 992 | CONFIG_HID=y |
964 | # CONFIG_HID_DEBUG is not set | 993 | # CONFIG_HID_DEBUG is not set |
994 | # CONFIG_HIDRAW is not set | ||
965 | 995 | ||
966 | # | 996 | # |
967 | # USB support | 997 | # USB Input Devices |
968 | # | 998 | # |
999 | CONFIG_USB_HID=y | ||
1000 | # CONFIG_USB_HIDINPUT_POWERBOOK is not set | ||
1001 | # CONFIG_HID_FF is not set | ||
1002 | # CONFIG_USB_HIDDEV is not set | ||
1003 | CONFIG_USB_SUPPORT=y | ||
969 | CONFIG_USB_ARCH_HAS_HCD=y | 1004 | CONFIG_USB_ARCH_HAS_HCD=y |
970 | CONFIG_USB_ARCH_HAS_OHCI=y | 1005 | CONFIG_USB_ARCH_HAS_OHCI=y |
971 | CONFIG_USB_ARCH_HAS_EHCI=y | 1006 | CONFIG_USB_ARCH_HAS_EHCI=y |
972 | # CONFIG_USB is not set | 1007 | CONFIG_USB=y |
1008 | CONFIG_USB_DEBUG=y | ||
973 | 1009 | ||
974 | # | 1010 | # |
975 | # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' | 1011 | # Miscellaneous USB options |
976 | # | 1012 | # |
1013 | CONFIG_USB_DEVICEFS=y | ||
1014 | # CONFIG_USB_DEVICE_CLASS is not set | ||
1015 | # CONFIG_USB_DYNAMIC_MINORS is not set | ||
1016 | # CONFIG_USB_OTG is not set | ||
977 | 1017 | ||
978 | # | 1018 | # |
979 | # USB Gadget Support | 1019 | # USB Host Controller Drivers |
980 | # | ||
981 | # CONFIG_USB_GADGET is not set | ||
982 | |||
983 | # | ||
984 | # MMC/SD Card support | ||
985 | # | ||
986 | # CONFIG_MMC is not set | ||
987 | |||
988 | # | ||
989 | # LED devices | ||
990 | # | 1020 | # |
991 | # CONFIG_NEW_LEDS is not set | 1021 | CONFIG_USB_EHCI_HCD=y |
1022 | # CONFIG_USB_EHCI_SPLIT_ISO is not set | ||
1023 | # CONFIG_USB_EHCI_ROOT_HUB_TT is not set | ||
1024 | # CONFIG_USB_EHCI_TT_NEWSCHED is not set | ||
1025 | # CONFIG_USB_ISP116X_HCD is not set | ||
1026 | # CONFIG_USB_OHCI_HCD is not set | ||
1027 | # CONFIG_USB_UHCI_HCD is not set | ||
1028 | # CONFIG_USB_SL811_HCD is not set | ||
1029 | # CONFIG_USB_R8A66597_HCD is not set | ||
992 | 1030 | ||
993 | # | 1031 | # |
994 | # LED drivers | 1032 | # USB Device Class drivers |
995 | # | 1033 | # |
1034 | # CONFIG_USB_ACM is not set | ||
1035 | CONFIG_USB_PRINTER=y | ||
996 | 1036 | ||
997 | # | 1037 | # |
998 | # LED Triggers | 1038 | # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' |
999 | # | 1039 | # |
1000 | 1040 | ||
1001 | # | 1041 | # |
1002 | # InfiniBand support | 1042 | # may also be needed; see USB_STORAGE Help for more information |
1003 | # | 1043 | # |
1004 | # CONFIG_INFINIBAND is not set | 1044 | CONFIG_USB_STORAGE=y |
1045 | # CONFIG_USB_STORAGE_DEBUG is not set | ||
1046 | # CONFIG_USB_STORAGE_DATAFAB is not set | ||
1047 | # CONFIG_USB_STORAGE_FREECOM is not set | ||
1048 | # CONFIG_USB_STORAGE_ISD200 is not set | ||
1049 | # CONFIG_USB_STORAGE_DPCM is not set | ||
1050 | # CONFIG_USB_STORAGE_USBAT is not set | ||
1051 | # CONFIG_USB_STORAGE_SDDR09 is not set | ||
1052 | # CONFIG_USB_STORAGE_SDDR55 is not set | ||
1053 | # CONFIG_USB_STORAGE_JUMPSHOT is not set | ||
1054 | # CONFIG_USB_STORAGE_ALAUDA is not set | ||
1055 | # CONFIG_USB_STORAGE_ONETOUCH is not set | ||
1056 | # CONFIG_USB_STORAGE_KARMA is not set | ||
1057 | # CONFIG_USB_LIBUSUAL is not set | ||
1005 | 1058 | ||
1006 | # | 1059 | # |
1007 | # EDAC - error detection and reporting (RAS) (EXPERIMENTAL) | 1060 | # USB Imaging devices |
1008 | # | 1061 | # |
1062 | # CONFIG_USB_MDC800 is not set | ||
1063 | # CONFIG_USB_MICROTEK is not set | ||
1064 | CONFIG_USB_MON=y | ||
1009 | 1065 | ||
1010 | # | 1066 | # |
1011 | # Real Time Clock | 1067 | # USB port drivers |
1012 | # | 1068 | # |
1013 | CONFIG_RTC_LIB=y | 1069 | # CONFIG_USB_USS720 is not set |
1014 | CONFIG_RTC_CLASS=y | ||
1015 | CONFIG_RTC_HCTOSYS=y | ||
1016 | CONFIG_RTC_HCTOSYS_DEVICE="rtc0" | ||
1017 | # CONFIG_RTC_DEBUG is not set | ||
1018 | 1070 | ||
1019 | # | 1071 | # |
1020 | # RTC interfaces | 1072 | # USB Serial Converter support |
1021 | # | 1073 | # |
1022 | CONFIG_RTC_INTF_SYSFS=y | 1074 | # CONFIG_USB_SERIAL is not set |
1023 | CONFIG_RTC_INTF_PROC=y | ||
1024 | CONFIG_RTC_INTF_DEV=y | ||
1025 | # CONFIG_RTC_INTF_DEV_UIE_EMUL is not set | ||
1026 | 1075 | ||
1027 | # | 1076 | # |
1028 | # RTC drivers | 1077 | # USB Miscellaneous drivers |
1029 | # | 1078 | # |
1030 | # CONFIG_RTC_DRV_DS1553 is not set | 1079 | # CONFIG_USB_EMI62 is not set |
1031 | # CONFIG_RTC_DRV_DS1742 is not set | 1080 | # CONFIG_USB_EMI26 is not set |
1032 | # CONFIG_RTC_DRV_M48T86 is not set | 1081 | # CONFIG_USB_ADUTUX is not set |
1033 | CONFIG_RTC_DRV_SH=y | 1082 | # CONFIG_USB_AUERSWALD is not set |
1034 | # CONFIG_RTC_DRV_TEST is not set | 1083 | # CONFIG_USB_RIO500 is not set |
1035 | # CONFIG_RTC_DRV_V3020 is not set | 1084 | # CONFIG_USB_LEGOTOWER is not set |
1085 | # CONFIG_USB_LCD is not set | ||
1086 | # CONFIG_USB_BERRY_CHARGE is not set | ||
1087 | # CONFIG_USB_LED is not set | ||
1088 | # CONFIG_USB_CYPRESS_CY7C63 is not set | ||
1089 | # CONFIG_USB_CYTHERM is not set | ||
1090 | # CONFIG_USB_PHIDGET is not set | ||
1091 | # CONFIG_USB_IDMOUSE is not set | ||
1092 | # CONFIG_USB_FTDI_ELAN is not set | ||
1093 | # CONFIG_USB_APPLEDISPLAY is not set | ||
1094 | # CONFIG_USB_SISUSBVGA is not set | ||
1095 | # CONFIG_USB_LD is not set | ||
1096 | # CONFIG_USB_TRANCEVIBRATOR is not set | ||
1097 | # CONFIG_USB_IOWARRIOR is not set | ||
1098 | # CONFIG_USB_TEST is not set | ||
1036 | 1099 | ||
1037 | # | 1100 | # |
1038 | # DMA Engine support | 1101 | # USB DSL modem support |
1039 | # | 1102 | # |
1040 | # CONFIG_DMA_ENGINE is not set | ||
1041 | 1103 | ||
1042 | # | 1104 | # |
1043 | # DMA Clients | 1105 | # USB Gadget Support |
1044 | # | 1106 | # |
1107 | # CONFIG_USB_GADGET is not set | ||
1108 | # CONFIG_MMC is not set | ||
1109 | CONFIG_NEW_LEDS=y | ||
1110 | CONFIG_LEDS_CLASS=y | ||
1045 | 1111 | ||
1046 | # | 1112 | # |
1047 | # DMA Devices | 1113 | # LED drivers |
1048 | # | 1114 | # |
1049 | 1115 | ||
1050 | # | 1116 | # |
1051 | # Auxiliary Display support | 1117 | # LED Triggers |
1052 | # | 1118 | # |
1119 | # CONFIG_LEDS_TRIGGERS is not set | ||
1120 | # CONFIG_INFINIBAND is not set | ||
1121 | # CONFIG_RTC_CLASS is not set | ||
1122 | # CONFIG_AUXDISPLAY is not set | ||
1053 | 1123 | ||
1054 | # | 1124 | # |
1055 | # Virtualization | 1125 | # Userspace I/O |
1056 | # | 1126 | # |
1127 | # CONFIG_UIO is not set | ||
1057 | 1128 | ||
1058 | # | 1129 | # |
1059 | # File systems | 1130 | # File systems |
1060 | # | 1131 | # |
1061 | CONFIG_EXT2_FS=y | 1132 | CONFIG_EXT2_FS=y |
1062 | # CONFIG_EXT2_FS_XATTR is not set | 1133 | CONFIG_EXT2_FS_XATTR=y |
1134 | CONFIG_EXT2_FS_POSIX_ACL=y | ||
1135 | # CONFIG_EXT2_FS_SECURITY is not set | ||
1063 | # CONFIG_EXT2_FS_XIP is not set | 1136 | # CONFIG_EXT2_FS_XIP is not set |
1064 | CONFIG_EXT3_FS=y | 1137 | CONFIG_EXT3_FS=y |
1065 | CONFIG_EXT3_FS_XATTR=y | 1138 | CONFIG_EXT3_FS_XATTR=y |
1066 | # CONFIG_EXT3_FS_POSIX_ACL is not set | 1139 | CONFIG_EXT3_FS_POSIX_ACL=y |
1067 | # CONFIG_EXT3_FS_SECURITY is not set | 1140 | # CONFIG_EXT3_FS_SECURITY is not set |
1068 | # CONFIG_EXT4DEV_FS is not set | 1141 | # CONFIG_EXT4DEV_FS is not set |
1069 | CONFIG_JBD=y | 1142 | CONFIG_JBD=y |
1070 | # CONFIG_JBD_DEBUG is not set | ||
1071 | CONFIG_FS_MBCACHE=y | 1143 | CONFIG_FS_MBCACHE=y |
1072 | # CONFIG_REISERFS_FS is not set | 1144 | # CONFIG_REISERFS_FS is not set |
1073 | # CONFIG_JFS_FS is not set | 1145 | # CONFIG_JFS_FS is not set |
@@ -1082,13 +1154,16 @@ CONFIG_INOTIFY_USER=y | |||
1082 | # CONFIG_QUOTA is not set | 1154 | # CONFIG_QUOTA is not set |
1083 | CONFIG_DNOTIFY=y | 1155 | CONFIG_DNOTIFY=y |
1084 | # CONFIG_AUTOFS_FS is not set | 1156 | # CONFIG_AUTOFS_FS is not set |
1085 | # CONFIG_AUTOFS4_FS is not set | 1157 | CONFIG_AUTOFS4_FS=y |
1086 | CONFIG_FUSE_FS=m | 1158 | # CONFIG_FUSE_FS is not set |
1159 | CONFIG_GENERIC_ACL=y | ||
1087 | 1160 | ||
1088 | # | 1161 | # |
1089 | # CD-ROM/DVD Filesystems | 1162 | # CD-ROM/DVD Filesystems |
1090 | # | 1163 | # |
1091 | # CONFIG_ISO9660_FS is not set | 1164 | CONFIG_ISO9660_FS=y |
1165 | # CONFIG_JOLIET is not set | ||
1166 | # CONFIG_ZISOFS is not set | ||
1092 | # CONFIG_UDF_FS is not set | 1167 | # CONFIG_UDF_FS is not set |
1093 | 1168 | ||
1094 | # | 1169 | # |
@@ -1100,22 +1175,21 @@ CONFIG_VFAT_FS=y | |||
1100 | CONFIG_FAT_DEFAULT_CODEPAGE=437 | 1175 | CONFIG_FAT_DEFAULT_CODEPAGE=437 |
1101 | CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" | 1176 | CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" |
1102 | CONFIG_NTFS_FS=y | 1177 | CONFIG_NTFS_FS=y |
1103 | # CONFIG_NTFS_DEBUG is not set | 1178 | CONFIG_NTFS_DEBUG=y |
1104 | CONFIG_NTFS_RW=y | 1179 | CONFIG_NTFS_RW=y |
1105 | 1180 | ||
1106 | # | 1181 | # |
1107 | # Pseudo filesystems | 1182 | # Pseudo filesystems |
1108 | # | 1183 | # |
1109 | CONFIG_PROC_FS=y | 1184 | CONFIG_PROC_FS=y |
1110 | CONFIG_PROC_KCORE=y | 1185 | # CONFIG_PROC_KCORE is not set |
1111 | CONFIG_PROC_SYSCTL=y | 1186 | CONFIG_PROC_SYSCTL=y |
1112 | CONFIG_SYSFS=y | 1187 | CONFIG_SYSFS=y |
1113 | CONFIG_TMPFS=y | 1188 | CONFIG_TMPFS=y |
1114 | # CONFIG_TMPFS_POSIX_ACL is not set | 1189 | CONFIG_TMPFS_POSIX_ACL=y |
1115 | CONFIG_HUGETLBFS=y | 1190 | CONFIG_HUGETLBFS=y |
1116 | CONFIG_HUGETLB_PAGE=y | 1191 | CONFIG_HUGETLB_PAGE=y |
1117 | CONFIG_RAMFS=y | 1192 | # CONFIG_CONFIGFS_FS is not set |
1118 | CONFIG_CONFIGFS_FS=m | ||
1119 | 1193 | ||
1120 | # | 1194 | # |
1121 | # Miscellaneous filesystems | 1195 | # Miscellaneous filesystems |
@@ -1133,19 +1207,16 @@ CONFIG_CONFIGFS_FS=m | |||
1133 | # CONFIG_QNX4FS_FS is not set | 1207 | # CONFIG_QNX4FS_FS is not set |
1134 | # CONFIG_SYSV_FS is not set | 1208 | # CONFIG_SYSV_FS is not set |
1135 | # CONFIG_UFS_FS is not set | 1209 | # CONFIG_UFS_FS is not set |
1136 | 1210 | CONFIG_NETWORK_FILESYSTEMS=y | |
1137 | # | ||
1138 | # Network File Systems | ||
1139 | # | ||
1140 | CONFIG_NFS_FS=y | 1211 | CONFIG_NFS_FS=y |
1141 | CONFIG_NFS_V3=y | 1212 | CONFIG_NFS_V3=y |
1142 | # CONFIG_NFS_V3_ACL is not set | 1213 | # CONFIG_NFS_V3_ACL is not set |
1143 | CONFIG_NFS_V4=y | 1214 | # CONFIG_NFS_V4 is not set |
1144 | # CONFIG_NFS_DIRECTIO is not set | 1215 | # CONFIG_NFS_DIRECTIO is not set |
1145 | CONFIG_NFSD=y | 1216 | CONFIG_NFSD=y |
1146 | CONFIG_NFSD_V3=y | 1217 | CONFIG_NFSD_V3=y |
1147 | # CONFIG_NFSD_V3_ACL is not set | 1218 | # CONFIG_NFSD_V3_ACL is not set |
1148 | CONFIG_NFSD_V4=y | 1219 | # CONFIG_NFSD_V4 is not set |
1149 | CONFIG_NFSD_TCP=y | 1220 | CONFIG_NFSD_TCP=y |
1150 | CONFIG_ROOT_NFS=y | 1221 | CONFIG_ROOT_NFS=y |
1151 | CONFIG_LOCKD=y | 1222 | CONFIG_LOCKD=y |
@@ -1153,25 +1224,20 @@ CONFIG_LOCKD_V4=y | |||
1153 | CONFIG_EXPORTFS=y | 1224 | CONFIG_EXPORTFS=y |
1154 | CONFIG_NFS_COMMON=y | 1225 | CONFIG_NFS_COMMON=y |
1155 | CONFIG_SUNRPC=y | 1226 | CONFIG_SUNRPC=y |
1156 | CONFIG_SUNRPC_GSS=y | 1227 | # CONFIG_SUNRPC_BIND34 is not set |
1157 | CONFIG_RPCSEC_GSS_KRB5=y | 1228 | # CONFIG_RPCSEC_GSS_KRB5 is not set |
1158 | # CONFIG_RPCSEC_GSS_SPKM3 is not set | 1229 | # CONFIG_RPCSEC_GSS_SPKM3 is not set |
1159 | # CONFIG_SMB_FS is not set | 1230 | # CONFIG_SMB_FS is not set |
1160 | # CONFIG_CIFS is not set | 1231 | # CONFIG_CIFS is not set |
1161 | # CONFIG_NCP_FS is not set | 1232 | # CONFIG_NCP_FS is not set |
1162 | # CONFIG_CODA_FS is not set | 1233 | # CONFIG_CODA_FS is not set |
1163 | # CONFIG_AFS_FS is not set | 1234 | # CONFIG_AFS_FS is not set |
1164 | # CONFIG_9P_FS is not set | ||
1165 | 1235 | ||
1166 | # | 1236 | # |
1167 | # Partition Types | 1237 | # Partition Types |
1168 | # | 1238 | # |
1169 | # CONFIG_PARTITION_ADVANCED is not set | 1239 | # CONFIG_PARTITION_ADVANCED is not set |
1170 | CONFIG_MSDOS_PARTITION=y | 1240 | CONFIG_MSDOS_PARTITION=y |
1171 | |||
1172 | # | ||
1173 | # Native Language Support | ||
1174 | # | ||
1175 | CONFIG_NLS=y | 1241 | CONFIG_NLS=y |
1176 | CONFIG_NLS_DEFAULT="iso8859-1" | 1242 | CONFIG_NLS_DEFAULT="iso8859-1" |
1177 | CONFIG_NLS_CODEPAGE_437=y | 1243 | CONFIG_NLS_CODEPAGE_437=y |
@@ -1191,13 +1257,13 @@ CONFIG_NLS_CODEPAGE_437=y | |||
1191 | # CONFIG_NLS_CODEPAGE_869 is not set | 1257 | # CONFIG_NLS_CODEPAGE_869 is not set |
1192 | # CONFIG_NLS_CODEPAGE_936 is not set | 1258 | # CONFIG_NLS_CODEPAGE_936 is not set |
1193 | # CONFIG_NLS_CODEPAGE_950 is not set | 1259 | # CONFIG_NLS_CODEPAGE_950 is not set |
1194 | CONFIG_NLS_CODEPAGE_932=y | 1260 | # CONFIG_NLS_CODEPAGE_932 is not set |
1195 | # CONFIG_NLS_CODEPAGE_949 is not set | 1261 | # CONFIG_NLS_CODEPAGE_949 is not set |
1196 | # CONFIG_NLS_CODEPAGE_874 is not set | 1262 | # CONFIG_NLS_CODEPAGE_874 is not set |
1197 | # CONFIG_NLS_ISO8859_8 is not set | 1263 | # CONFIG_NLS_ISO8859_8 is not set |
1198 | # CONFIG_NLS_CODEPAGE_1250 is not set | 1264 | # CONFIG_NLS_CODEPAGE_1250 is not set |
1199 | # CONFIG_NLS_CODEPAGE_1251 is not set | 1265 | # CONFIG_NLS_CODEPAGE_1251 is not set |
1200 | # CONFIG_NLS_ASCII is not set | 1266 | CONFIG_NLS_ASCII=y |
1201 | CONFIG_NLS_ISO8859_1=y | 1267 | CONFIG_NLS_ISO8859_1=y |
1202 | # CONFIG_NLS_ISO8859_2 is not set | 1268 | # CONFIG_NLS_ISO8859_2 is not set |
1203 | # CONFIG_NLS_ISO8859_3 is not set | 1269 | # CONFIG_NLS_ISO8859_3 is not set |
@@ -1208,44 +1274,39 @@ CONFIG_NLS_ISO8859_1=y | |||
1208 | # CONFIG_NLS_ISO8859_9 is not set | 1274 | # CONFIG_NLS_ISO8859_9 is not set |
1209 | # CONFIG_NLS_ISO8859_13 is not set | 1275 | # CONFIG_NLS_ISO8859_13 is not set |
1210 | # CONFIG_NLS_ISO8859_14 is not set | 1276 | # CONFIG_NLS_ISO8859_14 is not set |
1211 | # CONFIG_NLS_ISO8859_15 is not set | 1277 | CONFIG_NLS_ISO8859_15=y |
1212 | # CONFIG_NLS_KOI8_R is not set | 1278 | # CONFIG_NLS_KOI8_R is not set |
1213 | # CONFIG_NLS_KOI8_U is not set | 1279 | # CONFIG_NLS_KOI8_U is not set |
1214 | # CONFIG_NLS_UTF8 is not set | 1280 | CONFIG_NLS_UTF8=y |
1215 | |||
1216 | # | ||
1217 | # Distributed Lock Manager | ||
1218 | # | ||
1219 | # CONFIG_DLM is not set | 1281 | # CONFIG_DLM is not set |
1220 | 1282 | # CONFIG_INSTRUMENTATION is not set | |
1221 | # | ||
1222 | # Profiling support | ||
1223 | # | ||
1224 | CONFIG_PROFILING=y | ||
1225 | CONFIG_OPROFILE=m | ||
1226 | 1283 | ||
1227 | # | 1284 | # |
1228 | # Kernel hacking | 1285 | # Kernel hacking |
1229 | # | 1286 | # |
1230 | CONFIG_TRACE_IRQFLAGS_SUPPORT=y | 1287 | CONFIG_TRACE_IRQFLAGS_SUPPORT=y |
1231 | # CONFIG_PRINTK_TIME is not set | 1288 | # CONFIG_PRINTK_TIME is not set |
1232 | CONFIG_ENABLE_MUST_CHECK=y | 1289 | CONFIG_ENABLE_WARN_DEPRECATED=y |
1290 | # CONFIG_ENABLE_MUST_CHECK is not set | ||
1233 | CONFIG_MAGIC_SYSRQ=y | 1291 | CONFIG_MAGIC_SYSRQ=y |
1234 | # CONFIG_UNUSED_SYMBOLS is not set | 1292 | CONFIG_UNUSED_SYMBOLS=y |
1235 | CONFIG_DEBUG_FS=y | 1293 | # CONFIG_DEBUG_FS is not set |
1236 | # CONFIG_HEADERS_CHECK is not set | 1294 | # CONFIG_HEADERS_CHECK is not set |
1237 | CONFIG_DEBUG_KERNEL=y | 1295 | CONFIG_DEBUG_KERNEL=y |
1238 | # CONFIG_DEBUG_SHIRQ is not set | 1296 | # CONFIG_DEBUG_SHIRQ is not set |
1239 | CONFIG_LOG_BUF_SHIFT=14 | ||
1240 | CONFIG_DETECT_SOFTLOCKUP=y | 1297 | CONFIG_DETECT_SOFTLOCKUP=y |
1298 | # CONFIG_SCHED_DEBUG is not set | ||
1241 | # CONFIG_SCHEDSTATS is not set | 1299 | # CONFIG_SCHEDSTATS is not set |
1242 | # CONFIG_TIMER_STATS is not set | 1300 | CONFIG_TIMER_STATS=y |
1243 | # CONFIG_DEBUG_SLAB is not set | 1301 | # CONFIG_SLUB_DEBUG_ON is not set |
1244 | # CONFIG_DEBUG_PREEMPT is not set | 1302 | CONFIG_DEBUG_PREEMPT=y |
1303 | # CONFIG_DEBUG_RT_MUTEXES is not set | ||
1304 | # CONFIG_RT_MUTEX_TESTER is not set | ||
1245 | # CONFIG_DEBUG_SPINLOCK is not set | 1305 | # CONFIG_DEBUG_SPINLOCK is not set |
1246 | # CONFIG_DEBUG_MUTEXES is not set | 1306 | # CONFIG_DEBUG_MUTEXES is not set |
1247 | # CONFIG_DEBUG_LOCK_ALLOC is not set | 1307 | # CONFIG_DEBUG_LOCK_ALLOC is not set |
1248 | # CONFIG_PROVE_LOCKING is not set | 1308 | # CONFIG_PROVE_LOCKING is not set |
1309 | # CONFIG_LOCK_STAT is not set | ||
1249 | # CONFIG_DEBUG_SPINLOCK_SLEEP is not set | 1310 | # CONFIG_DEBUG_SPINLOCK_SLEEP is not set |
1250 | # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set | 1311 | # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set |
1251 | # CONFIG_DEBUG_KOBJECT is not set | 1312 | # CONFIG_DEBUG_KOBJECT is not set |
@@ -1253,16 +1314,21 @@ CONFIG_DEBUG_BUGVERBOSE=y | |||
1253 | CONFIG_DEBUG_INFO=y | 1314 | CONFIG_DEBUG_INFO=y |
1254 | # CONFIG_DEBUG_VM is not set | 1315 | # CONFIG_DEBUG_VM is not set |
1255 | # CONFIG_DEBUG_LIST is not set | 1316 | # CONFIG_DEBUG_LIST is not set |
1317 | # CONFIG_DEBUG_SG is not set | ||
1256 | # CONFIG_FRAME_POINTER is not set | 1318 | # CONFIG_FRAME_POINTER is not set |
1257 | CONFIG_FORCED_INLINING=y | 1319 | # CONFIG_FORCED_INLINING is not set |
1320 | # CONFIG_BOOT_PRINTK_DELAY is not set | ||
1258 | # CONFIG_RCU_TORTURE_TEST is not set | 1321 | # CONFIG_RCU_TORTURE_TEST is not set |
1259 | # CONFIG_FAULT_INJECTION is not set | 1322 | # CONFIG_FAULT_INJECTION is not set |
1323 | # CONFIG_SAMPLES is not set | ||
1260 | CONFIG_SH_STANDARD_BIOS=y | 1324 | CONFIG_SH_STANDARD_BIOS=y |
1261 | # CONFIG_EARLY_SCIF_CONSOLE is not set | 1325 | # CONFIG_EARLY_SCIF_CONSOLE is not set |
1262 | CONFIG_EARLY_PRINTK=y | 1326 | # CONFIG_EARLY_PRINTK is not set |
1327 | # CONFIG_DEBUG_BOOTMEM is not set | ||
1263 | CONFIG_DEBUG_STACKOVERFLOW=y | 1328 | CONFIG_DEBUG_STACKOVERFLOW=y |
1264 | # CONFIG_DEBUG_STACK_USAGE is not set | 1329 | # CONFIG_DEBUG_STACK_USAGE is not set |
1265 | # CONFIG_4KSTACKS is not set | 1330 | # CONFIG_4KSTACKS is not set |
1331 | # CONFIG_IRQSTACKS is not set | ||
1266 | # CONFIG_SH_KGDB is not set | 1332 | # CONFIG_SH_KGDB is not set |
1267 | 1333 | ||
1268 | # | 1334 | # |
@@ -1270,16 +1336,11 @@ CONFIG_DEBUG_STACKOVERFLOW=y | |||
1270 | # | 1336 | # |
1271 | # CONFIG_KEYS is not set | 1337 | # CONFIG_KEYS is not set |
1272 | # CONFIG_SECURITY is not set | 1338 | # CONFIG_SECURITY is not set |
1273 | 1339 | # CONFIG_SECURITY_FILE_CAPABILITIES is not set | |
1274 | # | ||
1275 | # Cryptographic options | ||
1276 | # | ||
1277 | CONFIG_CRYPTO=y | 1340 | CONFIG_CRYPTO=y |
1278 | CONFIG_CRYPTO_ALGAPI=y | 1341 | CONFIG_CRYPTO_ALGAPI=y |
1279 | CONFIG_CRYPTO_BLKCIPHER=y | 1342 | # CONFIG_CRYPTO_MANAGER is not set |
1280 | CONFIG_CRYPTO_HASH=y | 1343 | # CONFIG_CRYPTO_HMAC is not set |
1281 | CONFIG_CRYPTO_MANAGER=y | ||
1282 | CONFIG_CRYPTO_HMAC=y | ||
1283 | # CONFIG_CRYPTO_XCBC is not set | 1344 | # CONFIG_CRYPTO_XCBC is not set |
1284 | # CONFIG_CRYPTO_NULL is not set | 1345 | # CONFIG_CRYPTO_NULL is not set |
1285 | # CONFIG_CRYPTO_MD4 is not set | 1346 | # CONFIG_CRYPTO_MD4 is not set |
@@ -1290,10 +1351,12 @@ CONFIG_CRYPTO_MD5=y | |||
1290 | # CONFIG_CRYPTO_WP512 is not set | 1351 | # CONFIG_CRYPTO_WP512 is not set |
1291 | # CONFIG_CRYPTO_TGR192 is not set | 1352 | # CONFIG_CRYPTO_TGR192 is not set |
1292 | # CONFIG_CRYPTO_GF128MUL is not set | 1353 | # CONFIG_CRYPTO_GF128MUL is not set |
1293 | CONFIG_CRYPTO_ECB=m | 1354 | # CONFIG_CRYPTO_ECB is not set |
1294 | CONFIG_CRYPTO_CBC=y | 1355 | # CONFIG_CRYPTO_CBC is not set |
1295 | CONFIG_CRYPTO_PCBC=m | 1356 | # CONFIG_CRYPTO_PCBC is not set |
1296 | # CONFIG_CRYPTO_LRW is not set | 1357 | # CONFIG_CRYPTO_LRW is not set |
1358 | # CONFIG_CRYPTO_XTS is not set | ||
1359 | # CONFIG_CRYPTO_CRYPTD is not set | ||
1297 | CONFIG_CRYPTO_DES=y | 1360 | CONFIG_CRYPTO_DES=y |
1298 | # CONFIG_CRYPTO_FCRYPT is not set | 1361 | # CONFIG_CRYPTO_FCRYPT is not set |
1299 | # CONFIG_CRYPTO_BLOWFISH is not set | 1362 | # CONFIG_CRYPTO_BLOWFISH is not set |
@@ -1306,15 +1369,14 @@ CONFIG_CRYPTO_DES=y | |||
1306 | # CONFIG_CRYPTO_ARC4 is not set | 1369 | # CONFIG_CRYPTO_ARC4 is not set |
1307 | # CONFIG_CRYPTO_KHAZAD is not set | 1370 | # CONFIG_CRYPTO_KHAZAD is not set |
1308 | # CONFIG_CRYPTO_ANUBIS is not set | 1371 | # CONFIG_CRYPTO_ANUBIS is not set |
1372 | # CONFIG_CRYPTO_SEED is not set | ||
1309 | # CONFIG_CRYPTO_DEFLATE is not set | 1373 | # CONFIG_CRYPTO_DEFLATE is not set |
1310 | # CONFIG_CRYPTO_MICHAEL_MIC is not set | 1374 | # CONFIG_CRYPTO_MICHAEL_MIC is not set |
1311 | # CONFIG_CRYPTO_CRC32C is not set | 1375 | # CONFIG_CRYPTO_CRC32C is not set |
1312 | # CONFIG_CRYPTO_CAMELLIA is not set | 1376 | # CONFIG_CRYPTO_CAMELLIA is not set |
1313 | # CONFIG_CRYPTO_TEST is not set | 1377 | # CONFIG_CRYPTO_TEST is not set |
1314 | 1378 | # CONFIG_CRYPTO_AUTHENC is not set | |
1315 | # | 1379 | CONFIG_CRYPTO_HW=y |
1316 | # Hardware crypto devices | ||
1317 | # | ||
1318 | 1380 | ||
1319 | # | 1381 | # |
1320 | # Library routines | 1382 | # Library routines |
@@ -1322,7 +1384,11 @@ CONFIG_CRYPTO_DES=y | |||
1322 | CONFIG_BITREVERSE=y | 1384 | CONFIG_BITREVERSE=y |
1323 | # CONFIG_CRC_CCITT is not set | 1385 | # CONFIG_CRC_CCITT is not set |
1324 | # CONFIG_CRC16 is not set | 1386 | # CONFIG_CRC16 is not set |
1387 | # CONFIG_CRC_ITU_T is not set | ||
1325 | CONFIG_CRC32=y | 1388 | CONFIG_CRC32=y |
1389 | # CONFIG_CRC7 is not set | ||
1326 | # CONFIG_LIBCRC32C is not set | 1390 | # CONFIG_LIBCRC32C is not set |
1391 | CONFIG_PLIST=y | ||
1327 | CONFIG_HAS_IOMEM=y | 1392 | CONFIG_HAS_IOMEM=y |
1328 | CONFIG_HAS_IOPORT=y | 1393 | CONFIG_HAS_IOPORT=y |
1394 | CONFIG_HAS_DMA=y | ||
diff --git a/arch/sh/configs/se7712_defconfig b/arch/sh/configs/se7712_defconfig index a5e37dbc5353..240a1cef69aa 100644 --- a/arch/sh/configs/se7712_defconfig +++ b/arch/sh/configs/se7712_defconfig | |||
@@ -237,7 +237,7 @@ CONFIG_CPU_HAS_SR_RB=y | |||
237 | CONFIG_SH_TMU=y | 237 | CONFIG_SH_TMU=y |
238 | CONFIG_SH_TIMER_IRQ=16 | 238 | CONFIG_SH_TIMER_IRQ=16 |
239 | # CONFIG_NO_IDLE_HZ is not set | 239 | # CONFIG_NO_IDLE_HZ is not set |
240 | CONFIG_SH_PCLK_FREQ=33333333 | 240 | CONFIG_SH_PCLK_FREQ=66666666 |
241 | 241 | ||
242 | # | 242 | # |
243 | # CPU Frequency scaling | 243 | # CPU Frequency scaling |
diff --git a/arch/sh/drivers/dma/Kconfig b/arch/sh/drivers/dma/Kconfig index 4e711a0c3dae..01936368b8b0 100644 --- a/arch/sh/drivers/dma/Kconfig +++ b/arch/sh/drivers/dma/Kconfig | |||
@@ -12,7 +12,7 @@ config SH_DMA | |||
12 | config NR_ONCHIP_DMA_CHANNELS | 12 | config NR_ONCHIP_DMA_CHANNELS |
13 | int | 13 | int |
14 | depends on SH_DMA | 14 | depends on SH_DMA |
15 | default "6" if CPU_SUBTYPE_SH7720 | 15 | default "6" if CPU_SUBTYPE_SH7720 || CPU_SUBTYPE_SH7721 |
16 | default "8" if CPU_SUBTYPE_SH7750R || CPU_SUBTYPE_SH7751R | 16 | default "8" if CPU_SUBTYPE_SH7750R || CPU_SUBTYPE_SH7751R |
17 | default "12" if CPU_SUBTYPE_SH7780 | 17 | default "12" if CPU_SUBTYPE_SH7780 |
18 | default "4" | 18 | default "4" |
diff --git a/arch/sh/drivers/dma/dma-sh.c b/arch/sh/drivers/dma/dma-sh.c index 958bac1c585a..5c3359756a92 100644 --- a/arch/sh/drivers/dma/dma-sh.c +++ b/arch/sh/drivers/dma/dma-sh.c | |||
@@ -25,6 +25,7 @@ static int dmte_irq_map[] = { | |||
25 | DMTE2_IRQ, | 25 | DMTE2_IRQ, |
26 | DMTE3_IRQ, | 26 | DMTE3_IRQ, |
27 | #if defined(CONFIG_CPU_SUBTYPE_SH7720) || \ | 27 | #if defined(CONFIG_CPU_SUBTYPE_SH7720) || \ |
28 | defined(CONFIG_CPU_SUBTYPE_SH7721) || \ | ||
28 | defined(CONFIG_CPU_SUBTYPE_SH7751R) || \ | 29 | defined(CONFIG_CPU_SUBTYPE_SH7751R) || \ |
29 | defined(CONFIG_CPU_SUBTYPE_SH7760) || \ | 30 | defined(CONFIG_CPU_SUBTYPE_SH7760) || \ |
30 | defined(CONFIG_CPU_SUBTYPE_SH7709) || \ | 31 | defined(CONFIG_CPU_SUBTYPE_SH7709) || \ |
@@ -203,6 +204,7 @@ static int sh_dmac_get_dma_residue(struct dma_channel *chan) | |||
203 | } | 204 | } |
204 | 205 | ||
205 | #if defined(CONFIG_CPU_SUBTYPE_SH7720) || \ | 206 | #if defined(CONFIG_CPU_SUBTYPE_SH7720) || \ |
207 | defined(CONFIG_CPU_SUBTYPE_SH7721) || \ | ||
206 | defined(CONFIG_CPU_SUBTYPE_SH7780) | 208 | defined(CONFIG_CPU_SUBTYPE_SH7780) |
207 | #define dmaor_read_reg() ctrl_inw(DMAOR) | 209 | #define dmaor_read_reg() ctrl_inw(DMAOR) |
208 | #define dmaor_write_reg(data) ctrl_outw(data, DMAOR) | 210 | #define dmaor_write_reg(data) ctrl_outw(data, DMAOR) |
diff --git a/arch/sh/drivers/pci/Makefile b/arch/sh/drivers/pci/Makefile index fba6b5ba0b3a..0718805774e8 100644 --- a/arch/sh/drivers/pci/Makefile +++ b/arch/sh/drivers/pci/Makefile | |||
@@ -7,16 +7,19 @@ obj-$(CONFIG_PCI_AUTO) += pci-auto.o | |||
7 | 7 | ||
8 | obj-$(CONFIG_CPU_SUBTYPE_SH7751) += pci-sh7751.o ops-sh4.o | 8 | obj-$(CONFIG_CPU_SUBTYPE_SH7751) += pci-sh7751.o ops-sh4.o |
9 | obj-$(CONFIG_CPU_SUBTYPE_SH7751R) += pci-sh7751.o ops-sh4.o | 9 | obj-$(CONFIG_CPU_SUBTYPE_SH7751R) += pci-sh7751.o ops-sh4.o |
10 | obj-$(CONFIG_CPU_SUBTYPE_SH7763) += pci-sh7780.o ops-sh4.o | ||
10 | obj-$(CONFIG_CPU_SUBTYPE_SH7780) += pci-sh7780.o ops-sh4.o | 11 | obj-$(CONFIG_CPU_SUBTYPE_SH7780) += pci-sh7780.o ops-sh4.o |
11 | obj-$(CONFIG_CPU_SUBTYPE_SH7785) += pci-sh7780.o ops-sh4.o | 12 | obj-$(CONFIG_CPU_SUBTYPE_SH7785) += pci-sh7780.o ops-sh4.o |
13 | obj-$(CONFIG_CPU_SH5) += pci-sh5.o ops-sh5.o | ||
12 | 14 | ||
13 | obj-$(CONFIG_SH_DREAMCAST) += ops-dreamcast.o fixups-dreamcast.o \ | 15 | obj-$(CONFIG_SH_DREAMCAST) += ops-dreamcast.o fixups-dreamcast.o |
14 | dma-dreamcast.o | ||
15 | obj-$(CONFIG_SH_SECUREEDGE5410) += ops-snapgear.o | 16 | obj-$(CONFIG_SH_SECUREEDGE5410) += ops-snapgear.o |
16 | obj-$(CONFIG_SH_RTS7751R2D) += ops-rts7751r2d.o fixups-rts7751r2d.o | 17 | obj-$(CONFIG_SH_RTS7751R2D) += ops-rts7751r2d.o fixups-rts7751r2d.o |
17 | obj-$(CONFIG_SH_SH03) += ops-sh03.o fixups-sh03.o | 18 | obj-$(CONFIG_SH_SH03) += ops-sh03.o fixups-sh03.o |
18 | obj-$(CONFIG_SH_HIGHLANDER) += ops-r7780rp.o fixups-r7780rp.o | 19 | obj-$(CONFIG_SH_HIGHLANDER) += ops-r7780rp.o fixups-r7780rp.o |
20 | obj-$(CONFIG_SH_SDK7780) += ops-sdk7780.o fixups-sdk7780.o | ||
19 | obj-$(CONFIG_SH_TITAN) += ops-titan.o | 21 | obj-$(CONFIG_SH_TITAN) += ops-titan.o |
20 | obj-$(CONFIG_SH_LANDISK) += ops-landisk.o | 22 | obj-$(CONFIG_SH_LANDISK) += ops-landisk.o |
21 | obj-$(CONFIG_SH_LBOX_RE2) += ops-lboxre2.o fixups-lboxre2.o | 23 | obj-$(CONFIG_SH_LBOX_RE2) += ops-lboxre2.o fixups-lboxre2.o |
22 | obj-$(CONFIG_SH_7780_SOLUTION_ENGINE) += ops-se7780.o fixups-se7780.o | 24 | obj-$(CONFIG_SH_7780_SOLUTION_ENGINE) += ops-se7780.o fixups-se7780.o |
25 | obj-$(CONFIG_SH_CAYMAN) += ops-cayman.o | ||
diff --git a/arch/sh/drivers/pci/dma-dreamcast.c b/arch/sh/drivers/pci/dma-dreamcast.c deleted file mode 100644 index 888a34050599..000000000000 --- a/arch/sh/drivers/pci/dma-dreamcast.c +++ /dev/null | |||
@@ -1,70 +0,0 @@ | |||
1 | /* | ||
2 | * arch/sh/drivers/pci/dma-dreamcast.c | ||
3 | * | ||
4 | * PCI DMA support for the Sega Dreamcast | ||
5 | * | ||
6 | * Copyright (C) 2001, 2002 M. R. Brown | ||
7 | * Copyright (C) 2002, 2003 Paul Mundt | ||
8 | * | ||
9 | * This file originally bore the message (with enclosed-$): | ||
10 | * Id: pci.c,v 1.3 2003/05/04 19:29:46 lethal Exp | ||
11 | * Dreamcast PCI: Supports SEGA Broadband Adaptor only. | ||
12 | * | ||
13 | * This file is subject to the terms and conditions of the GNU General Public | ||
14 | * License. See the file "COPYING" in the main directory of this archive | ||
15 | * for more details. | ||
16 | */ | ||
17 | |||
18 | #include <linux/sched.h> | ||
19 | #include <linux/kernel.h> | ||
20 | #include <linux/param.h> | ||
21 | #include <linux/interrupt.h> | ||
22 | #include <linux/init.h> | ||
23 | #include <linux/irq.h> | ||
24 | #include <linux/pci.h> | ||
25 | #include <linux/dma-mapping.h> | ||
26 | #include <linux/device.h> | ||
27 | |||
28 | #include <asm/io.h> | ||
29 | #include <asm/irq.h> | ||
30 | #include <asm/mach/pci.h> | ||
31 | |||
32 | static int gapspci_dma_used = 0; | ||
33 | |||
34 | void *dreamcast_consistent_alloc(struct device *dev, size_t size, | ||
35 | dma_addr_t *dma_handle, gfp_t flag) | ||
36 | { | ||
37 | unsigned long buf; | ||
38 | |||
39 | if (dev && dev->bus != &pci_bus_type) | ||
40 | return NULL; | ||
41 | |||
42 | if (gapspci_dma_used + size > GAPSPCI_DMA_SIZE) | ||
43 | return ERR_PTR(-EINVAL); | ||
44 | |||
45 | buf = GAPSPCI_DMA_BASE + gapspci_dma_used; | ||
46 | |||
47 | gapspci_dma_used = PAGE_ALIGN(gapspci_dma_used+size); | ||
48 | |||
49 | *dma_handle = (dma_addr_t)buf; | ||
50 | |||
51 | buf = P2SEGADDR(buf); | ||
52 | |||
53 | /* Flush the dcache before we hand off the buffer */ | ||
54 | __flush_purge_region((void *)buf, size); | ||
55 | |||
56 | return (void *)buf; | ||
57 | } | ||
58 | |||
59 | int dreamcast_consistent_free(struct device *dev, size_t size, | ||
60 | void *vaddr, dma_addr_t dma_handle) | ||
61 | { | ||
62 | if (dev && dev->bus != &pci_bus_type) | ||
63 | return -EINVAL; | ||
64 | |||
65 | /* XXX */ | ||
66 | gapspci_dma_used = 0; | ||
67 | |||
68 | return 0; | ||
69 | } | ||
70 | |||
diff --git a/arch/sh/drivers/pci/fixups-dreamcast.c b/arch/sh/drivers/pci/fixups-dreamcast.c index 6f53f8200dc3..c44699301eeb 100644 --- a/arch/sh/drivers/pci/fixups-dreamcast.c +++ b/arch/sh/drivers/pci/fixups-dreamcast.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/init.h> | 22 | #include <linux/init.h> |
23 | #include <linux/irq.h> | 23 | #include <linux/irq.h> |
24 | #include <linux/pci.h> | 24 | #include <linux/pci.h> |
25 | #include <linux/dma-mapping.h> | ||
25 | 26 | ||
26 | #include <asm/io.h> | 27 | #include <asm/io.h> |
27 | #include <asm/irq.h> | 28 | #include <asm/irq.h> |
@@ -40,6 +41,15 @@ static void __init gapspci_fixup_resources(struct pci_dev *dev) | |||
40 | */ | 41 | */ |
41 | dev->resource[1].start = p->io_resource->start + 0x100; | 42 | dev->resource[1].start = p->io_resource->start + 0x100; |
42 | dev->resource[1].end = dev->resource[1].start + 0x200 - 1; | 43 | dev->resource[1].end = dev->resource[1].start + 0x200 - 1; |
44 | /* | ||
45 | * Redirect dma memory allocations to special memory window. | ||
46 | */ | ||
47 | BUG_ON(!dma_declare_coherent_memory(&dev->dev, | ||
48 | GAPSPCI_DMA_BASE, | ||
49 | GAPSPCI_DMA_BASE, | ||
50 | GAPSPCI_DMA_SIZE, | ||
51 | DMA_MEMORY_MAP | | ||
52 | DMA_MEMORY_EXCLUSIVE)); | ||
43 | break; | 53 | break; |
44 | default: | 54 | default: |
45 | printk("PCI: Failed resource fixup\n"); | 55 | printk("PCI: Failed resource fixup\n"); |
diff --git a/arch/sh/drivers/pci/fixups-sdk7780.c b/arch/sh/drivers/pci/fixups-sdk7780.c new file mode 100644 index 000000000000..2f8863099dd1 --- /dev/null +++ b/arch/sh/drivers/pci/fixups-sdk7780.c | |||
@@ -0,0 +1,59 @@ | |||
1 | /* | ||
2 | * arch/sh/drivers/pci/fixups-sdk7780.c | ||
3 | * | ||
4 | * PCI fixups for the SDK7780SE03 | ||
5 | * | ||
6 | * Copyright (C) 2003 Lineo uSolutions, Inc. | ||
7 | * Copyright (C) 2004 - 2006 Paul Mundt | ||
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 | #include <linux/pci.h> | ||
14 | #include "pci-sh4.h" | ||
15 | #include <asm/io.h> | ||
16 | |||
17 | int pci_fixup_pcic(void) | ||
18 | { | ||
19 | ctrl_outl(0x00000001, SH7780_PCI_VCR2); | ||
20 | |||
21 | /* Enable all interrupts, so we know what to fix */ | ||
22 | pci_write_reg(0x0000C3FF, SH7780_PCIIMR); | ||
23 | pci_write_reg(0x0000380F, SH7780_PCIAINTM); | ||
24 | |||
25 | /* Set up standard PCI config registers */ | ||
26 | pci_write_reg(0xFB00, SH7780_PCISTATUS); | ||
27 | pci_write_reg(0x0047, SH7780_PCICMD); | ||
28 | pci_write_reg(0x00, SH7780_PCIPIF); | ||
29 | pci_write_reg(0x00, SH7780_PCISUB); | ||
30 | pci_write_reg(0x06, SH7780_PCIBCC); | ||
31 | pci_write_reg(0x1912, SH7780_PCISVID); | ||
32 | pci_write_reg(0x0001, SH7780_PCISID); | ||
33 | |||
34 | pci_write_reg(0x08000000, SH7780_PCIMBAR0); /* PCI */ | ||
35 | pci_write_reg(0x08000000, SH7780_PCILAR0); /* SHwy */ | ||
36 | pci_write_reg(0x07F00001, SH7780_PCILSR); /* size 128M w/ MBAR */ | ||
37 | |||
38 | pci_write_reg(0x00000000, SH7780_PCIMBAR1); | ||
39 | pci_write_reg(0x00000000, SH7780_PCILAR1); | ||
40 | pci_write_reg(0x00000000, SH7780_PCILSR1); | ||
41 | |||
42 | pci_write_reg(0xAB000801, SH7780_PCIIBAR); | ||
43 | |||
44 | /* | ||
45 | * Set the MBR so PCI address is one-to-one with window, | ||
46 | * meaning all calls go straight through... use ifdef to | ||
47 | * catch erroneous assumption. | ||
48 | */ | ||
49 | pci_write_reg(0xFD000000 , SH7780_PCIMBR0); | ||
50 | pci_write_reg(0x00FC0000 , SH7780_PCIMBMR0); /* 16M */ | ||
51 | |||
52 | /* Set IOBR for window containing area specified in pci.h */ | ||
53 | pci_write_reg(PCIBIOS_MIN_IO & ~(SH7780_PCI_IO_SIZE-1), SH7780_PCIIOBR); | ||
54 | pci_write_reg((SH7780_PCI_IO_SIZE-1) & (7 << 18), SH7780_PCIIOBMR); | ||
55 | |||
56 | pci_write_reg(0xA5000C01, SH7780_PCICR); | ||
57 | |||
58 | return 0; | ||
59 | } | ||
diff --git a/arch/sh/drivers/pci/ops-cayman.c b/arch/sh/drivers/pci/ops-cayman.c new file mode 100644 index 000000000000..980275ffa30b --- /dev/null +++ b/arch/sh/drivers/pci/ops-cayman.c | |||
@@ -0,0 +1,94 @@ | |||
1 | #include <linux/kernel.h> | ||
2 | #include <linux/init.h> | ||
3 | #include <linux/pci.h> | ||
4 | #include <linux/types.h> | ||
5 | #include <asm/cpu/irq.h> | ||
6 | #include "pci-sh5.h" | ||
7 | |||
8 | static inline u8 bridge_swizzle(u8 pin, u8 slot) | ||
9 | { | ||
10 | return (((pin - 1) + slot) % 4) + 1; | ||
11 | } | ||
12 | |||
13 | int __init pcibios_map_platform_irq(struct pci_dev *dev, u8 slot, u8 pin) | ||
14 | { | ||
15 | int result = -1; | ||
16 | |||
17 | /* The complication here is that the PCI IRQ lines from the Cayman's 2 | ||
18 | 5V slots get into the CPU via a different path from the IRQ lines | ||
19 | from the 3 3.3V slots. Thus, we have to detect whether the card's | ||
20 | interrupts go via the 5V or 3.3V path, i.e. the 'bridge swizzling' | ||
21 | at the point where we cross from 5V to 3.3V is not the normal case. | ||
22 | |||
23 | The added complication is that we don't know that the 5V slots are | ||
24 | always bus 2, because a card containing a PCI-PCI bridge may be | ||
25 | plugged into a 3.3V slot, and this changes the bus numbering. | ||
26 | |||
27 | Also, the Cayman has an intermediate PCI bus that goes a custom | ||
28 | expansion board header (and to the secondary bridge). This bus has | ||
29 | never been used in practice. | ||
30 | |||
31 | The 1ary onboard PCI-PCI bridge is device 3 on bus 0 | ||
32 | The 2ary onboard PCI-PCI bridge is device 0 on the 2ary bus of | ||
33 | the 1ary bridge. | ||
34 | */ | ||
35 | |||
36 | struct slot_pin { | ||
37 | int slot; | ||
38 | int pin; | ||
39 | } path[4]; | ||
40 | int i=0; | ||
41 | |||
42 | while (dev->bus->number > 0) { | ||
43 | |||
44 | slot = path[i].slot = PCI_SLOT(dev->devfn); | ||
45 | pin = path[i].pin = bridge_swizzle(pin, slot); | ||
46 | dev = dev->bus->self; | ||
47 | i++; | ||
48 | if (i > 3) panic("PCI path to root bus too long!\n"); | ||
49 | } | ||
50 | |||
51 | slot = PCI_SLOT(dev->devfn); | ||
52 | /* This is the slot on bus 0 through which the device is eventually | ||
53 | reachable. */ | ||
54 | |||
55 | /* Now work back up. */ | ||
56 | if ((slot < 3) || (i == 0)) { | ||
57 | /* Bus 0 (incl. PCI-PCI bridge itself) : perform the final | ||
58 | swizzle now. */ | ||
59 | result = IRQ_INTA + bridge_swizzle(pin, slot) - 1; | ||
60 | } else { | ||
61 | i--; | ||
62 | slot = path[i].slot; | ||
63 | pin = path[i].pin; | ||
64 | if (slot > 0) { | ||
65 | panic("PCI expansion bus device found - not handled!\n"); | ||
66 | } else { | ||
67 | if (i > 0) { | ||
68 | /* 5V slots */ | ||
69 | i--; | ||
70 | slot = path[i].slot; | ||
71 | pin = path[i].pin; | ||
72 | /* 'pin' was swizzled earlier wrt slot, don't do it again. */ | ||
73 | result = IRQ_P2INTA + (pin - 1); | ||
74 | } else { | ||
75 | /* IRQ for 2ary PCI-PCI bridge : unused */ | ||
76 | result = -1; | ||
77 | } | ||
78 | } | ||
79 | } | ||
80 | |||
81 | return result; | ||
82 | } | ||
83 | |||
84 | struct pci_channel board_pci_channels[] = { | ||
85 | { &sh5_pci_ops, NULL, NULL, 0, 0xff }, | ||
86 | { NULL, NULL, NULL, 0, 0 }, | ||
87 | }; | ||
88 | EXPORT_SYMBOL(board_pci_channels); | ||
89 | |||
90 | int __init pcibios_init_platform(void) | ||
91 | { | ||
92 | return sh5pci_init(__pa(memory_start), | ||
93 | __pa(memory_end) - __pa(memory_start)); | ||
94 | } | ||
diff --git a/arch/sh/drivers/pci/ops-r7780rp.c b/arch/sh/drivers/pci/ops-r7780rp.c index 48fe4032ebea..5fdadaeed6fc 100644 --- a/arch/sh/drivers/pci/ops-r7780rp.c +++ b/arch/sh/drivers/pci/ops-r7780rp.c | |||
@@ -17,25 +17,13 @@ | |||
17 | #include <asm/io.h> | 17 | #include <asm/io.h> |
18 | #include "pci-sh4.h" | 18 | #include "pci-sh4.h" |
19 | 19 | ||
20 | static char r7780rp_irq_tab[] __initdata = { | 20 | static char irq_tab[] __initdata = { |
21 | 0, 1, 2, 3, | ||
22 | }; | ||
23 | |||
24 | static char r7780mp_irq_tab[] __initdata = { | ||
25 | 65, 66, 67, 68, | 21 | 65, 66, 67, 68, |
26 | }; | 22 | }; |
27 | 23 | ||
28 | int __init pcibios_map_platform_irq(struct pci_dev *pdev, u8 slot, u8 pin) | 24 | int __init pcibios_map_platform_irq(struct pci_dev *pdev, u8 slot, u8 pin) |
29 | { | 25 | { |
30 | if (mach_is_r7780rp()) | 26 | return irq_tab[slot]; |
31 | return r7780rp_irq_tab[slot]; | ||
32 | if (mach_is_r7780mp() || mach_is_r7785rp()) | ||
33 | return r7780mp_irq_tab[slot]; | ||
34 | |||
35 | printk(KERN_ERR "PCI: Bad IRQ mapping " | ||
36 | "request for slot %d, func %d\n", slot, pin-1); | ||
37 | |||
38 | return -1; | ||
39 | } | 27 | } |
40 | 28 | ||
41 | static struct resource sh7780_io_resource = { | 29 | static struct resource sh7780_io_resource = { |
diff --git a/arch/sh/drivers/pci/ops-sdk7780.c b/arch/sh/drivers/pci/ops-sdk7780.c new file mode 100644 index 000000000000..66a9b4047f26 --- /dev/null +++ b/arch/sh/drivers/pci/ops-sdk7780.c | |||
@@ -0,0 +1,73 @@ | |||
1 | /* | ||
2 | * linux/arch/sh/drivers/pci/ops-sdk7780.c | ||
3 | * | ||
4 | * Copyright (C) 2006 Nobuhiro Iwamatsu | ||
5 | * | ||
6 | * PCI initialization for the SDK7780SE03 | ||
7 | * | ||
8 | * May be copied or modified under the terms of the GNU General Public | ||
9 | * License. See linux/COPYING for more information. | ||
10 | */ | ||
11 | #include <linux/kernel.h> | ||
12 | #include <linux/types.h> | ||
13 | #include <linux/init.h> | ||
14 | #include <linux/delay.h> | ||
15 | #include <linux/pci.h> | ||
16 | #include <asm/sdk7780.h> | ||
17 | #include <asm/io.h> | ||
18 | #include "pci-sh4.h" | ||
19 | |||
20 | /* IDSEL [16][17][18][19][20][21][22][23][24][25][26][27][28][29][30][31] */ | ||
21 | static char sdk7780_irq_tab[4][16] __initdata = { | ||
22 | /* INTA */ | ||
23 | { 65, 68, 67, 68, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, | ||
24 | /* INTB */ | ||
25 | { 66, 65, -1, 65, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, | ||
26 | /* INTC */ | ||
27 | { 67, 66, -1, 66, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, | ||
28 | /* INTD */ | ||
29 | { 68, 67, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, | ||
30 | }; | ||
31 | |||
32 | int __init pcibios_map_platform_irq(struct pci_dev *pdev, u8 slot, u8 pin) | ||
33 | { | ||
34 | return sdk7780_irq_tab[pin-1][slot]; | ||
35 | } | ||
36 | |||
37 | static struct resource sdk7780_io_resource = { | ||
38 | .name = "SH7780_IO", | ||
39 | .start = SH7780_PCI_IO_BASE, | ||
40 | .end = SH7780_PCI_IO_BASE + SH7780_PCI_IO_SIZE - 1, | ||
41 | .flags = IORESOURCE_IO | ||
42 | }; | ||
43 | |||
44 | static struct resource sdk7780_mem_resource = { | ||
45 | .name = "SH7780_mem", | ||
46 | .start = SH7780_PCI_MEMORY_BASE, | ||
47 | .end = SH7780_PCI_MEMORY_BASE + SH7780_PCI_MEM_SIZE - 1, | ||
48 | .flags = IORESOURCE_MEM | ||
49 | }; | ||
50 | |||
51 | struct pci_channel board_pci_channels[] = { | ||
52 | { &sh4_pci_ops, &sdk7780_io_resource, &sdk7780_mem_resource, 0, 0xff }, | ||
53 | { NULL, NULL, NULL, 0, 0 }, | ||
54 | }; | ||
55 | EXPORT_SYMBOL(board_pci_channels); | ||
56 | |||
57 | static struct sh4_pci_address_map sdk7780_pci_map = { | ||
58 | .window0 = { | ||
59 | .base = SH7780_CS2_BASE_ADDR, | ||
60 | .size = 0x04000000, | ||
61 | }, | ||
62 | .window1 = { | ||
63 | .base = SH7780_CS3_BASE_ADDR, | ||
64 | .size = 0x04000000, | ||
65 | }, | ||
66 | .flags = SH4_PCIC_NO_RESET, | ||
67 | }; | ||
68 | |||
69 | int __init pcibios_init_platform(void) | ||
70 | { | ||
71 | printk(KERN_INFO "SH7780 PCI: Finished initializing PCI controller\n"); | ||
72 | return sh7780_pcic_init(&sdk7780_pci_map); | ||
73 | } | ||
diff --git a/arch/sh/drivers/pci/ops-sh5.c b/arch/sh/drivers/pci/ops-sh5.c new file mode 100644 index 000000000000..729e38a6fe07 --- /dev/null +++ b/arch/sh/drivers/pci/ops-sh5.c | |||
@@ -0,0 +1,93 @@ | |||
1 | /* | ||
2 | * Support functions for the SH5 PCI hardware. | ||
3 | * | ||
4 | * Copyright (C) 2001 David J. Mckay (david.mckay@st.com) | ||
5 | * Copyright (C) 2003, 2004 Paul Mundt | ||
6 | * Copyright (C) 2004 Richard Curnow | ||
7 | * | ||
8 | * May be copied or modified under the terms of the GNU General Public | ||
9 | * License. See linux/COPYING for more information. | ||
10 | */ | ||
11 | #include <linux/kernel.h> | ||
12 | #include <linux/rwsem.h> | ||
13 | #include <linux/smp.h> | ||
14 | #include <linux/interrupt.h> | ||
15 | #include <linux/init.h> | ||
16 | #include <linux/errno.h> | ||
17 | #include <linux/pci.h> | ||
18 | #include <linux/delay.h> | ||
19 | #include <linux/types.h> | ||
20 | #include <linux/irq.h> | ||
21 | #include <asm/pci.h> | ||
22 | #include <asm/io.h> | ||
23 | #include "pci-sh5.h" | ||
24 | |||
25 | static void __init pci_fixup_ide_bases(struct pci_dev *d) | ||
26 | { | ||
27 | int i; | ||
28 | |||
29 | /* | ||
30 | * PCI IDE controllers use non-standard I/O port decoding, respect it. | ||
31 | */ | ||
32 | if ((d->class >> 8) != PCI_CLASS_STORAGE_IDE) | ||
33 | return; | ||
34 | printk("PCI: IDE base address fixup for %s\n", pci_name(d)); | ||
35 | for(i=0; i<4; i++) { | ||
36 | struct resource *r = &d->resource[i]; | ||
37 | if ((r->start & ~0x80) == 0x374) { | ||
38 | r->start |= 2; | ||
39 | r->end = r->start; | ||
40 | } | ||
41 | } | ||
42 | } | ||
43 | DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pci_fixup_ide_bases); | ||
44 | |||
45 | char * __devinit pcibios_setup(char *str) | ||
46 | { | ||
47 | return str; | ||
48 | } | ||
49 | |||
50 | static int sh5pci_read(struct pci_bus *bus, unsigned int devfn, int where, | ||
51 | int size, u32 *val) | ||
52 | { | ||
53 | SH5PCI_WRITE(PAR, CONFIG_CMD(bus, devfn, where)); | ||
54 | |||
55 | switch (size) { | ||
56 | case 1: | ||
57 | *val = (u8)SH5PCI_READ_BYTE(PDR + (where & 3)); | ||
58 | break; | ||
59 | case 2: | ||
60 | *val = (u16)SH5PCI_READ_SHORT(PDR + (where & 2)); | ||
61 | break; | ||
62 | case 4: | ||
63 | *val = SH5PCI_READ(PDR); | ||
64 | break; | ||
65 | } | ||
66 | |||
67 | return PCIBIOS_SUCCESSFUL; | ||
68 | } | ||
69 | |||
70 | static int sh5pci_write(struct pci_bus *bus, unsigned int devfn, int where, | ||
71 | int size, u32 val) | ||
72 | { | ||
73 | SH5PCI_WRITE(PAR, CONFIG_CMD(bus, devfn, where)); | ||
74 | |||
75 | switch (size) { | ||
76 | case 1: | ||
77 | SH5PCI_WRITE_BYTE(PDR + (where & 3), (u8)val); | ||
78 | break; | ||
79 | case 2: | ||
80 | SH5PCI_WRITE_SHORT(PDR + (where & 2), (u16)val); | ||
81 | break; | ||
82 | case 4: | ||
83 | SH5PCI_WRITE(PDR, val); | ||
84 | break; | ||
85 | } | ||
86 | |||
87 | return PCIBIOS_SUCCESSFUL; | ||
88 | } | ||
89 | |||
90 | struct pci_ops sh5_pci_ops = { | ||
91 | .read = sh5pci_read, | ||
92 | .write = sh5pci_write, | ||
93 | }; | ||
diff --git a/arch/sh/drivers/pci/pci-auto.c b/arch/sh/drivers/pci/pci-auto.c index 224e007736fb..ea404704ace8 100644 --- a/arch/sh/drivers/pci/pci-auto.c +++ b/arch/sh/drivers/pci/pci-auto.c | |||
@@ -516,10 +516,8 @@ pciauto_bus_scan(struct pci_channel *hose, int top_bus, int current_bus) | |||
516 | PCI_COMMAND, cmdstat | PCI_COMMAND_IO | | 516 | PCI_COMMAND, cmdstat | PCI_COMMAND_IO | |
517 | PCI_COMMAND_MEMORY | | 517 | PCI_COMMAND_MEMORY | |
518 | PCI_COMMAND_MASTER); | 518 | PCI_COMMAND_MASTER); |
519 | #if !defined(CONFIG_SH_HS7751RVOIP) && !defined(CONFIG_SH_RTS7751R2D) | ||
520 | early_write_config_byte(hose, top_bus, current_bus, pci_devfn, | 519 | early_write_config_byte(hose, top_bus, current_bus, pci_devfn, |
521 | PCI_LATENCY_TIMER, 0x80); | 520 | PCI_LATENCY_TIMER, 0x80); |
522 | #endif | ||
523 | 521 | ||
524 | /* Allocate PCI I/O and/or memory space */ | 522 | /* Allocate PCI I/O and/or memory space */ |
525 | pciauto_setup_bars(hose, top_bus, current_bus, pci_devfn, PCI_BASE_ADDRESS_5); | 523 | pciauto_setup_bars(hose, top_bus, current_bus, pci_devfn, PCI_BASE_ADDRESS_5); |
diff --git a/arch/sh/drivers/pci/pci-sh4.h b/arch/sh/drivers/pci/pci-sh4.h index 1901c33cde6a..4925c79ea959 100644 --- a/arch/sh/drivers/pci/pci-sh4.h +++ b/arch/sh/drivers/pci/pci-sh4.h | |||
@@ -1,7 +1,9 @@ | |||
1 | #ifndef __PCI_SH4_H | 1 | #ifndef __PCI_SH4_H |
2 | #define __PCI_SH4_H | 2 | #define __PCI_SH4_H |
3 | 3 | ||
4 | #if defined(CONFIG_CPU_SUBTYPE_SH7780) || defined(CONFIG_CPU_SUBTYPE_SH7785) | 4 | #if defined(CONFIG_CPU_SUBTYPE_SH7780) || \ |
5 | defined(CONFIG_CPU_SUBTYPE_SH7785) || \ | ||
6 | defined(CONFIG_CPU_SUBTYPE_SH7763) | ||
5 | #include "pci-sh7780.h" | 7 | #include "pci-sh7780.h" |
6 | #else | 8 | #else |
7 | #include "pci-sh7751.h" | 9 | #include "pci-sh7751.h" |
diff --git a/arch/sh/drivers/pci/pci-sh5.c b/arch/sh/drivers/pci/pci-sh5.c new file mode 100644 index 000000000000..a00a4df8c02d --- /dev/null +++ b/arch/sh/drivers/pci/pci-sh5.c | |||
@@ -0,0 +1,228 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2001 David J. Mckay (david.mckay@st.com) | ||
3 | * Copyright (C) 2003, 2004 Paul Mundt | ||
4 | * Copyright (C) 2004 Richard Curnow | ||
5 | * | ||
6 | * May be copied or modified under the terms of the GNU General Public | ||
7 | * License. See linux/COPYING for more information. | ||
8 | * | ||
9 | * Support functions for the SH5 PCI hardware. | ||
10 | */ | ||
11 | |||
12 | #include <linux/kernel.h> | ||
13 | #include <linux/rwsem.h> | ||
14 | #include <linux/smp.h> | ||
15 | #include <linux/interrupt.h> | ||
16 | #include <linux/init.h> | ||
17 | #include <linux/errno.h> | ||
18 | #include <linux/pci.h> | ||
19 | #include <linux/delay.h> | ||
20 | #include <linux/types.h> | ||
21 | #include <linux/irq.h> | ||
22 | #include <asm/cpu/irq.h> | ||
23 | #include <asm/pci.h> | ||
24 | #include <asm/io.h> | ||
25 | #include "pci-sh5.h" | ||
26 | |||
27 | unsigned long pcicr_virt; | ||
28 | unsigned long PCI_IO_AREA; | ||
29 | |||
30 | /* Rounds a number UP to the nearest power of two. Used for | ||
31 | * sizing the PCI window. | ||
32 | */ | ||
33 | static u32 __init r2p2(u32 num) | ||
34 | { | ||
35 | int i = 31; | ||
36 | u32 tmp = num; | ||
37 | |||
38 | if (num == 0) | ||
39 | return 0; | ||
40 | |||
41 | do { | ||
42 | if (tmp & (1 << 31)) | ||
43 | break; | ||
44 | i--; | ||
45 | tmp <<= 1; | ||
46 | } while (i >= 0); | ||
47 | |||
48 | tmp = 1 << i; | ||
49 | /* If the original number isn't a power of 2, round it up */ | ||
50 | if (tmp != num) | ||
51 | tmp <<= 1; | ||
52 | |||
53 | return tmp; | ||
54 | } | ||
55 | |||
56 | static irqreturn_t pcish5_err_irq(int irq, void *dev_id) | ||
57 | { | ||
58 | struct pt_regs *regs = get_irq_regs(); | ||
59 | unsigned pci_int, pci_air, pci_cir, pci_aint; | ||
60 | |||
61 | pci_int = SH5PCI_READ(INT); | ||
62 | pci_cir = SH5PCI_READ(CIR); | ||
63 | pci_air = SH5PCI_READ(AIR); | ||
64 | |||
65 | if (pci_int) { | ||
66 | printk("PCI INTERRUPT (at %08llx)!\n", regs->pc); | ||
67 | printk("PCI INT -> 0x%x\n", pci_int & 0xffff); | ||
68 | printk("PCI AIR -> 0x%x\n", pci_air); | ||
69 | printk("PCI CIR -> 0x%x\n", pci_cir); | ||
70 | SH5PCI_WRITE(INT, ~0); | ||
71 | } | ||
72 | |||
73 | pci_aint = SH5PCI_READ(AINT); | ||
74 | if (pci_aint) { | ||
75 | printk("PCI ARB INTERRUPT!\n"); | ||
76 | printk("PCI AINT -> 0x%x\n", pci_aint); | ||
77 | printk("PCI AIR -> 0x%x\n", pci_air); | ||
78 | printk("PCI CIR -> 0x%x\n", pci_cir); | ||
79 | SH5PCI_WRITE(AINT, ~0); | ||
80 | } | ||
81 | |||
82 | return IRQ_HANDLED; | ||
83 | } | ||
84 | |||
85 | static irqreturn_t pcish5_serr_irq(int irq, void *dev_id) | ||
86 | { | ||
87 | printk("SERR IRQ\n"); | ||
88 | |||
89 | return IRQ_NONE; | ||
90 | } | ||
91 | |||
92 | int __init sh5pci_init(unsigned long memStart, unsigned long memSize) | ||
93 | { | ||
94 | u32 lsr0; | ||
95 | u32 uval; | ||
96 | |||
97 | if (request_irq(IRQ_ERR, pcish5_err_irq, | ||
98 | IRQF_DISABLED, "PCI Error",NULL) < 0) { | ||
99 | printk(KERN_ERR "PCISH5: Cannot hook PCI_PERR interrupt\n"); | ||
100 | return -EINVAL; | ||
101 | } | ||
102 | |||
103 | if (request_irq(IRQ_SERR, pcish5_serr_irq, | ||
104 | IRQF_DISABLED, "PCI SERR interrupt", NULL) < 0) { | ||
105 | printk(KERN_ERR "PCISH5: Cannot hook PCI_SERR interrupt\n"); | ||
106 | return -EINVAL; | ||
107 | } | ||
108 | |||
109 | pcicr_virt = onchip_remap(SH5PCI_ICR_BASE, 1024, "PCICR"); | ||
110 | if (!pcicr_virt) { | ||
111 | panic("Unable to remap PCICR\n"); | ||
112 | } | ||
113 | |||
114 | PCI_IO_AREA = onchip_remap(SH5PCI_IO_BASE, 0x10000, "PCIIO"); | ||
115 | if (!PCI_IO_AREA) { | ||
116 | panic("Unable to remap PCIIO\n"); | ||
117 | } | ||
118 | |||
119 | /* Clear snoop registers */ | ||
120 | SH5PCI_WRITE(CSCR0, 0); | ||
121 | SH5PCI_WRITE(CSCR1, 0); | ||
122 | |||
123 | /* Switch off interrupts */ | ||
124 | SH5PCI_WRITE(INTM, 0); | ||
125 | SH5PCI_WRITE(AINTM, 0); | ||
126 | SH5PCI_WRITE(PINTM, 0); | ||
127 | |||
128 | /* Set bus active, take it out of reset */ | ||
129 | uval = SH5PCI_READ(CR); | ||
130 | |||
131 | /* Set command Register */ | ||
132 | SH5PCI_WRITE(CR, uval | CR_LOCK_MASK | CR_CFINT| CR_FTO | CR_PFE | | ||
133 | CR_PFCS | CR_BMAM); | ||
134 | |||
135 | uval=SH5PCI_READ(CR); | ||
136 | |||
137 | /* Allow it to be a master */ | ||
138 | /* NB - WE DISABLE I/O ACCESS to stop overlap */ | ||
139 | /* set WAIT bit to enable stepping, an attempt to improve stability */ | ||
140 | SH5PCI_WRITE_SHORT(CSR_CMD, | ||
141 | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER | | ||
142 | PCI_COMMAND_WAIT); | ||
143 | |||
144 | /* | ||
145 | ** Set translation mapping memory in order to convert the address | ||
146 | ** used for the main bus, to the PCI internal address. | ||
147 | */ | ||
148 | SH5PCI_WRITE(MBR,0x40000000); | ||
149 | |||
150 | /* Always set the max size 512M */ | ||
151 | SH5PCI_WRITE(MBMR, PCISH5_MEM_SIZCONV(512*1024*1024)); | ||
152 | |||
153 | /* | ||
154 | ** I/O addresses are mapped at internal PCI specific address | ||
155 | ** as is described into the configuration bridge table. | ||
156 | ** These are changed to 0, to allow cards that have legacy | ||
157 | ** io such as vga to function correctly. We set the SH5 IOBAR to | ||
158 | ** 256K, which is a bit big as we can only have 64K of address space | ||
159 | */ | ||
160 | |||
161 | SH5PCI_WRITE(IOBR,0x0); | ||
162 | |||
163 | /* Set up a 256K window. Totally pointless waste of address space */ | ||
164 | SH5PCI_WRITE(IOBMR,0); | ||
165 | |||
166 | /* The SH5 has a HUGE 256K I/O region, which breaks the PCI spec. | ||
167 | * Ideally, we would want to map the I/O region somewhere, but it | ||
168 | * is so big this is not that easy! | ||
169 | */ | ||
170 | SH5PCI_WRITE(CSR_IBAR0,~0); | ||
171 | /* Set memory size value */ | ||
172 | memSize = memory_end - memory_start; | ||
173 | |||
174 | /* Now we set up the mbars so the PCI bus can see the memory of | ||
175 | * the machine */ | ||
176 | if (memSize < (1024 * 1024)) { | ||
177 | printk(KERN_ERR "PCISH5: Ridiculous memory size of 0x%lx?\n", | ||
178 | memSize); | ||
179 | return -EINVAL; | ||
180 | } | ||
181 | |||
182 | /* Set LSR 0 */ | ||
183 | lsr0 = (memSize > (512 * 1024 * 1024)) ? 0x1ff00001 : | ||
184 | ((r2p2(memSize) - 0x100000) | 0x1); | ||
185 | SH5PCI_WRITE(LSR0, lsr0); | ||
186 | |||
187 | /* Set MBAR 0 */ | ||
188 | SH5PCI_WRITE(CSR_MBAR0, memory_start); | ||
189 | SH5PCI_WRITE(LAR0, memory_start); | ||
190 | |||
191 | SH5PCI_WRITE(CSR_MBAR1,0); | ||
192 | SH5PCI_WRITE(LAR1,0); | ||
193 | SH5PCI_WRITE(LSR1,0); | ||
194 | |||
195 | /* Enable the PCI interrupts on the device */ | ||
196 | SH5PCI_WRITE(INTM, ~0); | ||
197 | SH5PCI_WRITE(AINTM, ~0); | ||
198 | SH5PCI_WRITE(PINTM, ~0); | ||
199 | |||
200 | return 0; | ||
201 | } | ||
202 | |||
203 | void __devinit pcibios_fixup_bus(struct pci_bus *bus) | ||
204 | { | ||
205 | struct pci_dev *dev = bus->self; | ||
206 | int i; | ||
207 | |||
208 | if (dev) { | ||
209 | for (i= 0; i < 3; i++) { | ||
210 | bus->resource[i] = | ||
211 | &dev->resource[PCI_BRIDGE_RESOURCES+i]; | ||
212 | bus->resource[i]->name = bus->name; | ||
213 | } | ||
214 | bus->resource[0]->flags |= IORESOURCE_IO; | ||
215 | bus->resource[1]->flags |= IORESOURCE_MEM; | ||
216 | |||
217 | /* For now, propagate host limits to the bus; | ||
218 | * we'll adjust them later. */ | ||
219 | bus->resource[0]->end = 64*1024 - 1 ; | ||
220 | bus->resource[1]->end = PCIBIOS_MIN_MEM+(256*1024*1024)-1; | ||
221 | bus->resource[0]->start = PCIBIOS_MIN_IO; | ||
222 | bus->resource[1]->start = PCIBIOS_MIN_MEM; | ||
223 | |||
224 | /* Turn off downstream PF memory address range by default */ | ||
225 | bus->resource[2]->start = 1024*1024; | ||
226 | bus->resource[2]->end = bus->resource[2]->start - 1; | ||
227 | } | ||
228 | } | ||
diff --git a/arch/sh64/kernel/pci_sh5.h b/arch/sh/drivers/pci/pci-sh5.h index c71159dd04b9..7cff3fc04d30 100644 --- a/arch/sh64/kernel/pci_sh5.h +++ b/arch/sh/drivers/pci/pci-sh5.h | |||
@@ -6,6 +6,8 @@ | |||
6 | * | 6 | * |
7 | * Definitions for the SH5 PCI hardware. | 7 | * Definitions for the SH5 PCI hardware. |
8 | */ | 8 | */ |
9 | #ifndef __PCI_SH5_H | ||
10 | #define __PCI_SH5_H | ||
9 | 11 | ||
10 | /* Product ID */ | 12 | /* Product ID */ |
11 | #define PCISH5_PID 0x350d | 13 | #define PCISH5_PID 0x350d |
@@ -73,13 +75,12 @@ | |||
73 | #define PCISH5_ICR_CSR_MBAR0 0x014 /* First Memory base address register */ | 75 | #define PCISH5_ICR_CSR_MBAR0 0x014 /* First Memory base address register */ |
74 | #define PCISH5_ICR_CSR_MBAR1 0x018 /* Second Memory base address register */ | 76 | #define PCISH5_ICR_CSR_MBAR1 0x018 /* Second Memory base address register */ |
75 | 77 | ||
76 | |||
77 | |||
78 | /* Base address of registers */ | 78 | /* Base address of registers */ |
79 | #define SH5PCI_ICR_BASE (PHYS_PCI_BLOCK + 0x00040000) | 79 | #define SH5PCI_ICR_BASE (PHYS_PCI_BLOCK + 0x00040000) |
80 | #define SH5PCI_IO_BASE (PHYS_PCI_BLOCK + 0x00800000) | 80 | #define SH5PCI_IO_BASE (PHYS_PCI_BLOCK + 0x00800000) |
81 | /* #define SH5PCI_VCR_BASE (P2SEG_PCICB_BLOCK + P2SEG) */ | 81 | /* #define SH5PCI_VCR_BASE (P2SEG_PCICB_BLOCK + P2SEG) */ |
82 | 82 | ||
83 | extern unsigned long pcicr_virt; | ||
83 | /* Register selection macro */ | 84 | /* Register selection macro */ |
84 | #define PCISH5_ICR_REG(x) ( pcicr_virt + (PCISH5_ICR_##x)) | 85 | #define PCISH5_ICR_REG(x) ( pcicr_virt + (PCISH5_ICR_##x)) |
85 | /* #define PCISH5_VCR_REG(x) ( SH5PCI_VCR_BASE (PCISH5_VCR_##x)) */ | 86 | /* #define PCISH5_VCR_REG(x) ( SH5PCI_VCR_BASE (PCISH5_VCR_##x)) */ |
@@ -104,4 +105,9 @@ | |||
104 | #define PCISH5_MEM_SIZCONV(x) (((x / 0x40000) - 1) << 18) | 105 | #define PCISH5_MEM_SIZCONV(x) (((x / 0x40000) - 1) << 18) |
105 | #define PCISH5_IO_SIZCONV(x) (((x / 0x40000) - 1) << 18) | 106 | #define PCISH5_IO_SIZCONV(x) (((x / 0x40000) - 1) << 18) |
106 | 107 | ||
108 | extern struct pci_ops sh5_pci_ops; | ||
109 | |||
110 | /* arch/sh/drivers/pci/pci-sh5.c */ | ||
111 | int sh5pci_init(unsigned long memStart, unsigned long memSize); | ||
107 | 112 | ||
113 | #endif /* __PCI_SH5_H */ | ||
diff --git a/arch/sh/drivers/pci/pci-sh7780.c b/arch/sh/drivers/pci/pci-sh7780.c index e516087fb435..7d797f4de5e7 100644 --- a/arch/sh/drivers/pci/pci-sh7780.c +++ b/arch/sh/drivers/pci/pci-sh7780.c | |||
@@ -58,6 +58,7 @@ static int __init sh7780_pci_init(void) | |||
58 | id = pci_read_reg(SH7780_PCIVID); | 58 | id = pci_read_reg(SH7780_PCIVID); |
59 | if ((id & 0xffff) == SH7780_VENDOR_ID) { | 59 | if ((id & 0xffff) == SH7780_VENDOR_ID) { |
60 | switch ((id >> 16) & 0xffff) { | 60 | switch ((id >> 16) & 0xffff) { |
61 | case SH7763_DEVICE_ID: | ||
61 | case SH7780_DEVICE_ID: | 62 | case SH7780_DEVICE_ID: |
62 | case SH7781_DEVICE_ID: | 63 | case SH7781_DEVICE_ID: |
63 | case SH7785_DEVICE_ID: | 64 | case SH7785_DEVICE_ID: |
diff --git a/arch/sh/drivers/pci/pci-sh7780.h b/arch/sh/drivers/pci/pci-sh7780.h index 1d069a859de2..97b2c98f05c4 100644 --- a/arch/sh/drivers/pci/pci-sh7780.h +++ b/arch/sh/drivers/pci/pci-sh7780.h | |||
@@ -16,6 +16,7 @@ | |||
16 | #define SH7780_VENDOR_ID 0x1912 | 16 | #define SH7780_VENDOR_ID 0x1912 |
17 | #define SH7781_DEVICE_ID 0x0001 | 17 | #define SH7781_DEVICE_ID 0x0001 |
18 | #define SH7780_DEVICE_ID 0x0002 | 18 | #define SH7780_DEVICE_ID 0x0002 |
19 | #define SH7763_DEVICE_ID 0x0004 | ||
19 | #define SH7785_DEVICE_ID 0x0007 | 20 | #define SH7785_DEVICE_ID 0x0007 |
20 | 21 | ||
21 | /* SH7780 Control Registers */ | 22 | /* SH7780 Control Registers */ |
diff --git a/arch/sh/drivers/pci/pci.c b/arch/sh/drivers/pci/pci.c index ccaba368ac9b..49b435c3a57a 100644 --- a/arch/sh/drivers/pci/pci.c +++ b/arch/sh/drivers/pci/pci.c | |||
@@ -71,7 +71,7 @@ subsys_initcall(pcibios_init); | |||
71 | * Called after each bus is probed, but before its children | 71 | * Called after each bus is probed, but before its children |
72 | * are examined. | 72 | * are examined. |
73 | */ | 73 | */ |
74 | void __devinit pcibios_fixup_bus(struct pci_bus *bus) | 74 | void __devinit __weak pcibios_fixup_bus(struct pci_bus *bus) |
75 | { | 75 | { |
76 | pci_read_bridge_bases(bus); | 76 | pci_read_bridge_bases(bus); |
77 | } | 77 | } |
diff --git a/arch/sh/kernel/Makefile b/arch/sh/kernel/Makefile index 4b81d9c47b00..349d833deab5 100644 --- a/arch/sh/kernel/Makefile +++ b/arch/sh/kernel/Makefile | |||
@@ -1,25 +1,5 @@ | |||
1 | # | 1 | ifeq ($(CONFIG_SUPERH32),y) |
2 | # Makefile for the Linux/SuperH kernel. | 2 | include ${srctree}/arch/sh/kernel/Makefile_32 |
3 | # | 3 | else |
4 | 4 | include ${srctree}/arch/sh/kernel/Makefile_64 | |
5 | extra-y := head.o init_task.o vmlinux.lds | 5 | endif |
6 | |||
7 | obj-y := debugtraps.o io.o io_generic.o irq.o machvec.o process.o ptrace.o \ | ||
8 | semaphore.o setup.o signal.o sys_sh.o syscalls.o \ | ||
9 | time.o topology.o traps.o | ||
10 | |||
11 | obj-y += cpu/ timers/ | ||
12 | obj-$(CONFIG_VSYSCALL) += vsyscall/ | ||
13 | obj-$(CONFIG_SMP) += smp.o | ||
14 | obj-$(CONFIG_CF_ENABLER) += cf-enabler.o | ||
15 | obj-$(CONFIG_SH_STANDARD_BIOS) += sh_bios.o | ||
16 | obj-$(CONFIG_SH_KGDB) += kgdb_stub.o kgdb_jmp.o | ||
17 | obj-$(CONFIG_SH_CPU_FREQ) += cpufreq.o | ||
18 | obj-$(CONFIG_MODULES) += sh_ksyms.o module.o | ||
19 | obj-$(CONFIG_EARLY_PRINTK) += early_printk.o | ||
20 | obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o | ||
21 | obj-$(CONFIG_CRASH_DUMP) += crash_dump.o | ||
22 | obj-$(CONFIG_PM) += pm.o | ||
23 | obj-$(CONFIG_STACKTRACE) += stacktrace.o | ||
24 | |||
25 | EXTRA_CFLAGS += -Werror | ||
diff --git a/arch/sh/kernel/Makefile_32 b/arch/sh/kernel/Makefile_32 new file mode 100644 index 000000000000..c89289831053 --- /dev/null +++ b/arch/sh/kernel/Makefile_32 | |||
@@ -0,0 +1,26 @@ | |||
1 | # | ||
2 | # Makefile for the Linux/SuperH kernel. | ||
3 | # | ||
4 | |||
5 | extra-y := head_32.o init_task.o vmlinux.lds | ||
6 | |||
7 | obj-y := debugtraps.o io.o io_generic.o irq.o machvec.o process_32.o \ | ||
8 | ptrace_32.o semaphore.o setup.o signal_32.o sys_sh.o sys_sh32.o \ | ||
9 | syscalls_32.o time_32.o topology.o traps.o traps_32.o | ||
10 | |||
11 | obj-y += cpu/ timers/ | ||
12 | obj-$(CONFIG_VSYSCALL) += vsyscall/ | ||
13 | obj-$(CONFIG_SMP) += smp.o | ||
14 | obj-$(CONFIG_CF_ENABLER) += cf-enabler.o | ||
15 | obj-$(CONFIG_SH_STANDARD_BIOS) += sh_bios.o | ||
16 | obj-$(CONFIG_SH_KGDB) += kgdb_stub.o kgdb_jmp.o | ||
17 | obj-$(CONFIG_SH_CPU_FREQ) += cpufreq.o | ||
18 | obj-$(CONFIG_MODULES) += sh_ksyms_32.o module.o | ||
19 | obj-$(CONFIG_EARLY_PRINTK) += early_printk.o | ||
20 | obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o | ||
21 | obj-$(CONFIG_CRASH_DUMP) += crash_dump.o | ||
22 | obj-$(CONFIG_PM) += pm.o | ||
23 | obj-$(CONFIG_STACKTRACE) += stacktrace.o | ||
24 | obj-$(CONFIG_BINFMT_ELF) += dump_task.o | ||
25 | |||
26 | EXTRA_CFLAGS += -Werror | ||
diff --git a/arch/sh/kernel/Makefile_64 b/arch/sh/kernel/Makefile_64 new file mode 100644 index 000000000000..1ef21cc087f3 --- /dev/null +++ b/arch/sh/kernel/Makefile_64 | |||
@@ -0,0 +1,22 @@ | |||
1 | extra-y := head_64.o init_task.o vmlinux.lds | ||
2 | |||
3 | obj-y := debugtraps.o io.o io_generic.o irq.o machvec.o process_64.o \ | ||
4 | ptrace_64.o semaphore.o setup.o signal_64.o sys_sh.o sys_sh64.o \ | ||
5 | syscalls_64.o time_64.o topology.o traps.o traps_64.o | ||
6 | |||
7 | obj-y += cpu/ timers/ | ||
8 | obj-$(CONFIG_VSYSCALL) += vsyscall/ | ||
9 | obj-$(CONFIG_SMP) += smp.o | ||
10 | obj-$(CONFIG_CF_ENABLER) += cf-enabler.o | ||
11 | obj-$(CONFIG_SH_STANDARD_BIOS) += sh_bios.o | ||
12 | obj-$(CONFIG_SH_KGDB) += kgdb_stub.o kgdb_jmp.o | ||
13 | obj-$(CONFIG_SH_CPU_FREQ) += cpufreq.o | ||
14 | obj-$(CONFIG_MODULES) += sh_ksyms_64.o module.o | ||
15 | obj-$(CONFIG_EARLY_PRINTK) += early_printk.o | ||
16 | obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o | ||
17 | obj-$(CONFIG_CRASH_DUMP) += crash_dump.o | ||
18 | obj-$(CONFIG_PM) += pm.o | ||
19 | obj-$(CONFIG_STACKTRACE) += stacktrace.o | ||
20 | obj-$(CONFIG_BINFMT_ELF) += dump_task.o | ||
21 | |||
22 | EXTRA_CFLAGS += -Werror | ||
diff --git a/arch/sh/kernel/cpu/Makefile b/arch/sh/kernel/cpu/Makefile index d055a3ea6b4b..f471d242774e 100644 --- a/arch/sh/kernel/cpu/Makefile +++ b/arch/sh/kernel/cpu/Makefile | |||
@@ -6,8 +6,14 @@ obj-$(CONFIG_CPU_SH2) = sh2/ | |||
6 | obj-$(CONFIG_CPU_SH2A) = sh2a/ | 6 | obj-$(CONFIG_CPU_SH2A) = sh2a/ |
7 | obj-$(CONFIG_CPU_SH3) = sh3/ | 7 | obj-$(CONFIG_CPU_SH3) = sh3/ |
8 | obj-$(CONFIG_CPU_SH4) = sh4/ | 8 | obj-$(CONFIG_CPU_SH4) = sh4/ |
9 | obj-$(CONFIG_CPU_SH5) = sh5/ | ||
10 | |||
11 | # Special cases for family ancestry. | ||
12 | |||
9 | obj-$(CONFIG_CPU_SH4A) += sh4a/ | 13 | obj-$(CONFIG_CPU_SH4A) += sh4a/ |
10 | 14 | ||
15 | # Common interfaces. | ||
16 | |||
11 | obj-$(CONFIG_UBC_WAKEUP) += ubc.o | 17 | obj-$(CONFIG_UBC_WAKEUP) += ubc.o |
12 | obj-$(CONFIG_SH_ADC) += adc.o | 18 | obj-$(CONFIG_SH_ADC) += adc.o |
13 | 19 | ||
diff --git a/arch/sh/kernel/cpu/init.c b/arch/sh/kernel/cpu/init.c index c217c4bf0085..80a31329ead9 100644 --- a/arch/sh/kernel/cpu/init.c +++ b/arch/sh/kernel/cpu/init.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
15 | #include <linux/mm.h> | 15 | #include <linux/mm.h> |
16 | #include <linux/log2.h> | ||
16 | #include <asm/mmu_context.h> | 17 | #include <asm/mmu_context.h> |
17 | #include <asm/processor.h> | 18 | #include <asm/processor.h> |
18 | #include <asm/uaccess.h> | 19 | #include <asm/uaccess.h> |
@@ -20,9 +21,12 @@ | |||
20 | #include <asm/system.h> | 21 | #include <asm/system.h> |
21 | #include <asm/cacheflush.h> | 22 | #include <asm/cacheflush.h> |
22 | #include <asm/cache.h> | 23 | #include <asm/cache.h> |
24 | #include <asm/elf.h> | ||
23 | #include <asm/io.h> | 25 | #include <asm/io.h> |
24 | #include <asm/ubc.h> | ||
25 | #include <asm/smp.h> | 26 | #include <asm/smp.h> |
27 | #ifdef CONFIG_SUPERH32 | ||
28 | #include <asm/ubc.h> | ||
29 | #endif | ||
26 | 30 | ||
27 | /* | 31 | /* |
28 | * Generic wrapper for command line arguments to disable on-chip | 32 | * Generic wrapper for command line arguments to disable on-chip |
@@ -61,25 +65,12 @@ static void __init speculative_execution_init(void) | |||
61 | /* | 65 | /* |
62 | * Generic first-level cache init | 66 | * Generic first-level cache init |
63 | */ | 67 | */ |
64 | static void __init cache_init(void) | 68 | #ifdef CONFIG_SUPERH32 |
69 | static void __uses_jump_to_uncached cache_init(void) | ||
65 | { | 70 | { |
66 | unsigned long ccr, flags; | 71 | unsigned long ccr, flags; |
67 | 72 | ||
68 | /* First setup the rest of the I-cache info */ | 73 | jump_to_uncached(); |
69 | current_cpu_data.icache.entry_mask = current_cpu_data.icache.way_incr - | ||
70 | current_cpu_data.icache.linesz; | ||
71 | |||
72 | current_cpu_data.icache.way_size = current_cpu_data.icache.sets * | ||
73 | current_cpu_data.icache.linesz; | ||
74 | |||
75 | /* And the D-cache too */ | ||
76 | current_cpu_data.dcache.entry_mask = current_cpu_data.dcache.way_incr - | ||
77 | current_cpu_data.dcache.linesz; | ||
78 | |||
79 | current_cpu_data.dcache.way_size = current_cpu_data.dcache.sets * | ||
80 | current_cpu_data.dcache.linesz; | ||
81 | |||
82 | jump_to_P2(); | ||
83 | ccr = ctrl_inl(CCR); | 74 | ccr = ctrl_inl(CCR); |
84 | 75 | ||
85 | /* | 76 | /* |
@@ -156,7 +147,31 @@ static void __init cache_init(void) | |||
156 | #endif | 147 | #endif |
157 | 148 | ||
158 | ctrl_outl(flags, CCR); | 149 | ctrl_outl(flags, CCR); |
159 | back_to_P1(); | 150 | back_to_cached(); |
151 | } | ||
152 | #else | ||
153 | #define cache_init() do { } while (0) | ||
154 | #endif | ||
155 | |||
156 | #define CSHAPE(totalsize, linesize, assoc) \ | ||
157 | ((totalsize & ~0xff) | (linesize << 4) | assoc) | ||
158 | |||
159 | #define CACHE_DESC_SHAPE(desc) \ | ||
160 | CSHAPE((desc).way_size * (desc).ways, ilog2((desc).linesz), (desc).ways) | ||
161 | |||
162 | static void detect_cache_shape(void) | ||
163 | { | ||
164 | l1d_cache_shape = CACHE_DESC_SHAPE(current_cpu_data.dcache); | ||
165 | |||
166 | if (current_cpu_data.dcache.flags & SH_CACHE_COMBINED) | ||
167 | l1i_cache_shape = l1d_cache_shape; | ||
168 | else | ||
169 | l1i_cache_shape = CACHE_DESC_SHAPE(current_cpu_data.icache); | ||
170 | |||
171 | if (current_cpu_data.flags & CPU_HAS_L2_CACHE) | ||
172 | l2_cache_shape = CACHE_DESC_SHAPE(current_cpu_data.scache); | ||
173 | else | ||
174 | l2_cache_shape = -1; /* No S-cache */ | ||
160 | } | 175 | } |
161 | 176 | ||
162 | #ifdef CONFIG_SH_DSP | 177 | #ifdef CONFIG_SH_DSP |
@@ -228,14 +243,32 @@ asmlinkage void __cpuinit sh_cpu_init(void) | |||
228 | if (current_cpu_data.type == CPU_SH_NONE) | 243 | if (current_cpu_data.type == CPU_SH_NONE) |
229 | panic("Unknown CPU"); | 244 | panic("Unknown CPU"); |
230 | 245 | ||
246 | /* First setup the rest of the I-cache info */ | ||
247 | current_cpu_data.icache.entry_mask = current_cpu_data.icache.way_incr - | ||
248 | current_cpu_data.icache.linesz; | ||
249 | |||
250 | current_cpu_data.icache.way_size = current_cpu_data.icache.sets * | ||
251 | current_cpu_data.icache.linesz; | ||
252 | |||
253 | /* And the D-cache too */ | ||
254 | current_cpu_data.dcache.entry_mask = current_cpu_data.dcache.way_incr - | ||
255 | current_cpu_data.dcache.linesz; | ||
256 | |||
257 | current_cpu_data.dcache.way_size = current_cpu_data.dcache.sets * | ||
258 | current_cpu_data.dcache.linesz; | ||
259 | |||
231 | /* Init the cache */ | 260 | /* Init the cache */ |
232 | cache_init(); | 261 | cache_init(); |
233 | 262 | ||
234 | if (raw_smp_processor_id() == 0) | 263 | if (raw_smp_processor_id() == 0) { |
235 | shm_align_mask = max_t(unsigned long, | 264 | shm_align_mask = max_t(unsigned long, |
236 | current_cpu_data.dcache.way_size - 1, | 265 | current_cpu_data.dcache.way_size - 1, |
237 | PAGE_SIZE - 1); | 266 | PAGE_SIZE - 1); |
238 | 267 | ||
268 | /* Boot CPU sets the cache shape */ | ||
269 | detect_cache_shape(); | ||
270 | } | ||
271 | |||
239 | /* Disable the FPU */ | 272 | /* Disable the FPU */ |
240 | if (fpu_disabled) { | 273 | if (fpu_disabled) { |
241 | printk("FPU Disabled\n"); | 274 | printk("FPU Disabled\n"); |
@@ -273,7 +306,10 @@ asmlinkage void __cpuinit sh_cpu_init(void) | |||
273 | * like PTRACE_SINGLESTEP or doing hardware watchpoints in GDB. So .. | 306 | * like PTRACE_SINGLESTEP or doing hardware watchpoints in GDB. So .. |
274 | * we wake it up and hope that all is well. | 307 | * we wake it up and hope that all is well. |
275 | */ | 308 | */ |
309 | #ifdef CONFIG_SUPERH32 | ||
276 | if (raw_smp_processor_id() == 0) | 310 | if (raw_smp_processor_id() == 0) |
277 | ubc_wakeup(); | 311 | ubc_wakeup(); |
312 | #endif | ||
313 | |||
278 | speculative_execution_init(); | 314 | speculative_execution_init(); |
279 | } | 315 | } |
diff --git a/arch/sh/kernel/cpu/irq/Makefile b/arch/sh/kernel/cpu/irq/Makefile index 8da8e178f09c..cc1836e47a5d 100644 --- a/arch/sh/kernel/cpu/irq/Makefile +++ b/arch/sh/kernel/cpu/irq/Makefile | |||
@@ -1,7 +1,9 @@ | |||
1 | # | 1 | # |
2 | # Makefile for the Linux/SuperH CPU-specifc IRQ handlers. | 2 | # Makefile for the Linux/SuperH CPU-specifc IRQ handlers. |
3 | # | 3 | # |
4 | obj-y += imask.o intc.o | 4 | obj-y += intc.o |
5 | 5 | ||
6 | obj-$(CONFIG_SUPERH32) += imask.o | ||
7 | obj-$(CONFIG_CPU_SH5) += intc-sh5.o | ||
6 | obj-$(CONFIG_CPU_HAS_IPR_IRQ) += ipr.o | 8 | obj-$(CONFIG_CPU_HAS_IPR_IRQ) += ipr.o |
7 | obj-$(CONFIG_CPU_HAS_MASKREG_IRQ) += maskreg.o | 9 | obj-$(CONFIG_CPU_HAS_MASKREG_IRQ) += maskreg.o |
diff --git a/arch/sh64/kernel/irq_intc.c b/arch/sh/kernel/cpu/irq/intc-sh5.c index 3b63a93198f2..43ee7a9a4f0b 100644 --- a/arch/sh64/kernel/irq_intc.c +++ b/arch/sh/kernel/cpu/irq/intc-sh5.c | |||
@@ -1,34 +1,27 @@ | |||
1 | /* | 1 | /* |
2 | * This file is subject to the terms and conditions of the GNU General Public | 2 | * arch/sh/kernel/cpu/irq/intc-sh5.c |
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | 3 | * |
6 | * arch/sh64/kernel/irq_intc.c | 4 | * Interrupt Controller support for SH5 INTC. |
7 | * | 5 | * |
8 | * Copyright (C) 2000, 2001 Paolo Alberelli | 6 | * Copyright (C) 2000, 2001 Paolo Alberelli |
9 | * Copyright (C) 2003 Paul Mundt | 7 | * Copyright (C) 2003 Paul Mundt |
10 | * | 8 | * |
11 | * Interrupt Controller support for SH5 INTC. | ||
12 | * Per-interrupt selective. IRLM=0 (Fixed priority) is not | 9 | * Per-interrupt selective. IRLM=0 (Fixed priority) is not |
13 | * supported being useless without a cascaded interrupt | 10 | * supported being useless without a cascaded interrupt |
14 | * controller. | 11 | * controller. |
15 | * | 12 | * |
13 | * This file is subject to the terms and conditions of the GNU General Public | ||
14 | * License. See the file "COPYING" in the main directory of this archive | ||
15 | * for more details. | ||
16 | */ | 16 | */ |
17 | |||
18 | #include <linux/init.h> | 17 | #include <linux/init.h> |
19 | #include <linux/interrupt.h> | 18 | #include <linux/interrupt.h> |
20 | #include <linux/irq.h> | 19 | #include <linux/irq.h> |
20 | #include <linux/io.h> | ||
21 | #include <linux/kernel.h> | 21 | #include <linux/kernel.h> |
22 | #include <linux/stddef.h> | 22 | #include <linux/bitops.h> |
23 | #include <linux/bitops.h> /* this includes also <asm/registers.h */ | 23 | #include <asm/cpu/irq.h> |
24 | /* which is required to remap register */ | ||
25 | /* names used into __asm__ blocks... */ | ||
26 | |||
27 | #include <asm/hardware.h> | ||
28 | #include <asm/platform.h> | ||
29 | #include <asm/page.h> | 24 | #include <asm/page.h> |
30 | #include <asm/io.h> | ||
31 | #include <asm/irq.h> | ||
32 | 25 | ||
33 | /* | 26 | /* |
34 | * Maybe the generic Peripheral block could move to a more | 27 | * Maybe the generic Peripheral block could move to a more |
@@ -192,7 +185,7 @@ int intc_irq_describe(char* p, int irq) | |||
192 | } | 185 | } |
193 | #endif | 186 | #endif |
194 | 187 | ||
195 | void __init init_IRQ(void) | 188 | void __init plat_irq_setup(void) |
196 | { | 189 | { |
197 | unsigned long long __dummy0, __dummy1=~0x00000000100000f0; | 190 | unsigned long long __dummy0, __dummy1=~0x00000000100000f0; |
198 | unsigned long reg; | 191 | unsigned long reg; |
@@ -251,14 +244,6 @@ void __init init_IRQ(void) | |||
251 | } | 244 | } |
252 | } | 245 | } |
253 | 246 | ||
254 | #ifdef CONFIG_SH_CAYMAN | ||
255 | { | ||
256 | extern void init_cayman_irq(void); | ||
257 | |||
258 | init_cayman_irq(); | ||
259 | } | ||
260 | #endif | ||
261 | |||
262 | /* | 247 | /* |
263 | * And now let interrupts come in. | 248 | * And now let interrupts come in. |
264 | * sti() is not enough, we need to | 249 | * sti() is not enough, we need to |
diff --git a/arch/sh/kernel/cpu/irq/intc.c b/arch/sh/kernel/cpu/irq/intc.c index 6ac018c15e03..84806b2027f8 100644 --- a/arch/sh/kernel/cpu/irq/intc.c +++ b/arch/sh/kernel/cpu/irq/intc.c | |||
@@ -335,31 +335,6 @@ static intc_enum __init intc_grp_id(struct intc_desc *desc, | |||
335 | return 0; | 335 | return 0; |
336 | } | 336 | } |
337 | 337 | ||
338 | static unsigned int __init intc_prio_value(struct intc_desc *desc, | ||
339 | intc_enum enum_id, int do_grps) | ||
340 | { | ||
341 | struct intc_prio *p = desc->priorities; | ||
342 | unsigned int i; | ||
343 | |||
344 | for (i = 0; p && enum_id && i < desc->nr_priorities; i++) { | ||
345 | p = desc->priorities + i; | ||
346 | |||
347 | if (p->enum_id != enum_id) | ||
348 | continue; | ||
349 | |||
350 | return p->priority; | ||
351 | } | ||
352 | |||
353 | if (do_grps) | ||
354 | return intc_prio_value(desc, intc_grp_id(desc, enum_id), 0); | ||
355 | |||
356 | /* default to the lowest priority possible if no priority is set | ||
357 | * - this needs to be at least 2 for 5-bit priorities on 7780 | ||
358 | */ | ||
359 | |||
360 | return 2; | ||
361 | } | ||
362 | |||
363 | static unsigned int __init intc_mask_data(struct intc_desc *desc, | 338 | static unsigned int __init intc_mask_data(struct intc_desc *desc, |
364 | struct intc_desc_int *d, | 339 | struct intc_desc_int *d, |
365 | intc_enum enum_id, int do_grps) | 340 | intc_enum enum_id, int do_grps) |
@@ -518,8 +493,10 @@ static void __init intc_register_irq(struct intc_desc *desc, | |||
518 | handle_level_irq, "level"); | 493 | handle_level_irq, "level"); |
519 | set_irq_chip_data(irq, (void *)data[primary]); | 494 | set_irq_chip_data(irq, (void *)data[primary]); |
520 | 495 | ||
521 | /* record the desired priority level */ | 496 | /* set priority level |
522 | intc_prio_level[irq] = intc_prio_value(desc, enum_id, 1); | 497 | * - this needs to be at least 2 for 5-bit priorities on 7780 |
498 | */ | ||
499 | intc_prio_level[irq] = 2; | ||
523 | 500 | ||
524 | /* enable secondary masking method if present */ | 501 | /* enable secondary masking method if present */ |
525 | if (data[!primary]) | 502 | if (data[!primary]) |
diff --git a/arch/sh/kernel/cpu/sh2/entry.S b/arch/sh/kernel/cpu/sh2/entry.S index ee8f1fe84b08..7a26569e7956 100644 --- a/arch/sh/kernel/cpu/sh2/entry.S +++ b/arch/sh/kernel/cpu/sh2/entry.S | |||
@@ -149,6 +149,14 @@ ENTRY(exception_handler) | |||
149 | mov #32,r8 | 149 | mov #32,r8 |
150 | cmp/hs r8,r9 | 150 | cmp/hs r8,r9 |
151 | bt trap_entry ! 64 > vec >= 32 is trap | 151 | bt trap_entry ! 64 > vec >= 32 is trap |
152 | |||
153 | #if defined(CONFIG_SH_FPU) | ||
154 | mov #13,r8 | ||
155 | cmp/eq r8,r9 | ||
156 | bt 10f ! fpu | ||
157 | nop | ||
158 | #endif | ||
159 | |||
152 | mov.l 4f,r8 | 160 | mov.l 4f,r8 |
153 | mov r9,r4 | 161 | mov r9,r4 |
154 | shll2 r9 | 162 | shll2 r9 |
@@ -158,6 +166,10 @@ ENTRY(exception_handler) | |||
158 | cmp/eq r9,r8 | 166 | cmp/eq r9,r8 |
159 | bf 3f | 167 | bf 3f |
160 | mov.l 8f,r8 ! unhandled exception | 168 | mov.l 8f,r8 ! unhandled exception |
169 | #if defined(CONFIG_SH_FPU) | ||
170 | 10: | ||
171 | mov.l 9f, r8 ! unhandled exception | ||
172 | #endif | ||
161 | 3: | 173 | 3: |
162 | mov.l 5f,r10 | 174 | mov.l 5f,r10 |
163 | jmp @r8 | 175 | jmp @r8 |
@@ -177,7 +189,10 @@ interrupt_entry: | |||
177 | 6: .long ret_from_irq | 189 | 6: .long ret_from_irq |
178 | 7: .long do_IRQ | 190 | 7: .long do_IRQ |
179 | 8: .long do_exception_error | 191 | 8: .long do_exception_error |
180 | 192 | #ifdef CONFIG_SH_FPU | |
193 | 9: .long fpu_error_trap_handler | ||
194 | #endif | ||
195 | |||
181 | trap_entry: | 196 | trap_entry: |
182 | mov #0x30,r8 | 197 | mov #0x30,r8 |
183 | cmp/ge r8,r9 ! vector 0x20-0x2f is systemcall | 198 | cmp/ge r8,r9 ! vector 0x20-0x2f is systemcall |
@@ -250,7 +265,7 @@ ENTRY(sh_bios_handler) | |||
250 | 1: .long gdb_vbr_vector | 265 | 1: .long gdb_vbr_vector |
251 | #endif /* CONFIG_SH_STANDARD_BIOS */ | 266 | #endif /* CONFIG_SH_STANDARD_BIOS */ |
252 | 267 | ||
253 | ENTRY(address_error_handler) | 268 | ENTRY(address_error_trap_handler) |
254 | mov r15,r4 ! regs | 269 | mov r15,r4 ! regs |
255 | add #4,r4 | 270 | add #4,r4 |
256 | mov #OFF_PC,r0 | 271 | mov #OFF_PC,r0 |
diff --git a/arch/sh/kernel/cpu/sh2/setup-sh7619.c b/arch/sh/kernel/cpu/sh2/setup-sh7619.c index ec6adc3f306f..b230eb278cef 100644 --- a/arch/sh/kernel/cpu/sh2/setup-sh7619.c +++ b/arch/sh/kernel/cpu/sh2/setup-sh7619.c | |||
@@ -65,7 +65,7 @@ static struct intc_prio_reg prio_registers[] __initdata = { | |||
65 | }; | 65 | }; |
66 | 66 | ||
67 | static DECLARE_INTC_DESC(intc_desc, "sh7619", vectors, groups, | 67 | static DECLARE_INTC_DESC(intc_desc, "sh7619", vectors, groups, |
68 | NULL, NULL, prio_registers, NULL); | 68 | NULL, prio_registers, NULL); |
69 | 69 | ||
70 | static struct plat_sci_port sci_platform_data[] = { | 70 | static struct plat_sci_port sci_platform_data[] = { |
71 | { | 71 | { |
diff --git a/arch/sh/kernel/cpu/sh2a/Makefile b/arch/sh/kernel/cpu/sh2a/Makefile index 965fa2572b23..b279cdc3a233 100644 --- a/arch/sh/kernel/cpu/sh2a/Makefile +++ b/arch/sh/kernel/cpu/sh2a/Makefile | |||
@@ -6,4 +6,8 @@ obj-y := common.o probe.o opcode_helper.o | |||
6 | 6 | ||
7 | common-y += $(addprefix ../sh2/, ex.o entry.o) | 7 | common-y += $(addprefix ../sh2/, ex.o entry.o) |
8 | 8 | ||
9 | obj-$(CONFIG_SH_FPU) += fpu.o | ||
10 | |||
9 | obj-$(CONFIG_CPU_SUBTYPE_SH7206) += setup-sh7206.o clock-sh7206.o | 11 | obj-$(CONFIG_CPU_SUBTYPE_SH7206) += setup-sh7206.o clock-sh7206.o |
12 | obj-$(CONFIG_CPU_SUBTYPE_SH7203) += setup-sh7203.o clock-sh7203.o | ||
13 | obj-$(CONFIG_CPU_SUBTYPE_SH7263) += setup-sh7203.o clock-sh7203.o | ||
diff --git a/arch/sh/kernel/cpu/sh2a/clock-sh7203.c b/arch/sh/kernel/cpu/sh2a/clock-sh7203.c new file mode 100644 index 000000000000..3feb95a4fcbc --- /dev/null +++ b/arch/sh/kernel/cpu/sh2a/clock-sh7203.c | |||
@@ -0,0 +1,89 @@ | |||
1 | /* | ||
2 | * arch/sh/kernel/cpu/sh2a/clock-sh7203.c | ||
3 | * | ||
4 | * SH7203 support for the clock framework | ||
5 | * | ||
6 | * Copyright (C) 2007 Kieran Bingham (MPC-Data Ltd) | ||
7 | * | ||
8 | * Based on clock-sh7263.c | ||
9 | * Copyright (C) 2006 Yoshinori Sato | ||
10 | * | ||
11 | * Based on clock-sh4.c | ||
12 | * Copyright (C) 2005 Paul Mundt | ||
13 | * | ||
14 | * This file is subject to the terms and conditions of the GNU General Public | ||
15 | * License. See the file "COPYING" in the main directory of this archive | ||
16 | * for more details. | ||
17 | */ | ||
18 | #include <linux/init.h> | ||
19 | #include <linux/kernel.h> | ||
20 | #include <asm/clock.h> | ||
21 | #include <asm/freq.h> | ||
22 | #include <asm/io.h> | ||
23 | |||
24 | const static int pll1rate[]={8,12,16,0}; | ||
25 | const static int pfc_divisors[]={1,2,3,4,6,8,12}; | ||
26 | #define ifc_divisors pfc_divisors | ||
27 | |||
28 | #if (CONFIG_SH_CLK_MD == 0) | ||
29 | #define PLL2 (1) | ||
30 | #elif (CONFIG_SH_CLK_MD == 1) | ||
31 | #define PLL2 (2) | ||
32 | #elif (CONFIG_SH_CLK_MD == 2) | ||
33 | #define PLL2 (4) | ||
34 | #elif (CONFIG_SH_CLK_MD == 3) | ||
35 | #define PLL2 (4) | ||
36 | #else | ||
37 | #error "Illegal Clock Mode!" | ||
38 | #endif | ||
39 | |||
40 | static void master_clk_init(struct clk *clk) | ||
41 | { | ||
42 | clk->rate *= pll1rate[(ctrl_inw(FREQCR) >> 8) & 0x0003] * PLL2 ; | ||
43 | } | ||
44 | |||
45 | static struct clk_ops sh7203_master_clk_ops = { | ||
46 | .init = master_clk_init, | ||
47 | }; | ||
48 | |||
49 | static void module_clk_recalc(struct clk *clk) | ||
50 | { | ||
51 | int idx = (ctrl_inw(FREQCR) & 0x0007); | ||
52 | clk->rate = clk->parent->rate / pfc_divisors[idx]; | ||
53 | } | ||
54 | |||
55 | static struct clk_ops sh7203_module_clk_ops = { | ||
56 | .recalc = module_clk_recalc, | ||
57 | }; | ||
58 | |||
59 | static void bus_clk_recalc(struct clk *clk) | ||
60 | { | ||
61 | int idx = (ctrl_inw(FREQCR) & 0x0007); | ||
62 | clk->rate = clk->parent->rate / pfc_divisors[idx-2]; | ||
63 | } | ||
64 | |||
65 | static struct clk_ops sh7203_bus_clk_ops = { | ||
66 | .recalc = bus_clk_recalc, | ||
67 | }; | ||
68 | |||
69 | static void cpu_clk_recalc(struct clk *clk) | ||
70 | { | ||
71 | clk->rate = clk->parent->rate; | ||
72 | } | ||
73 | |||
74 | static struct clk_ops sh7203_cpu_clk_ops = { | ||
75 | .recalc = cpu_clk_recalc, | ||
76 | }; | ||
77 | |||
78 | static struct clk_ops *sh7203_clk_ops[] = { | ||
79 | &sh7203_master_clk_ops, | ||
80 | &sh7203_module_clk_ops, | ||
81 | &sh7203_bus_clk_ops, | ||
82 | &sh7203_cpu_clk_ops, | ||
83 | }; | ||
84 | |||
85 | void __init arch_init_clk_ops(struct clk_ops **ops, int idx) | ||
86 | { | ||
87 | if (idx < ARRAY_SIZE(sh7203_clk_ops)) | ||
88 | *ops = sh7203_clk_ops[idx]; | ||
89 | } | ||
diff --git a/arch/sh/kernel/cpu/sh2a/fpu.c b/arch/sh/kernel/cpu/sh2a/fpu.c new file mode 100644 index 000000000000..ff99562456fb --- /dev/null +++ b/arch/sh/kernel/cpu/sh2a/fpu.c | |||
@@ -0,0 +1,633 @@ | |||
1 | /* | ||
2 | * Save/restore floating point context for signal handlers. | ||
3 | * | ||
4 | * Copyright (C) 1999, 2000 Kaz Kojima & Niibe Yutaka | ||
5 | * | ||
6 | * This file is subject to the terms and conditions of the GNU General Public | ||
7 | * License. See the file "COPYING" in the main directory of this archive | ||
8 | * for more details. | ||
9 | * | ||
10 | * FIXME! These routines can be optimized in big endian case. | ||
11 | */ | ||
12 | #include <linux/sched.h> | ||
13 | #include <linux/signal.h> | ||
14 | #include <asm/processor.h> | ||
15 | #include <asm/io.h> | ||
16 | |||
17 | /* The PR (precision) bit in the FP Status Register must be clear when | ||
18 | * an frchg instruction is executed, otherwise the instruction is undefined. | ||
19 | * Executing frchg with PR set causes a trap on some SH4 implementations. | ||
20 | */ | ||
21 | |||
22 | #define FPSCR_RCHG 0x00000000 | ||
23 | |||
24 | |||
25 | /* | ||
26 | * Save FPU registers onto task structure. | ||
27 | * Assume called with FPU enabled (SR.FD=0). | ||
28 | */ | ||
29 | void | ||
30 | save_fpu(struct task_struct *tsk, struct pt_regs *regs) | ||
31 | { | ||
32 | unsigned long dummy; | ||
33 | |||
34 | clear_tsk_thread_flag(tsk, TIF_USEDFPU); | ||
35 | enable_fpu(); | ||
36 | asm volatile("sts.l fpul, @-%0\n\t" | ||
37 | "sts.l fpscr, @-%0\n\t" | ||
38 | "fmov.s fr15, @-%0\n\t" | ||
39 | "fmov.s fr14, @-%0\n\t" | ||
40 | "fmov.s fr13, @-%0\n\t" | ||
41 | "fmov.s fr12, @-%0\n\t" | ||
42 | "fmov.s fr11, @-%0\n\t" | ||
43 | "fmov.s fr10, @-%0\n\t" | ||
44 | "fmov.s fr9, @-%0\n\t" | ||
45 | "fmov.s fr8, @-%0\n\t" | ||
46 | "fmov.s fr7, @-%0\n\t" | ||
47 | "fmov.s fr6, @-%0\n\t" | ||
48 | "fmov.s fr5, @-%0\n\t" | ||
49 | "fmov.s fr4, @-%0\n\t" | ||
50 | "fmov.s fr3, @-%0\n\t" | ||
51 | "fmov.s fr2, @-%0\n\t" | ||
52 | "fmov.s fr1, @-%0\n\t" | ||
53 | "fmov.s fr0, @-%0\n\t" | ||
54 | "lds %3, fpscr\n\t" | ||
55 | : "=r" (dummy) | ||
56 | : "0" ((char *)(&tsk->thread.fpu.hard.status)), | ||
57 | "r" (FPSCR_RCHG), | ||
58 | "r" (FPSCR_INIT) | ||
59 | : "memory"); | ||
60 | |||
61 | disable_fpu(); | ||
62 | release_fpu(regs); | ||
63 | } | ||
64 | |||
65 | static void | ||
66 | restore_fpu(struct task_struct *tsk) | ||
67 | { | ||
68 | unsigned long dummy; | ||
69 | |||
70 | enable_fpu(); | ||
71 | asm volatile("fmov.s @%0+, fr0\n\t" | ||
72 | "fmov.s @%0+, fr1\n\t" | ||
73 | "fmov.s @%0+, fr2\n\t" | ||
74 | "fmov.s @%0+, fr3\n\t" | ||
75 | "fmov.s @%0+, fr4\n\t" | ||
76 | "fmov.s @%0+, fr5\n\t" | ||
77 | "fmov.s @%0+, fr6\n\t" | ||
78 | "fmov.s @%0+, fr7\n\t" | ||
79 | "fmov.s @%0+, fr8\n\t" | ||
80 | "fmov.s @%0+, fr9\n\t" | ||
81 | "fmov.s @%0+, fr10\n\t" | ||
82 | "fmov.s @%0+, fr11\n\t" | ||
83 | "fmov.s @%0+, fr12\n\t" | ||
84 | "fmov.s @%0+, fr13\n\t" | ||
85 | "fmov.s @%0+, fr14\n\t" | ||
86 | "fmov.s @%0+, fr15\n\t" | ||
87 | "lds.l @%0+, fpscr\n\t" | ||
88 | "lds.l @%0+, fpul\n\t" | ||
89 | : "=r" (dummy) | ||
90 | : "0" (&tsk->thread.fpu), "r" (FPSCR_RCHG) | ||
91 | : "memory"); | ||
92 | disable_fpu(); | ||
93 | } | ||
94 | |||
95 | /* | ||
96 | * Load the FPU with signalling NANS. This bit pattern we're using | ||
97 | * has the property that no matter wether considered as single or as | ||
98 | * double precission represents signaling NANS. | ||
99 | */ | ||
100 | |||
101 | static void | ||
102 | fpu_init(void) | ||
103 | { | ||
104 | enable_fpu(); | ||
105 | asm volatile("lds %0, fpul\n\t" | ||
106 | "fsts fpul, fr0\n\t" | ||
107 | "fsts fpul, fr1\n\t" | ||
108 | "fsts fpul, fr2\n\t" | ||
109 | "fsts fpul, fr3\n\t" | ||
110 | "fsts fpul, fr4\n\t" | ||
111 | "fsts fpul, fr5\n\t" | ||
112 | "fsts fpul, fr6\n\t" | ||
113 | "fsts fpul, fr7\n\t" | ||
114 | "fsts fpul, fr8\n\t" | ||
115 | "fsts fpul, fr9\n\t" | ||
116 | "fsts fpul, fr10\n\t" | ||
117 | "fsts fpul, fr11\n\t" | ||
118 | "fsts fpul, fr12\n\t" | ||
119 | "fsts fpul, fr13\n\t" | ||
120 | "fsts fpul, fr14\n\t" | ||
121 | "fsts fpul, fr15\n\t" | ||
122 | "lds %2, fpscr\n\t" | ||
123 | : /* no output */ | ||
124 | : "r" (0), "r" (FPSCR_RCHG), "r" (FPSCR_INIT)); | ||
125 | disable_fpu(); | ||
126 | } | ||
127 | |||
128 | /* | ||
129 | * Emulate arithmetic ops on denormalized number for some FPU insns. | ||
130 | */ | ||
131 | |||
132 | /* denormalized float * float */ | ||
133 | static int denormal_mulf(int hx, int hy) | ||
134 | { | ||
135 | unsigned int ix, iy; | ||
136 | unsigned long long m, n; | ||
137 | int exp, w; | ||
138 | |||
139 | ix = hx & 0x7fffffff; | ||
140 | iy = hy & 0x7fffffff; | ||
141 | if (iy < 0x00800000 || ix == 0) | ||
142 | return ((hx ^ hy) & 0x80000000); | ||
143 | |||
144 | exp = (iy & 0x7f800000) >> 23; | ||
145 | ix &= 0x007fffff; | ||
146 | iy = (iy & 0x007fffff) | 0x00800000; | ||
147 | m = (unsigned long long)ix * iy; | ||
148 | n = m; | ||
149 | w = -1; | ||
150 | while (n) { n >>= 1; w++; } | ||
151 | |||
152 | /* FIXME: use guard bits */ | ||
153 | exp += w - 126 - 46; | ||
154 | if (exp > 0) | ||
155 | ix = ((int) (m >> (w - 23)) & 0x007fffff) | (exp << 23); | ||
156 | else if (exp + 22 >= 0) | ||
157 | ix = (int) (m >> (w - 22 - exp)) & 0x007fffff; | ||
158 | else | ||
159 | ix = 0; | ||
160 | |||
161 | ix |= (hx ^ hy) & 0x80000000; | ||
162 | return ix; | ||
163 | } | ||
164 | |||
165 | /* denormalized double * double */ | ||
166 | static void mult64(unsigned long long x, unsigned long long y, | ||
167 | unsigned long long *highp, unsigned long long *lowp) | ||
168 | { | ||
169 | unsigned long long sub0, sub1, sub2, sub3; | ||
170 | unsigned long long high, low; | ||
171 | |||
172 | sub0 = (x >> 32) * (unsigned long) (y >> 32); | ||
173 | sub1 = (x & 0xffffffffLL) * (unsigned long) (y >> 32); | ||
174 | sub2 = (x >> 32) * (unsigned long) (y & 0xffffffffLL); | ||
175 | sub3 = (x & 0xffffffffLL) * (unsigned long) (y & 0xffffffffLL); | ||
176 | low = sub3; | ||
177 | high = 0LL; | ||
178 | sub3 += (sub1 << 32); | ||
179 | if (low > sub3) | ||
180 | high++; | ||
181 | low = sub3; | ||
182 | sub3 += (sub2 << 32); | ||
183 | if (low > sub3) | ||
184 | high++; | ||
185 | low = sub3; | ||
186 | high += (sub1 >> 32) + (sub2 >> 32); | ||
187 | high += sub0; | ||
188 | *lowp = low; | ||
189 | *highp = high; | ||
190 | } | ||
191 | |||
192 | static inline long long rshift64(unsigned long long mh, | ||
193 | unsigned long long ml, int n) | ||
194 | { | ||
195 | if (n >= 64) | ||
196 | return mh >> (n - 64); | ||
197 | return (mh << (64 - n)) | (ml >> n); | ||
198 | } | ||
199 | |||
200 | static long long denormal_muld(long long hx, long long hy) | ||
201 | { | ||
202 | unsigned long long ix, iy; | ||
203 | unsigned long long mh, ml, nh, nl; | ||
204 | int exp, w; | ||
205 | |||
206 | ix = hx & 0x7fffffffffffffffLL; | ||
207 | iy = hy & 0x7fffffffffffffffLL; | ||
208 | if (iy < 0x0010000000000000LL || ix == 0) | ||
209 | return ((hx ^ hy) & 0x8000000000000000LL); | ||
210 | |||
211 | exp = (iy & 0x7ff0000000000000LL) >> 52; | ||
212 | ix &= 0x000fffffffffffffLL; | ||
213 | iy = (iy & 0x000fffffffffffffLL) | 0x0010000000000000LL; | ||
214 | mult64(ix, iy, &mh, &ml); | ||
215 | nh = mh; | ||
216 | nl = ml; | ||
217 | w = -1; | ||
218 | if (nh) { | ||
219 | while (nh) { nh >>= 1; w++;} | ||
220 | w += 64; | ||
221 | } else | ||
222 | while (nl) { nl >>= 1; w++;} | ||
223 | |||
224 | /* FIXME: use guard bits */ | ||
225 | exp += w - 1022 - 52 * 2; | ||
226 | if (exp > 0) | ||
227 | ix = (rshift64(mh, ml, w - 52) & 0x000fffffffffffffLL) | ||
228 | | ((long long)exp << 52); | ||
229 | else if (exp + 51 >= 0) | ||
230 | ix = rshift64(mh, ml, w - 51 - exp) & 0x000fffffffffffffLL; | ||
231 | else | ||
232 | ix = 0; | ||
233 | |||
234 | ix |= (hx ^ hy) & 0x8000000000000000LL; | ||
235 | return ix; | ||
236 | } | ||
237 | |||
238 | /* ix - iy where iy: denormal and ix, iy >= 0 */ | ||
239 | static int denormal_subf1(unsigned int ix, unsigned int iy) | ||
240 | { | ||
241 | int frac; | ||
242 | int exp; | ||
243 | |||
244 | if (ix < 0x00800000) | ||
245 | return ix - iy; | ||
246 | |||
247 | exp = (ix & 0x7f800000) >> 23; | ||
248 | if (exp - 1 > 31) | ||
249 | return ix; | ||
250 | iy >>= exp - 1; | ||
251 | if (iy == 0) | ||
252 | return ix; | ||
253 | |||
254 | frac = (ix & 0x007fffff) | 0x00800000; | ||
255 | frac -= iy; | ||
256 | while (frac < 0x00800000) { | ||
257 | if (--exp == 0) | ||
258 | return frac; | ||
259 | frac <<= 1; | ||
260 | } | ||
261 | |||
262 | return (exp << 23) | (frac & 0x007fffff); | ||
263 | } | ||
264 | |||
265 | /* ix + iy where iy: denormal and ix, iy >= 0 */ | ||
266 | static int denormal_addf1(unsigned int ix, unsigned int iy) | ||
267 | { | ||
268 | int frac; | ||
269 | int exp; | ||
270 | |||
271 | if (ix < 0x00800000) | ||
272 | return ix + iy; | ||
273 | |||
274 | exp = (ix & 0x7f800000) >> 23; | ||
275 | if (exp - 1 > 31) | ||
276 | return ix; | ||
277 | iy >>= exp - 1; | ||
278 | if (iy == 0) | ||
279 | return ix; | ||
280 | |||
281 | frac = (ix & 0x007fffff) | 0x00800000; | ||
282 | frac += iy; | ||
283 | if (frac >= 0x01000000) { | ||
284 | frac >>= 1; | ||
285 | ++exp; | ||
286 | } | ||
287 | |||
288 | return (exp << 23) | (frac & 0x007fffff); | ||
289 | } | ||
290 | |||
291 | static int denormal_addf(int hx, int hy) | ||
292 | { | ||
293 | unsigned int ix, iy; | ||
294 | int sign; | ||
295 | |||
296 | if ((hx ^ hy) & 0x80000000) { | ||
297 | sign = hx & 0x80000000; | ||
298 | ix = hx & 0x7fffffff; | ||
299 | iy = hy & 0x7fffffff; | ||
300 | if (iy < 0x00800000) { | ||
301 | ix = denormal_subf1(ix, iy); | ||
302 | if (ix < 0) { | ||
303 | ix = -ix; | ||
304 | sign ^= 0x80000000; | ||
305 | } | ||
306 | } else { | ||
307 | ix = denormal_subf1(iy, ix); | ||
308 | sign ^= 0x80000000; | ||
309 | } | ||
310 | } else { | ||
311 | sign = hx & 0x80000000; | ||
312 | ix = hx & 0x7fffffff; | ||
313 | iy = hy & 0x7fffffff; | ||
314 | if (iy < 0x00800000) | ||
315 | ix = denormal_addf1(ix, iy); | ||
316 | else | ||
317 | ix = denormal_addf1(iy, ix); | ||
318 | } | ||
319 | |||
320 | return sign | ix; | ||
321 | } | ||
322 | |||
323 | /* ix - iy where iy: denormal and ix, iy >= 0 */ | ||
324 | static long long denormal_subd1(unsigned long long ix, unsigned long long iy) | ||
325 | { | ||
326 | long long frac; | ||
327 | int exp; | ||
328 | |||
329 | if (ix < 0x0010000000000000LL) | ||
330 | return ix - iy; | ||
331 | |||
332 | exp = (ix & 0x7ff0000000000000LL) >> 52; | ||
333 | if (exp - 1 > 63) | ||
334 | return ix; | ||
335 | iy >>= exp - 1; | ||
336 | if (iy == 0) | ||
337 | return ix; | ||
338 | |||
339 | frac = (ix & 0x000fffffffffffffLL) | 0x0010000000000000LL; | ||
340 | frac -= iy; | ||
341 | while (frac < 0x0010000000000000LL) { | ||
342 | if (--exp == 0) | ||
343 | return frac; | ||
344 | frac <<= 1; | ||
345 | } | ||
346 | |||
347 | return ((long long)exp << 52) | (frac & 0x000fffffffffffffLL); | ||
348 | } | ||
349 | |||
350 | /* ix + iy where iy: denormal and ix, iy >= 0 */ | ||
351 | static long long denormal_addd1(unsigned long long ix, unsigned long long iy) | ||
352 | { | ||
353 | long long frac; | ||
354 | long long exp; | ||
355 | |||
356 | if (ix < 0x0010000000000000LL) | ||
357 | return ix + iy; | ||
358 | |||
359 | exp = (ix & 0x7ff0000000000000LL) >> 52; | ||
360 | if (exp - 1 > 63) | ||
361 | return ix; | ||
362 | iy >>= exp - 1; | ||
363 | if (iy == 0) | ||
364 | return ix; | ||
365 | |||
366 | frac = (ix & 0x000fffffffffffffLL) | 0x0010000000000000LL; | ||
367 | frac += iy; | ||
368 | if (frac >= 0x0020000000000000LL) { | ||
369 | frac >>= 1; | ||
370 | ++exp; | ||
371 | } | ||
372 | |||
373 | return (exp << 52) | (frac & 0x000fffffffffffffLL); | ||
374 | } | ||
375 | |||
376 | static long long denormal_addd(long long hx, long long hy) | ||
377 | { | ||
378 | unsigned long long ix, iy; | ||
379 | long long sign; | ||
380 | |||
381 | if ((hx ^ hy) & 0x8000000000000000LL) { | ||
382 | sign = hx & 0x8000000000000000LL; | ||
383 | ix = hx & 0x7fffffffffffffffLL; | ||
384 | iy = hy & 0x7fffffffffffffffLL; | ||
385 | if (iy < 0x0010000000000000LL) { | ||
386 | ix = denormal_subd1(ix, iy); | ||
387 | if (ix < 0) { | ||
388 | ix = -ix; | ||
389 | sign ^= 0x8000000000000000LL; | ||
390 | } | ||
391 | } else { | ||
392 | ix = denormal_subd1(iy, ix); | ||
393 | sign ^= 0x8000000000000000LL; | ||
394 | } | ||
395 | } else { | ||
396 | sign = hx & 0x8000000000000000LL; | ||
397 | ix = hx & 0x7fffffffffffffffLL; | ||
398 | iy = hy & 0x7fffffffffffffffLL; | ||
399 | if (iy < 0x0010000000000000LL) | ||
400 | ix = denormal_addd1(ix, iy); | ||
401 | else | ||
402 | ix = denormal_addd1(iy, ix); | ||
403 | } | ||
404 | |||
405 | return sign | ix; | ||
406 | } | ||
407 | |||
408 | /** | ||
409 | * denormal_to_double - Given denormalized float number, | ||
410 | * store double float | ||
411 | * | ||
412 | * @fpu: Pointer to sh_fpu_hard structure | ||
413 | * @n: Index to FP register | ||
414 | */ | ||
415 | static void | ||
416 | denormal_to_double (struct sh_fpu_hard_struct *fpu, int n) | ||
417 | { | ||
418 | unsigned long du, dl; | ||
419 | unsigned long x = fpu->fpul; | ||
420 | int exp = 1023 - 126; | ||
421 | |||
422 | if (x != 0 && (x & 0x7f800000) == 0) { | ||
423 | du = (x & 0x80000000); | ||
424 | while ((x & 0x00800000) == 0) { | ||
425 | x <<= 1; | ||
426 | exp--; | ||
427 | } | ||
428 | x &= 0x007fffff; | ||
429 | du |= (exp << 20) | (x >> 3); | ||
430 | dl = x << 29; | ||
431 | |||
432 | fpu->fp_regs[n] = du; | ||
433 | fpu->fp_regs[n+1] = dl; | ||
434 | } | ||
435 | } | ||
436 | |||
437 | /** | ||
438 | * ieee_fpe_handler - Handle denormalized number exception | ||
439 | * | ||
440 | * @regs: Pointer to register structure | ||
441 | * | ||
442 | * Returns 1 when it's handled (should not cause exception). | ||
443 | */ | ||
444 | static int | ||
445 | ieee_fpe_handler (struct pt_regs *regs) | ||
446 | { | ||
447 | unsigned short insn = *(unsigned short *) regs->pc; | ||
448 | unsigned short finsn; | ||
449 | unsigned long nextpc; | ||
450 | int nib[4] = { | ||
451 | (insn >> 12) & 0xf, | ||
452 | (insn >> 8) & 0xf, | ||
453 | (insn >> 4) & 0xf, | ||
454 | insn & 0xf}; | ||
455 | |||
456 | if (nib[0] == 0xb || | ||
457 | (nib[0] == 0x4 && nib[2] == 0x0 && nib[3] == 0xb)) /* bsr & jsr */ | ||
458 | regs->pr = regs->pc + 4; | ||
459 | if (nib[0] == 0xa || nib[0] == 0xb) { /* bra & bsr */ | ||
460 | nextpc = regs->pc + 4 + ((short) ((insn & 0xfff) << 4) >> 3); | ||
461 | finsn = *(unsigned short *) (regs->pc + 2); | ||
462 | } else if (nib[0] == 0x8 && nib[1] == 0xd) { /* bt/s */ | ||
463 | if (regs->sr & 1) | ||
464 | nextpc = regs->pc + 4 + ((char) (insn & 0xff) << 1); | ||
465 | else | ||
466 | nextpc = regs->pc + 4; | ||
467 | finsn = *(unsigned short *) (regs->pc + 2); | ||
468 | } else if (nib[0] == 0x8 && nib[1] == 0xf) { /* bf/s */ | ||
469 | if (regs->sr & 1) | ||
470 | nextpc = regs->pc + 4; | ||
471 | else | ||
472 | nextpc = regs->pc + 4 + ((char) (insn & 0xff) << 1); | ||
473 | finsn = *(unsigned short *) (regs->pc + 2); | ||
474 | } else if (nib[0] == 0x4 && nib[3] == 0xb && | ||
475 | (nib[2] == 0x0 || nib[2] == 0x2)) { /* jmp & jsr */ | ||
476 | nextpc = regs->regs[nib[1]]; | ||
477 | finsn = *(unsigned short *) (regs->pc + 2); | ||
478 | } else if (nib[0] == 0x0 && nib[3] == 0x3 && | ||
479 | (nib[2] == 0x0 || nib[2] == 0x2)) { /* braf & bsrf */ | ||
480 | nextpc = regs->pc + 4 + regs->regs[nib[1]]; | ||
481 | finsn = *(unsigned short *) (regs->pc + 2); | ||
482 | } else if (insn == 0x000b) { /* rts */ | ||
483 | nextpc = regs->pr; | ||
484 | finsn = *(unsigned short *) (regs->pc + 2); | ||
485 | } else { | ||
486 | nextpc = regs->pc + 2; | ||
487 | finsn = insn; | ||
488 | } | ||
489 | |||
490 | #define FPSCR_FPU_ERROR (1 << 17) | ||
491 | |||
492 | if ((finsn & 0xf1ff) == 0xf0ad) { /* fcnvsd */ | ||
493 | struct task_struct *tsk = current; | ||
494 | |||
495 | if ((tsk->thread.fpu.hard.fpscr & FPSCR_FPU_ERROR)) { | ||
496 | /* FPU error */ | ||
497 | denormal_to_double (&tsk->thread.fpu.hard, | ||
498 | (finsn >> 8) & 0xf); | ||
499 | } else | ||
500 | return 0; | ||
501 | |||
502 | regs->pc = nextpc; | ||
503 | return 1; | ||
504 | } else if ((finsn & 0xf00f) == 0xf002) { /* fmul */ | ||
505 | struct task_struct *tsk = current; | ||
506 | int fpscr; | ||
507 | int n, m, prec; | ||
508 | unsigned int hx, hy; | ||
509 | |||
510 | n = (finsn >> 8) & 0xf; | ||
511 | m = (finsn >> 4) & 0xf; | ||
512 | hx = tsk->thread.fpu.hard.fp_regs[n]; | ||
513 | hy = tsk->thread.fpu.hard.fp_regs[m]; | ||
514 | fpscr = tsk->thread.fpu.hard.fpscr; | ||
515 | prec = fpscr & (1 << 19); | ||
516 | |||
517 | if ((fpscr & FPSCR_FPU_ERROR) | ||
518 | && (prec && ((hx & 0x7fffffff) < 0x00100000 | ||
519 | || (hy & 0x7fffffff) < 0x00100000))) { | ||
520 | long long llx, lly; | ||
521 | |||
522 | /* FPU error because of denormal */ | ||
523 | llx = ((long long) hx << 32) | ||
524 | | tsk->thread.fpu.hard.fp_regs[n+1]; | ||
525 | lly = ((long long) hy << 32) | ||
526 | | tsk->thread.fpu.hard.fp_regs[m+1]; | ||
527 | if ((hx & 0x7fffffff) >= 0x00100000) | ||
528 | llx = denormal_muld(lly, llx); | ||
529 | else | ||
530 | llx = denormal_muld(llx, lly); | ||
531 | tsk->thread.fpu.hard.fp_regs[n] = llx >> 32; | ||
532 | tsk->thread.fpu.hard.fp_regs[n+1] = llx & 0xffffffff; | ||
533 | } else if ((fpscr & FPSCR_FPU_ERROR) | ||
534 | && (!prec && ((hx & 0x7fffffff) < 0x00800000 | ||
535 | || (hy & 0x7fffffff) < 0x00800000))) { | ||
536 | /* FPU error because of denormal */ | ||
537 | if ((hx & 0x7fffffff) >= 0x00800000) | ||
538 | hx = denormal_mulf(hy, hx); | ||
539 | else | ||
540 | hx = denormal_mulf(hx, hy); | ||
541 | tsk->thread.fpu.hard.fp_regs[n] = hx; | ||
542 | } else | ||
543 | return 0; | ||
544 | |||
545 | regs->pc = nextpc; | ||
546 | return 1; | ||
547 | } else if ((finsn & 0xf00e) == 0xf000) { /* fadd, fsub */ | ||
548 | struct task_struct *tsk = current; | ||
549 | int fpscr; | ||
550 | int n, m, prec; | ||
551 | unsigned int hx, hy; | ||
552 | |||
553 | n = (finsn >> 8) & 0xf; | ||
554 | m = (finsn >> 4) & 0xf; | ||
555 | hx = tsk->thread.fpu.hard.fp_regs[n]; | ||
556 | hy = tsk->thread.fpu.hard.fp_regs[m]; | ||
557 | fpscr = tsk->thread.fpu.hard.fpscr; | ||
558 | prec = fpscr & (1 << 19); | ||
559 | |||
560 | if ((fpscr & FPSCR_FPU_ERROR) | ||
561 | && (prec && ((hx & 0x7fffffff) < 0x00100000 | ||
562 | || (hy & 0x7fffffff) < 0x00100000))) { | ||
563 | long long llx, lly; | ||
564 | |||
565 | /* FPU error because of denormal */ | ||
566 | llx = ((long long) hx << 32) | ||
567 | | tsk->thread.fpu.hard.fp_regs[n+1]; | ||
568 | lly = ((long long) hy << 32) | ||
569 | | tsk->thread.fpu.hard.fp_regs[m+1]; | ||
570 | if ((finsn & 0xf00f) == 0xf000) | ||
571 | llx = denormal_addd(llx, lly); | ||
572 | else | ||
573 | llx = denormal_addd(llx, lly ^ (1LL << 63)); | ||
574 | tsk->thread.fpu.hard.fp_regs[n] = llx >> 32; | ||
575 | tsk->thread.fpu.hard.fp_regs[n+1] = llx & 0xffffffff; | ||
576 | } else if ((fpscr & FPSCR_FPU_ERROR) | ||
577 | && (!prec && ((hx & 0x7fffffff) < 0x00800000 | ||
578 | || (hy & 0x7fffffff) < 0x00800000))) { | ||
579 | /* FPU error because of denormal */ | ||
580 | if ((finsn & 0xf00f) == 0xf000) | ||
581 | hx = denormal_addf(hx, hy); | ||
582 | else | ||
583 | hx = denormal_addf(hx, hy ^ 0x80000000); | ||
584 | tsk->thread.fpu.hard.fp_regs[n] = hx; | ||
585 | } else | ||
586 | return 0; | ||
587 | |||
588 | regs->pc = nextpc; | ||
589 | return 1; | ||
590 | } | ||
591 | |||
592 | return 0; | ||
593 | } | ||
594 | |||
595 | BUILD_TRAP_HANDLER(fpu_error) | ||
596 | { | ||
597 | struct task_struct *tsk = current; | ||
598 | TRAP_HANDLER_DECL; | ||
599 | |||
600 | save_fpu(tsk, regs); | ||
601 | if (ieee_fpe_handler(regs)) { | ||
602 | tsk->thread.fpu.hard.fpscr &= | ||
603 | ~(FPSCR_CAUSE_MASK | FPSCR_FLAG_MASK); | ||
604 | grab_fpu(regs); | ||
605 | restore_fpu(tsk); | ||
606 | set_tsk_thread_flag(tsk, TIF_USEDFPU); | ||
607 | return; | ||
608 | } | ||
609 | |||
610 | force_sig(SIGFPE, tsk); | ||
611 | } | ||
612 | |||
613 | BUILD_TRAP_HANDLER(fpu_state_restore) | ||
614 | { | ||
615 | struct task_struct *tsk = current; | ||
616 | TRAP_HANDLER_DECL; | ||
617 | |||
618 | grab_fpu(regs); | ||
619 | if (!user_mode(regs)) { | ||
620 | printk(KERN_ERR "BUG: FPU is used in kernel mode.\n"); | ||
621 | return; | ||
622 | } | ||
623 | |||
624 | if (used_math()) { | ||
625 | /* Using the FPU again. */ | ||
626 | restore_fpu(tsk); | ||
627 | } else { | ||
628 | /* First time FPU user. */ | ||
629 | fpu_init(); | ||
630 | set_used_math(); | ||
631 | } | ||
632 | set_tsk_thread_flag(tsk, TIF_USEDFPU); | ||
633 | } | ||
diff --git a/arch/sh/kernel/cpu/sh2a/probe.c b/arch/sh/kernel/cpu/sh2a/probe.c index 6d02465704b9..6910e2664468 100644 --- a/arch/sh/kernel/cpu/sh2a/probe.c +++ b/arch/sh/kernel/cpu/sh2a/probe.c | |||
@@ -3,25 +3,36 @@ | |||
3 | * | 3 | * |
4 | * CPU Subtype Probing for SH-2A. | 4 | * CPU Subtype Probing for SH-2A. |
5 | * | 5 | * |
6 | * Copyright (C) 2004, 2005 Paul Mundt | 6 | * Copyright (C) 2004 - 2007 Paul Mundt |
7 | * | 7 | * |
8 | * This file is subject to the terms and conditions of the GNU General Public | 8 | * This file is subject to the terms and conditions of the GNU General Public |
9 | * License. See the file "COPYING" in the main directory of this archive | 9 | * License. See the file "COPYING" in the main directory of this archive |
10 | * for more details. | 10 | * for more details. |
11 | */ | 11 | */ |
12 | |||
13 | #include <linux/init.h> | 12 | #include <linux/init.h> |
14 | #include <asm/processor.h> | 13 | #include <asm/processor.h> |
15 | #include <asm/cache.h> | 14 | #include <asm/cache.h> |
16 | 15 | ||
17 | int __init detect_cpu_and_cache_system(void) | 16 | int __init detect_cpu_and_cache_system(void) |
18 | { | 17 | { |
19 | /* Just SH7206 for now .. */ | 18 | /* All SH-2A CPUs have support for 16 and 32-bit opcodes.. */ |
20 | boot_cpu_data.type = CPU_SH7206; | ||
21 | boot_cpu_data.flags |= CPU_HAS_OP32; | 19 | boot_cpu_data.flags |= CPU_HAS_OP32; |
22 | 20 | ||
21 | #if defined(CONFIG_CPU_SUBTYPE_SH7203) | ||
22 | boot_cpu_data.type = CPU_SH7203; | ||
23 | /* SH7203 has an FPU.. */ | ||
24 | boot_cpu_data.flags |= CPU_HAS_FPU; | ||
25 | #elif defined(CONFIG_CPU_SUBTYPE_SH7263) | ||
26 | boot_cpu_data.type = CPU_SH7263; | ||
27 | boot_cpu_data.flags |= CPU_HAS_FPU; | ||
28 | #elif defined(CONFIG_CPU_SUBTYPE_SH7206) | ||
29 | boot_cpu_data.type = CPU_SH7206; | ||
30 | /* While SH7206 has a DSP.. */ | ||
31 | boot_cpu_data.flags |= CPU_HAS_DSP; | ||
32 | #endif | ||
33 | |||
23 | boot_cpu_data.dcache.ways = 4; | 34 | boot_cpu_data.dcache.ways = 4; |
24 | boot_cpu_data.dcache.way_incr = (1 << 11); | 35 | boot_cpu_data.dcache.way_incr = (1 << 11); |
25 | boot_cpu_data.dcache.sets = 128; | 36 | boot_cpu_data.dcache.sets = 128; |
26 | boot_cpu_data.dcache.entry_shift = 4; | 37 | boot_cpu_data.dcache.entry_shift = 4; |
27 | boot_cpu_data.dcache.linesz = L1_CACHE_BYTES; | 38 | boot_cpu_data.dcache.linesz = L1_CACHE_BYTES; |
@@ -37,4 +48,3 @@ int __init detect_cpu_and_cache_system(void) | |||
37 | 48 | ||
38 | return 0; | 49 | return 0; |
39 | } | 50 | } |
40 | |||
diff --git a/arch/sh/kernel/cpu/sh2a/setup-sh7203.c b/arch/sh/kernel/cpu/sh2a/setup-sh7203.c new file mode 100644 index 000000000000..db6ef5cecde1 --- /dev/null +++ b/arch/sh/kernel/cpu/sh2a/setup-sh7203.c | |||
@@ -0,0 +1,319 @@ | |||
1 | /* | ||
2 | * SH7203 and SH7263 Setup | ||
3 | * | ||
4 | * Copyright (C) 2007 Paul Mundt | ||
5 | * | ||
6 | * This file is subject to the terms and conditions of the GNU General Public | ||
7 | * License. See the file "COPYING" in the main directory of this archive | ||
8 | * for more details. | ||
9 | */ | ||
10 | #include <linux/platform_device.h> | ||
11 | #include <linux/init.h> | ||
12 | #include <linux/serial.h> | ||
13 | #include <asm/sci.h> | ||
14 | |||
15 | enum { | ||
16 | UNUSED = 0, | ||
17 | |||
18 | /* interrupt sources */ | ||
19 | IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7, | ||
20 | PINT0, PINT1, PINT2, PINT3, PINT4, PINT5, PINT6, PINT7, | ||
21 | DMAC0_DEI, DMAC0_HEI, DMAC1_DEI, DMAC1_HEI, | ||
22 | DMAC2_DEI, DMAC2_HEI, DMAC3_DEI, DMAC3_HEI, | ||
23 | DMAC4_DEI, DMAC4_HEI, DMAC5_DEI, DMAC5_HEI, | ||
24 | DMAC6_DEI, DMAC6_HEI, DMAC7_DEI, DMAC7_HEI, | ||
25 | USB, LCDC, CMT0, CMT1, BSC, WDT, | ||
26 | MTU2_TGI0A, MTU2_TGI0B, MTU2_TGI0C, MTU2_TGI0D, | ||
27 | MTU2_TCI0V, MTU2_TGI0E, MTU2_TGI0F, | ||
28 | MTU2_TGI1A, MTU2_TGI1B, MTU2_TCI1V, MTU2_TCI1U, | ||
29 | MTU2_TGI2A, MTU2_TGI2B, MTU2_TCI2V, MTU2_TCI2U, | ||
30 | MTU2_TGI3A, MTU2_TGI3B, MTU2_TGI3C, MTU2_TGI3D, MTU2_TCI3V, | ||
31 | MTU2_TGI4A, MTU2_TGI4B, MTU2_TGI4C, MTU2_TGI4D, MTU2_TCI4V, | ||
32 | ADC_ADI, | ||
33 | IIC30_STPI, IIC30_NAKI, IIC30_RXI, IIC30_TXI, IIC30_TEI, | ||
34 | IIC31_STPI, IIC31_NAKI, IIC31_RXI, IIC31_TXI, IIC31_TEI, | ||
35 | IIC32_STPI, IIC32_NAKI, IIC32_RXI, IIC32_TXI, IIC32_TEI, | ||
36 | IIC33_STPI, IIC33_NAKI, IIC33_RXI, IIC33_TXI, IIC33_TEI, | ||
37 | SCIF0_BRI, SCIF0_ERI, SCIF0_RXI, SCIF0_TXI, | ||
38 | SCIF1_BRI, SCIF1_ERI, SCIF1_RXI, SCIF1_TXI, | ||
39 | SCIF2_BRI, SCIF2_ERI, SCIF2_RXI, SCIF2_TXI, | ||
40 | SCIF3_BRI, SCIF3_ERI, SCIF3_RXI, SCIF3_TXI, | ||
41 | SSU0_SSERI, SSU0_SSRXI, SSU0_SSTXI, | ||
42 | SSU1_SSERI, SSU1_SSRXI, SSU1_SSTXI, | ||
43 | SSI0_SSII, SSI1_SSII, SSI2_SSII, SSI3_SSII, | ||
44 | |||
45 | /* ROM-DEC, SDHI, SRC, and IEB are SH7263 specific */ | ||
46 | ROMDEC_ISY, ROMDEC_IERR, ROMDEC_IARG, ROMDEC_ISEC, ROMDEC_IBUF, | ||
47 | ROMDEC_IREADY, | ||
48 | |||
49 | FLCTL_FLSTEI, FLCTL_FLTENDI, FLCTL_FLTREQ0I, FLCTL_FLTREQ1I, | ||
50 | |||
51 | SDHI3, SDHI0, SDHI1, | ||
52 | |||
53 | RTC_ARM, RTC_PRD, RTC_CUP, | ||
54 | RCAN0_ERS, RCAN0_OVR, RCAN0_RM0, RCAN0_RM1, RCAN0_SLE, | ||
55 | RCAN1_ERS, RCAN1_OVR, RCAN1_RM0, RCAN1_RM1, RCAN1_SLE, | ||
56 | |||
57 | SRC_OVF, SRC_ODFI, SRC_IDEI, IEBI, | ||
58 | |||
59 | /* interrupt groups */ | ||
60 | PINT, DMAC0, DMAC1, DMAC2, DMAC3, DMAC4, DMAC5, DMAC6, DMAC7, | ||
61 | MTU0_ABCD, MTU0_VEF, MTU1_AB, MTU1_VU, MTU2_AB, MTU2_VU, | ||
62 | MTU3_ABCD, MTU4_ABCD, | ||
63 | IIC30, IIC31, IIC32, IIC33, SCIF0, SCIF1, SCIF2, SCIF3, | ||
64 | SSU0, SSU1, ROMDEC, SDHI, FLCTL, RTC, RCAN0, RCAN1, SRC | ||
65 | }; | ||
66 | |||
67 | static struct intc_vect vectors[] __initdata = { | ||
68 | INTC_IRQ(IRQ0, 64), INTC_IRQ(IRQ1, 65), | ||
69 | INTC_IRQ(IRQ2, 66), INTC_IRQ(IRQ3, 67), | ||
70 | INTC_IRQ(IRQ4, 68), INTC_IRQ(IRQ5, 69), | ||
71 | INTC_IRQ(IRQ6, 70), INTC_IRQ(IRQ7, 71), | ||
72 | INTC_IRQ(PINT0, 80), INTC_IRQ(PINT1, 81), | ||
73 | INTC_IRQ(PINT2, 82), INTC_IRQ(PINT3, 83), | ||
74 | INTC_IRQ(PINT4, 84), INTC_IRQ(PINT5, 85), | ||
75 | INTC_IRQ(PINT6, 86), INTC_IRQ(PINT7, 87), | ||
76 | INTC_IRQ(DMAC0_DEI, 108), INTC_IRQ(DMAC0_HEI, 109), | ||
77 | INTC_IRQ(DMAC1_DEI, 112), INTC_IRQ(DMAC1_HEI, 113), | ||
78 | INTC_IRQ(DMAC2_DEI, 116), INTC_IRQ(DMAC2_HEI, 117), | ||
79 | INTC_IRQ(DMAC3_DEI, 120), INTC_IRQ(DMAC3_HEI, 121), | ||
80 | INTC_IRQ(DMAC4_DEI, 124), INTC_IRQ(DMAC4_HEI, 125), | ||
81 | INTC_IRQ(DMAC5_DEI, 128), INTC_IRQ(DMAC5_HEI, 129), | ||
82 | INTC_IRQ(DMAC6_DEI, 132), INTC_IRQ(DMAC6_HEI, 133), | ||
83 | INTC_IRQ(DMAC7_DEI, 136), INTC_IRQ(DMAC7_HEI, 137), | ||
84 | INTC_IRQ(USB, 140), INTC_IRQ(LCDC, 141), | ||
85 | INTC_IRQ(CMT0, 142), INTC_IRQ(CMT1, 143), | ||
86 | INTC_IRQ(BSC, 144), INTC_IRQ(WDT, 145), | ||
87 | INTC_IRQ(MTU2_TGI0A, 146), INTC_IRQ(MTU2_TGI0B, 147), | ||
88 | INTC_IRQ(MTU2_TGI0C, 148), INTC_IRQ(MTU2_TGI0D, 149), | ||
89 | INTC_IRQ(MTU2_TCI0V, 150), | ||
90 | INTC_IRQ(MTU2_TGI0E, 151), INTC_IRQ(MTU2_TGI0F, 152), | ||
91 | INTC_IRQ(MTU2_TGI1A, 153), INTC_IRQ(MTU2_TGI1B, 154), | ||
92 | INTC_IRQ(MTU2_TCI1V, 155), INTC_IRQ(MTU2_TCI1U, 156), | ||
93 | INTC_IRQ(MTU2_TGI2A, 157), INTC_IRQ(MTU2_TGI2B, 158), | ||
94 | INTC_IRQ(MTU2_TCI2V, 159), INTC_IRQ(MTU2_TCI2U, 160), | ||
95 | INTC_IRQ(MTU2_TGI3A, 161), INTC_IRQ(MTU2_TGI3B, 162), | ||
96 | INTC_IRQ(MTU2_TGI3C, 163), INTC_IRQ(MTU2_TGI3D, 164), | ||
97 | INTC_IRQ(MTU2_TCI3V, 165), | ||
98 | INTC_IRQ(MTU2_TGI4A, 166), INTC_IRQ(MTU2_TGI4B, 167), | ||
99 | INTC_IRQ(MTU2_TGI4C, 168), INTC_IRQ(MTU2_TGI4D, 169), | ||
100 | INTC_IRQ(MTU2_TCI4V, 170), | ||
101 | INTC_IRQ(ADC_ADI, 171), | ||
102 | INTC_IRQ(IIC30_STPI, 172), INTC_IRQ(IIC30_NAKI, 173), | ||
103 | INTC_IRQ(IIC30_RXI, 174), INTC_IRQ(IIC30_TXI, 175), | ||
104 | INTC_IRQ(IIC30_TEI, 176), | ||
105 | INTC_IRQ(IIC31_STPI, 177), INTC_IRQ(IIC31_NAKI, 178), | ||
106 | INTC_IRQ(IIC31_RXI, 179), INTC_IRQ(IIC31_TXI, 180), | ||
107 | INTC_IRQ(IIC31_TEI, 181), | ||
108 | INTC_IRQ(IIC32_STPI, 182), INTC_IRQ(IIC32_NAKI, 183), | ||
109 | INTC_IRQ(IIC32_RXI, 184), INTC_IRQ(IIC32_TXI, 185), | ||
110 | INTC_IRQ(IIC32_TEI, 186), | ||
111 | INTC_IRQ(IIC33_STPI, 187), INTC_IRQ(IIC33_NAKI, 188), | ||
112 | INTC_IRQ(IIC33_RXI, 189), INTC_IRQ(IIC33_TXI, 190), | ||
113 | INTC_IRQ(IIC33_TEI, 191), | ||
114 | INTC_IRQ(SCIF0_BRI, 192), INTC_IRQ(SCIF0_ERI, 193), | ||
115 | INTC_IRQ(SCIF0_RXI, 194), INTC_IRQ(SCIF0_TXI, 195), | ||
116 | INTC_IRQ(SCIF1_BRI, 196), INTC_IRQ(SCIF1_ERI, 197), | ||
117 | INTC_IRQ(SCIF1_RXI, 198), INTC_IRQ(SCIF1_TXI, 199), | ||
118 | INTC_IRQ(SCIF2_BRI, 200), INTC_IRQ(SCIF2_ERI, 201), | ||
119 | INTC_IRQ(SCIF2_RXI, 202), INTC_IRQ(SCIF2_TXI, 203), | ||
120 | INTC_IRQ(SCIF3_BRI, 204), INTC_IRQ(SCIF3_ERI, 205), | ||
121 | INTC_IRQ(SCIF3_RXI, 206), INTC_IRQ(SCIF3_TXI, 207), | ||
122 | INTC_IRQ(SSU0_SSERI, 208), INTC_IRQ(SSU0_SSRXI, 209), | ||
123 | INTC_IRQ(SSU0_SSTXI, 210), | ||
124 | INTC_IRQ(SSU1_SSERI, 211), INTC_IRQ(SSU1_SSRXI, 212), | ||
125 | INTC_IRQ(SSU1_SSTXI, 213), | ||
126 | INTC_IRQ(SSI0_SSII, 214), INTC_IRQ(SSI1_SSII, 215), | ||
127 | INTC_IRQ(SSI2_SSII, 216), INTC_IRQ(SSI3_SSII, 217), | ||
128 | INTC_IRQ(FLCTL_FLSTEI, 224), INTC_IRQ(FLCTL_FLTENDI, 225), | ||
129 | INTC_IRQ(FLCTL_FLTREQ0I, 226), INTC_IRQ(FLCTL_FLTREQ1I, 227), | ||
130 | INTC_IRQ(RTC_ARM, 231), INTC_IRQ(RTC_PRD, 232), | ||
131 | INTC_IRQ(RTC_CUP, 233), | ||
132 | INTC_IRQ(RCAN0_ERS, 234), INTC_IRQ(RCAN0_OVR, 235), | ||
133 | INTC_IRQ(RCAN0_RM0, 236), INTC_IRQ(RCAN0_RM1, 237), | ||
134 | INTC_IRQ(RCAN0_SLE, 238), | ||
135 | INTC_IRQ(RCAN1_ERS, 239), INTC_IRQ(RCAN1_OVR, 240), | ||
136 | INTC_IRQ(RCAN1_RM0, 241), INTC_IRQ(RCAN1_RM1, 242), | ||
137 | INTC_IRQ(RCAN1_SLE, 243), | ||
138 | |||
139 | /* SH7263-specific trash */ | ||
140 | #ifdef CONFIG_CPU_SUBTYPE_SH7263 | ||
141 | INTC_IRQ(ROMDEC_ISY, 218), INTC_IRQ(ROMDEC_IERR, 219), | ||
142 | INTC_IRQ(ROMDEC_IARG, 220), INTC_IRQ(ROMDEC_ISEC, 221), | ||
143 | INTC_IRQ(ROMDEC_IBUF, 222), INTC_IRQ(ROMDEC_IREADY, 223), | ||
144 | |||
145 | INTC_IRQ(SDHI3, 228), INTC_IRQ(SDHI0, 229), INTC_IRQ(SDHI1, 230), | ||
146 | |||
147 | INTC_IRQ(SRC_OVF, 244), INTC_IRQ(SRC_ODFI, 245), | ||
148 | INTC_IRQ(SRC_IDEI, 246), | ||
149 | |||
150 | INTC_IRQ(IEBI, 247), | ||
151 | #endif | ||
152 | }; | ||
153 | |||
154 | static struct intc_group groups[] __initdata = { | ||
155 | INTC_GROUP(PINT, PINT0, PINT1, PINT2, PINT3, | ||
156 | PINT4, PINT5, PINT6, PINT7), | ||
157 | INTC_GROUP(DMAC0, DMAC0_DEI, DMAC0_HEI), | ||
158 | INTC_GROUP(DMAC1, DMAC1_DEI, DMAC1_HEI), | ||
159 | INTC_GROUP(DMAC2, DMAC2_DEI, DMAC2_HEI), | ||
160 | INTC_GROUP(DMAC3, DMAC3_DEI, DMAC3_HEI), | ||
161 | INTC_GROUP(DMAC4, DMAC4_DEI, DMAC4_HEI), | ||
162 | INTC_GROUP(DMAC5, DMAC5_DEI, DMAC5_HEI), | ||
163 | INTC_GROUP(DMAC6, DMAC6_DEI, DMAC6_HEI), | ||
164 | INTC_GROUP(DMAC7, DMAC7_DEI, DMAC7_HEI), | ||
165 | INTC_GROUP(MTU0_ABCD, MTU2_TGI0A, MTU2_TGI0B, MTU2_TGI0C, MTU2_TGI0D), | ||
166 | INTC_GROUP(MTU0_VEF, MTU2_TCI0V, MTU2_TGI0E, MTU2_TGI0F), | ||
167 | INTC_GROUP(MTU1_AB, MTU2_TGI1A, MTU2_TGI1B), | ||
168 | INTC_GROUP(MTU1_VU, MTU2_TCI1V, MTU2_TCI1U), | ||
169 | INTC_GROUP(MTU2_AB, MTU2_TGI2A, MTU2_TGI2B), | ||
170 | INTC_GROUP(MTU2_VU, MTU2_TCI2V, MTU2_TCI2U), | ||
171 | INTC_GROUP(MTU3_ABCD, MTU2_TGI3A, MTU2_TGI3B, MTU2_TGI3C, MTU2_TGI3D), | ||
172 | INTC_GROUP(MTU4_ABCD, MTU2_TGI4A, MTU2_TGI4B, MTU2_TGI4C, MTU2_TGI4D), | ||
173 | INTC_GROUP(IIC30, IIC30_STPI, IIC30_NAKI, IIC30_RXI, IIC30_TXI, | ||
174 | IIC30_TEI), | ||
175 | INTC_GROUP(IIC31, IIC31_STPI, IIC31_NAKI, IIC31_RXI, IIC31_TXI, | ||
176 | IIC31_TEI), | ||
177 | INTC_GROUP(IIC32, IIC32_STPI, IIC32_NAKI, IIC32_RXI, IIC32_TXI, | ||
178 | IIC32_TEI), | ||
179 | INTC_GROUP(IIC33, IIC33_STPI, IIC33_NAKI, IIC33_RXI, IIC33_TXI, | ||
180 | IIC33_TEI), | ||
181 | INTC_GROUP(SCIF0, SCIF0_BRI, SCIF0_ERI, SCIF0_RXI, SCIF0_TXI), | ||
182 | INTC_GROUP(SCIF1, SCIF1_BRI, SCIF1_ERI, SCIF1_RXI, SCIF1_TXI), | ||
183 | INTC_GROUP(SCIF2, SCIF2_BRI, SCIF2_ERI, SCIF2_RXI, SCIF2_TXI), | ||
184 | INTC_GROUP(SCIF3, SCIF3_BRI, SCIF3_ERI, SCIF3_RXI, SCIF3_TXI), | ||
185 | INTC_GROUP(SSU0, SSU0_SSERI, SSU0_SSRXI, SSU0_SSTXI), | ||
186 | INTC_GROUP(SSU1, SSU1_SSERI, SSU1_SSRXI, SSU1_SSTXI), | ||
187 | INTC_GROUP(FLCTL, FLCTL_FLSTEI, FLCTL_FLTENDI, FLCTL_FLTREQ0I, | ||
188 | FLCTL_FLTREQ1I), | ||
189 | INTC_GROUP(RTC, RTC_ARM, RTC_PRD, RTC_CUP), | ||
190 | INTC_GROUP(RCAN0, RCAN0_ERS, RCAN0_OVR, RCAN0_RM0, RCAN0_RM1, | ||
191 | RCAN0_SLE), | ||
192 | INTC_GROUP(RCAN1, RCAN1_ERS, RCAN1_OVR, RCAN1_RM0, RCAN1_RM1, | ||
193 | RCAN1_SLE), | ||
194 | |||
195 | #ifdef CONFIG_CPU_SUBTYPE_SH7263 | ||
196 | INTC_GROUP(ROMDEC, ROMDEC_ISY, ROMDEC_IERR, ROMDEC_IARG, | ||
197 | ROMDEC_ISEC, ROMDEC_IBUF, ROMDEC_IREADY), | ||
198 | INTC_GROUP(SDHI, SDHI3, SDHI0, SDHI1), | ||
199 | INTC_GROUP(SRC, SRC_OVF, SRC_ODFI, SRC_IDEI), | ||
200 | #endif | ||
201 | }; | ||
202 | |||
203 | static struct intc_prio_reg prio_registers[] __initdata = { | ||
204 | { 0xfffe0818, 0, 16, 4, /* IPR01 */ { IRQ0, IRQ1, IRQ2, IRQ3 } }, | ||
205 | { 0xfffe081a, 0, 16, 4, /* IPR02 */ { IRQ4, IRQ5, IRQ6, IRQ7 } }, | ||
206 | { 0xfffe0820, 0, 16, 4, /* IPR05 */ { PINT, 0, 0, 0 } }, | ||
207 | { 0xfffe0c00, 0, 16, 4, /* IPR06 */ { DMAC0, DMAC1, DMAC2, DMAC3 } }, | ||
208 | { 0xfffe0c02, 0, 16, 4, /* IPR07 */ { DMAC4, DMAC5, DMAC6, DMAC7 } }, | ||
209 | { 0xfffe0c04, 0, 16, 4, /* IPR08 */ { USB, LCDC, CMT0, CMT1 } }, | ||
210 | { 0xfffe0c06, 0, 16, 4, /* IPR09 */ { BSC, WDT, MTU0_ABCD, MTU0_VEF } }, | ||
211 | { 0xfffe0c08, 0, 16, 4, /* IPR10 */ { MTU1_AB, MTU1_VU, MTU2_AB, | ||
212 | MTU2_VU } }, | ||
213 | { 0xfffe0c0a, 0, 16, 4, /* IPR11 */ { MTU3_ABCD, MTU2_TCI3V, MTU4_ABCD, | ||
214 | MTU2_TCI4V } }, | ||
215 | { 0xfffe0c0c, 0, 16, 4, /* IPR12 */ { ADC_ADI, IIC30, IIC31, IIC32 } }, | ||
216 | { 0xfffe0c0e, 0, 16, 4, /* IPR13 */ { IIC33, SCIF0, SCIF1, SCIF2 } }, | ||
217 | { 0xfffe0c10, 0, 16, 4, /* IPR14 */ { SCIF3, SSU0, SSU1, SSI0_SSII } }, | ||
218 | #ifdef CONFIG_CPU_SUBTYPE_SH7203 | ||
219 | { 0xfffe0c12, 0, 16, 4, /* IPR15 */ { SSI1_SSII, SSI2_SSII, | ||
220 | SSI3_SSII, 0 } }, | ||
221 | { 0xfffe0c14, 0, 16, 4, /* IPR16 */ { FLCTL, 0, RTC, RCAN0 } }, | ||
222 | { 0xfffe0c16, 0, 16, 4, /* IPR17 */ { RCAN1, 0, 0, 0 } }, | ||
223 | #else | ||
224 | { 0xfffe0c12, 0, 16, 4, /* IPR15 */ { SSI1_SSII, SSI2_SSII, | ||
225 | SSI3_SSII, ROMDEC } }, | ||
226 | { 0xfffe0c14, 0, 16, 4, /* IPR16 */ { FLCTL, SDHI, RTC, RCAN0 } }, | ||
227 | { 0xfffe0c16, 0, 16, 4, /* IPR17 */ { RCAN1, SRC, IEBI, 0 } }, | ||
228 | #endif | ||
229 | }; | ||
230 | |||
231 | static struct intc_mask_reg mask_registers[] __initdata = { | ||
232 | { 0xfffe0808, 0, 16, /* PINTER */ | ||
233 | { 0, 0, 0, 0, 0, 0, 0, 0, | ||
234 | PINT7, PINT6, PINT5, PINT4, PINT3, PINT2, PINT1, PINT0 } }, | ||
235 | }; | ||
236 | |||
237 | static DECLARE_INTC_DESC(intc_desc, "sh7203", vectors, groups, | ||
238 | mask_registers, prio_registers, NULL); | ||
239 | |||
240 | static struct plat_sci_port sci_platform_data[] = { | ||
241 | { | ||
242 | .mapbase = 0xfffe8000, | ||
243 | .flags = UPF_BOOT_AUTOCONF, | ||
244 | .type = PORT_SCIF, | ||
245 | .irqs = { 193, 194, 195, 192 }, | ||
246 | }, { | ||
247 | .mapbase = 0xfffe8800, | ||
248 | .flags = UPF_BOOT_AUTOCONF, | ||
249 | .type = PORT_SCIF, | ||
250 | .irqs = { 197, 198, 199, 196 }, | ||
251 | }, { | ||
252 | .mapbase = 0xfffe9000, | ||
253 | .flags = UPF_BOOT_AUTOCONF, | ||
254 | .type = PORT_SCIF, | ||
255 | .irqs = { 201, 202, 203, 200 }, | ||
256 | }, { | ||
257 | .mapbase = 0xfffe9800, | ||
258 | .flags = UPF_BOOT_AUTOCONF, | ||
259 | .type = PORT_SCIF, | ||
260 | .irqs = { 205, 206, 207, 204 }, | ||
261 | }, { | ||
262 | .flags = 0, | ||
263 | } | ||
264 | }; | ||
265 | |||
266 | static struct platform_device sci_device = { | ||
267 | .name = "sh-sci", | ||
268 | .id = -1, | ||
269 | .dev = { | ||
270 | .platform_data = sci_platform_data, | ||
271 | }, | ||
272 | }; | ||
273 | |||
274 | static struct resource rtc_resources[] = { | ||
275 | [0] = { | ||
276 | .start = 0xffff2000, | ||
277 | .end = 0xffff2000 + 0x58 - 1, | ||
278 | .flags = IORESOURCE_IO, | ||
279 | }, | ||
280 | [1] = { | ||
281 | /* Period IRQ */ | ||
282 | .start = 232, | ||
283 | .flags = IORESOURCE_IRQ, | ||
284 | }, | ||
285 | [2] = { | ||
286 | /* Carry IRQ */ | ||
287 | .start = 233, | ||
288 | .flags = IORESOURCE_IRQ, | ||
289 | }, | ||
290 | [3] = { | ||
291 | /* Alarm IRQ */ | ||
292 | .start = 231, | ||
293 | .flags = IORESOURCE_IRQ, | ||
294 | }, | ||
295 | }; | ||
296 | |||
297 | static struct platform_device rtc_device = { | ||
298 | .name = "sh-rtc", | ||
299 | .id = -1, | ||
300 | .num_resources = ARRAY_SIZE(rtc_resources), | ||
301 | .resource = rtc_resources, | ||
302 | }; | ||
303 | |||
304 | static struct platform_device *sh7203_devices[] __initdata = { | ||
305 | &sci_device, | ||
306 | &rtc_device, | ||
307 | }; | ||
308 | |||
309 | static int __init sh7203_devices_setup(void) | ||
310 | { | ||
311 | return platform_add_devices(sh7203_devices, | ||
312 | ARRAY_SIZE(sh7203_devices)); | ||
313 | } | ||
314 | __initcall(sh7203_devices_setup); | ||
315 | |||
316 | void __init plat_irq_setup(void) | ||
317 | { | ||
318 | register_intc_controller(&intc_desc); | ||
319 | } | ||
diff --git a/arch/sh/kernel/cpu/sh2a/setup-sh7206.c b/arch/sh/kernel/cpu/sh2a/setup-sh7206.c index bd745aa87222..a564425b905f 100644 --- a/arch/sh/kernel/cpu/sh2a/setup-sh7206.c +++ b/arch/sh/kernel/cpu/sh2a/setup-sh7206.c | |||
@@ -167,7 +167,7 @@ static struct intc_mask_reg mask_registers[] __initdata = { | |||
167 | }; | 167 | }; |
168 | 168 | ||
169 | static DECLARE_INTC_DESC(intc_desc, "sh7206", vectors, groups, | 169 | static DECLARE_INTC_DESC(intc_desc, "sh7206", vectors, groups, |
170 | NULL, mask_registers, prio_registers, NULL); | 170 | mask_registers, prio_registers, NULL); |
171 | 171 | ||
172 | static struct plat_sci_port sci_platform_data[] = { | 172 | static struct plat_sci_port sci_platform_data[] = { |
173 | { | 173 | { |
diff --git a/arch/sh/kernel/cpu/sh3/Makefile b/arch/sh/kernel/cpu/sh3/Makefile index 646eb6933614..3ae4d9111f19 100644 --- a/arch/sh/kernel/cpu/sh3/Makefile +++ b/arch/sh/kernel/cpu/sh3/Makefile | |||
@@ -13,6 +13,7 @@ obj-$(CONFIG_CPU_SUBTYPE_SH7709) += setup-sh770x.o | |||
13 | obj-$(CONFIG_CPU_SUBTYPE_SH7710) += setup-sh7710.o | 13 | obj-$(CONFIG_CPU_SUBTYPE_SH7710) += setup-sh7710.o |
14 | obj-$(CONFIG_CPU_SUBTYPE_SH7712) += setup-sh7710.o | 14 | obj-$(CONFIG_CPU_SUBTYPE_SH7712) += setup-sh7710.o |
15 | obj-$(CONFIG_CPU_SUBTYPE_SH7720) += setup-sh7720.o | 15 | obj-$(CONFIG_CPU_SUBTYPE_SH7720) += setup-sh7720.o |
16 | obj-$(CONFIG_CPU_SUBTYPE_SH7721) += setup-sh7720.o | ||
16 | 17 | ||
17 | # Primary on-chip clocks (common) | 18 | # Primary on-chip clocks (common) |
18 | clock-$(CONFIG_CPU_SH3) := clock-sh3.o | 19 | clock-$(CONFIG_CPU_SH3) := clock-sh3.o |
@@ -21,5 +22,6 @@ clock-$(CONFIG_CPU_SUBTYPE_SH7706) := clock-sh7706.o | |||
21 | clock-$(CONFIG_CPU_SUBTYPE_SH7709) := clock-sh7709.o | 22 | clock-$(CONFIG_CPU_SUBTYPE_SH7709) := clock-sh7709.o |
22 | clock-$(CONFIG_CPU_SUBTYPE_SH7710) := clock-sh7710.o | 23 | clock-$(CONFIG_CPU_SUBTYPE_SH7710) := clock-sh7710.o |
23 | clock-$(CONFIG_CPU_SUBTYPE_SH7720) := clock-sh7710.o | 24 | clock-$(CONFIG_CPU_SUBTYPE_SH7720) := clock-sh7710.o |
25 | clock-$(CONFIG_CPU_SUBTYPE_SH7712) := clock-sh7712.o | ||
24 | 26 | ||
25 | obj-y += $(clock-y) | 27 | obj-y += $(clock-y) |
diff --git a/arch/sh/kernel/cpu/sh3/clock-sh7712.c b/arch/sh/kernel/cpu/sh3/clock-sh7712.c new file mode 100644 index 000000000000..54f54df51ef0 --- /dev/null +++ b/arch/sh/kernel/cpu/sh3/clock-sh7712.c | |||
@@ -0,0 +1,71 @@ | |||
1 | /* | ||
2 | * arch/sh/kernel/cpu/sh3/clock-sh7712.c | ||
3 | * | ||
4 | * SH7712 support for the clock framework | ||
5 | * | ||
6 | * Copyright (C) 2007 Andrew Murray <amurray@mpc-data.co.uk> | ||
7 | * | ||
8 | * Based on arch/sh/kernel/cpu/sh3/clock-sh3.c | ||
9 | * Copyright (C) 2005 Paul Mundt | ||
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 | #include <linux/init.h> | ||
16 | #include <linux/kernel.h> | ||
17 | #include <asm/clock.h> | ||
18 | #include <asm/freq.h> | ||
19 | #include <asm/io.h> | ||
20 | |||
21 | static int multipliers[] = { 1, 2, 3 }; | ||
22 | static int divisors[] = { 1, 2, 3, 4, 6 }; | ||
23 | |||
24 | static void master_clk_init(struct clk *clk) | ||
25 | { | ||
26 | int frqcr = ctrl_inw(FRQCR); | ||
27 | int idx = (frqcr & 0x0300) >> 8; | ||
28 | |||
29 | clk->rate *= multipliers[idx]; | ||
30 | } | ||
31 | |||
32 | static struct clk_ops sh7712_master_clk_ops = { | ||
33 | .init = master_clk_init, | ||
34 | }; | ||
35 | |||
36 | static void module_clk_recalc(struct clk *clk) | ||
37 | { | ||
38 | int frqcr = ctrl_inw(FRQCR); | ||
39 | int idx = frqcr & 0x0007; | ||
40 | |||
41 | clk->rate = clk->parent->rate / divisors[idx]; | ||
42 | } | ||
43 | |||
44 | static struct clk_ops sh7712_module_clk_ops = { | ||
45 | .recalc = module_clk_recalc, | ||
46 | }; | ||
47 | |||
48 | static void cpu_clk_recalc(struct clk *clk) | ||
49 | { | ||
50 | int frqcr = ctrl_inw(FRQCR); | ||
51 | int idx = (frqcr & 0x0030) >> 4; | ||
52 | |||
53 | clk->rate = clk->parent->rate / divisors[idx]; | ||
54 | } | ||
55 | |||
56 | static struct clk_ops sh7712_cpu_clk_ops = { | ||
57 | .recalc = cpu_clk_recalc, | ||
58 | }; | ||
59 | |||
60 | static struct clk_ops *sh7712_clk_ops[] = { | ||
61 | &sh7712_master_clk_ops, | ||
62 | &sh7712_module_clk_ops, | ||
63 | &sh7712_cpu_clk_ops, | ||
64 | }; | ||
65 | |||
66 | void __init arch_init_clk_ops(struct clk_ops **ops, int idx) | ||
67 | { | ||
68 | if (idx < ARRAY_SIZE(sh7712_clk_ops)) | ||
69 | *ops = sh7712_clk_ops[idx]; | ||
70 | } | ||
71 | |||
diff --git a/arch/sh/kernel/cpu/sh3/entry.S b/arch/sh/kernel/cpu/sh3/entry.S index 0d12a124055c..4004073f98cd 100644 --- a/arch/sh/kernel/cpu/sh3/entry.S +++ b/arch/sh/kernel/cpu/sh3/entry.S | |||
@@ -13,8 +13,9 @@ | |||
13 | #include <linux/linkage.h> | 13 | #include <linux/linkage.h> |
14 | #include <asm/asm-offsets.h> | 14 | #include <asm/asm-offsets.h> |
15 | #include <asm/thread_info.h> | 15 | #include <asm/thread_info.h> |
16 | #include <asm/cpu/mmu_context.h> | ||
17 | #include <asm/unistd.h> | 16 | #include <asm/unistd.h> |
17 | #include <asm/cpu/mmu_context.h> | ||
18 | #include <asm/page.h> | ||
18 | 19 | ||
19 | ! NOTE: | 20 | ! NOTE: |
20 | ! GNU as (as of 2.9.1) changes bf/s into bt/s and bra, when the address | 21 | ! GNU as (as of 2.9.1) changes bf/s into bt/s and bra, when the address |
@@ -409,6 +410,27 @@ ENTRY(handle_exception) | |||
409 | ! Using k0, k1 for scratch registers (r0_bank1, r1_bank), | 410 | ! Using k0, k1 for scratch registers (r0_bank1, r1_bank), |
410 | ! save all registers onto stack. | 411 | ! save all registers onto stack. |
411 | ! | 412 | ! |
413 | |||
414 | #ifdef CONFIG_GUSA | ||
415 | ! Check for roll back gRB (User and Kernel) | ||
416 | mov r15, k0 | ||
417 | shll k0 | ||
418 | bf/s 1f | ||
419 | shll k0 | ||
420 | bf/s 1f | ||
421 | stc spc, k1 | ||
422 | stc r0_bank, k0 | ||
423 | cmp/hs k0, k1 ! test k1 (saved PC) >= k0 (saved r0) | ||
424 | bt/s 2f | ||
425 | stc r1_bank, k1 | ||
426 | |||
427 | add #-2, k0 | ||
428 | add r15, k0 | ||
429 | ldc k0, spc ! PC = saved r0 + r15 - 2 | ||
430 | 2: mov k1, r15 ! SP = r1 | ||
431 | 1: | ||
432 | #endif | ||
433 | |||
412 | stc ssr, k0 ! Is it from kernel space? | 434 | stc ssr, k0 ! Is it from kernel space? |
413 | shll k0 ! Check MD bit (bit30) by shifting it into... | 435 | shll k0 ! Check MD bit (bit30) by shifting it into... |
414 | shll k0 ! ...the T bit | 436 | shll k0 ! ...the T bit |
diff --git a/arch/sh/kernel/cpu/sh3/ex.S b/arch/sh/kernel/cpu/sh3/ex.S index b6abf38d3a8d..11b6d9c6edae 100644 --- a/arch/sh/kernel/cpu/sh3/ex.S +++ b/arch/sh/kernel/cpu/sh3/ex.S | |||
@@ -36,7 +36,7 @@ ENTRY(exception_handling_table) | |||
36 | .long exception_error ! address error store /* 100 */ | 36 | .long exception_error ! address error store /* 100 */ |
37 | #endif | 37 | #endif |
38 | #if defined(CONFIG_SH_FPU) | 38 | #if defined(CONFIG_SH_FPU) |
39 | .long do_fpu_error /* 120 */ | 39 | .long fpu_error_trap_handler /* 120 */ |
40 | #else | 40 | #else |
41 | .long exception_error /* 120 */ | 41 | .long exception_error /* 120 */ |
42 | #endif | 42 | #endif |
diff --git a/arch/sh/kernel/cpu/sh3/probe.c b/arch/sh/kernel/cpu/sh3/probe.c index bf579e061e09..fcc80bb7bee7 100644 --- a/arch/sh/kernel/cpu/sh3/probe.c +++ b/arch/sh/kernel/cpu/sh3/probe.c | |||
@@ -16,11 +16,11 @@ | |||
16 | #include <asm/cache.h> | 16 | #include <asm/cache.h> |
17 | #include <asm/io.h> | 17 | #include <asm/io.h> |
18 | 18 | ||
19 | int __init detect_cpu_and_cache_system(void) | 19 | int __uses_jump_to_uncached detect_cpu_and_cache_system(void) |
20 | { | 20 | { |
21 | unsigned long addr0, addr1, data0, data1, data2, data3; | 21 | unsigned long addr0, addr1, data0, data1, data2, data3; |
22 | 22 | ||
23 | jump_to_P2(); | 23 | jump_to_uncached(); |
24 | /* | 24 | /* |
25 | * Check if the entry shadows or not. | 25 | * Check if the entry shadows or not. |
26 | * When shadowed, it's 128-entry system. | 26 | * When shadowed, it's 128-entry system. |
@@ -48,7 +48,7 @@ int __init detect_cpu_and_cache_system(void) | |||
48 | ctrl_outl(data0&~SH_CACHE_VALID, addr0); | 48 | ctrl_outl(data0&~SH_CACHE_VALID, addr0); |
49 | ctrl_outl(data2&~SH_CACHE_VALID, addr1); | 49 | ctrl_outl(data2&~SH_CACHE_VALID, addr1); |
50 | 50 | ||
51 | back_to_P1(); | 51 | back_to_cached(); |
52 | 52 | ||
53 | boot_cpu_data.dcache.ways = 4; | 53 | boot_cpu_data.dcache.ways = 4; |
54 | boot_cpu_data.dcache.entry_shift = 4; | 54 | boot_cpu_data.dcache.entry_shift = 4; |
@@ -84,6 +84,9 @@ int __init detect_cpu_and_cache_system(void) | |||
84 | #if defined(CONFIG_CPU_SUBTYPE_SH7720) | 84 | #if defined(CONFIG_CPU_SUBTYPE_SH7720) |
85 | boot_cpu_data.type = CPU_SH7720; | 85 | boot_cpu_data.type = CPU_SH7720; |
86 | #endif | 86 | #endif |
87 | #if defined(CONFIG_CPU_SUBTYPE_SH7721) | ||
88 | boot_cpu_data.type = CPU_SH7721; | ||
89 | #endif | ||
87 | #if defined(CONFIG_CPU_SUBTYPE_SH7705) | 90 | #if defined(CONFIG_CPU_SUBTYPE_SH7705) |
88 | boot_cpu_data.type = CPU_SH7705; | 91 | boot_cpu_data.type = CPU_SH7705; |
89 | 92 | ||
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh7705.c b/arch/sh/kernel/cpu/sh3/setup-sh7705.c index f6c65f2659e9..dd0a20a685f7 100644 --- a/arch/sh/kernel/cpu/sh3/setup-sh7705.c +++ b/arch/sh/kernel/cpu/sh3/setup-sh7705.c | |||
@@ -66,12 +66,6 @@ static struct intc_group groups[] __initdata = { | |||
66 | INTC_GROUP(SCIF2, SCIF2_ERI, SCIF2_RXI, SCIF2_TXI), | 66 | INTC_GROUP(SCIF2, SCIF2_ERI, SCIF2_RXI, SCIF2_TXI), |
67 | }; | 67 | }; |
68 | 68 | ||
69 | static struct intc_prio priorities[] __initdata = { | ||
70 | INTC_PRIO(DMAC, 7), | ||
71 | INTC_PRIO(SCIF2, 3), | ||
72 | INTC_PRIO(SCIF0, 3), | ||
73 | }; | ||
74 | |||
75 | static struct intc_prio_reg prio_registers[] __initdata = { | 69 | static struct intc_prio_reg prio_registers[] __initdata = { |
76 | { 0xfffffee2, 0, 16, 4, /* IPRA */ { TMU0, TMU1, TMU2, RTC } }, | 70 | { 0xfffffee2, 0, 16, 4, /* IPRA */ { TMU0, TMU1, TMU2, RTC } }, |
77 | { 0xfffffee4, 0, 16, 4, /* IPRB */ { WDT, REF_RCMI, 0, 0 } }, | 71 | { 0xfffffee4, 0, 16, 4, /* IPRB */ { WDT, REF_RCMI, 0, 0 } }, |
@@ -85,7 +79,7 @@ static struct intc_prio_reg prio_registers[] __initdata = { | |||
85 | }; | 79 | }; |
86 | 80 | ||
87 | static DECLARE_INTC_DESC(intc_desc, "sh7705", vectors, groups, | 81 | static DECLARE_INTC_DESC(intc_desc, "sh7705", vectors, groups, |
88 | priorities, NULL, prio_registers, NULL); | 82 | NULL, prio_registers, NULL); |
89 | 83 | ||
90 | static struct intc_vect vectors_irq[] __initdata = { | 84 | static struct intc_vect vectors_irq[] __initdata = { |
91 | INTC_VECT(IRQ0, 0x600), INTC_VECT(IRQ1, 0x620), | 85 | INTC_VECT(IRQ0, 0x600), INTC_VECT(IRQ1, 0x620), |
@@ -93,7 +87,7 @@ static struct intc_vect vectors_irq[] __initdata = { | |||
93 | }; | 87 | }; |
94 | 88 | ||
95 | static DECLARE_INTC_DESC(intc_desc_irq, "sh7705-irq", vectors_irq, NULL, | 89 | static DECLARE_INTC_DESC(intc_desc_irq, "sh7705-irq", vectors_irq, NULL, |
96 | priorities, NULL, prio_registers, NULL); | 90 | NULL, prio_registers, NULL); |
97 | 91 | ||
98 | static struct plat_sci_port sci_platform_data[] = { | 92 | static struct plat_sci_port sci_platform_data[] = { |
99 | { | 93 | { |
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh770x.c b/arch/sh/kernel/cpu/sh3/setup-sh770x.c index 60b04b1f9453..969804bb523b 100644 --- a/arch/sh/kernel/cpu/sh3/setup-sh770x.c +++ b/arch/sh/kernel/cpu/sh3/setup-sh770x.c | |||
@@ -81,13 +81,6 @@ static struct intc_group groups[] __initdata = { | |||
81 | INTC_GROUP(SCIF2, SCIF2_ERI, SCIF2_RXI, SCIF2_BRI, SCIF2_TXI), | 81 | INTC_GROUP(SCIF2, SCIF2_ERI, SCIF2_RXI, SCIF2_BRI, SCIF2_TXI), |
82 | }; | 82 | }; |
83 | 83 | ||
84 | static struct intc_prio priorities[] __initdata = { | ||
85 | INTC_PRIO(DMAC, 7), | ||
86 | INTC_PRIO(SCI, 3), | ||
87 | INTC_PRIO(SCIF2, 3), | ||
88 | INTC_PRIO(SCIF0, 3), | ||
89 | }; | ||
90 | |||
91 | static struct intc_prio_reg prio_registers[] __initdata = { | 84 | static struct intc_prio_reg prio_registers[] __initdata = { |
92 | { 0xfffffee2, 0, 16, 4, /* IPRA */ { TMU0, TMU1, TMU2, RTC } }, | 85 | { 0xfffffee2, 0, 16, 4, /* IPRA */ { TMU0, TMU1, TMU2, RTC } }, |
93 | { 0xfffffee4, 0, 16, 4, /* IPRB */ { WDT, REF, SCI, 0 } }, | 86 | { 0xfffffee4, 0, 16, 4, /* IPRB */ { WDT, REF, SCI, 0 } }, |
@@ -109,7 +102,7 @@ static struct intc_prio_reg prio_registers[] __initdata = { | |||
109 | }; | 102 | }; |
110 | 103 | ||
111 | static DECLARE_INTC_DESC(intc_desc, "sh770x", vectors, groups, | 104 | static DECLARE_INTC_DESC(intc_desc, "sh770x", vectors, groups, |
112 | priorities, NULL, prio_registers, NULL); | 105 | NULL, prio_registers, NULL); |
113 | 106 | ||
114 | #if defined(CONFIG_CPU_SUBTYPE_SH7706) || \ | 107 | #if defined(CONFIG_CPU_SUBTYPE_SH7706) || \ |
115 | defined(CONFIG_CPU_SUBTYPE_SH7707) || \ | 108 | defined(CONFIG_CPU_SUBTYPE_SH7707) || \ |
@@ -120,7 +113,7 @@ static struct intc_vect vectors_irq[] __initdata = { | |||
120 | }; | 113 | }; |
121 | 114 | ||
122 | static DECLARE_INTC_DESC(intc_desc_irq, "sh770x-irq", vectors_irq, NULL, | 115 | static DECLARE_INTC_DESC(intc_desc_irq, "sh770x-irq", vectors_irq, NULL, |
123 | priorities, NULL, prio_registers, NULL); | 116 | NULL, prio_registers, NULL); |
124 | #endif | 117 | #endif |
125 | 118 | ||
126 | static struct resource rtc_resources[] = { | 119 | static struct resource rtc_resources[] = { |
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh7710.c b/arch/sh/kernel/cpu/sh3/setup-sh7710.c index 84e5629fa841..0cc0e2bf135d 100644 --- a/arch/sh/kernel/cpu/sh3/setup-sh7710.c +++ b/arch/sh/kernel/cpu/sh3/setup-sh7710.c | |||
@@ -73,18 +73,6 @@ static struct intc_group groups[] __initdata = { | |||
73 | INTC_GROUP(SIOF1, SIOF1_ERI, SIOF1_TXI, SIOF1_RXI, SIOF1_CCI), | 73 | INTC_GROUP(SIOF1, SIOF1_ERI, SIOF1_TXI, SIOF1_RXI, SIOF1_CCI), |
74 | }; | 74 | }; |
75 | 75 | ||
76 | static struct intc_prio priorities[] __initdata = { | ||
77 | INTC_PRIO(DMAC1, 7), | ||
78 | INTC_PRIO(DMAC2, 7), | ||
79 | INTC_PRIO(SCIF0, 3), | ||
80 | INTC_PRIO(SCIF1, 3), | ||
81 | INTC_PRIO(SIOF0, 3), | ||
82 | INTC_PRIO(SIOF1, 3), | ||
83 | INTC_PRIO(EDMAC0, 5), | ||
84 | INTC_PRIO(EDMAC1, 5), | ||
85 | INTC_PRIO(EDMAC2, 5), | ||
86 | }; | ||
87 | |||
88 | static struct intc_prio_reg prio_registers[] __initdata = { | 76 | static struct intc_prio_reg prio_registers[] __initdata = { |
89 | { 0xfffffee2, 0, 16, 4, /* IPRA */ { TMU0, TMU1, TMU2, RTC } }, | 77 | { 0xfffffee2, 0, 16, 4, /* IPRA */ { TMU0, TMU1, TMU2, RTC } }, |
90 | { 0xfffffee4, 0, 16, 4, /* IPRB */ { WDT, REF, 0, 0 } }, | 78 | { 0xfffffee4, 0, 16, 4, /* IPRB */ { WDT, REF, 0, 0 } }, |
@@ -101,7 +89,7 @@ static struct intc_prio_reg prio_registers[] __initdata = { | |||
101 | }; | 89 | }; |
102 | 90 | ||
103 | static DECLARE_INTC_DESC(intc_desc, "sh7710", vectors, groups, | 91 | static DECLARE_INTC_DESC(intc_desc, "sh7710", vectors, groups, |
104 | priorities, NULL, prio_registers, NULL); | 92 | NULL, prio_registers, NULL); |
105 | 93 | ||
106 | static struct intc_vect vectors_irq[] __initdata = { | 94 | static struct intc_vect vectors_irq[] __initdata = { |
107 | INTC_VECT(IRQ0, 0x600), INTC_VECT(IRQ1, 0x620), | 95 | INTC_VECT(IRQ0, 0x600), INTC_VECT(IRQ1, 0x620), |
@@ -109,7 +97,7 @@ static struct intc_vect vectors_irq[] __initdata = { | |||
109 | }; | 97 | }; |
110 | 98 | ||
111 | static DECLARE_INTC_DESC(intc_desc_irq, "sh7710-irq", vectors_irq, NULL, | 99 | static DECLARE_INTC_DESC(intc_desc_irq, "sh7710-irq", vectors_irq, NULL, |
112 | priorities, NULL, prio_registers, NULL); | 100 | NULL, prio_registers, NULL); |
113 | 101 | ||
114 | static struct resource rtc_resources[] = { | 102 | static struct resource rtc_resources[] = { |
115 | [0] = { | 103 | [0] = { |
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh7720.c b/arch/sh/kernel/cpu/sh3/setup-sh7720.c index a0929b8a95ae..3855ea4c21c8 100644 --- a/arch/sh/kernel/cpu/sh3/setup-sh7720.c +++ b/arch/sh/kernel/cpu/sh3/setup-sh7720.c | |||
@@ -85,9 +85,62 @@ static struct platform_device sci_device = { | |||
85 | }, | 85 | }, |
86 | }; | 86 | }; |
87 | 87 | ||
88 | static struct resource usb_ohci_resources[] = { | ||
89 | [0] = { | ||
90 | .start = 0xA4428000, | ||
91 | .end = 0xA44280FF, | ||
92 | .flags = IORESOURCE_MEM, | ||
93 | }, | ||
94 | [1] = { | ||
95 | .start = 67, | ||
96 | .end = 67, | ||
97 | .flags = IORESOURCE_IRQ, | ||
98 | }, | ||
99 | }; | ||
100 | |||
101 | static u64 usb_ohci_dma_mask = 0xffffffffUL; | ||
102 | static struct platform_device usb_ohci_device = { | ||
103 | .name = "sh_ohci", | ||
104 | .id = -1, | ||
105 | .dev = { | ||
106 | .dma_mask = &usb_ohci_dma_mask, | ||
107 | .coherent_dma_mask = 0xffffffff, | ||
108 | }, | ||
109 | .num_resources = ARRAY_SIZE(usb_ohci_resources), | ||
110 | .resource = usb_ohci_resources, | ||
111 | }; | ||
112 | |||
113 | static struct resource usbf_resources[] = { | ||
114 | [0] = { | ||
115 | .name = "sh_udc", | ||
116 | .start = 0xA4420000, | ||
117 | .end = 0xA44200FF, | ||
118 | .flags = IORESOURCE_MEM, | ||
119 | }, | ||
120 | [1] = { | ||
121 | .name = "sh_udc", | ||
122 | .start = 65, | ||
123 | .end = 65, | ||
124 | .flags = IORESOURCE_IRQ, | ||
125 | }, | ||
126 | }; | ||
127 | |||
128 | static struct platform_device usbf_device = { | ||
129 | .name = "sh_udc", | ||
130 | .id = -1, | ||
131 | .dev = { | ||
132 | .dma_mask = NULL, | ||
133 | .coherent_dma_mask = 0xffffffff, | ||
134 | }, | ||
135 | .num_resources = ARRAY_SIZE(usbf_resources), | ||
136 | .resource = usbf_resources, | ||
137 | }; | ||
138 | |||
88 | static struct platform_device *sh7720_devices[] __initdata = { | 139 | static struct platform_device *sh7720_devices[] __initdata = { |
89 | &rtc_device, | 140 | &rtc_device, |
90 | &sci_device, | 141 | &sci_device, |
142 | &usb_ohci_device, | ||
143 | &usbf_device, | ||
91 | }; | 144 | }; |
92 | 145 | ||
93 | static int __init sh7720_devices_setup(void) | 146 | static int __init sh7720_devices_setup(void) |
@@ -127,8 +180,11 @@ static struct intc_vect vectors[] __initdata = { | |||
127 | INTC_VECT(USBF_SPD, 0x6e0), INTC_VECT(DMAC1_DEI0, 0x800), | 180 | INTC_VECT(USBF_SPD, 0x6e0), INTC_VECT(DMAC1_DEI0, 0x800), |
128 | INTC_VECT(DMAC1_DEI1, 0x820), INTC_VECT(DMAC1_DEI2, 0x840), | 181 | INTC_VECT(DMAC1_DEI1, 0x820), INTC_VECT(DMAC1_DEI2, 0x840), |
129 | INTC_VECT(DMAC1_DEI3, 0x860), INTC_VECT(LCDC, 0x900), | 182 | INTC_VECT(DMAC1_DEI3, 0x860), INTC_VECT(LCDC, 0x900), |
130 | INTC_VECT(SSL, 0x980), INTC_VECT(USBFI0, 0xa20), | 183 | #if defined(CONFIG_CPU_SUBTYPE_SH7720) |
131 | INTC_VECT(USBFI1, 0xa40), INTC_VECT(USBHI, 0xa60), | 184 | INTC_VECT(SSL, 0x980), |
185 | #endif | ||
186 | INTC_VECT(USBFI0, 0xa20), INTC_VECT(USBFI1, 0xa40), | ||
187 | INTC_VECT(USBHI, 0xa60), | ||
132 | INTC_VECT(DMAC2_DEI4, 0xb80), INTC_VECT(DMAC2_DEI5, 0xba0), | 188 | INTC_VECT(DMAC2_DEI4, 0xb80), INTC_VECT(DMAC2_DEI5, 0xba0), |
133 | INTC_VECT(ADC, 0xbe0), INTC_VECT(SCIF0, 0xc00), | 189 | INTC_VECT(ADC, 0xbe0), INTC_VECT(SCIF0, 0xc00), |
134 | INTC_VECT(SCIF1, 0xc20), INTC_VECT(PINT07, 0xc80), | 190 | INTC_VECT(SCIF1, 0xc20), INTC_VECT(PINT07, 0xc80), |
@@ -153,22 +209,16 @@ static struct intc_group groups[] __initdata = { | |||
153 | INTC_GROUP(MMC, MMCI0, MMCI1, MMCI2, MMCI3), | 209 | INTC_GROUP(MMC, MMCI0, MMCI1, MMCI2, MMCI3), |
154 | }; | 210 | }; |
155 | 211 | ||
156 | static struct intc_prio priorities[] __initdata = { | ||
157 | INTC_PRIO(SCIF0, 2), | ||
158 | INTC_PRIO(SCIF1, 2), | ||
159 | INTC_PRIO(DMAC1, 1), | ||
160 | INTC_PRIO(DMAC2, 1), | ||
161 | INTC_PRIO(RTC, 2), | ||
162 | INTC_PRIO(TMU, 2), | ||
163 | INTC_PRIO(TPU, 2), | ||
164 | }; | ||
165 | |||
166 | static struct intc_prio_reg prio_registers[] __initdata = { | 212 | static struct intc_prio_reg prio_registers[] __initdata = { |
167 | { 0xA414FEE2UL, 0, 16, 4, /* IPRA */ { TMU0, TMU1, TMU2, RTC } }, | 213 | { 0xA414FEE2UL, 0, 16, 4, /* IPRA */ { TMU0, TMU1, TMU2, RTC } }, |
168 | { 0xA414FEE4UL, 0, 16, 4, /* IPRB */ { WDT, REF_RCMI, SIM, 0 } }, | 214 | { 0xA414FEE4UL, 0, 16, 4, /* IPRB */ { WDT, REF_RCMI, SIM, 0 } }, |
169 | { 0xA4140016UL, 0, 16, 4, /* IPRC */ { IRQ3, IRQ2, IRQ1, IRQ0 } }, | 215 | { 0xA4140016UL, 0, 16, 4, /* IPRC */ { IRQ3, IRQ2, IRQ1, IRQ0 } }, |
170 | { 0xA4140018UL, 0, 16, 4, /* IPRD */ { USBF_SPD, TMU_SUNI, IRQ5, IRQ4 } }, | 216 | { 0xA4140018UL, 0, 16, 4, /* IPRD */ { USBF_SPD, TMU_SUNI, IRQ5, IRQ4 } }, |
217 | #if defined(CONFIG_CPU_SUBTYPE_SH7720) | ||
171 | { 0xA414001AUL, 0, 16, 4, /* IPRE */ { DMAC1, 0, LCDC, SSL } }, | 218 | { 0xA414001AUL, 0, 16, 4, /* IPRE */ { DMAC1, 0, LCDC, SSL } }, |
219 | #else | ||
220 | { 0xA414001AUL, 0, 16, 4, /* IPRE */ { DMAC1, 0, LCDC, 0 } }, | ||
221 | #endif | ||
172 | { 0xA4080000UL, 0, 16, 4, /* IPRF */ { ADC, DMAC2, USBFI, CMT } }, | 222 | { 0xA4080000UL, 0, 16, 4, /* IPRF */ { ADC, DMAC2, USBFI, CMT } }, |
173 | { 0xA4080002UL, 0, 16, 4, /* IPRG */ { SCIF0, SCIF1, 0, 0 } }, | 223 | { 0xA4080002UL, 0, 16, 4, /* IPRG */ { SCIF0, SCIF1, 0, 0 } }, |
174 | { 0xA4080004UL, 0, 16, 4, /* IPRH */ { PINT07, PINT815, TPU, IIC } }, | 224 | { 0xA4080004UL, 0, 16, 4, /* IPRH */ { PINT07, PINT815, TPU, IIC } }, |
@@ -177,7 +227,7 @@ static struct intc_prio_reg prio_registers[] __initdata = { | |||
177 | }; | 227 | }; |
178 | 228 | ||
179 | static DECLARE_INTC_DESC(intc_desc, "sh7720", vectors, groups, | 229 | static DECLARE_INTC_DESC(intc_desc, "sh7720", vectors, groups, |
180 | priorities, NULL, prio_registers, NULL); | 230 | NULL, prio_registers, NULL); |
181 | 231 | ||
182 | static struct intc_sense_reg sense_registers[] __initdata = { | 232 | static struct intc_sense_reg sense_registers[] __initdata = { |
183 | { INTC_ICR1, 16, 2, { 0, 0, IRQ5, IRQ4, IRQ3, IRQ2, IRQ1, IRQ0 } }, | 233 | { INTC_ICR1, 16, 2, { 0, 0, IRQ5, IRQ4, IRQ3, IRQ2, IRQ1, IRQ0 } }, |
@@ -190,7 +240,7 @@ static struct intc_vect vectors_irq[] __initdata = { | |||
190 | }; | 240 | }; |
191 | 241 | ||
192 | static DECLARE_INTC_DESC(intc_irq_desc, "sh7720-irq", vectors_irq, | 242 | static DECLARE_INTC_DESC(intc_irq_desc, "sh7720-irq", vectors_irq, |
193 | NULL, priorities, NULL, prio_registers, sense_registers); | 243 | NULL, NULL, prio_registers, sense_registers); |
194 | 244 | ||
195 | void __init plat_irq_setup_pins(int mode) | 245 | void __init plat_irq_setup_pins(int mode) |
196 | { | 246 | { |
diff --git a/arch/sh/kernel/cpu/sh4/Makefile b/arch/sh/kernel/cpu/sh4/Makefile index dadd6bffc128..d608557c7a3f 100644 --- a/arch/sh/kernel/cpu/sh4/Makefile +++ b/arch/sh/kernel/cpu/sh4/Makefile | |||
@@ -5,7 +5,7 @@ | |||
5 | obj-y := probe.o common.o | 5 | obj-y := probe.o common.o |
6 | common-y += $(addprefix ../sh3/, entry.o ex.o) | 6 | common-y += $(addprefix ../sh3/, entry.o ex.o) |
7 | 7 | ||
8 | obj-$(CONFIG_SH_FPU) += fpu.o | 8 | obj-$(CONFIG_SH_FPU) += fpu.o softfloat.o |
9 | obj-$(CONFIG_SH_STORE_QUEUES) += sq.o | 9 | obj-$(CONFIG_SH_STORE_QUEUES) += sq.o |
10 | 10 | ||
11 | # CPU subtype setup | 11 | # CPU subtype setup |
diff --git a/arch/sh/kernel/cpu/sh4/fpu.c b/arch/sh/kernel/cpu/sh4/fpu.c index c5a4fc77fa06..817f9939cda6 100644 --- a/arch/sh/kernel/cpu/sh4/fpu.c +++ b/arch/sh/kernel/cpu/sh4/fpu.c | |||
@@ -1,7 +1,4 @@ | |||
1 | /* $Id: fpu.c,v 1.4 2004/01/13 05:52:11 kkojima Exp $ | 1 | /* |
2 | * | ||
3 | * linux/arch/sh/kernel/fpu.c | ||
4 | * | ||
5 | * Save/restore floating point context for signal handlers. | 2 | * Save/restore floating point context for signal handlers. |
6 | * | 3 | * |
7 | * This file is subject to the terms and conditions of the GNU General Public | 4 | * This file is subject to the terms and conditions of the GNU General Public |
@@ -9,15 +6,16 @@ | |||
9 | * for more details. | 6 | * for more details. |
10 | * | 7 | * |
11 | * Copyright (C) 1999, 2000 Kaz Kojima & Niibe Yutaka | 8 | * Copyright (C) 1999, 2000 Kaz Kojima & Niibe Yutaka |
9 | * Copyright (C) 2006 ST Microelectronics Ltd. (denorm support) | ||
12 | * | 10 | * |
13 | * FIXME! These routines can be optimized in big endian case. | 11 | * FIXME! These routines have not been tested for big endian case. |
14 | */ | 12 | */ |
15 | |||
16 | #include <linux/sched.h> | 13 | #include <linux/sched.h> |
17 | #include <linux/signal.h> | 14 | #include <linux/signal.h> |
15 | #include <linux/io.h> | ||
16 | #include <asm/cpu/fpu.h> | ||
18 | #include <asm/processor.h> | 17 | #include <asm/processor.h> |
19 | #include <asm/system.h> | 18 | #include <asm/system.h> |
20 | #include <asm/io.h> | ||
21 | 19 | ||
22 | /* The PR (precision) bit in the FP Status Register must be clear when | 20 | /* The PR (precision) bit in the FP Status Register must be clear when |
23 | * an frchg instruction is executed, otherwise the instruction is undefined. | 21 | * an frchg instruction is executed, otherwise the instruction is undefined. |
@@ -25,177 +23,184 @@ | |||
25 | */ | 23 | */ |
26 | 24 | ||
27 | #define FPSCR_RCHG 0x00000000 | 25 | #define FPSCR_RCHG 0x00000000 |
26 | extern unsigned long long float64_div(unsigned long long a, | ||
27 | unsigned long long b); | ||
28 | extern unsigned long int float32_div(unsigned long int a, unsigned long int b); | ||
29 | extern unsigned long long float64_mul(unsigned long long a, | ||
30 | unsigned long long b); | ||
31 | extern unsigned long int float32_mul(unsigned long int a, unsigned long int b); | ||
32 | extern unsigned long long float64_add(unsigned long long a, | ||
33 | unsigned long long b); | ||
34 | extern unsigned long int float32_add(unsigned long int a, unsigned long int b); | ||
35 | extern unsigned long long float64_sub(unsigned long long a, | ||
36 | unsigned long long b); | ||
37 | extern unsigned long int float32_sub(unsigned long int a, unsigned long int b); | ||
28 | 38 | ||
39 | static unsigned int fpu_exception_flags; | ||
29 | 40 | ||
30 | /* | 41 | /* |
31 | * Save FPU registers onto task structure. | 42 | * Save FPU registers onto task structure. |
32 | * Assume called with FPU enabled (SR.FD=0). | 43 | * Assume called with FPU enabled (SR.FD=0). |
33 | */ | 44 | */ |
34 | void | 45 | void save_fpu(struct task_struct *tsk, struct pt_regs *regs) |
35 | save_fpu(struct task_struct *tsk, struct pt_regs *regs) | ||
36 | { | 46 | { |
37 | unsigned long dummy; | 47 | unsigned long dummy; |
38 | 48 | ||
39 | clear_tsk_thread_flag(tsk, TIF_USEDFPU); | 49 | clear_tsk_thread_flag(tsk, TIF_USEDFPU); |
40 | enable_fpu(); | 50 | enable_fpu(); |
41 | asm volatile("sts.l fpul, @-%0\n\t" | 51 | asm volatile ("sts.l fpul, @-%0\n\t" |
42 | "sts.l fpscr, @-%0\n\t" | 52 | "sts.l fpscr, @-%0\n\t" |
43 | "lds %2, fpscr\n\t" | 53 | "lds %2, fpscr\n\t" |
44 | "frchg\n\t" | 54 | "frchg\n\t" |
45 | "fmov.s fr15, @-%0\n\t" | 55 | "fmov.s fr15, @-%0\n\t" |
46 | "fmov.s fr14, @-%0\n\t" | 56 | "fmov.s fr14, @-%0\n\t" |
47 | "fmov.s fr13, @-%0\n\t" | 57 | "fmov.s fr13, @-%0\n\t" |
48 | "fmov.s fr12, @-%0\n\t" | 58 | "fmov.s fr12, @-%0\n\t" |
49 | "fmov.s fr11, @-%0\n\t" | 59 | "fmov.s fr11, @-%0\n\t" |
50 | "fmov.s fr10, @-%0\n\t" | 60 | "fmov.s fr10, @-%0\n\t" |
51 | "fmov.s fr9, @-%0\n\t" | 61 | "fmov.s fr9, @-%0\n\t" |
52 | "fmov.s fr8, @-%0\n\t" | 62 | "fmov.s fr8, @-%0\n\t" |
53 | "fmov.s fr7, @-%0\n\t" | 63 | "fmov.s fr7, @-%0\n\t" |
54 | "fmov.s fr6, @-%0\n\t" | 64 | "fmov.s fr6, @-%0\n\t" |
55 | "fmov.s fr5, @-%0\n\t" | 65 | "fmov.s fr5, @-%0\n\t" |
56 | "fmov.s fr4, @-%0\n\t" | 66 | "fmov.s fr4, @-%0\n\t" |
57 | "fmov.s fr3, @-%0\n\t" | 67 | "fmov.s fr3, @-%0\n\t" |
58 | "fmov.s fr2, @-%0\n\t" | 68 | "fmov.s fr2, @-%0\n\t" |
59 | "fmov.s fr1, @-%0\n\t" | 69 | "fmov.s fr1, @-%0\n\t" |
60 | "fmov.s fr0, @-%0\n\t" | 70 | "fmov.s fr0, @-%0\n\t" |
61 | "frchg\n\t" | 71 | "frchg\n\t" |
62 | "fmov.s fr15, @-%0\n\t" | 72 | "fmov.s fr15, @-%0\n\t" |
63 | "fmov.s fr14, @-%0\n\t" | 73 | "fmov.s fr14, @-%0\n\t" |
64 | "fmov.s fr13, @-%0\n\t" | 74 | "fmov.s fr13, @-%0\n\t" |
65 | "fmov.s fr12, @-%0\n\t" | 75 | "fmov.s fr12, @-%0\n\t" |
66 | "fmov.s fr11, @-%0\n\t" | 76 | "fmov.s fr11, @-%0\n\t" |
67 | "fmov.s fr10, @-%0\n\t" | 77 | "fmov.s fr10, @-%0\n\t" |
68 | "fmov.s fr9, @-%0\n\t" | 78 | "fmov.s fr9, @-%0\n\t" |
69 | "fmov.s fr8, @-%0\n\t" | 79 | "fmov.s fr8, @-%0\n\t" |
70 | "fmov.s fr7, @-%0\n\t" | 80 | "fmov.s fr7, @-%0\n\t" |
71 | "fmov.s fr6, @-%0\n\t" | 81 | "fmov.s fr6, @-%0\n\t" |
72 | "fmov.s fr5, @-%0\n\t" | 82 | "fmov.s fr5, @-%0\n\t" |
73 | "fmov.s fr4, @-%0\n\t" | 83 | "fmov.s fr4, @-%0\n\t" |
74 | "fmov.s fr3, @-%0\n\t" | 84 | "fmov.s fr3, @-%0\n\t" |
75 | "fmov.s fr2, @-%0\n\t" | 85 | "fmov.s fr2, @-%0\n\t" |
76 | "fmov.s fr1, @-%0\n\t" | 86 | "fmov.s fr1, @-%0\n\t" |
77 | "fmov.s fr0, @-%0\n\t" | 87 | "fmov.s fr0, @-%0\n\t" |
78 | "lds %3, fpscr\n\t" | 88 | "lds %3, fpscr\n\t":"=r" (dummy) |
79 | : "=r" (dummy) | 89 | :"0"((char *)(&tsk->thread.fpu.hard.status)), |
80 | : "0" ((char *)(&tsk->thread.fpu.hard.status)), | 90 | "r"(FPSCR_RCHG), "r"(FPSCR_INIT) |
81 | "r" (FPSCR_RCHG), | 91 | :"memory"); |
82 | "r" (FPSCR_INIT) | 92 | |
83 | : "memory"); | 93 | disable_fpu(); |
84 | 94 | release_fpu(regs); | |
85 | disable_fpu(); | ||
86 | release_fpu(regs); | ||
87 | } | 95 | } |
88 | 96 | ||
89 | static void | 97 | static void restore_fpu(struct task_struct *tsk) |
90 | restore_fpu(struct task_struct *tsk) | ||
91 | { | 98 | { |
92 | unsigned long dummy; | 99 | unsigned long dummy; |
93 | 100 | ||
94 | enable_fpu(); | 101 | enable_fpu(); |
95 | asm volatile("lds %2, fpscr\n\t" | 102 | asm volatile ("lds %2, fpscr\n\t" |
96 | "fmov.s @%0+, fr0\n\t" | 103 | "fmov.s @%0+, fr0\n\t" |
97 | "fmov.s @%0+, fr1\n\t" | 104 | "fmov.s @%0+, fr1\n\t" |
98 | "fmov.s @%0+, fr2\n\t" | 105 | "fmov.s @%0+, fr2\n\t" |
99 | "fmov.s @%0+, fr3\n\t" | 106 | "fmov.s @%0+, fr3\n\t" |
100 | "fmov.s @%0+, fr4\n\t" | 107 | "fmov.s @%0+, fr4\n\t" |
101 | "fmov.s @%0+, fr5\n\t" | 108 | "fmov.s @%0+, fr5\n\t" |
102 | "fmov.s @%0+, fr6\n\t" | 109 | "fmov.s @%0+, fr6\n\t" |
103 | "fmov.s @%0+, fr7\n\t" | 110 | "fmov.s @%0+, fr7\n\t" |
104 | "fmov.s @%0+, fr8\n\t" | 111 | "fmov.s @%0+, fr8\n\t" |
105 | "fmov.s @%0+, fr9\n\t" | 112 | "fmov.s @%0+, fr9\n\t" |
106 | "fmov.s @%0+, fr10\n\t" | 113 | "fmov.s @%0+, fr10\n\t" |
107 | "fmov.s @%0+, fr11\n\t" | 114 | "fmov.s @%0+, fr11\n\t" |
108 | "fmov.s @%0+, fr12\n\t" | 115 | "fmov.s @%0+, fr12\n\t" |
109 | "fmov.s @%0+, fr13\n\t" | 116 | "fmov.s @%0+, fr13\n\t" |
110 | "fmov.s @%0+, fr14\n\t" | 117 | "fmov.s @%0+, fr14\n\t" |
111 | "fmov.s @%0+, fr15\n\t" | 118 | "fmov.s @%0+, fr15\n\t" |
112 | "frchg\n\t" | 119 | "frchg\n\t" |
113 | "fmov.s @%0+, fr0\n\t" | 120 | "fmov.s @%0+, fr0\n\t" |
114 | "fmov.s @%0+, fr1\n\t" | 121 | "fmov.s @%0+, fr1\n\t" |
115 | "fmov.s @%0+, fr2\n\t" | 122 | "fmov.s @%0+, fr2\n\t" |
116 | "fmov.s @%0+, fr3\n\t" | 123 | "fmov.s @%0+, fr3\n\t" |
117 | "fmov.s @%0+, fr4\n\t" | 124 | "fmov.s @%0+, fr4\n\t" |
118 | "fmov.s @%0+, fr5\n\t" | 125 | "fmov.s @%0+, fr5\n\t" |
119 | "fmov.s @%0+, fr6\n\t" | 126 | "fmov.s @%0+, fr6\n\t" |
120 | "fmov.s @%0+, fr7\n\t" | 127 | "fmov.s @%0+, fr7\n\t" |
121 | "fmov.s @%0+, fr8\n\t" | 128 | "fmov.s @%0+, fr8\n\t" |
122 | "fmov.s @%0+, fr9\n\t" | 129 | "fmov.s @%0+, fr9\n\t" |
123 | "fmov.s @%0+, fr10\n\t" | 130 | "fmov.s @%0+, fr10\n\t" |
124 | "fmov.s @%0+, fr11\n\t" | 131 | "fmov.s @%0+, fr11\n\t" |
125 | "fmov.s @%0+, fr12\n\t" | 132 | "fmov.s @%0+, fr12\n\t" |
126 | "fmov.s @%0+, fr13\n\t" | 133 | "fmov.s @%0+, fr13\n\t" |
127 | "fmov.s @%0+, fr14\n\t" | 134 | "fmov.s @%0+, fr14\n\t" |
128 | "fmov.s @%0+, fr15\n\t" | 135 | "fmov.s @%0+, fr15\n\t" |
129 | "frchg\n\t" | 136 | "frchg\n\t" |
130 | "lds.l @%0+, fpscr\n\t" | 137 | "lds.l @%0+, fpscr\n\t" |
131 | "lds.l @%0+, fpul\n\t" | 138 | "lds.l @%0+, fpul\n\t" |
132 | : "=r" (dummy) | 139 | :"=r" (dummy) |
133 | : "0" (&tsk->thread.fpu), "r" (FPSCR_RCHG) | 140 | :"0"(&tsk->thread.fpu), "r"(FPSCR_RCHG) |
134 | : "memory"); | 141 | :"memory"); |
135 | disable_fpu(); | 142 | disable_fpu(); |
136 | } | 143 | } |
137 | 144 | ||
138 | /* | 145 | /* |
139 | * Load the FPU with signalling NANS. This bit pattern we're using | 146 | * Load the FPU with signalling NANS. This bit pattern we're using |
140 | * has the property that no matter wether considered as single or as | 147 | * has the property that no matter wether considered as single or as |
141 | * double precision represents signaling NANS. | 148 | * double precision represents signaling NANS. |
142 | */ | 149 | */ |
143 | 150 | ||
144 | static void | 151 | static void fpu_init(void) |
145 | fpu_init(void) | ||
146 | { | 152 | { |
147 | enable_fpu(); | 153 | enable_fpu(); |
148 | asm volatile("lds %0, fpul\n\t" | 154 | asm volatile ( "lds %0, fpul\n\t" |
149 | "lds %1, fpscr\n\t" | 155 | "lds %1, fpscr\n\t" |
150 | "fsts fpul, fr0\n\t" | 156 | "fsts fpul, fr0\n\t" |
151 | "fsts fpul, fr1\n\t" | 157 | "fsts fpul, fr1\n\t" |
152 | "fsts fpul, fr2\n\t" | 158 | "fsts fpul, fr2\n\t" |
153 | "fsts fpul, fr3\n\t" | 159 | "fsts fpul, fr3\n\t" |
154 | "fsts fpul, fr4\n\t" | 160 | "fsts fpul, fr4\n\t" |
155 | "fsts fpul, fr5\n\t" | 161 | "fsts fpul, fr5\n\t" |
156 | "fsts fpul, fr6\n\t" | 162 | "fsts fpul, fr6\n\t" |
157 | "fsts fpul, fr7\n\t" | 163 | "fsts fpul, fr7\n\t" |
158 | "fsts fpul, fr8\n\t" | 164 | "fsts fpul, fr8\n\t" |
159 | "fsts fpul, fr9\n\t" | 165 | "fsts fpul, fr9\n\t" |
160 | "fsts fpul, fr10\n\t" | 166 | "fsts fpul, fr10\n\t" |
161 | "fsts fpul, fr11\n\t" | 167 | "fsts fpul, fr11\n\t" |
162 | "fsts fpul, fr12\n\t" | 168 | "fsts fpul, fr12\n\t" |
163 | "fsts fpul, fr13\n\t" | 169 | "fsts fpul, fr13\n\t" |
164 | "fsts fpul, fr14\n\t" | 170 | "fsts fpul, fr14\n\t" |
165 | "fsts fpul, fr15\n\t" | 171 | "fsts fpul, fr15\n\t" |
166 | "frchg\n\t" | 172 | "frchg\n\t" |
167 | "fsts fpul, fr0\n\t" | 173 | "fsts fpul, fr0\n\t" |
168 | "fsts fpul, fr1\n\t" | 174 | "fsts fpul, fr1\n\t" |
169 | "fsts fpul, fr2\n\t" | 175 | "fsts fpul, fr2\n\t" |
170 | "fsts fpul, fr3\n\t" | 176 | "fsts fpul, fr3\n\t" |
171 | "fsts fpul, fr4\n\t" | 177 | "fsts fpul, fr4\n\t" |
172 | "fsts fpul, fr5\n\t" | 178 | "fsts fpul, fr5\n\t" |
173 | "fsts fpul, fr6\n\t" | 179 | "fsts fpul, fr6\n\t" |
174 | "fsts fpul, fr7\n\t" | 180 | "fsts fpul, fr7\n\t" |
175 | "fsts fpul, fr8\n\t" | 181 | "fsts fpul, fr8\n\t" |
176 | "fsts fpul, fr9\n\t" | 182 | "fsts fpul, fr9\n\t" |
177 | "fsts fpul, fr10\n\t" | 183 | "fsts fpul, fr10\n\t" |
178 | "fsts fpul, fr11\n\t" | 184 | "fsts fpul, fr11\n\t" |
179 | "fsts fpul, fr12\n\t" | 185 | "fsts fpul, fr12\n\t" |
180 | "fsts fpul, fr13\n\t" | 186 | "fsts fpul, fr13\n\t" |
181 | "fsts fpul, fr14\n\t" | 187 | "fsts fpul, fr14\n\t" |
182 | "fsts fpul, fr15\n\t" | 188 | "fsts fpul, fr15\n\t" |
183 | "frchg\n\t" | 189 | "frchg\n\t" |
184 | "lds %2, fpscr\n\t" | 190 | "lds %2, fpscr\n\t" |
185 | : /* no output */ | 191 | : /* no output */ |
186 | : "r" (0), "r" (FPSCR_RCHG), "r" (FPSCR_INIT)); | 192 | :"r" (0), "r"(FPSCR_RCHG), "r"(FPSCR_INIT)); |
187 | disable_fpu(); | 193 | disable_fpu(); |
188 | } | 194 | } |
189 | 195 | ||
190 | /** | 196 | /** |
191 | * denormal_to_double - Given denormalized float number, | 197 | * denormal_to_double - Given denormalized float number, |
192 | * store double float | 198 | * store double float |
193 | * | 199 | * |
194 | * @fpu: Pointer to sh_fpu_hard structure | 200 | * @fpu: Pointer to sh_fpu_hard structure |
195 | * @n: Index to FP register | 201 | * @n: Index to FP register |
196 | */ | 202 | */ |
197 | static void | 203 | static void denormal_to_double(struct sh_fpu_hard_struct *fpu, int n) |
198 | denormal_to_double (struct sh_fpu_hard_struct *fpu, int n) | ||
199 | { | 204 | { |
200 | unsigned long du, dl; | 205 | unsigned long du, dl; |
201 | unsigned long x = fpu->fpul; | 206 | unsigned long x = fpu->fpul; |
@@ -212,7 +217,7 @@ denormal_to_double (struct sh_fpu_hard_struct *fpu, int n) | |||
212 | dl = x << 29; | 217 | dl = x << 29; |
213 | 218 | ||
214 | fpu->fp_regs[n] = du; | 219 | fpu->fp_regs[n] = du; |
215 | fpu->fp_regs[n+1] = dl; | 220 | fpu->fp_regs[n + 1] = dl; |
216 | } | 221 | } |
217 | } | 222 | } |
218 | 223 | ||
@@ -223,68 +228,191 @@ denormal_to_double (struct sh_fpu_hard_struct *fpu, int n) | |||
223 | * | 228 | * |
224 | * Returns 1 when it's handled (should not cause exception). | 229 | * Returns 1 when it's handled (should not cause exception). |
225 | */ | 230 | */ |
226 | static int | 231 | static int ieee_fpe_handler(struct pt_regs *regs) |
227 | ieee_fpe_handler (struct pt_regs *regs) | ||
228 | { | 232 | { |
229 | unsigned short insn = *(unsigned short *) regs->pc; | 233 | unsigned short insn = *(unsigned short *)regs->pc; |
230 | unsigned short finsn; | 234 | unsigned short finsn; |
231 | unsigned long nextpc; | 235 | unsigned long nextpc; |
232 | int nib[4] = { | 236 | int nib[4] = { |
233 | (insn >> 12) & 0xf, | 237 | (insn >> 12) & 0xf, |
234 | (insn >> 8) & 0xf, | 238 | (insn >> 8) & 0xf, |
235 | (insn >> 4) & 0xf, | 239 | (insn >> 4) & 0xf, |
236 | insn & 0xf}; | 240 | insn & 0xf |
237 | 241 | }; | |
238 | if (nib[0] == 0xb || | 242 | |
239 | (nib[0] == 0x4 && nib[2] == 0x0 && nib[3] == 0xb)) /* bsr & jsr */ | 243 | if (nib[0] == 0xb || (nib[0] == 0x4 && nib[2] == 0x0 && nib[3] == 0xb)) |
240 | regs->pr = regs->pc + 4; | 244 | regs->pr = regs->pc + 4; /* bsr & jsr */ |
241 | 245 | ||
242 | if (nib[0] == 0xa || nib[0] == 0xb) { /* bra & bsr */ | 246 | if (nib[0] == 0xa || nib[0] == 0xb) { |
243 | nextpc = regs->pc + 4 + ((short) ((insn & 0xfff) << 4) >> 3); | 247 | /* bra & bsr */ |
244 | finsn = *(unsigned short *) (regs->pc + 2); | 248 | nextpc = regs->pc + 4 + ((short)((insn & 0xfff) << 4) >> 3); |
245 | } else if (nib[0] == 0x8 && nib[1] == 0xd) { /* bt/s */ | 249 | finsn = *(unsigned short *)(regs->pc + 2); |
250 | } else if (nib[0] == 0x8 && nib[1] == 0xd) { | ||
251 | /* bt/s */ | ||
246 | if (regs->sr & 1) | 252 | if (regs->sr & 1) |
247 | nextpc = regs->pc + 4 + ((char) (insn & 0xff) << 1); | 253 | nextpc = regs->pc + 4 + ((char)(insn & 0xff) << 1); |
248 | else | 254 | else |
249 | nextpc = regs->pc + 4; | 255 | nextpc = regs->pc + 4; |
250 | finsn = *(unsigned short *) (regs->pc + 2); | 256 | finsn = *(unsigned short *)(regs->pc + 2); |
251 | } else if (nib[0] == 0x8 && nib[1] == 0xf) { /* bf/s */ | 257 | } else if (nib[0] == 0x8 && nib[1] == 0xf) { |
258 | /* bf/s */ | ||
252 | if (regs->sr & 1) | 259 | if (regs->sr & 1) |
253 | nextpc = regs->pc + 4; | 260 | nextpc = regs->pc + 4; |
254 | else | 261 | else |
255 | nextpc = regs->pc + 4 + ((char) (insn & 0xff) << 1); | 262 | nextpc = regs->pc + 4 + ((char)(insn & 0xff) << 1); |
256 | finsn = *(unsigned short *) (regs->pc + 2); | 263 | finsn = *(unsigned short *)(regs->pc + 2); |
257 | } else if (nib[0] == 0x4 && nib[3] == 0xb && | 264 | } else if (nib[0] == 0x4 && nib[3] == 0xb && |
258 | (nib[2] == 0x0 || nib[2] == 0x2)) { /* jmp & jsr */ | 265 | (nib[2] == 0x0 || nib[2] == 0x2)) { |
266 | /* jmp & jsr */ | ||
259 | nextpc = regs->regs[nib[1]]; | 267 | nextpc = regs->regs[nib[1]]; |
260 | finsn = *(unsigned short *) (regs->pc + 2); | 268 | finsn = *(unsigned short *)(regs->pc + 2); |
261 | } else if (nib[0] == 0x0 && nib[3] == 0x3 && | 269 | } else if (nib[0] == 0x0 && nib[3] == 0x3 && |
262 | (nib[2] == 0x0 || nib[2] == 0x2)) { /* braf & bsrf */ | 270 | (nib[2] == 0x0 || nib[2] == 0x2)) { |
271 | /* braf & bsrf */ | ||
263 | nextpc = regs->pc + 4 + regs->regs[nib[1]]; | 272 | nextpc = regs->pc + 4 + regs->regs[nib[1]]; |
264 | finsn = *(unsigned short *) (regs->pc + 2); | 273 | finsn = *(unsigned short *)(regs->pc + 2); |
265 | } else if (insn == 0x000b) { /* rts */ | 274 | } else if (insn == 0x000b) { |
275 | /* rts */ | ||
266 | nextpc = regs->pr; | 276 | nextpc = regs->pr; |
267 | finsn = *(unsigned short *) (regs->pc + 2); | 277 | finsn = *(unsigned short *)(regs->pc + 2); |
268 | } else { | 278 | } else { |
269 | nextpc = regs->pc + instruction_size(insn); | 279 | nextpc = regs->pc + instruction_size(insn); |
270 | finsn = insn; | 280 | finsn = insn; |
271 | } | 281 | } |
272 | 282 | ||
273 | if ((finsn & 0xf1ff) == 0xf0ad) { /* fcnvsd */ | 283 | if ((finsn & 0xf1ff) == 0xf0ad) { |
284 | /* fcnvsd */ | ||
274 | struct task_struct *tsk = current; | 285 | struct task_struct *tsk = current; |
275 | 286 | ||
276 | save_fpu(tsk, regs); | 287 | save_fpu(tsk, regs); |
277 | if ((tsk->thread.fpu.hard.fpscr & (1 << 17))) { | 288 | if ((tsk->thread.fpu.hard.fpscr & FPSCR_CAUSE_ERROR)) |
278 | /* FPU error */ | 289 | /* FPU error */ |
279 | denormal_to_double (&tsk->thread.fpu.hard, | 290 | denormal_to_double(&tsk->thread.fpu.hard, |
280 | (finsn >> 8) & 0xf); | 291 | (finsn >> 8) & 0xf); |
281 | tsk->thread.fpu.hard.fpscr &= | 292 | else |
282 | ~(FPSCR_CAUSE_MASK | FPSCR_FLAG_MASK); | 293 | return 0; |
283 | grab_fpu(regs); | 294 | |
284 | restore_fpu(tsk); | 295 | regs->pc = nextpc; |
285 | set_tsk_thread_flag(tsk, TIF_USEDFPU); | 296 | return 1; |
297 | } else if ((finsn & 0xf00f) == 0xf002) { | ||
298 | /* fmul */ | ||
299 | struct task_struct *tsk = current; | ||
300 | int fpscr; | ||
301 | int n, m, prec; | ||
302 | unsigned int hx, hy; | ||
303 | |||
304 | n = (finsn >> 8) & 0xf; | ||
305 | m = (finsn >> 4) & 0xf; | ||
306 | hx = tsk->thread.fpu.hard.fp_regs[n]; | ||
307 | hy = tsk->thread.fpu.hard.fp_regs[m]; | ||
308 | fpscr = tsk->thread.fpu.hard.fpscr; | ||
309 | prec = fpscr & FPSCR_DBL_PRECISION; | ||
310 | |||
311 | if ((fpscr & FPSCR_CAUSE_ERROR) | ||
312 | && (prec && ((hx & 0x7fffffff) < 0x00100000 | ||
313 | || (hy & 0x7fffffff) < 0x00100000))) { | ||
314 | long long llx, lly; | ||
315 | |||
316 | /* FPU error because of denormal (doubles) */ | ||
317 | llx = ((long long)hx << 32) | ||
318 | | tsk->thread.fpu.hard.fp_regs[n + 1]; | ||
319 | lly = ((long long)hy << 32) | ||
320 | | tsk->thread.fpu.hard.fp_regs[m + 1]; | ||
321 | llx = float64_mul(llx, lly); | ||
322 | tsk->thread.fpu.hard.fp_regs[n] = llx >> 32; | ||
323 | tsk->thread.fpu.hard.fp_regs[n + 1] = llx & 0xffffffff; | ||
324 | } else if ((fpscr & FPSCR_CAUSE_ERROR) | ||
325 | && (!prec && ((hx & 0x7fffffff) < 0x00800000 | ||
326 | || (hy & 0x7fffffff) < 0x00800000))) { | ||
327 | /* FPU error because of denormal (floats) */ | ||
328 | hx = float32_mul(hx, hy); | ||
329 | tsk->thread.fpu.hard.fp_regs[n] = hx; | ||
330 | } else | ||
331 | return 0; | ||
332 | |||
333 | regs->pc = nextpc; | ||
334 | return 1; | ||
335 | } else if ((finsn & 0xf00e) == 0xf000) { | ||
336 | /* fadd, fsub */ | ||
337 | struct task_struct *tsk = current; | ||
338 | int fpscr; | ||
339 | int n, m, prec; | ||
340 | unsigned int hx, hy; | ||
341 | |||
342 | n = (finsn >> 8) & 0xf; | ||
343 | m = (finsn >> 4) & 0xf; | ||
344 | hx = tsk->thread.fpu.hard.fp_regs[n]; | ||
345 | hy = tsk->thread.fpu.hard.fp_regs[m]; | ||
346 | fpscr = tsk->thread.fpu.hard.fpscr; | ||
347 | prec = fpscr & FPSCR_DBL_PRECISION; | ||
348 | |||
349 | if ((fpscr & FPSCR_CAUSE_ERROR) | ||
350 | && (prec && ((hx & 0x7fffffff) < 0x00100000 | ||
351 | || (hy & 0x7fffffff) < 0x00100000))) { | ||
352 | long long llx, lly; | ||
353 | |||
354 | /* FPU error because of denormal (doubles) */ | ||
355 | llx = ((long long)hx << 32) | ||
356 | | tsk->thread.fpu.hard.fp_regs[n + 1]; | ||
357 | lly = ((long long)hy << 32) | ||
358 | | tsk->thread.fpu.hard.fp_regs[m + 1]; | ||
359 | if ((finsn & 0xf00f) == 0xf000) | ||
360 | llx = float64_add(llx, lly); | ||
361 | else | ||
362 | llx = float64_sub(llx, lly); | ||
363 | tsk->thread.fpu.hard.fp_regs[n] = llx >> 32; | ||
364 | tsk->thread.fpu.hard.fp_regs[n + 1] = llx & 0xffffffff; | ||
365 | } else if ((fpscr & FPSCR_CAUSE_ERROR) | ||
366 | && (!prec && ((hx & 0x7fffffff) < 0x00800000 | ||
367 | || (hy & 0x7fffffff) < 0x00800000))) { | ||
368 | /* FPU error because of denormal (floats) */ | ||
369 | if ((finsn & 0xf00f) == 0xf000) | ||
370 | hx = float32_add(hx, hy); | ||
371 | else | ||
372 | hx = float32_sub(hx, hy); | ||
373 | tsk->thread.fpu.hard.fp_regs[n] = hx; | ||
374 | } else | ||
375 | return 0; | ||
376 | |||
377 | regs->pc = nextpc; | ||
378 | return 1; | ||
379 | } else if ((finsn & 0xf003) == 0xf003) { | ||
380 | /* fdiv */ | ||
381 | struct task_struct *tsk = current; | ||
382 | int fpscr; | ||
383 | int n, m, prec; | ||
384 | unsigned int hx, hy; | ||
385 | |||
386 | n = (finsn >> 8) & 0xf; | ||
387 | m = (finsn >> 4) & 0xf; | ||
388 | hx = tsk->thread.fpu.hard.fp_regs[n]; | ||
389 | hy = tsk->thread.fpu.hard.fp_regs[m]; | ||
390 | fpscr = tsk->thread.fpu.hard.fpscr; | ||
391 | prec = fpscr & FPSCR_DBL_PRECISION; | ||
392 | |||
393 | if ((fpscr & FPSCR_CAUSE_ERROR) | ||
394 | && (prec && ((hx & 0x7fffffff) < 0x00100000 | ||
395 | || (hy & 0x7fffffff) < 0x00100000))) { | ||
396 | long long llx, lly; | ||
397 | |||
398 | /* FPU error because of denormal (doubles) */ | ||
399 | llx = ((long long)hx << 32) | ||
400 | | tsk->thread.fpu.hard.fp_regs[n + 1]; | ||
401 | lly = ((long long)hy << 32) | ||
402 | | tsk->thread.fpu.hard.fp_regs[m + 1]; | ||
403 | |||
404 | llx = float64_div(llx, lly); | ||
405 | |||
406 | tsk->thread.fpu.hard.fp_regs[n] = llx >> 32; | ||
407 | tsk->thread.fpu.hard.fp_regs[n + 1] = llx & 0xffffffff; | ||
408 | } else if ((fpscr & FPSCR_CAUSE_ERROR) | ||
409 | && (!prec && ((hx & 0x7fffffff) < 0x00800000 | ||
410 | || (hy & 0x7fffffff) < 0x00800000))) { | ||
411 | /* FPU error because of denormal (floats) */ | ||
412 | hx = float32_div(hx, hy); | ||
413 | tsk->thread.fpu.hard.fp_regs[n] = hx; | ||
286 | } else | 414 | } else |
287 | force_sig(SIGFPE, tsk); | 415 | return 0; |
288 | 416 | ||
289 | regs->pc = nextpc; | 417 | regs->pc = nextpc; |
290 | return 1; | 418 | return 1; |
@@ -293,27 +421,48 @@ ieee_fpe_handler (struct pt_regs *regs) | |||
293 | return 0; | 421 | return 0; |
294 | } | 422 | } |
295 | 423 | ||
296 | asmlinkage void | 424 | void float_raise(unsigned int flags) |
297 | do_fpu_error(unsigned long r4, unsigned long r5, unsigned long r6, | 425 | { |
298 | unsigned long r7, struct pt_regs __regs) | 426 | fpu_exception_flags |= flags; |
427 | } | ||
428 | |||
429 | int float_rounding_mode(void) | ||
299 | { | 430 | { |
300 | struct pt_regs *regs = RELOC_HIDE(&__regs, 0); | ||
301 | struct task_struct *tsk = current; | 431 | struct task_struct *tsk = current; |
432 | int roundingMode = FPSCR_ROUNDING_MODE(tsk->thread.fpu.hard.fpscr); | ||
433 | return roundingMode; | ||
434 | } | ||
302 | 435 | ||
303 | if (ieee_fpe_handler(regs)) | 436 | BUILD_TRAP_HANDLER(fpu_error) |
304 | return; | 437 | { |
438 | struct task_struct *tsk = current; | ||
439 | TRAP_HANDLER_DECL; | ||
305 | 440 | ||
306 | regs->pc += 2; | ||
307 | save_fpu(tsk, regs); | 441 | save_fpu(tsk, regs); |
442 | fpu_exception_flags = 0; | ||
443 | if (ieee_fpe_handler(regs)) { | ||
444 | tsk->thread.fpu.hard.fpscr &= | ||
445 | ~(FPSCR_CAUSE_MASK | FPSCR_FLAG_MASK); | ||
446 | tsk->thread.fpu.hard.fpscr |= fpu_exception_flags; | ||
447 | /* Set the FPSCR flag as well as cause bits - simply | ||
448 | * replicate the cause */ | ||
449 | tsk->thread.fpu.hard.fpscr |= (fpu_exception_flags >> 10); | ||
450 | grab_fpu(regs); | ||
451 | restore_fpu(tsk); | ||
452 | set_tsk_thread_flag(tsk, TIF_USEDFPU); | ||
453 | if ((((tsk->thread.fpu.hard.fpscr & FPSCR_ENABLE_MASK) >> 7) & | ||
454 | (fpu_exception_flags >> 2)) == 0) { | ||
455 | return; | ||
456 | } | ||
457 | } | ||
458 | |||
308 | force_sig(SIGFPE, tsk); | 459 | force_sig(SIGFPE, tsk); |
309 | } | 460 | } |
310 | 461 | ||
311 | asmlinkage void | 462 | BUILD_TRAP_HANDLER(fpu_state_restore) |
312 | do_fpu_state_restore(unsigned long r4, unsigned long r5, unsigned long r6, | ||
313 | unsigned long r7, struct pt_regs __regs) | ||
314 | { | 463 | { |
315 | struct pt_regs *regs = RELOC_HIDE(&__regs, 0); | ||
316 | struct task_struct *tsk = current; | 464 | struct task_struct *tsk = current; |
465 | TRAP_HANDLER_DECL; | ||
317 | 466 | ||
318 | grab_fpu(regs); | 467 | grab_fpu(regs); |
319 | if (!user_mode(regs)) { | 468 | if (!user_mode(regs)) { |
@@ -324,7 +473,7 @@ do_fpu_state_restore(unsigned long r4, unsigned long r5, unsigned long r6, | |||
324 | if (used_math()) { | 473 | if (used_math()) { |
325 | /* Using the FPU again. */ | 474 | /* Using the FPU again. */ |
326 | restore_fpu(tsk); | 475 | restore_fpu(tsk); |
327 | } else { | 476 | } else { |
328 | /* First time FPU user. */ | 477 | /* First time FPU user. */ |
329 | fpu_init(); | 478 | fpu_init(); |
330 | set_used_math(); | 479 | set_used_math(); |
diff --git a/arch/sh/kernel/cpu/sh4/probe.c b/arch/sh/kernel/cpu/sh4/probe.c index bc9c28a69bf1..f2b9238cda04 100644 --- a/arch/sh/kernel/cpu/sh4/probe.c +++ b/arch/sh/kernel/cpu/sh4/probe.c | |||
@@ -98,6 +98,8 @@ int __init detect_cpu_and_cache_system(void) | |||
98 | case 0x200A: | 98 | case 0x200A: |
99 | if (prr == 0x61) | 99 | if (prr == 0x61) |
100 | boot_cpu_data.type = CPU_SH7781; | 100 | boot_cpu_data.type = CPU_SH7781; |
101 | else if (prr == 0xa1) | ||
102 | boot_cpu_data.type = CPU_SH7763; | ||
101 | else | 103 | else |
102 | boot_cpu_data.type = CPU_SH7780; | 104 | boot_cpu_data.type = CPU_SH7780; |
103 | 105 | ||
diff --git a/arch/sh/kernel/cpu/sh4/setup-sh7750.c b/arch/sh/kernel/cpu/sh4/setup-sh7750.c index 523f68a9ce0e..ae3603aca615 100644 --- a/arch/sh/kernel/cpu/sh4/setup-sh7750.c +++ b/arch/sh/kernel/cpu/sh4/setup-sh7750.c | |||
@@ -126,12 +126,6 @@ static struct intc_group groups[] __initdata = { | |||
126 | INTC_GROUP(REF, REF_RCMI, REF_ROVI), | 126 | INTC_GROUP(REF, REF_RCMI, REF_ROVI), |
127 | }; | 127 | }; |
128 | 128 | ||
129 | static struct intc_prio priorities[] __initdata = { | ||
130 | INTC_PRIO(SCIF, 3), | ||
131 | INTC_PRIO(SCI1, 3), | ||
132 | INTC_PRIO(DMAC, 7), | ||
133 | }; | ||
134 | |||
135 | static struct intc_prio_reg prio_registers[] __initdata = { | 129 | static struct intc_prio_reg prio_registers[] __initdata = { |
136 | { 0xffd00004, 0, 16, 4, /* IPRA */ { TMU0, TMU1, TMU2, RTC } }, | 130 | { 0xffd00004, 0, 16, 4, /* IPRA */ { TMU0, TMU1, TMU2, RTC } }, |
137 | { 0xffd00008, 0, 16, 4, /* IPRB */ { WDT, REF, SCI1, 0 } }, | 131 | { 0xffd00008, 0, 16, 4, /* IPRB */ { WDT, REF, SCI1, 0 } }, |
@@ -143,7 +137,7 @@ static struct intc_prio_reg prio_registers[] __initdata = { | |||
143 | }; | 137 | }; |
144 | 138 | ||
145 | static DECLARE_INTC_DESC(intc_desc, "sh7750", vectors, groups, | 139 | static DECLARE_INTC_DESC(intc_desc, "sh7750", vectors, groups, |
146 | priorities, NULL, prio_registers, NULL); | 140 | NULL, prio_registers, NULL); |
147 | 141 | ||
148 | /* SH7750, SH7750S, SH7751 and SH7091 all have 4-channel DMA controllers */ | 142 | /* SH7750, SH7750S, SH7751 and SH7091 all have 4-channel DMA controllers */ |
149 | #if defined(CONFIG_CPU_SUBTYPE_SH7750) || \ | 143 | #if defined(CONFIG_CPU_SUBTYPE_SH7750) || \ |
@@ -163,7 +157,7 @@ static struct intc_group groups_dma4[] __initdata = { | |||
163 | 157 | ||
164 | static DECLARE_INTC_DESC(intc_desc_dma4, "sh7750_dma4", | 158 | static DECLARE_INTC_DESC(intc_desc_dma4, "sh7750_dma4", |
165 | vectors_dma4, groups_dma4, | 159 | vectors_dma4, groups_dma4, |
166 | priorities, NULL, prio_registers, NULL); | 160 | NULL, prio_registers, NULL); |
167 | #endif | 161 | #endif |
168 | 162 | ||
169 | /* SH7750R and SH7751R both have 8-channel DMA controllers */ | 163 | /* SH7750R and SH7751R both have 8-channel DMA controllers */ |
@@ -184,7 +178,7 @@ static struct intc_group groups_dma8[] __initdata = { | |||
184 | 178 | ||
185 | static DECLARE_INTC_DESC(intc_desc_dma8, "sh7750_dma8", | 179 | static DECLARE_INTC_DESC(intc_desc_dma8, "sh7750_dma8", |
186 | vectors_dma8, groups_dma8, | 180 | vectors_dma8, groups_dma8, |
187 | priorities, NULL, prio_registers, NULL); | 181 | NULL, prio_registers, NULL); |
188 | #endif | 182 | #endif |
189 | 183 | ||
190 | /* SH7750R, SH7751 and SH7751R all have two extra timer channels */ | 184 | /* SH7750R, SH7751 and SH7751R all have two extra timer channels */ |
@@ -205,7 +199,7 @@ static struct intc_mask_reg mask_registers[] __initdata = { | |||
205 | }; | 199 | }; |
206 | 200 | ||
207 | static DECLARE_INTC_DESC(intc_desc_tmu34, "sh7750_tmu34", | 201 | static DECLARE_INTC_DESC(intc_desc_tmu34, "sh7750_tmu34", |
208 | vectors_tmu34, NULL, priorities, | 202 | vectors_tmu34, NULL, |
209 | mask_registers, prio_registers, NULL); | 203 | mask_registers, prio_registers, NULL); |
210 | #endif | 204 | #endif |
211 | 205 | ||
@@ -216,7 +210,7 @@ static struct intc_vect vectors_irlm[] __initdata = { | |||
216 | }; | 210 | }; |
217 | 211 | ||
218 | static DECLARE_INTC_DESC(intc_desc_irlm, "sh7750_irlm", vectors_irlm, NULL, | 212 | static DECLARE_INTC_DESC(intc_desc_irlm, "sh7750_irlm", vectors_irlm, NULL, |
219 | priorities, NULL, prio_registers, NULL); | 213 | NULL, prio_registers, NULL); |
220 | 214 | ||
221 | /* SH7751 and SH7751R both have PCI */ | 215 | /* SH7751 and SH7751R both have PCI */ |
222 | #if defined(CONFIG_CPU_SUBTYPE_SH7751) || defined(CONFIG_CPU_SUBTYPE_SH7751R) | 216 | #if defined(CONFIG_CPU_SUBTYPE_SH7751) || defined(CONFIG_CPU_SUBTYPE_SH7751R) |
@@ -233,7 +227,7 @@ static struct intc_group groups_pci[] __initdata = { | |||
233 | }; | 227 | }; |
234 | 228 | ||
235 | static DECLARE_INTC_DESC(intc_desc_pci, "sh7750_pci", vectors_pci, groups_pci, | 229 | static DECLARE_INTC_DESC(intc_desc_pci, "sh7750_pci", vectors_pci, groups_pci, |
236 | priorities, mask_registers, prio_registers, NULL); | 230 | mask_registers, prio_registers, NULL); |
237 | #endif | 231 | #endif |
238 | 232 | ||
239 | #if defined(CONFIG_CPU_SUBTYPE_SH7750) || \ | 233 | #if defined(CONFIG_CPU_SUBTYPE_SH7750) || \ |
diff --git a/arch/sh/kernel/cpu/sh4/setup-sh7760.c b/arch/sh/kernel/cpu/sh4/setup-sh7760.c index 7a898cb1d940..85f81579b97e 100644 --- a/arch/sh/kernel/cpu/sh4/setup-sh7760.c +++ b/arch/sh/kernel/cpu/sh4/setup-sh7760.c | |||
@@ -92,15 +92,6 @@ static struct intc_group groups[] __initdata = { | |||
92 | INTC_GROUP(REF, REF_RCMI, REF_ROVI), | 92 | INTC_GROUP(REF, REF_RCMI, REF_ROVI), |
93 | }; | 93 | }; |
94 | 94 | ||
95 | static struct intc_prio priorities[] __initdata = { | ||
96 | INTC_PRIO(SCIF0, 3), | ||
97 | INTC_PRIO(SCIF1, 3), | ||
98 | INTC_PRIO(SCIF2, 3), | ||
99 | INTC_PRIO(SIM, 3), | ||
100 | INTC_PRIO(DMAC, 7), | ||
101 | INTC_PRIO(DMABRG, 13), | ||
102 | }; | ||
103 | |||
104 | static struct intc_mask_reg mask_registers[] __initdata = { | 95 | static struct intc_mask_reg mask_registers[] __initdata = { |
105 | { 0xfe080040, 0xfe080060, 32, /* INTMSK00 / INTMSKCLR00 */ | 96 | { 0xfe080040, 0xfe080060, 32, /* INTMSK00 / INTMSKCLR00 */ |
106 | { IRQ4, IRQ5, IRQ6, IRQ7, 0, 0, HCAN20, HCAN21, | 97 | { IRQ4, IRQ5, IRQ6, IRQ7, 0, 0, HCAN20, HCAN21, |
@@ -132,7 +123,7 @@ static struct intc_prio_reg prio_registers[] __initdata = { | |||
132 | }; | 123 | }; |
133 | 124 | ||
134 | static DECLARE_INTC_DESC(intc_desc, "sh7760", vectors, groups, | 125 | static DECLARE_INTC_DESC(intc_desc, "sh7760", vectors, groups, |
135 | priorities, mask_registers, prio_registers, NULL); | 126 | mask_registers, prio_registers, NULL); |
136 | 127 | ||
137 | static struct intc_vect vectors_irq[] __initdata = { | 128 | static struct intc_vect vectors_irq[] __initdata = { |
138 | INTC_VECT(IRL0, 0x240), INTC_VECT(IRL1, 0x2a0), | 129 | INTC_VECT(IRL0, 0x240), INTC_VECT(IRL1, 0x2a0), |
@@ -140,7 +131,7 @@ static struct intc_vect vectors_irq[] __initdata = { | |||
140 | }; | 131 | }; |
141 | 132 | ||
142 | static DECLARE_INTC_DESC(intc_desc_irq, "sh7760-irq", vectors_irq, groups, | 133 | static DECLARE_INTC_DESC(intc_desc_irq, "sh7760-irq", vectors_irq, groups, |
143 | priorities, mask_registers, prio_registers, NULL); | 134 | mask_registers, prio_registers, NULL); |
144 | 135 | ||
145 | static struct plat_sci_port sci_platform_data[] = { | 136 | static struct plat_sci_port sci_platform_data[] = { |
146 | { | 137 | { |
diff --git a/arch/sh/kernel/cpu/sh4/softfloat.c b/arch/sh/kernel/cpu/sh4/softfloat.c new file mode 100644 index 000000000000..7b2d337ee412 --- /dev/null +++ b/arch/sh/kernel/cpu/sh4/softfloat.c | |||
@@ -0,0 +1,892 @@ | |||
1 | /* | ||
2 | * Floating point emulation support for subnormalised numbers on SH4 | ||
3 | * architecture This file is derived from the SoftFloat IEC/IEEE | ||
4 | * Floating-point Arithmetic Package, Release 2 the original license of | ||
5 | * which is reproduced below. | ||
6 | * | ||
7 | * ======================================================================== | ||
8 | * | ||
9 | * This C source file is part of the SoftFloat IEC/IEEE Floating-point | ||
10 | * Arithmetic Package, Release 2. | ||
11 | * | ||
12 | * Written by John R. Hauser. This work was made possible in part by the | ||
13 | * International Computer Science Institute, located at Suite 600, 1947 Center | ||
14 | * Street, Berkeley, California 94704. Funding was partially provided by the | ||
15 | * National Science Foundation under grant MIP-9311980. The original version | ||
16 | * of this code was written as part of a project to build a fixed-point vector | ||
17 | * processor in collaboration with the University of California at Berkeley, | ||
18 | * overseen by Profs. Nelson Morgan and John Wawrzynek. More information | ||
19 | * is available through the web page `http://HTTP.CS.Berkeley.EDU/~jhauser/ | ||
20 | * arithmetic/softfloat.html'. | ||
21 | * | ||
22 | * THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort | ||
23 | * has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT | ||
24 | * TIMES RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO | ||
25 | * PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY | ||
26 | * AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE. | ||
27 | * | ||
28 | * Derivative works are acceptable, even for commercial purposes, so long as | ||
29 | * (1) they include prominent notice that the work is derivative, and (2) they | ||
30 | * include prominent notice akin to these three paragraphs for those parts of | ||
31 | * this code that are retained. | ||
32 | * | ||
33 | * ======================================================================== | ||
34 | * | ||
35 | * SH4 modifications by Ismail Dhaoui <ismail.dhaoui@st.com> | ||
36 | * and Kamel Khelifi <kamel.khelifi@st.com> | ||
37 | */ | ||
38 | #include <linux/kernel.h> | ||
39 | #include <asm/cpu/fpu.h> | ||
40 | |||
41 | #define LIT64( a ) a##LL | ||
42 | |||
43 | typedef char flag; | ||
44 | typedef unsigned char uint8; | ||
45 | typedef signed char int8; | ||
46 | typedef int uint16; | ||
47 | typedef int int16; | ||
48 | typedef unsigned int uint32; | ||
49 | typedef signed int int32; | ||
50 | |||
51 | typedef unsigned long long int bits64; | ||
52 | typedef signed long long int sbits64; | ||
53 | |||
54 | typedef unsigned char bits8; | ||
55 | typedef signed char sbits8; | ||
56 | typedef unsigned short int bits16; | ||
57 | typedef signed short int sbits16; | ||
58 | typedef unsigned int bits32; | ||
59 | typedef signed int sbits32; | ||
60 | |||
61 | typedef unsigned long long int uint64; | ||
62 | typedef signed long long int int64; | ||
63 | |||
64 | typedef unsigned long int float32; | ||
65 | typedef unsigned long long float64; | ||
66 | |||
67 | extern void float_raise(unsigned int flags); /* in fpu.c */ | ||
68 | extern int float_rounding_mode(void); /* in fpu.c */ | ||
69 | |||
70 | inline bits64 extractFloat64Frac(float64 a); | ||
71 | inline flag extractFloat64Sign(float64 a); | ||
72 | inline int16 extractFloat64Exp(float64 a); | ||
73 | inline int16 extractFloat32Exp(float32 a); | ||
74 | inline flag extractFloat32Sign(float32 a); | ||
75 | inline bits32 extractFloat32Frac(float32 a); | ||
76 | inline float64 packFloat64(flag zSign, int16 zExp, bits64 zSig); | ||
77 | inline void shift64RightJamming(bits64 a, int16 count, bits64 * zPtr); | ||
78 | inline float32 packFloat32(flag zSign, int16 zExp, bits32 zSig); | ||
79 | inline void shift32RightJamming(bits32 a, int16 count, bits32 * zPtr); | ||
80 | float64 float64_sub(float64 a, float64 b); | ||
81 | float32 float32_sub(float32 a, float32 b); | ||
82 | float32 float32_add(float32 a, float32 b); | ||
83 | float64 float64_add(float64 a, float64 b); | ||
84 | float64 float64_div(float64 a, float64 b); | ||
85 | float32 float32_div(float32 a, float32 b); | ||
86 | float32 float32_mul(float32 a, float32 b); | ||
87 | float64 float64_mul(float64 a, float64 b); | ||
88 | inline void add128(bits64 a0, bits64 a1, bits64 b0, bits64 b1, bits64 * z0Ptr, | ||
89 | bits64 * z1Ptr); | ||
90 | inline void sub128(bits64 a0, bits64 a1, bits64 b0, bits64 b1, bits64 * z0Ptr, | ||
91 | bits64 * z1Ptr); | ||
92 | inline void mul64To128(bits64 a, bits64 b, bits64 * z0Ptr, bits64 * z1Ptr); | ||
93 | |||
94 | static int8 countLeadingZeros32(bits32 a); | ||
95 | static int8 countLeadingZeros64(bits64 a); | ||
96 | static float64 normalizeRoundAndPackFloat64(flag zSign, int16 zExp, | ||
97 | bits64 zSig); | ||
98 | static float64 subFloat64Sigs(float64 a, float64 b, flag zSign); | ||
99 | static float64 addFloat64Sigs(float64 a, float64 b, flag zSign); | ||
100 | static float32 roundAndPackFloat32(flag zSign, int16 zExp, bits32 zSig); | ||
101 | static float32 normalizeRoundAndPackFloat32(flag zSign, int16 zExp, | ||
102 | bits32 zSig); | ||
103 | static float64 roundAndPackFloat64(flag zSign, int16 zExp, bits64 zSig); | ||
104 | static float32 subFloat32Sigs(float32 a, float32 b, flag zSign); | ||
105 | static float32 addFloat32Sigs(float32 a, float32 b, flag zSign); | ||
106 | static void normalizeFloat64Subnormal(bits64 aSig, int16 * zExpPtr, | ||
107 | bits64 * zSigPtr); | ||
108 | static bits64 estimateDiv128To64(bits64 a0, bits64 a1, bits64 b); | ||
109 | static void normalizeFloat32Subnormal(bits32 aSig, int16 * zExpPtr, | ||
110 | bits32 * zSigPtr); | ||
111 | |||
112 | inline bits64 extractFloat64Frac(float64 a) | ||
113 | { | ||
114 | return a & LIT64(0x000FFFFFFFFFFFFF); | ||
115 | } | ||
116 | |||
117 | inline flag extractFloat64Sign(float64 a) | ||
118 | { | ||
119 | return a >> 63; | ||
120 | } | ||
121 | |||
122 | inline int16 extractFloat64Exp(float64 a) | ||
123 | { | ||
124 | return (a >> 52) & 0x7FF; | ||
125 | } | ||
126 | |||
127 | inline int16 extractFloat32Exp(float32 a) | ||
128 | { | ||
129 | return (a >> 23) & 0xFF; | ||
130 | } | ||
131 | |||
132 | inline flag extractFloat32Sign(float32 a) | ||
133 | { | ||
134 | return a >> 31; | ||
135 | } | ||
136 | |||
137 | inline bits32 extractFloat32Frac(float32 a) | ||
138 | { | ||
139 | return a & 0x007FFFFF; | ||
140 | } | ||
141 | |||
142 | inline float64 packFloat64(flag zSign, int16 zExp, bits64 zSig) | ||
143 | { | ||
144 | return (((bits64) zSign) << 63) + (((bits64) zExp) << 52) + zSig; | ||
145 | } | ||
146 | |||
147 | inline void shift64RightJamming(bits64 a, int16 count, bits64 * zPtr) | ||
148 | { | ||
149 | bits64 z; | ||
150 | |||
151 | if (count == 0) { | ||
152 | z = a; | ||
153 | } else if (count < 64) { | ||
154 | z = (a >> count) | ((a << ((-count) & 63)) != 0); | ||
155 | } else { | ||
156 | z = (a != 0); | ||
157 | } | ||
158 | *zPtr = z; | ||
159 | } | ||
160 | |||
161 | static int8 countLeadingZeros32(bits32 a) | ||
162 | { | ||
163 | static const int8 countLeadingZerosHigh[] = { | ||
164 | 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, | ||
165 | 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, | ||
166 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | ||
167 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | ||
168 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | ||
169 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | ||
170 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | ||
171 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | ||
172 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
173 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
174 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
175 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
176 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
177 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
178 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
179 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | ||
180 | }; | ||
181 | int8 shiftCount; | ||
182 | |||
183 | shiftCount = 0; | ||
184 | if (a < 0x10000) { | ||
185 | shiftCount += 16; | ||
186 | a <<= 16; | ||
187 | } | ||
188 | if (a < 0x1000000) { | ||
189 | shiftCount += 8; | ||
190 | a <<= 8; | ||
191 | } | ||
192 | shiftCount += countLeadingZerosHigh[a >> 24]; | ||
193 | return shiftCount; | ||
194 | |||
195 | } | ||
196 | |||
197 | static int8 countLeadingZeros64(bits64 a) | ||
198 | { | ||
199 | int8 shiftCount; | ||
200 | |||
201 | shiftCount = 0; | ||
202 | if (a < ((bits64) 1) << 32) { | ||
203 | shiftCount += 32; | ||
204 | } else { | ||
205 | a >>= 32; | ||
206 | } | ||
207 | shiftCount += countLeadingZeros32(a); | ||
208 | return shiftCount; | ||
209 | |||
210 | } | ||
211 | |||
212 | static float64 normalizeRoundAndPackFloat64(flag zSign, int16 zExp, bits64 zSig) | ||
213 | { | ||
214 | int8 shiftCount; | ||
215 | |||
216 | shiftCount = countLeadingZeros64(zSig) - 1; | ||
217 | return roundAndPackFloat64(zSign, zExp - shiftCount, | ||
218 | zSig << shiftCount); | ||
219 | |||
220 | } | ||
221 | |||
222 | static float64 subFloat64Sigs(float64 a, float64 b, flag zSign) | ||
223 | { | ||
224 | int16 aExp, bExp, zExp; | ||
225 | bits64 aSig, bSig, zSig; | ||
226 | int16 expDiff; | ||
227 | |||
228 | aSig = extractFloat64Frac(a); | ||
229 | aExp = extractFloat64Exp(a); | ||
230 | bSig = extractFloat64Frac(b); | ||
231 | bExp = extractFloat64Exp(b); | ||
232 | expDiff = aExp - bExp; | ||
233 | aSig <<= 10; | ||
234 | bSig <<= 10; | ||
235 | if (0 < expDiff) | ||
236 | goto aExpBigger; | ||
237 | if (expDiff < 0) | ||
238 | goto bExpBigger; | ||
239 | if (aExp == 0) { | ||
240 | aExp = 1; | ||
241 | bExp = 1; | ||
242 | } | ||
243 | if (bSig < aSig) | ||
244 | goto aBigger; | ||
245 | if (aSig < bSig) | ||
246 | goto bBigger; | ||
247 | return packFloat64(float_rounding_mode() == FPSCR_RM_ZERO, 0, 0); | ||
248 | bExpBigger: | ||
249 | if (bExp == 0x7FF) { | ||
250 | return packFloat64(zSign ^ 1, 0x7FF, 0); | ||
251 | } | ||
252 | if (aExp == 0) { | ||
253 | ++expDiff; | ||
254 | } else { | ||
255 | aSig |= LIT64(0x4000000000000000); | ||
256 | } | ||
257 | shift64RightJamming(aSig, -expDiff, &aSig); | ||
258 | bSig |= LIT64(0x4000000000000000); | ||
259 | bBigger: | ||
260 | zSig = bSig - aSig; | ||
261 | zExp = bExp; | ||
262 | zSign ^= 1; | ||
263 | goto normalizeRoundAndPack; | ||
264 | aExpBigger: | ||
265 | if (aExp == 0x7FF) { | ||
266 | return a; | ||
267 | } | ||
268 | if (bExp == 0) { | ||
269 | --expDiff; | ||
270 | } else { | ||
271 | bSig |= LIT64(0x4000000000000000); | ||
272 | } | ||
273 | shift64RightJamming(bSig, expDiff, &bSig); | ||
274 | aSig |= LIT64(0x4000000000000000); | ||
275 | aBigger: | ||
276 | zSig = aSig - bSig; | ||
277 | zExp = aExp; | ||
278 | normalizeRoundAndPack: | ||
279 | --zExp; | ||
280 | return normalizeRoundAndPackFloat64(zSign, zExp, zSig); | ||
281 | |||
282 | } | ||
283 | static float64 addFloat64Sigs(float64 a, float64 b, flag zSign) | ||
284 | { | ||
285 | int16 aExp, bExp, zExp; | ||
286 | bits64 aSig, bSig, zSig; | ||
287 | int16 expDiff; | ||
288 | |||
289 | aSig = extractFloat64Frac(a); | ||
290 | aExp = extractFloat64Exp(a); | ||
291 | bSig = extractFloat64Frac(b); | ||
292 | bExp = extractFloat64Exp(b); | ||
293 | expDiff = aExp - bExp; | ||
294 | aSig <<= 9; | ||
295 | bSig <<= 9; | ||
296 | if (0 < expDiff) { | ||
297 | if (aExp == 0x7FF) { | ||
298 | return a; | ||
299 | } | ||
300 | if (bExp == 0) { | ||
301 | --expDiff; | ||
302 | } else { | ||
303 | bSig |= LIT64(0x2000000000000000); | ||
304 | } | ||
305 | shift64RightJamming(bSig, expDiff, &bSig); | ||
306 | zExp = aExp; | ||
307 | } else if (expDiff < 0) { | ||
308 | if (bExp == 0x7FF) { | ||
309 | return packFloat64(zSign, 0x7FF, 0); | ||
310 | } | ||
311 | if (aExp == 0) { | ||
312 | ++expDiff; | ||
313 | } else { | ||
314 | aSig |= LIT64(0x2000000000000000); | ||
315 | } | ||
316 | shift64RightJamming(aSig, -expDiff, &aSig); | ||
317 | zExp = bExp; | ||
318 | } else { | ||
319 | if (aExp == 0x7FF) { | ||
320 | return a; | ||
321 | } | ||
322 | if (aExp == 0) | ||
323 | return packFloat64(zSign, 0, (aSig + bSig) >> 9); | ||
324 | zSig = LIT64(0x4000000000000000) + aSig + bSig; | ||
325 | zExp = aExp; | ||
326 | goto roundAndPack; | ||
327 | } | ||
328 | aSig |= LIT64(0x2000000000000000); | ||
329 | zSig = (aSig + bSig) << 1; | ||
330 | --zExp; | ||
331 | if ((sbits64) zSig < 0) { | ||
332 | zSig = aSig + bSig; | ||
333 | ++zExp; | ||
334 | } | ||
335 | roundAndPack: | ||
336 | return roundAndPackFloat64(zSign, zExp, zSig); | ||
337 | |||
338 | } | ||
339 | |||
340 | inline float32 packFloat32(flag zSign, int16 zExp, bits32 zSig) | ||
341 | { | ||
342 | return (((bits32) zSign) << 31) + (((bits32) zExp) << 23) + zSig; | ||
343 | } | ||
344 | |||
345 | inline void shift32RightJamming(bits32 a, int16 count, bits32 * zPtr) | ||
346 | { | ||
347 | bits32 z; | ||
348 | if (count == 0) { | ||
349 | z = a; | ||
350 | } else if (count < 32) { | ||
351 | z = (a >> count) | ((a << ((-count) & 31)) != 0); | ||
352 | } else { | ||
353 | z = (a != 0); | ||
354 | } | ||
355 | *zPtr = z; | ||
356 | } | ||
357 | |||
358 | static float32 roundAndPackFloat32(flag zSign, int16 zExp, bits32 zSig) | ||
359 | { | ||
360 | flag roundNearestEven; | ||
361 | int8 roundIncrement, roundBits; | ||
362 | flag isTiny; | ||
363 | |||
364 | /* SH4 has only 2 rounding modes - round to nearest and round to zero */ | ||
365 | roundNearestEven = (float_rounding_mode() == FPSCR_RM_NEAREST); | ||
366 | roundIncrement = 0x40; | ||
367 | if (!roundNearestEven) { | ||
368 | roundIncrement = 0; | ||
369 | } | ||
370 | roundBits = zSig & 0x7F; | ||
371 | if (0xFD <= (bits16) zExp) { | ||
372 | if ((0xFD < zExp) | ||
373 | || ((zExp == 0xFD) | ||
374 | && ((sbits32) (zSig + roundIncrement) < 0)) | ||
375 | ) { | ||
376 | float_raise(FPSCR_CAUSE_OVERFLOW | FPSCR_CAUSE_INEXACT); | ||
377 | return packFloat32(zSign, 0xFF, | ||
378 | 0) - (roundIncrement == 0); | ||
379 | } | ||
380 | if (zExp < 0) { | ||
381 | isTiny = (zExp < -1) | ||
382 | || (zSig + roundIncrement < 0x80000000); | ||
383 | shift32RightJamming(zSig, -zExp, &zSig); | ||
384 | zExp = 0; | ||
385 | roundBits = zSig & 0x7F; | ||
386 | if (isTiny && roundBits) | ||
387 | float_raise(FPSCR_CAUSE_UNDERFLOW); | ||
388 | } | ||
389 | } | ||
390 | if (roundBits) | ||
391 | float_raise(FPSCR_CAUSE_INEXACT); | ||
392 | zSig = (zSig + roundIncrement) >> 7; | ||
393 | zSig &= ~(((roundBits ^ 0x40) == 0) & roundNearestEven); | ||
394 | if (zSig == 0) | ||
395 | zExp = 0; | ||
396 | return packFloat32(zSign, zExp, zSig); | ||
397 | |||
398 | } | ||
399 | |||
400 | static float32 normalizeRoundAndPackFloat32(flag zSign, int16 zExp, bits32 zSig) | ||
401 | { | ||
402 | int8 shiftCount; | ||
403 | |||
404 | shiftCount = countLeadingZeros32(zSig) - 1; | ||
405 | return roundAndPackFloat32(zSign, zExp - shiftCount, | ||
406 | zSig << shiftCount); | ||
407 | } | ||
408 | |||
409 | static float64 roundAndPackFloat64(flag zSign, int16 zExp, bits64 zSig) | ||
410 | { | ||
411 | flag roundNearestEven; | ||
412 | int16 roundIncrement, roundBits; | ||
413 | flag isTiny; | ||
414 | |||
415 | /* SH4 has only 2 rounding modes - round to nearest and round to zero */ | ||
416 | roundNearestEven = (float_rounding_mode() == FPSCR_RM_NEAREST); | ||
417 | roundIncrement = 0x200; | ||
418 | if (!roundNearestEven) { | ||
419 | roundIncrement = 0; | ||
420 | } | ||
421 | roundBits = zSig & 0x3FF; | ||
422 | if (0x7FD <= (bits16) zExp) { | ||
423 | if ((0x7FD < zExp) | ||
424 | || ((zExp == 0x7FD) | ||
425 | && ((sbits64) (zSig + roundIncrement) < 0)) | ||
426 | ) { | ||
427 | float_raise(FPSCR_CAUSE_OVERFLOW | FPSCR_CAUSE_INEXACT); | ||
428 | return packFloat64(zSign, 0x7FF, | ||
429 | 0) - (roundIncrement == 0); | ||
430 | } | ||
431 | if (zExp < 0) { | ||
432 | isTiny = (zExp < -1) | ||
433 | || (zSig + roundIncrement < | ||
434 | LIT64(0x8000000000000000)); | ||
435 | shift64RightJamming(zSig, -zExp, &zSig); | ||
436 | zExp = 0; | ||
437 | roundBits = zSig & 0x3FF; | ||
438 | if (isTiny && roundBits) | ||
439 | float_raise(FPSCR_CAUSE_UNDERFLOW); | ||
440 | } | ||
441 | } | ||
442 | if (roundBits) | ||
443 | float_raise(FPSCR_CAUSE_INEXACT); | ||
444 | zSig = (zSig + roundIncrement) >> 10; | ||
445 | zSig &= ~(((roundBits ^ 0x200) == 0) & roundNearestEven); | ||
446 | if (zSig == 0) | ||
447 | zExp = 0; | ||
448 | return packFloat64(zSign, zExp, zSig); | ||
449 | |||
450 | } | ||
451 | |||
452 | static float32 subFloat32Sigs(float32 a, float32 b, flag zSign) | ||
453 | { | ||
454 | int16 aExp, bExp, zExp; | ||
455 | bits32 aSig, bSig, zSig; | ||
456 | int16 expDiff; | ||
457 | |||
458 | aSig = extractFloat32Frac(a); | ||
459 | aExp = extractFloat32Exp(a); | ||
460 | bSig = extractFloat32Frac(b); | ||
461 | bExp = extractFloat32Exp(b); | ||
462 | expDiff = aExp - bExp; | ||
463 | aSig <<= 7; | ||
464 | bSig <<= 7; | ||
465 | if (0 < expDiff) | ||
466 | goto aExpBigger; | ||
467 | if (expDiff < 0) | ||
468 | goto bExpBigger; | ||
469 | if (aExp == 0) { | ||
470 | aExp = 1; | ||
471 | bExp = 1; | ||
472 | } | ||
473 | if (bSig < aSig) | ||
474 | goto aBigger; | ||
475 | if (aSig < bSig) | ||
476 | goto bBigger; | ||
477 | return packFloat32(float_rounding_mode() == FPSCR_RM_ZERO, 0, 0); | ||
478 | bExpBigger: | ||
479 | if (bExp == 0xFF) { | ||
480 | return packFloat32(zSign ^ 1, 0xFF, 0); | ||
481 | } | ||
482 | if (aExp == 0) { | ||
483 | ++expDiff; | ||
484 | } else { | ||
485 | aSig |= 0x40000000; | ||
486 | } | ||
487 | shift32RightJamming(aSig, -expDiff, &aSig); | ||
488 | bSig |= 0x40000000; | ||
489 | bBigger: | ||
490 | zSig = bSig - aSig; | ||
491 | zExp = bExp; | ||
492 | zSign ^= 1; | ||
493 | goto normalizeRoundAndPack; | ||
494 | aExpBigger: | ||
495 | if (aExp == 0xFF) { | ||
496 | return a; | ||
497 | } | ||
498 | if (bExp == 0) { | ||
499 | --expDiff; | ||
500 | } else { | ||
501 | bSig |= 0x40000000; | ||
502 | } | ||
503 | shift32RightJamming(bSig, expDiff, &bSig); | ||
504 | aSig |= 0x40000000; | ||
505 | aBigger: | ||
506 | zSig = aSig - bSig; | ||
507 | zExp = aExp; | ||
508 | normalizeRoundAndPack: | ||
509 | --zExp; | ||
510 | return normalizeRoundAndPackFloat32(zSign, zExp, zSig); | ||
511 | |||
512 | } | ||
513 | |||
514 | static float32 addFloat32Sigs(float32 a, float32 b, flag zSign) | ||
515 | { | ||
516 | int16 aExp, bExp, zExp; | ||
517 | bits32 aSig, bSig, zSig; | ||
518 | int16 expDiff; | ||
519 | |||
520 | aSig = extractFloat32Frac(a); | ||
521 | aExp = extractFloat32Exp(a); | ||
522 | bSig = extractFloat32Frac(b); | ||
523 | bExp = extractFloat32Exp(b); | ||
524 | expDiff = aExp - bExp; | ||
525 | aSig <<= 6; | ||
526 | bSig <<= 6; | ||
527 | if (0 < expDiff) { | ||
528 | if (aExp == 0xFF) { | ||
529 | return a; | ||
530 | } | ||
531 | if (bExp == 0) { | ||
532 | --expDiff; | ||
533 | } else { | ||
534 | bSig |= 0x20000000; | ||
535 | } | ||
536 | shift32RightJamming(bSig, expDiff, &bSig); | ||
537 | zExp = aExp; | ||
538 | } else if (expDiff < 0) { | ||
539 | if (bExp == 0xFF) { | ||
540 | return packFloat32(zSign, 0xFF, 0); | ||
541 | } | ||
542 | if (aExp == 0) { | ||
543 | ++expDiff; | ||
544 | } else { | ||
545 | aSig |= 0x20000000; | ||
546 | } | ||
547 | shift32RightJamming(aSig, -expDiff, &aSig); | ||
548 | zExp = bExp; | ||
549 | } else { | ||
550 | if (aExp == 0xFF) { | ||
551 | return a; | ||
552 | } | ||
553 | if (aExp == 0) | ||
554 | return packFloat32(zSign, 0, (aSig + bSig) >> 6); | ||
555 | zSig = 0x40000000 + aSig + bSig; | ||
556 | zExp = aExp; | ||
557 | goto roundAndPack; | ||
558 | } | ||
559 | aSig |= 0x20000000; | ||
560 | zSig = (aSig + bSig) << 1; | ||
561 | --zExp; | ||
562 | if ((sbits32) zSig < 0) { | ||
563 | zSig = aSig + bSig; | ||
564 | ++zExp; | ||
565 | } | ||
566 | roundAndPack: | ||
567 | return roundAndPackFloat32(zSign, zExp, zSig); | ||
568 | |||
569 | } | ||
570 | |||
571 | float64 float64_sub(float64 a, float64 b) | ||
572 | { | ||
573 | flag aSign, bSign; | ||
574 | |||
575 | aSign = extractFloat64Sign(a); | ||
576 | bSign = extractFloat64Sign(b); | ||
577 | if (aSign == bSign) { | ||
578 | return subFloat64Sigs(a, b, aSign); | ||
579 | } else { | ||
580 | return addFloat64Sigs(a, b, aSign); | ||
581 | } | ||
582 | |||
583 | } | ||
584 | |||
585 | float32 float32_sub(float32 a, float32 b) | ||
586 | { | ||
587 | flag aSign, bSign; | ||
588 | |||
589 | aSign = extractFloat32Sign(a); | ||
590 | bSign = extractFloat32Sign(b); | ||
591 | if (aSign == bSign) { | ||
592 | return subFloat32Sigs(a, b, aSign); | ||
593 | } else { | ||
594 | return addFloat32Sigs(a, b, aSign); | ||
595 | } | ||
596 | |||
597 | } | ||
598 | |||
599 | float32 float32_add(float32 a, float32 b) | ||
600 | { | ||
601 | flag aSign, bSign; | ||
602 | |||
603 | aSign = extractFloat32Sign(a); | ||
604 | bSign = extractFloat32Sign(b); | ||
605 | if (aSign == bSign) { | ||
606 | return addFloat32Sigs(a, b, aSign); | ||
607 | } else { | ||
608 | return subFloat32Sigs(a, b, aSign); | ||
609 | } | ||
610 | |||
611 | } | ||
612 | |||
613 | float64 float64_add(float64 a, float64 b) | ||
614 | { | ||
615 | flag aSign, bSign; | ||
616 | |||
617 | aSign = extractFloat64Sign(a); | ||
618 | bSign = extractFloat64Sign(b); | ||
619 | if (aSign == bSign) { | ||
620 | return addFloat64Sigs(a, b, aSign); | ||
621 | } else { | ||
622 | return subFloat64Sigs(a, b, aSign); | ||
623 | } | ||
624 | } | ||
625 | |||
626 | static void | ||
627 | normalizeFloat64Subnormal(bits64 aSig, int16 * zExpPtr, bits64 * zSigPtr) | ||
628 | { | ||
629 | int8 shiftCount; | ||
630 | |||
631 | shiftCount = countLeadingZeros64(aSig) - 11; | ||
632 | *zSigPtr = aSig << shiftCount; | ||
633 | *zExpPtr = 1 - shiftCount; | ||
634 | } | ||
635 | |||
636 | inline void add128(bits64 a0, bits64 a1, bits64 b0, bits64 b1, bits64 * z0Ptr, | ||
637 | bits64 * z1Ptr) | ||
638 | { | ||
639 | bits64 z1; | ||
640 | |||
641 | z1 = a1 + b1; | ||
642 | *z1Ptr = z1; | ||
643 | *z0Ptr = a0 + b0 + (z1 < a1); | ||
644 | } | ||
645 | |||
646 | inline void | ||
647 | sub128(bits64 a0, bits64 a1, bits64 b0, bits64 b1, bits64 * z0Ptr, | ||
648 | bits64 * z1Ptr) | ||
649 | { | ||
650 | *z1Ptr = a1 - b1; | ||
651 | *z0Ptr = a0 - b0 - (a1 < b1); | ||
652 | } | ||
653 | |||
654 | static bits64 estimateDiv128To64(bits64 a0, bits64 a1, bits64 b) | ||
655 | { | ||
656 | bits64 b0, b1; | ||
657 | bits64 rem0, rem1, term0, term1; | ||
658 | bits64 z; | ||
659 | if (b <= a0) | ||
660 | return LIT64(0xFFFFFFFFFFFFFFFF); | ||
661 | b0 = b >> 32; | ||
662 | z = (b0 << 32 <= a0) ? LIT64(0xFFFFFFFF00000000) : (a0 / b0) << 32; | ||
663 | mul64To128(b, z, &term0, &term1); | ||
664 | sub128(a0, a1, term0, term1, &rem0, &rem1); | ||
665 | while (((sbits64) rem0) < 0) { | ||
666 | z -= LIT64(0x100000000); | ||
667 | b1 = b << 32; | ||
668 | add128(rem0, rem1, b0, b1, &rem0, &rem1); | ||
669 | } | ||
670 | rem0 = (rem0 << 32) | (rem1 >> 32); | ||
671 | z |= (b0 << 32 <= rem0) ? 0xFFFFFFFF : rem0 / b0; | ||
672 | return z; | ||
673 | } | ||
674 | |||
675 | inline void mul64To128(bits64 a, bits64 b, bits64 * z0Ptr, bits64 * z1Ptr) | ||
676 | { | ||
677 | bits32 aHigh, aLow, bHigh, bLow; | ||
678 | bits64 z0, zMiddleA, zMiddleB, z1; | ||
679 | |||
680 | aLow = a; | ||
681 | aHigh = a >> 32; | ||
682 | bLow = b; | ||
683 | bHigh = b >> 32; | ||
684 | z1 = ((bits64) aLow) * bLow; | ||
685 | zMiddleA = ((bits64) aLow) * bHigh; | ||
686 | zMiddleB = ((bits64) aHigh) * bLow; | ||
687 | z0 = ((bits64) aHigh) * bHigh; | ||
688 | zMiddleA += zMiddleB; | ||
689 | z0 += (((bits64) (zMiddleA < zMiddleB)) << 32) + (zMiddleA >> 32); | ||
690 | zMiddleA <<= 32; | ||
691 | z1 += zMiddleA; | ||
692 | z0 += (z1 < zMiddleA); | ||
693 | *z1Ptr = z1; | ||
694 | *z0Ptr = z0; | ||
695 | |||
696 | } | ||
697 | |||
698 | static void normalizeFloat32Subnormal(bits32 aSig, int16 * zExpPtr, | ||
699 | bits32 * zSigPtr) | ||
700 | { | ||
701 | int8 shiftCount; | ||
702 | |||
703 | shiftCount = countLeadingZeros32(aSig) - 8; | ||
704 | *zSigPtr = aSig << shiftCount; | ||
705 | *zExpPtr = 1 - shiftCount; | ||
706 | |||
707 | } | ||
708 | |||
709 | float64 float64_div(float64 a, float64 b) | ||
710 | { | ||
711 | flag aSign, bSign, zSign; | ||
712 | int16 aExp, bExp, zExp; | ||
713 | bits64 aSig, bSig, zSig; | ||
714 | bits64 rem0, rem1; | ||
715 | bits64 term0, term1; | ||
716 | |||
717 | aSig = extractFloat64Frac(a); | ||
718 | aExp = extractFloat64Exp(a); | ||
719 | aSign = extractFloat64Sign(a); | ||
720 | bSig = extractFloat64Frac(b); | ||
721 | bExp = extractFloat64Exp(b); | ||
722 | bSign = extractFloat64Sign(b); | ||
723 | zSign = aSign ^ bSign; | ||
724 | if (aExp == 0x7FF) { | ||
725 | if (bExp == 0x7FF) { | ||
726 | } | ||
727 | return packFloat64(zSign, 0x7FF, 0); | ||
728 | } | ||
729 | if (bExp == 0x7FF) { | ||
730 | return packFloat64(zSign, 0, 0); | ||
731 | } | ||
732 | if (bExp == 0) { | ||
733 | if (bSig == 0) { | ||
734 | if ((aExp | aSig) == 0) { | ||
735 | float_raise(FPSCR_CAUSE_INVALID); | ||
736 | } | ||
737 | return packFloat64(zSign, 0x7FF, 0); | ||
738 | } | ||
739 | normalizeFloat64Subnormal(bSig, &bExp, &bSig); | ||
740 | } | ||
741 | if (aExp == 0) { | ||
742 | if (aSig == 0) | ||
743 | return packFloat64(zSign, 0, 0); | ||
744 | normalizeFloat64Subnormal(aSig, &aExp, &aSig); | ||
745 | } | ||
746 | zExp = aExp - bExp + 0x3FD; | ||
747 | aSig = (aSig | LIT64(0x0010000000000000)) << 10; | ||
748 | bSig = (bSig | LIT64(0x0010000000000000)) << 11; | ||
749 | if (bSig <= (aSig + aSig)) { | ||
750 | aSig >>= 1; | ||
751 | ++zExp; | ||
752 | } | ||
753 | zSig = estimateDiv128To64(aSig, 0, bSig); | ||
754 | if ((zSig & 0x1FF) <= 2) { | ||
755 | mul64To128(bSig, zSig, &term0, &term1); | ||
756 | sub128(aSig, 0, term0, term1, &rem0, &rem1); | ||
757 | while ((sbits64) rem0 < 0) { | ||
758 | --zSig; | ||
759 | add128(rem0, rem1, 0, bSig, &rem0, &rem1); | ||
760 | } | ||
761 | zSig |= (rem1 != 0); | ||
762 | } | ||
763 | return roundAndPackFloat64(zSign, zExp, zSig); | ||
764 | |||
765 | } | ||
766 | |||
767 | float32 float32_div(float32 a, float32 b) | ||
768 | { | ||
769 | flag aSign, bSign, zSign; | ||
770 | int16 aExp, bExp, zExp; | ||
771 | bits32 aSig, bSig, zSig; | ||
772 | |||
773 | aSig = extractFloat32Frac(a); | ||
774 | aExp = extractFloat32Exp(a); | ||
775 | aSign = extractFloat32Sign(a); | ||
776 | bSig = extractFloat32Frac(b); | ||
777 | bExp = extractFloat32Exp(b); | ||
778 | bSign = extractFloat32Sign(b); | ||
779 | zSign = aSign ^ bSign; | ||
780 | if (aExp == 0xFF) { | ||
781 | if (bExp == 0xFF) { | ||
782 | } | ||
783 | return packFloat32(zSign, 0xFF, 0); | ||
784 | } | ||
785 | if (bExp == 0xFF) { | ||
786 | return packFloat32(zSign, 0, 0); | ||
787 | } | ||
788 | if (bExp == 0) { | ||
789 | if (bSig == 0) { | ||
790 | return packFloat32(zSign, 0xFF, 0); | ||
791 | } | ||
792 | normalizeFloat32Subnormal(bSig, &bExp, &bSig); | ||
793 | } | ||
794 | if (aExp == 0) { | ||
795 | if (aSig == 0) | ||
796 | return packFloat32(zSign, 0, 0); | ||
797 | normalizeFloat32Subnormal(aSig, &aExp, &aSig); | ||
798 | } | ||
799 | zExp = aExp - bExp + 0x7D; | ||
800 | aSig = (aSig | 0x00800000) << 7; | ||
801 | bSig = (bSig | 0x00800000) << 8; | ||
802 | if (bSig <= (aSig + aSig)) { | ||
803 | aSig >>= 1; | ||
804 | ++zExp; | ||
805 | } | ||
806 | zSig = (((bits64) aSig) << 32) / bSig; | ||
807 | if ((zSig & 0x3F) == 0) { | ||
808 | zSig |= (((bits64) bSig) * zSig != ((bits64) aSig) << 32); | ||
809 | } | ||
810 | return roundAndPackFloat32(zSign, zExp, zSig); | ||
811 | |||
812 | } | ||
813 | |||
814 | float32 float32_mul(float32 a, float32 b) | ||
815 | { | ||
816 | char aSign, bSign, zSign; | ||
817 | int aExp, bExp, zExp; | ||
818 | unsigned int aSig, bSig; | ||
819 | unsigned long long zSig64; | ||
820 | unsigned int zSig; | ||
821 | |||
822 | aSig = extractFloat32Frac(a); | ||
823 | aExp = extractFloat32Exp(a); | ||
824 | aSign = extractFloat32Sign(a); | ||
825 | bSig = extractFloat32Frac(b); | ||
826 | bExp = extractFloat32Exp(b); | ||
827 | bSign = extractFloat32Sign(b); | ||
828 | zSign = aSign ^ bSign; | ||
829 | if (aExp == 0) { | ||
830 | if (aSig == 0) | ||
831 | return packFloat32(zSign, 0, 0); | ||
832 | normalizeFloat32Subnormal(aSig, &aExp, &aSig); | ||
833 | } | ||
834 | if (bExp == 0) { | ||
835 | if (bSig == 0) | ||
836 | return packFloat32(zSign, 0, 0); | ||
837 | normalizeFloat32Subnormal(bSig, &bExp, &bSig); | ||
838 | } | ||
839 | if ((bExp == 0xff && bSig == 0) || (aExp == 0xff && aSig == 0)) | ||
840 | return roundAndPackFloat32(zSign, 0xff, 0); | ||
841 | |||
842 | zExp = aExp + bExp - 0x7F; | ||
843 | aSig = (aSig | 0x00800000) << 7; | ||
844 | bSig = (bSig | 0x00800000) << 8; | ||
845 | shift64RightJamming(((unsigned long long)aSig) * bSig, 32, &zSig64); | ||
846 | zSig = zSig64; | ||
847 | if (0 <= (signed int)(zSig << 1)) { | ||
848 | zSig <<= 1; | ||
849 | --zExp; | ||
850 | } | ||
851 | return roundAndPackFloat32(zSign, zExp, zSig); | ||
852 | |||
853 | } | ||
854 | |||
855 | float64 float64_mul(float64 a, float64 b) | ||
856 | { | ||
857 | char aSign, bSign, zSign; | ||
858 | int aExp, bExp, zExp; | ||
859 | unsigned long long int aSig, bSig, zSig0, zSig1; | ||
860 | |||
861 | aSig = extractFloat64Frac(a); | ||
862 | aExp = extractFloat64Exp(a); | ||
863 | aSign = extractFloat64Sign(a); | ||
864 | bSig = extractFloat64Frac(b); | ||
865 | bExp = extractFloat64Exp(b); | ||
866 | bSign = extractFloat64Sign(b); | ||
867 | zSign = aSign ^ bSign; | ||
868 | |||
869 | if (aExp == 0) { | ||
870 | if (aSig == 0) | ||
871 | return packFloat64(zSign, 0, 0); | ||
872 | normalizeFloat64Subnormal(aSig, &aExp, &aSig); | ||
873 | } | ||
874 | if (bExp == 0) { | ||
875 | if (bSig == 0) | ||
876 | return packFloat64(zSign, 0, 0); | ||
877 | normalizeFloat64Subnormal(bSig, &bExp, &bSig); | ||
878 | } | ||
879 | if ((aExp == 0x7ff && aSig == 0) || (bExp == 0x7ff && bSig == 0)) | ||
880 | return roundAndPackFloat64(zSign, 0x7ff, 0); | ||
881 | |||
882 | zExp = aExp + bExp - 0x3FF; | ||
883 | aSig = (aSig | 0x0010000000000000LL) << 10; | ||
884 | bSig = (bSig | 0x0010000000000000LL) << 11; | ||
885 | mul64To128(aSig, bSig, &zSig0, &zSig1); | ||
886 | zSig0 |= (zSig1 != 0); | ||
887 | if (0 <= (signed long long int)(zSig0 << 1)) { | ||
888 | zSig0 <<= 1; | ||
889 | --zExp; | ||
890 | } | ||
891 | return roundAndPackFloat64(zSign, zExp, zSig0); | ||
892 | } | ||
diff --git a/arch/sh/kernel/cpu/sh4a/Makefile b/arch/sh/kernel/cpu/sh4a/Makefile index 24539873943a..08ac6387bf17 100644 --- a/arch/sh/kernel/cpu/sh4a/Makefile +++ b/arch/sh/kernel/cpu/sh4a/Makefile | |||
@@ -3,6 +3,7 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | # CPU subtype setup | 5 | # CPU subtype setup |
6 | obj-$(CONFIG_CPU_SUBTYPE_SH7763) += setup-sh7763.o | ||
6 | obj-$(CONFIG_CPU_SUBTYPE_SH7770) += setup-sh7770.o | 7 | obj-$(CONFIG_CPU_SUBTYPE_SH7770) += setup-sh7770.o |
7 | obj-$(CONFIG_CPU_SUBTYPE_SH7780) += setup-sh7780.o | 8 | obj-$(CONFIG_CPU_SUBTYPE_SH7780) += setup-sh7780.o |
8 | obj-$(CONFIG_CPU_SUBTYPE_SH7785) += setup-sh7785.o | 9 | obj-$(CONFIG_CPU_SUBTYPE_SH7785) += setup-sh7785.o |
@@ -14,6 +15,7 @@ obj-$(CONFIG_CPU_SUBTYPE_SHX3) += setup-shx3.o | |||
14 | smp-$(CONFIG_CPU_SUBTYPE_SHX3) := smp-shx3.o | 15 | smp-$(CONFIG_CPU_SUBTYPE_SHX3) := smp-shx3.o |
15 | 16 | ||
16 | # Primary on-chip clocks (common) | 17 | # Primary on-chip clocks (common) |
18 | clock-$(CONFIG_CPU_SUBTYPE_SH7763) := clock-sh7763.o | ||
17 | clock-$(CONFIG_CPU_SUBTYPE_SH7770) := clock-sh7770.o | 19 | clock-$(CONFIG_CPU_SUBTYPE_SH7770) := clock-sh7770.o |
18 | clock-$(CONFIG_CPU_SUBTYPE_SH7780) := clock-sh7780.o | 20 | clock-$(CONFIG_CPU_SUBTYPE_SH7780) := clock-sh7780.o |
19 | clock-$(CONFIG_CPU_SUBTYPE_SH7785) := clock-sh7785.o | 21 | clock-$(CONFIG_CPU_SUBTYPE_SH7785) := clock-sh7785.o |
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7763.c b/arch/sh/kernel/cpu/sh4a/clock-sh7763.c new file mode 100644 index 000000000000..45889d412c80 --- /dev/null +++ b/arch/sh/kernel/cpu/sh4a/clock-sh7763.c | |||
@@ -0,0 +1,126 @@ | |||
1 | /* | ||
2 | * arch/sh/kernel/cpu/sh4a/clock-sh7763.c | ||
3 | * | ||
4 | * SH7763 support for the clock framework | ||
5 | * | ||
6 | * Copyright (C) 2005 Paul Mundt | ||
7 | * Copyright (C) 2007 Yoshihiro Shimoda | ||
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 | #include <linux/init.h> | ||
14 | #include <linux/kernel.h> | ||
15 | #include <asm/clock.h> | ||
16 | #include <asm/freq.h> | ||
17 | #include <asm/io.h> | ||
18 | |||
19 | static int bfc_divisors[] = { 1, 1, 1, 8, 1, 1, 1, 1 }; | ||
20 | static int p0fc_divisors[] = { 1, 1, 1, 8, 1, 1, 1, 1 }; | ||
21 | static int p1fc_divisors[] = { 1, 1, 1, 16, 1, 1, 1, 1 }; | ||
22 | static int cfc_divisors[] = { 1, 1, 4, 1, 1, 1, 1, 1 }; | ||
23 | |||
24 | static void master_clk_init(struct clk *clk) | ||
25 | { | ||
26 | clk->rate *= p0fc_divisors[(ctrl_inl(FRQCR) >> 4) & 0x07]; | ||
27 | } | ||
28 | |||
29 | static struct clk_ops sh7763_master_clk_ops = { | ||
30 | .init = master_clk_init, | ||
31 | }; | ||
32 | |||
33 | static void module_clk_recalc(struct clk *clk) | ||
34 | { | ||
35 | int idx = ((ctrl_inl(FRQCR) >> 4) & 0x07); | ||
36 | clk->rate = clk->parent->rate / p0fc_divisors[idx]; | ||
37 | } | ||
38 | |||
39 | static struct clk_ops sh7763_module_clk_ops = { | ||
40 | .recalc = module_clk_recalc, | ||
41 | }; | ||
42 | |||
43 | static void bus_clk_recalc(struct clk *clk) | ||
44 | { | ||
45 | int idx = ((ctrl_inl(FRQCR) >> 16) & 0x07); | ||
46 | clk->rate = clk->parent->rate / bfc_divisors[idx]; | ||
47 | } | ||
48 | |||
49 | static struct clk_ops sh7763_bus_clk_ops = { | ||
50 | .recalc = bus_clk_recalc, | ||
51 | }; | ||
52 | |||
53 | static void cpu_clk_recalc(struct clk *clk) | ||
54 | { | ||
55 | clk->rate = clk->parent->rate; | ||
56 | } | ||
57 | |||
58 | static struct clk_ops sh7763_cpu_clk_ops = { | ||
59 | .recalc = cpu_clk_recalc, | ||
60 | }; | ||
61 | |||
62 | static struct clk_ops *sh7763_clk_ops[] = { | ||
63 | &sh7763_master_clk_ops, | ||
64 | &sh7763_module_clk_ops, | ||
65 | &sh7763_bus_clk_ops, | ||
66 | &sh7763_cpu_clk_ops, | ||
67 | }; | ||
68 | |||
69 | void __init arch_init_clk_ops(struct clk_ops **ops, int idx) | ||
70 | { | ||
71 | if (idx < ARRAY_SIZE(sh7763_clk_ops)) | ||
72 | *ops = sh7763_clk_ops[idx]; | ||
73 | } | ||
74 | |||
75 | static void shyway_clk_recalc(struct clk *clk) | ||
76 | { | ||
77 | int idx = ((ctrl_inl(FRQCR) >> 20) & 0x07); | ||
78 | clk->rate = clk->parent->rate / cfc_divisors[idx]; | ||
79 | } | ||
80 | |||
81 | static struct clk_ops sh7763_shyway_clk_ops = { | ||
82 | .recalc = shyway_clk_recalc, | ||
83 | }; | ||
84 | |||
85 | static struct clk sh7763_shyway_clk = { | ||
86 | .name = "shyway_clk", | ||
87 | .flags = CLK_ALWAYS_ENABLED, | ||
88 | .ops = &sh7763_shyway_clk_ops, | ||
89 | }; | ||
90 | |||
91 | /* | ||
92 | * Additional SH7763-specific on-chip clocks that aren't already part of the | ||
93 | * clock framework | ||
94 | */ | ||
95 | static struct clk *sh7763_onchip_clocks[] = { | ||
96 | &sh7763_shyway_clk, | ||
97 | }; | ||
98 | |||
99 | static int __init sh7763_clk_init(void) | ||
100 | { | ||
101 | struct clk *clk = clk_get(NULL, "master_clk"); | ||
102 | int i; | ||
103 | |||
104 | for (i = 0; i < ARRAY_SIZE(sh7763_onchip_clocks); i++) { | ||
105 | struct clk *clkp = sh7763_onchip_clocks[i]; | ||
106 | |||
107 | clkp->parent = clk; | ||
108 | clk_register(clkp); | ||
109 | clk_enable(clkp); | ||
110 | } | ||
111 | |||
112 | /* | ||
113 | * Now that we have the rest of the clocks registered, we need to | ||
114 | * force the parent clock to propagate so that these clocks will | ||
115 | * automatically figure out their rate. We cheat by handing the | ||
116 | * parent clock its current rate and forcing child propagation. | ||
117 | */ | ||
118 | clk_set_rate(clk, clk_get_rate(clk)); | ||
119 | |||
120 | clk_put(clk); | ||
121 | |||
122 | return 0; | ||
123 | } | ||
124 | |||
125 | arch_initcall(sh7763_clk_init); | ||
126 | |||
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c index b9c6547c4a90..73c778d40d13 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c | |||
@@ -157,14 +157,6 @@ static struct intc_group groups[] __initdata = { | |||
157 | INTC_GROUP(SDHI, SDHI0, SDHI1, SDHI2, SDHI3), | 157 | INTC_GROUP(SDHI, SDHI0, SDHI1, SDHI2, SDHI3), |
158 | }; | 158 | }; |
159 | 159 | ||
160 | static struct intc_prio priorities[] __initdata = { | ||
161 | INTC_PRIO(SCIF0, 3), | ||
162 | INTC_PRIO(SCIF1, 3), | ||
163 | INTC_PRIO(SCIF2, 3), | ||
164 | INTC_PRIO(TMU0, 2), | ||
165 | INTC_PRIO(TMU1, 2), | ||
166 | }; | ||
167 | |||
168 | static struct intc_mask_reg mask_registers[] __initdata = { | 160 | static struct intc_mask_reg mask_registers[] __initdata = { |
169 | { 0xa4080080, 0xa40800c0, 8, /* IMR0 / IMCR0 */ | 161 | { 0xa4080080, 0xa40800c0, 8, /* IMR0 / IMCR0 */ |
170 | { } }, | 162 | { } }, |
@@ -217,7 +209,7 @@ static struct intc_sense_reg sense_registers[] __initdata = { | |||
217 | { IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7 } }, | 209 | { IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7 } }, |
218 | }; | 210 | }; |
219 | 211 | ||
220 | static DECLARE_INTC_DESC(intc_desc, "sh7722", vectors, groups, priorities, | 212 | static DECLARE_INTC_DESC(intc_desc, "sh7722", vectors, groups, |
221 | mask_registers, prio_registers, sense_registers); | 213 | mask_registers, prio_registers, sense_registers); |
222 | 214 | ||
223 | void __init plat_irq_setup(void) | 215 | void __init plat_irq_setup(void) |
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7763.c b/arch/sh/kernel/cpu/sh4a/setup-sh7763.c new file mode 100644 index 000000000000..eabd5386812d --- /dev/null +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7763.c | |||
@@ -0,0 +1,390 @@ | |||
1 | /* | ||
2 | * SH7763 Setup | ||
3 | * | ||
4 | * Copyright (C) 2006 Paul Mundt | ||
5 | * Copyright (C) 2007 Yoshihiro Shimoda | ||
6 | * | ||
7 | * This file is subject to the terms and conditions of the GNU General Public | ||
8 | * License. See the file "COPYING" in the main directory of this archive | ||
9 | * for more details. | ||
10 | */ | ||
11 | #include <linux/platform_device.h> | ||
12 | #include <linux/init.h> | ||
13 | #include <linux/serial.h> | ||
14 | #include <linux/io.h> | ||
15 | #include <asm/sci.h> | ||
16 | |||
17 | static struct resource rtc_resources[] = { | ||
18 | [0] = { | ||
19 | .start = 0xffe80000, | ||
20 | .end = 0xffe80000 + 0x58 - 1, | ||
21 | .flags = IORESOURCE_IO, | ||
22 | }, | ||
23 | [1] = { | ||
24 | /* Period IRQ */ | ||
25 | .start = 21, | ||
26 | .flags = IORESOURCE_IRQ, | ||
27 | }, | ||
28 | [2] = { | ||
29 | /* Carry IRQ */ | ||
30 | .start = 22, | ||
31 | .flags = IORESOURCE_IRQ, | ||
32 | }, | ||
33 | [3] = { | ||
34 | /* Alarm IRQ */ | ||
35 | .start = 20, | ||
36 | .flags = IORESOURCE_IRQ, | ||
37 | }, | ||
38 | }; | ||
39 | |||
40 | static struct platform_device rtc_device = { | ||
41 | .name = "sh-rtc", | ||
42 | .id = -1, | ||
43 | .num_resources = ARRAY_SIZE(rtc_resources), | ||
44 | .resource = rtc_resources, | ||
45 | }; | ||
46 | |||
47 | static struct plat_sci_port sci_platform_data[] = { | ||
48 | { | ||
49 | .mapbase = 0xffe00000, | ||
50 | .flags = UPF_BOOT_AUTOCONF, | ||
51 | .type = PORT_SCIF, | ||
52 | .irqs = { 40, 41, 43, 42 }, | ||
53 | }, { | ||
54 | .mapbase = 0xffe08000, | ||
55 | .flags = UPF_BOOT_AUTOCONF, | ||
56 | .type = PORT_SCIF, | ||
57 | .irqs = { 76, 77, 79, 78 }, | ||
58 | }, { | ||
59 | .flags = 0, | ||
60 | } | ||
61 | }; | ||
62 | |||
63 | static struct platform_device sci_device = { | ||
64 | .name = "sh-sci", | ||
65 | .id = -1, | ||
66 | .dev = { | ||
67 | .platform_data = sci_platform_data, | ||
68 | }, | ||
69 | }; | ||
70 | |||
71 | static struct resource usb_ohci_resources[] = { | ||
72 | [0] = { | ||
73 | .start = 0xffec8000, | ||
74 | .end = 0xffec80ff, | ||
75 | .flags = IORESOURCE_MEM, | ||
76 | }, | ||
77 | [1] = { | ||
78 | .start = 83, | ||
79 | .end = 83, | ||
80 | .flags = IORESOURCE_IRQ, | ||
81 | }, | ||
82 | }; | ||
83 | |||
84 | static u64 usb_ohci_dma_mask = 0xffffffffUL; | ||
85 | static struct platform_device usb_ohci_device = { | ||
86 | .name = "sh_ohci", | ||
87 | .id = -1, | ||
88 | .dev = { | ||
89 | .dma_mask = &usb_ohci_dma_mask, | ||
90 | .coherent_dma_mask = 0xffffffff, | ||
91 | }, | ||
92 | .num_resources = ARRAY_SIZE(usb_ohci_resources), | ||
93 | .resource = usb_ohci_resources, | ||
94 | }; | ||
95 | |||
96 | static struct resource usbf_resources[] = { | ||
97 | [0] = { | ||
98 | .start = 0xffec0000, | ||
99 | .end = 0xffec00ff, | ||
100 | .flags = IORESOURCE_MEM, | ||
101 | }, | ||
102 | [1] = { | ||
103 | .start = 84, | ||
104 | .end = 84, | ||
105 | .flags = IORESOURCE_IRQ, | ||
106 | }, | ||
107 | }; | ||
108 | |||
109 | static struct platform_device usbf_device = { | ||
110 | .name = "sh_udc", | ||
111 | .id = -1, | ||
112 | .dev = { | ||
113 | .dma_mask = NULL, | ||
114 | .coherent_dma_mask = 0xffffffff, | ||
115 | }, | ||
116 | .num_resources = ARRAY_SIZE(usbf_resources), | ||
117 | .resource = usbf_resources, | ||
118 | }; | ||
119 | |||
120 | static struct platform_device *sh7763_devices[] __initdata = { | ||
121 | &rtc_device, | ||
122 | &sci_device, | ||
123 | &usb_ohci_device, | ||
124 | &usbf_device, | ||
125 | }; | ||
126 | |||
127 | static int __init sh7763_devices_setup(void) | ||
128 | { | ||
129 | return platform_add_devices(sh7763_devices, | ||
130 | ARRAY_SIZE(sh7763_devices)); | ||
131 | } | ||
132 | __initcall(sh7763_devices_setup); | ||
133 | |||
134 | enum { | ||
135 | UNUSED = 0, | ||
136 | |||
137 | /* interrupt sources */ | ||
138 | |||
139 | IRL_LLLL, IRL_LLLH, IRL_LLHL, IRL_LLHH, | ||
140 | IRL_LHLL, IRL_LHLH, IRL_LHHL, IRL_LHHH, | ||
141 | IRL_HLLL, IRL_HLLH, IRL_HLHL, IRL_HLHH, | ||
142 | IRL_HHLL, IRL_HHLH, IRL_HHHL, | ||
143 | |||
144 | IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7, | ||
145 | RTC_ATI, RTC_PRI, RTC_CUI, | ||
146 | WDT, TMU0, TMU1, TMU2, TMU2_TICPI, | ||
147 | HUDI, LCDC, | ||
148 | DMAC0_DMINT0, DMAC0_DMINT1, DMAC0_DMINT2, DMAC0_DMINT3, DMAC0_DMAE, | ||
149 | SCIF0_ERI, SCIF0_RXI, SCIF0_BRI, SCIF0_TXI, | ||
150 | DMAC0_DMINT4, DMAC0_DMINT5, | ||
151 | IIC0, IIC1, | ||
152 | CMT, | ||
153 | GEINT0, GEINT1, GEINT2, | ||
154 | HAC, | ||
155 | PCISERR, PCIINTA, PCIINTB, PCIINTC, PCIINTD, | ||
156 | PCIERR, PCIPWD3, PCIPWD2, PCIPWD1, PCIPWD0, | ||
157 | STIF0, STIF1, | ||
158 | SCIF1_ERI, SCIF1_RXI, SCIF1_BRI, SCIF1_TXI, | ||
159 | SIOF0, SIOF1, SIOF2, | ||
160 | USBH, USBFI0, USBFI1, | ||
161 | TPU, PCC, | ||
162 | MMCIF_FSTAT, MMCIF_TRAN, MMCIF_ERR, MMCIF_FRDY, | ||
163 | SIM_ERI, SIM_RXI, SIM_TXI, SIM_TEND, | ||
164 | TMU3, TMU4, TMU5, ADC, SSI0, SSI1, SSI2, SSI3, | ||
165 | SCIF2_ERI, SCIF2_RXI, SCIF2_BRI, SCIF2_TXI, | ||
166 | GPIO_CH0, GPIO_CH1, GPIO_CH2, GPIO_CH3, | ||
167 | |||
168 | /* interrupt groups */ | ||
169 | |||
170 | TMU012, TMU345, RTC, DMAC, SCIF0, GETHER, PCIC5, | ||
171 | SCIF1, USBF, MMCIF, SIM, SCIF2, GPIO, | ||
172 | }; | ||
173 | |||
174 | static struct intc_vect vectors[] __initdata = { | ||
175 | INTC_VECT(RTC_ATI, 0x480), INTC_VECT(RTC_PRI, 0x4a0), | ||
176 | INTC_VECT(RTC_CUI, 0x4c0), | ||
177 | INTC_VECT(WDT, 0x560), INTC_VECT(TMU0, 0x580), | ||
178 | INTC_VECT(TMU1, 0x5a0), INTC_VECT(TMU2, 0x5c0), | ||
179 | INTC_VECT(TMU2_TICPI, 0x5e0), INTC_VECT(HUDI, 0x600), | ||
180 | INTC_VECT(LCDC, 0x620), | ||
181 | INTC_VECT(DMAC0_DMINT0, 0x640), INTC_VECT(DMAC0_DMINT1, 0x660), | ||
182 | INTC_VECT(DMAC0_DMINT2, 0x680), INTC_VECT(DMAC0_DMINT3, 0x6a0), | ||
183 | INTC_VECT(DMAC0_DMAE, 0x6c0), | ||
184 | INTC_VECT(SCIF0_ERI, 0x700), INTC_VECT(SCIF0_RXI, 0x720), | ||
185 | INTC_VECT(SCIF0_BRI, 0x740), INTC_VECT(SCIF0_TXI, 0x760), | ||
186 | INTC_VECT(DMAC0_DMINT4, 0x780), INTC_VECT(DMAC0_DMINT5, 0x7a0), | ||
187 | INTC_VECT(IIC0, 0x8A0), INTC_VECT(IIC1, 0x8C0), | ||
188 | INTC_VECT(CMT, 0x900), INTC_VECT(GEINT0, 0x920), | ||
189 | INTC_VECT(GEINT1, 0x940), INTC_VECT(GEINT2, 0x960), | ||
190 | INTC_VECT(HAC, 0x980), | ||
191 | INTC_VECT(PCISERR, 0xa00), INTC_VECT(PCIINTA, 0xa20), | ||
192 | INTC_VECT(PCIINTB, 0xa40), INTC_VECT(PCIINTC, 0xa60), | ||
193 | INTC_VECT(PCIINTD, 0xa80), INTC_VECT(PCIERR, 0xaa0), | ||
194 | INTC_VECT(PCIPWD3, 0xac0), INTC_VECT(PCIPWD2, 0xae0), | ||
195 | INTC_VECT(PCIPWD1, 0xb00), INTC_VECT(PCIPWD0, 0xb20), | ||
196 | INTC_VECT(STIF0, 0xb40), INTC_VECT(STIF1, 0xb60), | ||
197 | INTC_VECT(SCIF1_ERI, 0xb80), INTC_VECT(SCIF1_RXI, 0xba0), | ||
198 | INTC_VECT(SCIF1_BRI, 0xbc0), INTC_VECT(SCIF1_TXI, 0xbe0), | ||
199 | INTC_VECT(SIOF0, 0xc00), INTC_VECT(SIOF1, 0xc20), | ||
200 | INTC_VECT(USBH, 0xc60), INTC_VECT(USBFI0, 0xc80), | ||
201 | INTC_VECT(USBFI1, 0xca0), | ||
202 | INTC_VECT(TPU, 0xcc0), INTC_VECT(PCC, 0xce0), | ||
203 | INTC_VECT(MMCIF_FSTAT, 0xd00), INTC_VECT(MMCIF_TRAN, 0xd20), | ||
204 | INTC_VECT(MMCIF_ERR, 0xd40), INTC_VECT(MMCIF_FRDY, 0xd60), | ||
205 | INTC_VECT(SIM_ERI, 0xd80), INTC_VECT(SIM_RXI, 0xda0), | ||
206 | INTC_VECT(SIM_TXI, 0xdc0), INTC_VECT(SIM_TEND, 0xde0), | ||
207 | INTC_VECT(TMU3, 0xe00), INTC_VECT(TMU4, 0xe20), | ||
208 | INTC_VECT(TMU5, 0xe40), INTC_VECT(ADC, 0xe60), | ||
209 | INTC_VECT(SSI0, 0xe80), INTC_VECT(SSI1, 0xea0), | ||
210 | INTC_VECT(SSI2, 0xec0), INTC_VECT(SSI3, 0xee0), | ||
211 | INTC_VECT(SCIF1_ERI, 0xf00), INTC_VECT(SCIF1_RXI, 0xf20), | ||
212 | INTC_VECT(SCIF1_BRI, 0xf40), INTC_VECT(SCIF1_TXI, 0xf60), | ||
213 | INTC_VECT(GPIO_CH0, 0xf80), INTC_VECT(GPIO_CH1, 0xfa0), | ||
214 | INTC_VECT(GPIO_CH2, 0xfc0), INTC_VECT(GPIO_CH3, 0xfe0), | ||
215 | }; | ||
216 | |||
217 | static struct intc_group groups[] __initdata = { | ||
218 | INTC_GROUP(TMU012, TMU0, TMU1, TMU2, TMU2_TICPI), | ||
219 | INTC_GROUP(TMU345, TMU3, TMU4, TMU5), | ||
220 | INTC_GROUP(RTC, RTC_ATI, RTC_PRI, RTC_CUI), | ||
221 | INTC_GROUP(DMAC, DMAC0_DMINT0, DMAC0_DMINT1, DMAC0_DMINT2, | ||
222 | DMAC0_DMINT3, DMAC0_DMINT4, DMAC0_DMINT5, DMAC0_DMAE), | ||
223 | INTC_GROUP(SCIF0, SCIF0_ERI, SCIF0_RXI, SCIF0_BRI, SCIF0_TXI), | ||
224 | INTC_GROUP(GETHER, GEINT0, GEINT1, GEINT2), | ||
225 | INTC_GROUP(PCIC5, PCIERR, PCIPWD3, PCIPWD2, PCIPWD1, PCIPWD0), | ||
226 | INTC_GROUP(SCIF1, SCIF1_ERI, SCIF1_RXI, SCIF1_BRI, SCIF1_TXI), | ||
227 | INTC_GROUP(USBF, USBFI0, USBFI1), | ||
228 | INTC_GROUP(MMCIF, MMCIF_FSTAT, MMCIF_TRAN, MMCIF_ERR, MMCIF_FRDY), | ||
229 | INTC_GROUP(SIM, SIM_ERI, SIM_RXI, SIM_TXI, SIM_TEND), | ||
230 | INTC_GROUP(SCIF2, SCIF2_ERI, SCIF2_RXI, SCIF2_BRI, SCIF2_TXI), | ||
231 | INTC_GROUP(GPIO, GPIO_CH0, GPIO_CH1, GPIO_CH2, GPIO_CH3), | ||
232 | }; | ||
233 | |||
234 | static struct intc_prio priorities[] __initdata = { | ||
235 | INTC_PRIO(SCIF0, 3), | ||
236 | INTC_PRIO(SCIF1, 3), | ||
237 | INTC_PRIO(SCIF2, 3), | ||
238 | }; | ||
239 | |||
240 | static struct intc_mask_reg mask_registers[] __initdata = { | ||
241 | { 0xffd40038, 0xffd4003c, 32, /* INT2MSKR / INT2MSKCR */ | ||
242 | { 0, 0, 0, 0, 0, 0, GPIO, 0, | ||
243 | SSI0, MMCIF, 0, SIOF0, PCIC5, PCIINTD, PCIINTC, PCIINTB, | ||
244 | PCIINTA, PCISERR, HAC, CMT, 0, 0, 0, DMAC, | ||
245 | HUDI, 0, WDT, SCIF1, SCIF0, RTC, TMU345, TMU012 } }, | ||
246 | { 0xffd400d0, 0xffd400d4, 32, /* INT2MSKR1 / INT2MSKCR1 */ | ||
247 | { 0, 0, 0, 0, 0, 0, SCIF2, USBF, | ||
248 | 0, 0, STIF1, STIF0, 0, 0, USBH, GETHER, | ||
249 | PCC, 0, 0, ADC, TPU, SIM, SIOF2, SIOF1, | ||
250 | LCDC, 0, IIC1, IIC0, SSI3, SSI2, SSI1, 0 } }, | ||
251 | }; | ||
252 | |||
253 | static struct intc_prio_reg prio_registers[] __initdata = { | ||
254 | { 0xffd40000, 0, 32, 8, /* INT2PRI0 */ { TMU0, TMU1, | ||
255 | TMU2, TMU2_TICPI } }, | ||
256 | { 0xffd40004, 0, 32, 8, /* INT2PRI1 */ { TMU3, TMU4, TMU5, RTC } }, | ||
257 | { 0xffd40008, 0, 32, 8, /* INT2PRI2 */ { SCIF0, SCIF1, WDT } }, | ||
258 | { 0xffd4000c, 0, 32, 8, /* INT2PRI3 */ { HUDI, DMAC, ADC } }, | ||
259 | { 0xffd40010, 0, 32, 8, /* INT2PRI4 */ { CMT, HAC, | ||
260 | PCISERR, PCIINTA } }, | ||
261 | { 0xffd40014, 0, 32, 8, /* INT2PRI5 */ { PCIINTB, PCIINTC, | ||
262 | PCIINTD, PCIC5 } }, | ||
263 | { 0xffd40018, 0, 32, 8, /* INT2PRI6 */ { SIOF0, USBF, MMCIF, SSI0 } }, | ||
264 | { 0xffd4001c, 0, 32, 8, /* INT2PRI7 */ { SCIF2, GPIO } }, | ||
265 | { 0xffd400a0, 0, 32, 8, /* INT2PRI8 */ { SSI3, SSI2, SSI1, 0 } }, | ||
266 | { 0xffd400a4, 0, 32, 8, /* INT2PRI9 */ { LCDC, 0, IIC1, IIC0 } }, | ||
267 | { 0xffd400a8, 0, 32, 8, /* INT2PRI10 */ { TPU, SIM, SIOF2, SIOF1 } }, | ||
268 | { 0xffd400ac, 0, 32, 8, /* INT2PRI11 */ { PCC } }, | ||
269 | { 0xffd400b0, 0, 32, 8, /* INT2PRI12 */ { 0, 0, USBH, GETHER } }, | ||
270 | { 0xffd400b4, 0, 32, 8, /* INT2PRI13 */ { 0, 0, STIF1, STIF0 } }, | ||
271 | }; | ||
272 | |||
273 | static DECLARE_INTC_DESC(intc_desc, "sh7763", vectors, groups, priorities, | ||
274 | mask_registers, prio_registers, NULL); | ||
275 | |||
276 | /* Support for external interrupt pins in IRQ mode */ | ||
277 | |||
278 | static struct intc_vect irq_vectors[] __initdata = { | ||
279 | INTC_VECT(IRQ0, 0x240), INTC_VECT(IRQ1, 0x280), | ||
280 | INTC_VECT(IRQ2, 0x2c0), INTC_VECT(IRQ3, 0x300), | ||
281 | INTC_VECT(IRQ4, 0x340), INTC_VECT(IRQ5, 0x380), | ||
282 | INTC_VECT(IRQ6, 0x3c0), INTC_VECT(IRQ7, 0x200), | ||
283 | }; | ||
284 | |||
285 | static struct intc_mask_reg irq_mask_registers[] __initdata = { | ||
286 | { 0xffd00044, 0xffd00064, 32, /* INTMSK0 / INTMSKCLR0 */ | ||
287 | { IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7 } }, | ||
288 | }; | ||
289 | |||
290 | static struct intc_prio_reg irq_prio_registers[] __initdata = { | ||
291 | { 0xffd00010, 0, 32, 4, /* INTPRI */ { IRQ0, IRQ1, IRQ2, IRQ3, | ||
292 | IRQ4, IRQ5, IRQ6, IRQ7 } }, | ||
293 | }; | ||
294 | |||
295 | static struct intc_sense_reg irq_sense_registers[] __initdata = { | ||
296 | { 0xffd0001c, 32, 2, /* ICR1 */ { IRQ0, IRQ1, IRQ2, IRQ3, | ||
297 | IRQ4, IRQ5, IRQ6, IRQ7 } }, | ||
298 | }; | ||
299 | |||
300 | static DECLARE_INTC_DESC(intc_irq_desc, "sh7763-irq", irq_vectors, | ||
301 | NULL, NULL, irq_mask_registers, irq_prio_registers, | ||
302 | irq_sense_registers); | ||
303 | |||
304 | /* External interrupt pins in IRL mode */ | ||
305 | |||
306 | static struct intc_vect irl_vectors[] __initdata = { | ||
307 | INTC_VECT(IRL_LLLL, 0x200), INTC_VECT(IRL_LLLH, 0x220), | ||
308 | INTC_VECT(IRL_LLHL, 0x240), INTC_VECT(IRL_LLHH, 0x260), | ||
309 | INTC_VECT(IRL_LHLL, 0x280), INTC_VECT(IRL_LHLH, 0x2a0), | ||
310 | INTC_VECT(IRL_LHHL, 0x2c0), INTC_VECT(IRL_LHHH, 0x2e0), | ||
311 | INTC_VECT(IRL_HLLL, 0x300), INTC_VECT(IRL_HLLH, 0x320), | ||
312 | INTC_VECT(IRL_HLHL, 0x340), INTC_VECT(IRL_HLHH, 0x360), | ||
313 | INTC_VECT(IRL_HHLL, 0x380), INTC_VECT(IRL_HHLH, 0x3a0), | ||
314 | INTC_VECT(IRL_HHHL, 0x3c0), | ||
315 | }; | ||
316 | |||
317 | static struct intc_mask_reg irl3210_mask_registers[] __initdata = { | ||
318 | { 0xffd40080, 0xffd40084, 32, /* INTMSK2 / INTMSKCLR2 */ | ||
319 | { IRL_LLLL, IRL_LLLH, IRL_LLHL, IRL_LLHH, | ||
320 | IRL_LHLL, IRL_LHLH, IRL_LHHL, IRL_LHHH, | ||
321 | IRL_HLLL, IRL_HLLH, IRL_HLHL, IRL_HLHH, | ||
322 | IRL_HHLL, IRL_HHLH, IRL_HHHL, } }, | ||
323 | }; | ||
324 | |||
325 | static struct intc_mask_reg irl7654_mask_registers[] __initdata = { | ||
326 | { 0xffd40080, 0xffd40084, 32, /* INTMSK2 / INTMSKCLR2 */ | ||
327 | { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
328 | IRL_LLLL, IRL_LLLH, IRL_LLHL, IRL_LLHH, | ||
329 | IRL_LHLL, IRL_LHLH, IRL_LHHL, IRL_LHHH, | ||
330 | IRL_HLLL, IRL_HLLH, IRL_HLHL, IRL_HLHH, | ||
331 | IRL_HHLL, IRL_HHLH, IRL_HHHL, } }, | ||
332 | }; | ||
333 | |||
334 | static DECLARE_INTC_DESC(intc_irl7654_desc, "sh7763-irl7654", irl_vectors, | ||
335 | NULL, NULL, irl7654_mask_registers, NULL, NULL); | ||
336 | |||
337 | static DECLARE_INTC_DESC(intc_irl3210_desc, "sh7763-irl3210", irl_vectors, | ||
338 | NULL, NULL, irl3210_mask_registers, NULL, NULL); | ||
339 | |||
340 | #define INTC_ICR0 0xffd00000 | ||
341 | #define INTC_INTMSK0 0xffd00044 | ||
342 | #define INTC_INTMSK1 0xffd00048 | ||
343 | #define INTC_INTMSK2 0xffd40080 | ||
344 | #define INTC_INTMSKCLR1 0xffd00068 | ||
345 | #define INTC_INTMSKCLR2 0xffd40084 | ||
346 | |||
347 | void __init plat_irq_setup(void) | ||
348 | { | ||
349 | /* disable IRQ7-0 */ | ||
350 | ctrl_outl(0xff000000, INTC_INTMSK0); | ||
351 | |||
352 | /* disable IRL3-0 + IRL7-4 */ | ||
353 | ctrl_outl(0xc0000000, INTC_INTMSK1); | ||
354 | ctrl_outl(0xfffefffe, INTC_INTMSK2); | ||
355 | |||
356 | register_intc_controller(&intc_desc); | ||
357 | } | ||
358 | |||
359 | void __init plat_irq_setup_pins(int mode) | ||
360 | { | ||
361 | switch (mode) { | ||
362 | case IRQ_MODE_IRQ: | ||
363 | /* select IRQ mode for IRL3-0 + IRL7-4 */ | ||
364 | ctrl_outl(ctrl_inl(INTC_ICR0) | 0x00c00000, INTC_ICR0); | ||
365 | register_intc_controller(&intc_irq_desc); | ||
366 | break; | ||
367 | case IRQ_MODE_IRL7654: | ||
368 | /* enable IRL7-4 but don't provide any masking */ | ||
369 | ctrl_outl(0x40000000, INTC_INTMSKCLR1); | ||
370 | ctrl_outl(0x0000fffe, INTC_INTMSKCLR2); | ||
371 | break; | ||
372 | case IRQ_MODE_IRL3210: | ||
373 | /* enable IRL0-3 but don't provide any masking */ | ||
374 | ctrl_outl(0x80000000, INTC_INTMSKCLR1); | ||
375 | ctrl_outl(0xfffe0000, INTC_INTMSKCLR2); | ||
376 | break; | ||
377 | case IRQ_MODE_IRL7654_MASK: | ||
378 | /* enable IRL7-4 and mask using cpu intc controller */ | ||
379 | ctrl_outl(0x40000000, INTC_INTMSKCLR1); | ||
380 | register_intc_controller(&intc_irl7654_desc); | ||
381 | break; | ||
382 | case IRQ_MODE_IRL3210_MASK: | ||
383 | /* enable IRL0-3 and mask using cpu intc controller */ | ||
384 | ctrl_outl(0x80000000, INTC_INTMSKCLR1); | ||
385 | register_intc_controller(&intc_irl3210_desc); | ||
386 | break; | ||
387 | default: | ||
388 | BUG(); | ||
389 | } | ||
390 | } | ||
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7780.c b/arch/sh/kernel/cpu/sh4a/setup-sh7780.c index e8fd33ff0605..293004b526ff 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7780.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7780.c | |||
@@ -168,11 +168,6 @@ static struct intc_group groups[] __initdata = { | |||
168 | INTC_GROUP(GPIO, GPIOI0, GPIOI1, GPIOI2, GPIOI3), | 168 | INTC_GROUP(GPIO, GPIOI0, GPIOI1, GPIOI2, GPIOI3), |
169 | }; | 169 | }; |
170 | 170 | ||
171 | static struct intc_prio priorities[] __initdata = { | ||
172 | INTC_PRIO(SCIF0, 3), | ||
173 | INTC_PRIO(SCIF1, 3), | ||
174 | }; | ||
175 | |||
176 | static struct intc_mask_reg mask_registers[] __initdata = { | 171 | static struct intc_mask_reg mask_registers[] __initdata = { |
177 | { 0xffd40038, 0xffd4003c, 32, /* INT2MSKR / INT2MSKCR */ | 172 | { 0xffd40038, 0xffd4003c, 32, /* INT2MSKR / INT2MSKCR */ |
178 | { 0, 0, 0, 0, 0, 0, GPIO, FLCTL, | 173 | { 0, 0, 0, 0, 0, 0, GPIO, FLCTL, |
@@ -195,7 +190,7 @@ static struct intc_prio_reg prio_registers[] __initdata = { | |||
195 | { 0xffd4001c, 0, 32, 8, /* INT2PRI7 */ { FLCTL, GPIO } }, | 190 | { 0xffd4001c, 0, 32, 8, /* INT2PRI7 */ { FLCTL, GPIO } }, |
196 | }; | 191 | }; |
197 | 192 | ||
198 | static DECLARE_INTC_DESC(intc_desc, "sh7780", vectors, groups, priorities, | 193 | static DECLARE_INTC_DESC(intc_desc, "sh7780", vectors, groups, |
199 | mask_registers, prio_registers, NULL); | 194 | mask_registers, prio_registers, NULL); |
200 | 195 | ||
201 | /* Support for external interrupt pins in IRQ mode */ | 196 | /* Support for external interrupt pins in IRQ mode */ |
@@ -223,7 +218,7 @@ static struct intc_sense_reg irq_sense_registers[] __initdata = { | |||
223 | }; | 218 | }; |
224 | 219 | ||
225 | static DECLARE_INTC_DESC(intc_irq_desc, "sh7780-irq", irq_vectors, | 220 | static DECLARE_INTC_DESC(intc_irq_desc, "sh7780-irq", irq_vectors, |
226 | NULL, NULL, irq_mask_registers, irq_prio_registers, | 221 | NULL, irq_mask_registers, irq_prio_registers, |
227 | irq_sense_registers); | 222 | irq_sense_registers); |
228 | 223 | ||
229 | /* External interrupt pins in IRL mode */ | 224 | /* External interrupt pins in IRL mode */ |
@@ -257,10 +252,10 @@ static struct intc_mask_reg irl7654_mask_registers[] __initdata = { | |||
257 | }; | 252 | }; |
258 | 253 | ||
259 | static DECLARE_INTC_DESC(intc_irl7654_desc, "sh7780-irl7654", irl_vectors, | 254 | static DECLARE_INTC_DESC(intc_irl7654_desc, "sh7780-irl7654", irl_vectors, |
260 | NULL, NULL, irl7654_mask_registers, NULL, NULL); | 255 | NULL, irl7654_mask_registers, NULL, NULL); |
261 | 256 | ||
262 | static DECLARE_INTC_DESC(intc_irl3210_desc, "sh7780-irl3210", irl_vectors, | 257 | static DECLARE_INTC_DESC(intc_irl3210_desc, "sh7780-irl3210", irl_vectors, |
263 | NULL, NULL, irl3210_mask_registers, NULL, NULL); | 258 | NULL, irl3210_mask_registers, NULL, NULL); |
264 | 259 | ||
265 | #define INTC_ICR0 0xffd00000 | 260 | #define INTC_ICR0 0xffd00000 |
266 | #define INTC_INTMSK0 0xffd00044 | 261 | #define INTC_INTMSK0 0xffd00044 |
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7785.c b/arch/sh/kernel/cpu/sh4a/setup-sh7785.c index 39b215d6cee5..74b60e96cdf4 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7785.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7785.c | |||
@@ -178,15 +178,6 @@ static struct intc_group groups[] __initdata = { | |||
178 | INTC_GROUP(GPIO, GPIOI0, GPIOI1, GPIOI2, GPIOI3), | 178 | INTC_GROUP(GPIO, GPIOI0, GPIOI1, GPIOI2, GPIOI3), |
179 | }; | 179 | }; |
180 | 180 | ||
181 | static struct intc_prio priorities[] __initdata = { | ||
182 | INTC_PRIO(SCIF0, 3), | ||
183 | INTC_PRIO(SCIF1, 3), | ||
184 | INTC_PRIO(SCIF2, 3), | ||
185 | INTC_PRIO(SCIF3, 3), | ||
186 | INTC_PRIO(SCIF4, 3), | ||
187 | INTC_PRIO(SCIF5, 3), | ||
188 | }; | ||
189 | |||
190 | static struct intc_mask_reg mask_registers[] __initdata = { | 181 | static struct intc_mask_reg mask_registers[] __initdata = { |
191 | { 0xffd00044, 0xffd00064, 32, /* INTMSK0 / INTMSKCLR0 */ | 182 | { 0xffd00044, 0xffd00064, 32, /* INTMSK0 / INTMSKCLR0 */ |
192 | { IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7 } }, | 183 | { IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7 } }, |
@@ -227,7 +218,7 @@ static struct intc_prio_reg prio_registers[] __initdata = { | |||
227 | { 0xffd40024, 0, 32, 8, /* INT2PRI9 */ { DU, GDTA, } }, | 218 | { 0xffd40024, 0, 32, 8, /* INT2PRI9 */ { DU, GDTA, } }, |
228 | }; | 219 | }; |
229 | 220 | ||
230 | static DECLARE_INTC_DESC(intc_desc, "sh7785", vectors, groups, priorities, | 221 | static DECLARE_INTC_DESC(intc_desc, "sh7785", vectors, groups, |
231 | mask_registers, prio_registers, NULL); | 222 | mask_registers, prio_registers, NULL); |
232 | 223 | ||
233 | /* Support for external interrupt pins in IRQ mode */ | 224 | /* Support for external interrupt pins in IRQ mode */ |
@@ -248,11 +239,11 @@ static struct intc_sense_reg sense_registers[] __initdata = { | |||
248 | }; | 239 | }; |
249 | 240 | ||
250 | static DECLARE_INTC_DESC(intc_desc_irq0123, "sh7785-irq0123", vectors_irq0123, | 241 | static DECLARE_INTC_DESC(intc_desc_irq0123, "sh7785-irq0123", vectors_irq0123, |
251 | NULL, NULL, mask_registers, prio_registers, | 242 | NULL, mask_registers, prio_registers, |
252 | sense_registers); | 243 | sense_registers); |
253 | 244 | ||
254 | static DECLARE_INTC_DESC(intc_desc_irq4567, "sh7785-irq4567", vectors_irq4567, | 245 | static DECLARE_INTC_DESC(intc_desc_irq4567, "sh7785-irq4567", vectors_irq4567, |
255 | NULL, NULL, mask_registers, prio_registers, | 246 | NULL, mask_registers, prio_registers, |
256 | sense_registers); | 247 | sense_registers); |
257 | 248 | ||
258 | /* External interrupt pins in IRL mode */ | 249 | /* External interrupt pins in IRL mode */ |
@@ -280,10 +271,10 @@ static struct intc_vect vectors_irl4567[] __initdata = { | |||
280 | }; | 271 | }; |
281 | 272 | ||
282 | static DECLARE_INTC_DESC(intc_desc_irl0123, "sh7785-irl0123", vectors_irl0123, | 273 | static DECLARE_INTC_DESC(intc_desc_irl0123, "sh7785-irl0123", vectors_irl0123, |
283 | NULL, NULL, mask_registers, NULL, NULL); | 274 | NULL, mask_registers, NULL, NULL); |
284 | 275 | ||
285 | static DECLARE_INTC_DESC(intc_desc_irl4567, "sh7785-irl4567", vectors_irl4567, | 276 | static DECLARE_INTC_DESC(intc_desc_irl4567, "sh7785-irl4567", vectors_irl4567, |
286 | NULL, NULL, mask_registers, NULL, NULL); | 277 | NULL, mask_registers, NULL, NULL); |
287 | 278 | ||
288 | #define INTC_ICR0 0xffd00000 | 279 | #define INTC_ICR0 0xffd00000 |
289 | #define INTC_INTMSK0 0xffd00044 | 280 | #define INTC_INTMSK0 0xffd00044 |
diff --git a/arch/sh/kernel/cpu/sh4a/setup-shx3.c b/arch/sh/kernel/cpu/sh4a/setup-shx3.c index c6cdd7e3b049..4dc958b6b314 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-shx3.c +++ b/arch/sh/kernel/cpu/sh4a/setup-shx3.c | |||
@@ -165,13 +165,6 @@ static struct intc_group groups[] __initdata = { | |||
165 | INTC_GROUP(DTU3, DTU3_TEND, DTU3_AE, DTU3_TMISS), | 165 | INTC_GROUP(DTU3, DTU3_TEND, DTU3_AE, DTU3_TMISS), |
166 | }; | 166 | }; |
167 | 167 | ||
168 | static struct intc_prio priorities[] __initdata = { | ||
169 | INTC_PRIO(SCIF0, 3), | ||
170 | INTC_PRIO(SCIF1, 3), | ||
171 | INTC_PRIO(SCIF2, 3), | ||
172 | INTC_PRIO(SCIF3, 3), | ||
173 | }; | ||
174 | |||
175 | static struct intc_mask_reg mask_registers[] __initdata = { | 168 | static struct intc_mask_reg mask_registers[] __initdata = { |
176 | { 0xfe410030, 0xfe410050, 32, /* CnINTMSK0 / CnINTMSKCLR0 */ | 169 | { 0xfe410030, 0xfe410050, 32, /* CnINTMSK0 / CnINTMSKCLR0 */ |
177 | { IRQ0, IRQ1, IRQ2, IRQ3 } }, | 170 | { IRQ0, IRQ1, IRQ2, IRQ3 } }, |
@@ -218,7 +211,7 @@ static struct intc_prio_reg prio_registers[] __initdata = { | |||
218 | INTICI3, INTICI2, INTICI1, INTICI0 }, INTC_SMP(4, 4) }, | 211 | INTICI3, INTICI2, INTICI1, INTICI0 }, INTC_SMP(4, 4) }, |
219 | }; | 212 | }; |
220 | 213 | ||
221 | static DECLARE_INTC_DESC(intc_desc, "shx3", vectors, groups, priorities, | 214 | static DECLARE_INTC_DESC(intc_desc, "shx3", vectors, groups, |
222 | mask_registers, prio_registers, NULL); | 215 | mask_registers, prio_registers, NULL); |
223 | 216 | ||
224 | /* Support for external interrupt pins in IRQ mode */ | 217 | /* Support for external interrupt pins in IRQ mode */ |
@@ -232,8 +225,7 @@ static struct intc_sense_reg sense_registers[] __initdata = { | |||
232 | }; | 225 | }; |
233 | 226 | ||
234 | static DECLARE_INTC_DESC(intc_desc_irq, "shx3-irq", vectors_irq, groups, | 227 | static DECLARE_INTC_DESC(intc_desc_irq, "shx3-irq", vectors_irq, groups, |
235 | priorities, mask_registers, prio_registers, | 228 | mask_registers, prio_registers, sense_registers); |
236 | sense_registers); | ||
237 | 229 | ||
238 | /* External interrupt pins in IRL mode */ | 230 | /* External interrupt pins in IRL mode */ |
239 | static struct intc_vect vectors_irl[] __initdata = { | 231 | static struct intc_vect vectors_irl[] __initdata = { |
@@ -248,7 +240,7 @@ static struct intc_vect vectors_irl[] __initdata = { | |||
248 | }; | 240 | }; |
249 | 241 | ||
250 | static DECLARE_INTC_DESC(intc_desc_irl, "shx3-irl", vectors_irl, groups, | 242 | static DECLARE_INTC_DESC(intc_desc_irl, "shx3-irl", vectors_irl, groups, |
251 | priorities, mask_registers, prio_registers, NULL); | 243 | mask_registers, prio_registers, NULL); |
252 | 244 | ||
253 | void __init plat_irq_setup_pins(int mode) | 245 | void __init plat_irq_setup_pins(int mode) |
254 | { | 246 | { |
diff --git a/arch/sh/kernel/cpu/sh5/Makefile b/arch/sh/kernel/cpu/sh5/Makefile new file mode 100644 index 000000000000..8646363e9ded --- /dev/null +++ b/arch/sh/kernel/cpu/sh5/Makefile | |||
@@ -0,0 +1,7 @@ | |||
1 | # | ||
2 | # Makefile for the Linux/SuperH SH-5 backends. | ||
3 | # | ||
4 | obj-y := entry.o probe.o switchto.o | ||
5 | |||
6 | obj-$(CONFIG_SH_FPU) += fpu.o | ||
7 | obj-$(CONFIG_KALLSYMS) += unwind.o | ||
diff --git a/arch/sh64/kernel/entry.S b/arch/sh/kernel/cpu/sh5/entry.S index 7013fcb6665c..ba8750176d91 100644 --- a/arch/sh64/kernel/entry.S +++ b/arch/sh/kernel/cpu/sh5/entry.S | |||
@@ -1,21 +1,18 @@ | |||
1 | /* | 1 | /* |
2 | * This file is subject to the terms and conditions of the GNU General Public | 2 | * arch/sh/kernel/cpu/sh5/entry.S |
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * arch/sh64/kernel/entry.S | ||
7 | * | 3 | * |
8 | * Copyright (C) 2000, 2001 Paolo Alberelli | 4 | * Copyright (C) 2000, 2001 Paolo Alberelli |
9 | * Copyright (C) 2004, 2005 Paul Mundt | 5 | * Copyright (C) 2004 - 2007 Paul Mundt |
10 | * Copyright (C) 2003, 2004 Richard Curnow | 6 | * Copyright (C) 2003, 2004 Richard Curnow |
11 | * | 7 | * |
8 | * This file is subject to the terms and conditions of the GNU General Public | ||
9 | * License. See the file "COPYING" in the main directory of this archive | ||
10 | * for more details. | ||
12 | */ | 11 | */ |
13 | |||
14 | #include <linux/errno.h> | 12 | #include <linux/errno.h> |
15 | #include <linux/sys.h> | 13 | #include <linux/sys.h> |
16 | 14 | #include <asm/cpu/registers.h> | |
17 | #include <asm/processor.h> | 15 | #include <asm/processor.h> |
18 | #include <asm/registers.h> | ||
19 | #include <asm/unistd.h> | 16 | #include <asm/unistd.h> |
20 | #include <asm/thread_info.h> | 17 | #include <asm/thread_info.h> |
21 | #include <asm/asm-offsets.h> | 18 | #include <asm/asm-offsets.h> |
@@ -163,7 +160,7 @@ trap_jtable: | |||
163 | .long system_call /* 0x160 */ | 160 | .long system_call /* 0x160 */ |
164 | .long do_reserved_inst /* 0x180 */ | 161 | .long do_reserved_inst /* 0x180 */ |
165 | .long do_illegal_slot_inst /* 0x1A0 */ | 162 | .long do_illegal_slot_inst /* 0x1A0 */ |
166 | .long do_NMI /* 0x1C0 */ | 163 | .long do_exception_error /* 0x1C0 - NMI */ |
167 | .long do_exception_error /* 0x1E0 */ | 164 | .long do_exception_error /* 0x1E0 */ |
168 | .rept 15 | 165 | .rept 15 |
169 | .long do_IRQ /* 0x200 - 0x3C0 */ | 166 | .long do_IRQ /* 0x200 - 0x3C0 */ |
@@ -434,7 +431,7 @@ reset_or_panic: | |||
434 | synco /* TAKum03020 (but probably a good idea anyway.) */ | 431 | synco /* TAKum03020 (but probably a good idea anyway.) */ |
435 | putcon SP, DCR | 432 | putcon SP, DCR |
436 | /* First save r0-1 and tr0, as we need to use these */ | 433 | /* First save r0-1 and tr0, as we need to use these */ |
437 | movi resvec_save_area-CONFIG_CACHED_MEMORY_OFFSET, SP | 434 | movi resvec_save_area-CONFIG_PAGE_OFFSET, SP |
438 | st.q SP, 0, r0 | 435 | st.q SP, 0, r0 |
439 | st.q SP, 8, r1 | 436 | st.q SP, 8, r1 |
440 | gettr tr0, r0 | 437 | gettr tr0, r0 |
@@ -444,7 +441,7 @@ reset_or_panic: | |||
444 | getcon EXPEVT, r0 | 441 | getcon EXPEVT, r0 |
445 | movi RESET_CAUSE, r1 | 442 | movi RESET_CAUSE, r1 |
446 | sub r1, r0, r1 /* r1=0 if reset */ | 443 | sub r1, r0, r1 /* r1=0 if reset */ |
447 | movi _stext-CONFIG_CACHED_MEMORY_OFFSET, r0 | 444 | movi _stext-CONFIG_PAGE_OFFSET, r0 |
448 | ori r0, 1, r0 | 445 | ori r0, 1, r0 |
449 | ptabs r0, tr0 | 446 | ptabs r0, tr0 |
450 | beqi r1, 0, tr0 /* Jump to start address if reset */ | 447 | beqi r1, 0, tr0 /* Jump to start address if reset */ |
@@ -456,7 +453,7 @@ reset_or_panic: | |||
456 | beqi r1, 0, tr0 /* jump if single step */ | 453 | beqi r1, 0, tr0 /* jump if single step */ |
457 | 454 | ||
458 | /* Now jump to where we save the registers. */ | 455 | /* Now jump to where we save the registers. */ |
459 | movi panic_stash_regs-CONFIG_CACHED_MEMORY_OFFSET, r1 | 456 | movi panic_stash_regs-CONFIG_PAGE_OFFSET, r1 |
460 | ptabs r1, tr0 | 457 | ptabs r1, tr0 |
461 | blink tr0, r63 | 458 | blink tr0, r63 |
462 | 459 | ||
@@ -492,7 +489,7 @@ debug_exception: | |||
492 | */ | 489 | */ |
493 | putcon SP, DCR | 490 | putcon SP, DCR |
494 | /* Save SSR & SPC, together with R0 & R1, as we need to use 2 regs. */ | 491 | /* Save SSR & SPC, together with R0 & R1, as we need to use 2 regs. */ |
495 | movi resvec_save_area-CONFIG_CACHED_MEMORY_OFFSET, SP | 492 | movi resvec_save_area-CONFIG_PAGE_OFFSET, SP |
496 | 493 | ||
497 | /* With the MMU off, we are bypassing the cache, so purge any | 494 | /* With the MMU off, we are bypassing the cache, so purge any |
498 | * data that will be made stale by the following stores. | 495 | * data that will be made stale by the following stores. |
@@ -560,7 +557,7 @@ debug_interrupt: | |||
560 | /* Save original stack pointer into KCR1 */ | 557 | /* Save original stack pointer into KCR1 */ |
561 | synco | 558 | synco |
562 | putcon SP, KCR1 | 559 | putcon SP, KCR1 |
563 | movi resvec_save_area-CONFIG_CACHED_MEMORY_OFFSET, SP | 560 | movi resvec_save_area-CONFIG_PAGE_OFFSET, SP |
564 | ocbp SP, 0 | 561 | ocbp SP, 0 |
565 | ocbp SP, 32 | 562 | ocbp SP, 32 |
566 | synco | 563 | synco |
@@ -609,7 +606,7 @@ debug_interrupt: | |||
609 | movi EVENT_FAULT_NOT_TLB, r4 | 606 | movi EVENT_FAULT_NOT_TLB, r4 |
610 | 607 | ||
611 | or SP, ZERO, r5 | 608 | or SP, ZERO, r5 |
612 | movi CONFIG_CACHED_MEMORY_OFFSET, r6 | 609 | movi CONFIG_PAGE_OFFSET, r6 |
613 | add r6, r5, r5 | 610 | add r6, r5, r5 |
614 | getcon KCR1, SP | 611 | getcon KCR1, SP |
615 | 612 | ||
@@ -944,9 +941,6 @@ ret_with_reschedule: | |||
944 | getcon KCR0, r6 ! r6 contains current_thread_info | 941 | getcon KCR0, r6 ! r6 contains current_thread_info |
945 | ld.l r6, TI_FLAGS, r7 ! r7 contains current_thread_info->flags | 942 | ld.l r6, TI_FLAGS, r7 ! r7 contains current_thread_info->flags |
946 | 943 | ||
947 | ! FIXME:!!! | ||
948 | ! no handling of TIF_SYSCALL_TRACE yet!! | ||
949 | |||
950 | movi _TIF_NEED_RESCHED, r8 | 944 | movi _TIF_NEED_RESCHED, r8 |
951 | and r8, r7, r8 | 945 | and r8, r7, r8 |
952 | pta work_resched, tr0 | 946 | pta work_resched, tr0 |
@@ -1282,14 +1276,17 @@ syscall_allowed: | |||
1282 | 1276 | ||
1283 | getcon KCR0, r2 | 1277 | getcon KCR0, r2 |
1284 | ld.l r2, TI_FLAGS, r4 | 1278 | ld.l r2, TI_FLAGS, r4 |
1285 | movi (1 << TIF_SYSCALL_TRACE), r6 | 1279 | movi (_TIF_SYSCALL_TRACE | _TIF_SINGLESTEP | _TIF_SYSCALL_AUDIT), r6 |
1286 | and r6, r4, r6 | 1280 | and r6, r4, r6 |
1287 | beq/l r6, ZERO, tr0 | 1281 | beq/l r6, ZERO, tr0 |
1288 | 1282 | ||
1289 | /* Trace it by calling syscall_trace before and after */ | 1283 | /* Trace it by calling syscall_trace before and after */ |
1290 | movi syscall_trace, r4 | 1284 | movi syscall_trace, r4 |
1285 | or SP, ZERO, r2 | ||
1286 | or ZERO, ZERO, r3 | ||
1291 | ptabs r4, tr0 | 1287 | ptabs r4, tr0 |
1292 | blink tr0, LINK | 1288 | blink tr0, LINK |
1289 | |||
1293 | /* Reload syscall number as r5 is trashed by syscall_trace */ | 1290 | /* Reload syscall number as r5 is trashed by syscall_trace */ |
1294 | ld.q SP, FRAME_S(FSYSCALL_ID), r5 | 1291 | ld.q SP, FRAME_S(FSYSCALL_ID), r5 |
1295 | andi r5, 0x1ff, r5 | 1292 | andi r5, 0x1ff, r5 |
@@ -1323,6 +1320,8 @@ syscall_ret_trace: | |||
1323 | st.q SP, FRAME_R(9), r2 /* Save return value */ | 1320 | st.q SP, FRAME_R(9), r2 /* Save return value */ |
1324 | 1321 | ||
1325 | movi syscall_trace, LINK | 1322 | movi syscall_trace, LINK |
1323 | or SP, ZERO, r2 | ||
1324 | movi 1, r3 | ||
1326 | ptabs LINK, tr0 | 1325 | ptabs LINK, tr0 |
1327 | blink tr0, LINK | 1326 | blink tr0, LINK |
1328 | 1327 | ||
@@ -1368,7 +1367,7 @@ route_to_panic_handler: | |||
1368 | last-chance debugging, e.g. if no output wants to go to the console. | 1367 | last-chance debugging, e.g. if no output wants to go to the console. |
1369 | */ | 1368 | */ |
1370 | 1369 | ||
1371 | movi panic_handler - CONFIG_CACHED_MEMORY_OFFSET, r1 | 1370 | movi panic_handler - CONFIG_PAGE_OFFSET, r1 |
1372 | ptabs r1, tr0 | 1371 | ptabs r1, tr0 |
1373 | pta 1f, tr1 | 1372 | pta 1f, tr1 |
1374 | gettr tr1, r0 | 1373 | gettr tr1, r0 |
@@ -1410,7 +1409,7 @@ peek_real_address_q: | |||
1410 | andc r1, r36, r1 /* turn sr.mmu off in real mode section */ | 1409 | andc r1, r36, r1 /* turn sr.mmu off in real mode section */ |
1411 | 1410 | ||
1412 | putcon r1, ssr | 1411 | putcon r1, ssr |
1413 | movi .peek0 - CONFIG_CACHED_MEMORY_OFFSET, r36 /* real mode target address */ | 1412 | movi .peek0 - CONFIG_PAGE_OFFSET, r36 /* real mode target address */ |
1414 | movi 1f, r37 /* virtual mode return addr */ | 1413 | movi 1f, r37 /* virtual mode return addr */ |
1415 | putcon r36, spc | 1414 | putcon r36, spc |
1416 | 1415 | ||
@@ -1459,7 +1458,7 @@ poke_real_address_q: | |||
1459 | andc r1, r36, r1 /* turn sr.mmu off in real mode section */ | 1458 | andc r1, r36, r1 /* turn sr.mmu off in real mode section */ |
1460 | 1459 | ||
1461 | putcon r1, ssr | 1460 | putcon r1, ssr |
1462 | movi .poke0-CONFIG_CACHED_MEMORY_OFFSET, r36 /* real mode target address */ | 1461 | movi .poke0-CONFIG_PAGE_OFFSET, r36 /* real mode target address */ |
1463 | movi 1f, r37 /* virtual mode return addr */ | 1462 | movi 1f, r37 /* virtual mode return addr */ |
1464 | putcon r36, spc | 1463 | putcon r36, spc |
1465 | 1464 | ||
@@ -1956,7 +1955,7 @@ panic_stash_regs: | |||
1956 | getcon SSR,r3 | 1955 | getcon SSR,r3 |
1957 | getcon EXPEVT,r4 | 1956 | getcon EXPEVT,r4 |
1958 | /* Prepare to jump to C - physical address */ | 1957 | /* Prepare to jump to C - physical address */ |
1959 | movi panic_handler-CONFIG_CACHED_MEMORY_OFFSET, r1 | 1958 | movi panic_handler-CONFIG_PAGE_OFFSET, r1 |
1960 | ori r1, 1, r1 | 1959 | ori r1, 1, r1 |
1961 | ptabs r1, tr0 | 1960 | ptabs r1, tr0 |
1962 | getcon DCR, SP | 1961 | getcon DCR, SP |
@@ -2057,7 +2056,7 @@ trap_init: | |||
2057 | andi r19, -4, r19 /* reset MMUOFF + reserved */ | 2056 | andi r19, -4, r19 /* reset MMUOFF + reserved */ |
2058 | /* For RESVEC exceptions we force the MMU off, which means we need the | 2057 | /* For RESVEC exceptions we force the MMU off, which means we need the |
2059 | physical address. */ | 2058 | physical address. */ |
2060 | movi LRESVEC_block-CONFIG_CACHED_MEMORY_OFFSET, r20 | 2059 | movi LRESVEC_block-CONFIG_PAGE_OFFSET, r20 |
2061 | andi r20, -4, r20 /* reset reserved */ | 2060 | andi r20, -4, r20 /* reset reserved */ |
2062 | ori r20, 1, r20 /* set MMUOFF */ | 2061 | ori r20, 1, r20 /* set MMUOFF */ |
2063 | putcon r19, VBR | 2062 | putcon r19, VBR |
diff --git a/arch/sh64/kernel/fpu.c b/arch/sh/kernel/cpu/sh5/fpu.c index 8ad4ed6a6c9b..30b76a94abf2 100644 --- a/arch/sh64/kernel/fpu.c +++ b/arch/sh/kernel/cpu/sh5/fpu.c | |||
@@ -1,9 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * This file is subject to the terms and conditions of the GNU General Public | 2 | * arch/sh/kernel/cpu/sh5/fpu.c |
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * arch/sh64/kernel/fpu.c | ||
7 | * | 3 | * |
8 | * Copyright (C) 2001 Manuela Cirronis, Paolo Alberelli | 4 | * Copyright (C) 2001 Manuela Cirronis, Paolo Alberelli |
9 | * Copyright (C) 2002 STMicroelectronics Limited | 5 | * Copyright (C) 2002 STMicroelectronics Limited |
@@ -12,8 +8,10 @@ | |||
12 | * Started from SH4 version: | 8 | * Started from SH4 version: |
13 | * Copyright (C) 1999, 2000 Kaz Kojima & Niibe Yutaka | 9 | * Copyright (C) 1999, 2000 Kaz Kojima & Niibe Yutaka |
14 | * | 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. | ||
15 | */ | 14 | */ |
16 | |||
17 | #include <linux/sched.h> | 15 | #include <linux/sched.h> |
18 | #include <linux/signal.h> | 16 | #include <linux/signal.h> |
19 | #include <asm/processor.h> | 17 | #include <asm/processor.h> |
@@ -30,12 +28,12 @@ | |||
30 | 28 | ||
31 | static union sh_fpu_union init_fpuregs = { | 29 | static union sh_fpu_union init_fpuregs = { |
32 | .hard = { | 30 | .hard = { |
33 | .fp_regs = { [0 ... 63] = sNAN32 }, | 31 | .fp_regs = { [0 ... 63] = sNAN32 }, |
34 | .fpscr = FPSCR_INIT | 32 | .fpscr = FPSCR_INIT |
35 | } | 33 | } |
36 | }; | 34 | }; |
37 | 35 | ||
38 | inline void fpsave(struct sh_fpu_hard_struct *fpregs) | 36 | void save_fpu(struct task_struct *tsk, struct pt_regs *regs) |
39 | { | 37 | { |
40 | asm volatile("fst.p %0, (0*8), fp0\n\t" | 38 | asm volatile("fst.p %0, (0*8), fp0\n\t" |
41 | "fst.p %0, (1*8), fp2\n\t" | 39 | "fst.p %0, (1*8), fp2\n\t" |
@@ -73,11 +71,10 @@ inline void fpsave(struct sh_fpu_hard_struct *fpregs) | |||
73 | "fgetscr fr63\n\t" | 71 | "fgetscr fr63\n\t" |
74 | "fst.s %0, (32*8), fr63\n\t" | 72 | "fst.s %0, (32*8), fr63\n\t" |
75 | : /* no output */ | 73 | : /* no output */ |
76 | : "r" (fpregs) | 74 | : "r" (&tsk->thread.fpu.hard) |
77 | : "memory"); | 75 | : "memory"); |
78 | } | 76 | } |
79 | 77 | ||
80 | |||
81 | static inline void | 78 | static inline void |
82 | fpload(struct sh_fpu_hard_struct *fpregs) | 79 | fpload(struct sh_fpu_hard_struct *fpregs) |
83 | { | 80 | { |
@@ -152,11 +149,11 @@ do_fpu_state_restore(unsigned long ex, struct pt_regs *regs) | |||
152 | if (last_task_used_math == current) | 149 | if (last_task_used_math == current) |
153 | return; | 150 | return; |
154 | 151 | ||
155 | grab_fpu(); | 152 | enable_fpu(); |
156 | if (last_task_used_math != NULL) { | 153 | if (last_task_used_math != NULL) |
157 | /* Other processes fpu state, save away */ | 154 | /* Other processes fpu state, save away */ |
158 | fpsave(&last_task_used_math->thread.fpu.hard); | 155 | save_fpu(last_task_used_math, regs); |
159 | } | 156 | |
160 | last_task_used_math = current; | 157 | last_task_used_math = current; |
161 | if (used_math()) { | 158 | if (used_math()) { |
162 | fpload(¤t->thread.fpu.hard); | 159 | fpload(¤t->thread.fpu.hard); |
@@ -165,6 +162,5 @@ do_fpu_state_restore(unsigned long ex, struct pt_regs *regs) | |||
165 | fpload(&init_fpuregs.hard); | 162 | fpload(&init_fpuregs.hard); |
166 | set_used_math(); | 163 | set_used_math(); |
167 | } | 164 | } |
168 | release_fpu(); | 165 | disable_fpu(); |
169 | } | 166 | } |
170 | |||
diff --git a/arch/sh/kernel/cpu/sh5/probe.c b/arch/sh/kernel/cpu/sh5/probe.c new file mode 100644 index 000000000000..15d167fd0ae7 --- /dev/null +++ b/arch/sh/kernel/cpu/sh5/probe.c | |||
@@ -0,0 +1,76 @@ | |||
1 | /* | ||
2 | * arch/sh/kernel/cpu/sh5/probe.c | ||
3 | * | ||
4 | * CPU Subtype Probing for SH-5. | ||
5 | * | ||
6 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
7 | * Copyright (C) 2003 - 2007 Paul Mundt | ||
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 | #include <linux/init.h> | ||
14 | #include <linux/io.h> | ||
15 | #include <linux/string.h> | ||
16 | #include <asm/processor.h> | ||
17 | #include <asm/cache.h> | ||
18 | |||
19 | int __init detect_cpu_and_cache_system(void) | ||
20 | { | ||
21 | unsigned long long cir; | ||
22 | |||
23 | /* Do peeks in real mode to avoid having to set up a mapping for the | ||
24 | WPC registers. On SH5-101 cut2, such a mapping would be exposed to | ||
25 | an address translation erratum which would make it hard to set up | ||
26 | correctly. */ | ||
27 | cir = peek_real_address_q(0x0d000008); | ||
28 | if ((cir & 0xffff) == 0x5103) { | ||
29 | boot_cpu_data.type = CPU_SH5_103; | ||
30 | } else if (((cir >> 32) & 0xffff) == 0x51e2) { | ||
31 | /* CPU.VCR aliased at CIR address on SH5-101 */ | ||
32 | boot_cpu_data.type = CPU_SH5_101; | ||
33 | } else { | ||
34 | boot_cpu_data.type = CPU_SH_NONE; | ||
35 | } | ||
36 | |||
37 | /* | ||
38 | * First, setup some sane values for the I-cache. | ||
39 | */ | ||
40 | boot_cpu_data.icache.ways = 4; | ||
41 | boot_cpu_data.icache.sets = 256; | ||
42 | boot_cpu_data.icache.linesz = L1_CACHE_BYTES; | ||
43 | |||
44 | #if 0 | ||
45 | /* | ||
46 | * FIXME: This can probably be cleaned up a bit as well.. for example, | ||
47 | * do we really need the way shift _and_ the way_step_shift ?? Judging | ||
48 | * by the existing code, I would guess no.. is there any valid reason | ||
49 | * why we need to be tracking this around? | ||
50 | */ | ||
51 | boot_cpu_data.icache.way_shift = 13; | ||
52 | boot_cpu_data.icache.entry_shift = 5; | ||
53 | boot_cpu_data.icache.set_shift = 4; | ||
54 | boot_cpu_data.icache.way_step_shift = 16; | ||
55 | boot_cpu_data.icache.asid_shift = 2; | ||
56 | |||
57 | /* | ||
58 | * way offset = cache size / associativity, so just don't factor in | ||
59 | * associativity in the first place.. | ||
60 | */ | ||
61 | boot_cpu_data.icache.way_ofs = boot_cpu_data.icache.sets * | ||
62 | boot_cpu_data.icache.linesz; | ||
63 | |||
64 | boot_cpu_data.icache.asid_mask = 0x3fc; | ||
65 | boot_cpu_data.icache.idx_mask = 0x1fe0; | ||
66 | boot_cpu_data.icache.epn_mask = 0xffffe000; | ||
67 | #endif | ||
68 | |||
69 | boot_cpu_data.icache.flags = 0; | ||
70 | |||
71 | /* A trivial starting point.. */ | ||
72 | memcpy(&boot_cpu_data.dcache, | ||
73 | &boot_cpu_data.icache, sizeof(struct cache_info)); | ||
74 | |||
75 | return 0; | ||
76 | } | ||
diff --git a/arch/sh64/kernel/switchto.S b/arch/sh/kernel/cpu/sh5/switchto.S index 45b2d90eed7d..45c351b0f1ba 100644 --- a/arch/sh64/kernel/switchto.S +++ b/arch/sh/kernel/cpu/sh5/switchto.S | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * arch/sh64/kernel/switchto.S | 2 | * arch/sh/kernel/cpu/sh5/switchto.S |
3 | * | 3 | * |
4 | * sh64 context switch | 4 | * sh64 context switch |
5 | * | 5 | * |
diff --git a/arch/sh64/kernel/unwind.c b/arch/sh/kernel/cpu/sh5/unwind.c index 1214c78e3584..119c20afd4e5 100644 --- a/arch/sh64/kernel/unwind.c +++ b/arch/sh/kernel/cpu/sh5/unwind.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * arch/sh64/kernel/unwind.c | 2 | * arch/sh/kernel/cpu/sh5/unwind.c |
3 | * | 3 | * |
4 | * Copyright (C) 2004 Paul Mundt | 4 | * Copyright (C) 2004 Paul Mundt |
5 | * Copyright (C) 2004 Richard Curnow | 5 | * Copyright (C) 2004 Richard Curnow |
diff --git a/arch/sh/kernel/dump_task.c b/arch/sh/kernel/dump_task.c new file mode 100644 index 000000000000..4a8a4083ff0b --- /dev/null +++ b/arch/sh/kernel/dump_task.c | |||
@@ -0,0 +1,31 @@ | |||
1 | #include <linux/elfcore.h> | ||
2 | #include <linux/sched.h> | ||
3 | |||
4 | /* | ||
5 | * Capture the user space registers if the task is not running (in user space) | ||
6 | */ | ||
7 | int dump_task_regs(struct task_struct *tsk, elf_gregset_t *regs) | ||
8 | { | ||
9 | struct pt_regs ptregs; | ||
10 | |||
11 | ptregs = *task_pt_regs(tsk); | ||
12 | elf_core_copy_regs(regs, &ptregs); | ||
13 | |||
14 | return 1; | ||
15 | } | ||
16 | |||
17 | int dump_task_fpu(struct task_struct *tsk, elf_fpregset_t *fpu) | ||
18 | { | ||
19 | int fpvalid = 0; | ||
20 | |||
21 | #if defined(CONFIG_SH_FPU) | ||
22 | fpvalid = !!tsk_used_math(tsk); | ||
23 | if (fpvalid) { | ||
24 | unlazy_fpu(tsk, task_pt_regs(tsk)); | ||
25 | memcpy(fpu, &tsk->thread.fpu.hard, sizeof(*fpu)); | ||
26 | } | ||
27 | #endif | ||
28 | |||
29 | return fpvalid; | ||
30 | } | ||
31 | |||
diff --git a/arch/sh/kernel/early_printk.c b/arch/sh/kernel/early_printk.c index 2f30977558ad..957f25611543 100644 --- a/arch/sh/kernel/early_printk.c +++ b/arch/sh/kernel/early_printk.c | |||
@@ -63,7 +63,8 @@ static struct console bios_console = { | |||
63 | #include <linux/serial_core.h> | 63 | #include <linux/serial_core.h> |
64 | #include "../../../drivers/serial/sh-sci.h" | 64 | #include "../../../drivers/serial/sh-sci.h" |
65 | 65 | ||
66 | #if defined(CONFIG_CPU_SUBTYPE_SH7720) | 66 | #if defined(CONFIG_CPU_SUBTYPE_SH7720) || \ |
67 | defined(CONFIG_CPU_SUBTYPE_SH7721) | ||
67 | #define EPK_SCSMR_VALUE 0x000 | 68 | #define EPK_SCSMR_VALUE 0x000 |
68 | #define EPK_SCBRR_VALUE 0x00C | 69 | #define EPK_SCBRR_VALUE 0x00C |
69 | #define EPK_FIFO_SIZE 64 | 70 | #define EPK_FIFO_SIZE 64 |
@@ -117,7 +118,8 @@ static struct console scif_console = { | |||
117 | }; | 118 | }; |
118 | 119 | ||
119 | #if !defined(CONFIG_SH_STANDARD_BIOS) | 120 | #if !defined(CONFIG_SH_STANDARD_BIOS) |
120 | #if defined(CONFIG_CPU_SUBTYPE_SH7720) | 121 | #if defined(CONFIG_CPU_SUBTYPE_SH7720) || \ |
122 | defined(CONFIG_CPU_SUBTYPE_SH7721) | ||
121 | static void scif_sercon_init(char *s) | 123 | static void scif_sercon_init(char *s) |
122 | { | 124 | { |
123 | sci_out(&scif_port, SCSCR, 0x0000); /* clear TE and RE */ | 125 | sci_out(&scif_port, SCSCR, 0x0000); /* clear TE and RE */ |
@@ -208,10 +210,12 @@ static int __init setup_early_printk(char *buf) | |||
208 | if (!strncmp(buf, "serial", 6)) { | 210 | if (!strncmp(buf, "serial", 6)) { |
209 | early_console = &scif_console; | 211 | early_console = &scif_console; |
210 | 212 | ||
211 | #if (defined(CONFIG_CPU_SH4) || defined(CONFIG_CPU_SUBTYPE_SH7720)) && \ | 213 | #if !defined(CONFIG_SH_STANDARD_BIOS) |
212 | !defined(CONFIG_SH_STANDARD_BIOS) | 214 | #if defined(CONFIG_CPU_SH4) || defined(CONFIG_CPU_SUBTYPE_SH7720) || \ |
215 | defined(CONFIG_CPU_SUBTYPE_SH7721) | ||
213 | scif_sercon_init(buf + 6); | 216 | scif_sercon_init(buf + 6); |
214 | #endif | 217 | #endif |
218 | #endif | ||
215 | } | 219 | } |
216 | #endif | 220 | #endif |
217 | 221 | ||
diff --git a/arch/sh/kernel/entry-common.S b/arch/sh/kernel/entry-common.S index e0317ed080c3..926b2e7b11c1 100644 --- a/arch/sh/kernel/entry-common.S +++ b/arch/sh/kernel/entry-common.S | |||
@@ -176,25 +176,6 @@ work_notifysig: | |||
176 | jmp @r1 | 176 | jmp @r1 |
177 | lds r0, pr | 177 | lds r0, pr |
178 | work_resched: | 178 | work_resched: |
179 | #if defined(CONFIG_GUSA) && !defined(CONFIG_PREEMPT) | ||
180 | ! gUSA handling | ||
181 | mov.l @(OFF_SP,r15), r0 ! get user space stack pointer | ||
182 | mov r0, r1 | ||
183 | shll r0 | ||
184 | bf/s 1f | ||
185 | shll r0 | ||
186 | bf/s 1f | ||
187 | mov #OFF_PC, r0 | ||
188 | ! SP >= 0xc0000000 : gUSA mark | ||
189 | mov.l @(r0,r15), r2 ! get user space PC (program counter) | ||
190 | mov.l @(OFF_R0,r15), r3 ! end point | ||
191 | cmp/hs r3, r2 ! r2 >= r3? | ||
192 | bt 1f | ||
193 | add r3, r1 ! rewind point #2 | ||
194 | mov.l r1, @(r0,r15) ! reset PC to rewind point #2 | ||
195 | ! | ||
196 | 1: | ||
197 | #endif | ||
198 | mov.l 1f, r1 | 179 | mov.l 1f, r1 |
199 | jsr @r1 ! schedule | 180 | jsr @r1 ! schedule |
200 | nop | 181 | nop |
@@ -224,7 +205,7 @@ work_resched: | |||
224 | syscall_exit_work: | 205 | syscall_exit_work: |
225 | ! r0: current_thread_info->flags | 206 | ! r0: current_thread_info->flags |
226 | ! r8: current_thread_info | 207 | ! r8: current_thread_info |
227 | tst #_TIF_SYSCALL_TRACE | _TIF_SINGLESTEP, r0 | 208 | tst #_TIF_SYSCALL_TRACE | _TIF_SINGLESTEP | _TIF_SYSCALL_AUDIT, r0 |
228 | bt/s work_pending | 209 | bt/s work_pending |
229 | tst #_TIF_NEED_RESCHED, r0 | 210 | tst #_TIF_NEED_RESCHED, r0 |
230 | #ifdef CONFIG_TRACE_IRQFLAGS | 211 | #ifdef CONFIG_TRACE_IRQFLAGS |
@@ -234,6 +215,8 @@ syscall_exit_work: | |||
234 | #endif | 215 | #endif |
235 | sti | 216 | sti |
236 | ! XXX setup arguments... | 217 | ! XXX setup arguments... |
218 | mov r15, r4 | ||
219 | mov #1, r5 | ||
237 | mov.l 4f, r0 ! do_syscall_trace | 220 | mov.l 4f, r0 ! do_syscall_trace |
238 | jsr @r0 | 221 | jsr @r0 |
239 | nop | 222 | nop |
@@ -244,6 +227,8 @@ syscall_exit_work: | |||
244 | syscall_trace_entry: | 227 | syscall_trace_entry: |
245 | ! Yes it is traced. | 228 | ! Yes it is traced. |
246 | ! XXX setup arguments... | 229 | ! XXX setup arguments... |
230 | mov r15, r4 | ||
231 | mov #0, r5 | ||
247 | mov.l 4f, r11 ! Call do_syscall_trace which notifies | 232 | mov.l 4f, r11 ! Call do_syscall_trace which notifies |
248 | jsr @r11 ! superior (will chomp R[0-7]) | 233 | jsr @r11 ! superior (will chomp R[0-7]) |
249 | nop | 234 | nop |
@@ -366,7 +351,7 @@ ENTRY(system_call) | |||
366 | ! | 351 | ! |
367 | get_current_thread_info r8, r10 | 352 | get_current_thread_info r8, r10 |
368 | mov.l @(TI_FLAGS,r8), r8 | 353 | mov.l @(TI_FLAGS,r8), r8 |
369 | mov #_TIF_SYSCALL_TRACE, r10 | 354 | mov #(_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT), r10 |
370 | tst r10, r8 | 355 | tst r10, r8 |
371 | bf syscall_trace_entry | 356 | bf syscall_trace_entry |
372 | ! | 357 | ! |
diff --git a/arch/sh/kernel/head.S b/arch/sh/kernel/head_32.S index 3338239717f1..d67d7ed09f22 100644 --- a/arch/sh/kernel/head.S +++ b/arch/sh/kernel/head_32.S | |||
@@ -32,7 +32,11 @@ ENTRY(empty_zero_page) | |||
32 | .long 1 /* LOADER_TYPE */ | 32 | .long 1 /* LOADER_TYPE */ |
33 | .long 0x00360000 /* INITRD_START */ | 33 | .long 0x00360000 /* INITRD_START */ |
34 | .long 0x000a0000 /* INITRD_SIZE */ | 34 | .long 0x000a0000 /* INITRD_SIZE */ |
35 | .long 0 | 35 | #ifdef CONFIG_32BIT |
36 | .long 0x53453f00 + 32 /* "SE?" = 32 bit */ | ||
37 | #else | ||
38 | .long 0x53453f00 + 29 /* "SE?" = 29 bit */ | ||
39 | #endif | ||
36 | 1: | 40 | 1: |
37 | .skip PAGE_SIZE - empty_zero_page - 1b | 41 | .skip PAGE_SIZE - empty_zero_page - 1b |
38 | 42 | ||
diff --git a/arch/sh64/kernel/head.S b/arch/sh/kernel/head_64.S index 186406d3ad9c..f42d4c0feb76 100644 --- a/arch/sh64/kernel/head.S +++ b/arch/sh/kernel/head_64.S | |||
@@ -1,32 +1,18 @@ | |||
1 | /* | 1 | /* |
2 | * This file is subject to the terms and conditions of the GNU General Public | 2 | * arch/sh/kernel/head_64.S |
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * arch/sh64/kernel/head.S | ||
7 | * | 3 | * |
8 | * Copyright (C) 2000, 2001 Paolo Alberelli | 4 | * Copyright (C) 2000, 2001 Paolo Alberelli |
9 | * Copyright (C) 2003, 2004 Paul Mundt | 5 | * Copyright (C) 2003, 2004 Paul Mundt |
10 | * | 6 | * |
11 | * | 7 | * This file is subject to the terms and conditions of the GNU General Public |
12 | * benedict.gaster@superh.com: 2nd May 2002 | 8 | * License. See the file "COPYING" in the main directory of this archive |
13 | * Moved definition of empty_zero_page to its own section allowing | 9 | * for more details. |
14 | * it to be placed at an absolute address known at load time. | ||
15 | * | ||
16 | * lethal@linux-sh.org: 9th May 2003 | ||
17 | * Kill off GLOBAL_NAME() usage. | ||
18 | * | ||
19 | * lethal@linux-sh.org: 8th May 2004 | ||
20 | * Add early SCIF console DTLB mapping. | ||
21 | */ | 10 | */ |
22 | |||
23 | |||
24 | #include <asm/page.h> | 11 | #include <asm/page.h> |
25 | #include <asm/mmu_context.h> | ||
26 | #include <asm/cache.h> | 12 | #include <asm/cache.h> |
27 | #include <asm/tlb.h> | 13 | #include <asm/tlb.h> |
28 | #include <asm/processor.h> | 14 | #include <asm/cpu/registers.h> |
29 | #include <asm/registers.h> | 15 | #include <asm/cpu/mmu_context.h> |
30 | #include <asm/thread_info.h> | 16 | #include <asm/thread_info.h> |
31 | 17 | ||
32 | /* | 18 | /* |
@@ -41,9 +27,9 @@ | |||
41 | #define MMUDR_END DTLB_LAST_VAR_UNRESTRICTED+TLB_STEP | 27 | #define MMUDR_END DTLB_LAST_VAR_UNRESTRICTED+TLB_STEP |
42 | #define MMUDR_STEP TLB_STEP | 28 | #define MMUDR_STEP TLB_STEP |
43 | 29 | ||
44 | /* Safety check : CONFIG_CACHED_MEMORY_OFFSET has to be a multiple of 512Mb */ | 30 | /* Safety check : CONFIG_PAGE_OFFSET has to be a multiple of 512Mb */ |
45 | #if (CONFIG_CACHED_MEMORY_OFFSET & ((1UL<<29)-1)) | 31 | #if (CONFIG_PAGE_OFFSET & ((1UL<<29)-1)) |
46 | #error "CONFIG_CACHED_MEMORY_OFFSET must be a multiple of 512Mb" | 32 | #error "CONFIG_PAGE_OFFSET must be a multiple of 512Mb" |
47 | #endif | 33 | #endif |
48 | 34 | ||
49 | /* | 35 | /* |
@@ -52,7 +38,7 @@ | |||
52 | /* Deal safely with the case where the base of RAM is not 512Mb aligned */ | 38 | /* Deal safely with the case where the base of RAM is not 512Mb aligned */ |
53 | 39 | ||
54 | #define ALIGN_512M_MASK (0xffffffffe0000000) | 40 | #define ALIGN_512M_MASK (0xffffffffe0000000) |
55 | #define ALIGNED_EFFECTIVE ((CONFIG_CACHED_MEMORY_OFFSET + CONFIG_MEMORY_START) & ALIGN_512M_MASK) | 41 | #define ALIGNED_EFFECTIVE ((CONFIG_PAGE_OFFSET + CONFIG_MEMORY_START) & ALIGN_512M_MASK) |
56 | #define ALIGNED_PHYSICAL (CONFIG_MEMORY_START & ALIGN_512M_MASK) | 42 | #define ALIGNED_PHYSICAL (CONFIG_MEMORY_START & ALIGN_512M_MASK) |
57 | 43 | ||
58 | #define MMUIR_TEXT_H (0x0000000000000003 | ALIGNED_EFFECTIVE) | 44 | #define MMUIR_TEXT_H (0x0000000000000003 | ALIGNED_EFFECTIVE) |
@@ -66,23 +52,23 @@ | |||
66 | #define MMUDR_CACHED_L 0x000000000000015a | ALIGNED_PHYSICAL | 52 | #define MMUDR_CACHED_L 0x000000000000015a | ALIGNED_PHYSICAL |
67 | /* 512 Mb, Cacheable, Write-back, read/write, Not User, Ph. Add. */ | 53 | /* 512 Mb, Cacheable, Write-back, read/write, Not User, Ph. Add. */ |
68 | 54 | ||
69 | #ifdef CONFIG_ICACHE_DISABLED | 55 | #ifdef CONFIG_CACHE_OFF |
70 | #define ICCR0_INIT_VAL ICCR0_OFF /* ICACHE off */ | 56 | #define ICCR0_INIT_VAL ICCR0_OFF /* ICACHE off */ |
71 | #else | 57 | #else |
72 | #define ICCR0_INIT_VAL ICCR0_ON | ICCR0_ICI /* ICE + ICI */ | 58 | #define ICCR0_INIT_VAL ICCR0_ON | ICCR0_ICI /* ICE + ICI */ |
73 | #endif | 59 | #endif |
74 | #define ICCR1_INIT_VAL ICCR1_NOLOCK /* No locking */ | 60 | #define ICCR1_INIT_VAL ICCR1_NOLOCK /* No locking */ |
75 | 61 | ||
76 | #if defined (CONFIG_DCACHE_DISABLED) | 62 | #if defined (CONFIG_CACHE_OFF) |
77 | #define OCCR0_INIT_VAL OCCR0_OFF /* D-cache: off */ | 63 | #define OCCR0_INIT_VAL OCCR0_OFF /* D-cache: off */ |
78 | #elif defined (CONFIG_DCACHE_WRITE_THROUGH) | 64 | #elif defined (CONFIG_CACHE_WRITETHROUGH) |
79 | #define OCCR0_INIT_VAL OCCR0_ON | OCCR0_OCI | OCCR0_WT /* D-cache: on, */ | 65 | #define OCCR0_INIT_VAL OCCR0_ON | OCCR0_OCI | OCCR0_WT /* D-cache: on, */ |
80 | /* WT, invalidate */ | 66 | /* WT, invalidate */ |
81 | #elif defined (CONFIG_DCACHE_WRITE_BACK) | 67 | #elif defined (CONFIG_CACHE_WRITEBACK) |
82 | #define OCCR0_INIT_VAL OCCR0_ON | OCCR0_OCI | OCCR0_WB /* D-cache: on, */ | 68 | #define OCCR0_INIT_VAL OCCR0_ON | OCCR0_OCI | OCCR0_WB /* D-cache: on, */ |
83 | /* WB, invalidate */ | 69 | /* WB, invalidate */ |
84 | #else | 70 | #else |
85 | #error preprocessor flag CONFIG_DCACHE_... not recognized! | 71 | #error preprocessor flag CONFIG_CACHE_... not recognized! |
86 | #endif | 72 | #endif |
87 | 73 | ||
88 | #define OCCR1_INIT_VAL OCCR1_NOLOCK /* No locking */ | 74 | #define OCCR1_INIT_VAL OCCR1_NOLOCK /* No locking */ |
@@ -108,8 +94,8 @@ empty_zero_page: | |||
108 | .section .data, "aw" | 94 | .section .data, "aw" |
109 | .balign PAGE_SIZE | 95 | .balign PAGE_SIZE |
110 | 96 | ||
111 | .global swapper_pg_dir | 97 | .global mmu_pdtp_cache |
112 | swapper_pg_dir: | 98 | mmu_pdtp_cache: |
113 | .space PAGE_SIZE, 0 | 99 | .space PAGE_SIZE, 0 |
114 | 100 | ||
115 | .global empty_bad_page | 101 | .global empty_bad_page |
@@ -368,5 +354,3 @@ hopeless: | |||
368 | * (r32) _start_kernel address | 354 | * (r32) _start_kernel address |
369 | */ | 355 | */ |
370 | blink tr7, ZERO | 356 | blink tr7, ZERO |
371 | |||
372 | |||
diff --git a/arch/sh/kernel/init_task.c b/arch/sh/kernel/init_task.c index 4b449c4a6bad..f9bcc606127e 100644 --- a/arch/sh/kernel/init_task.c +++ b/arch/sh/kernel/init_task.c | |||
@@ -11,8 +11,8 @@ static struct fs_struct init_fs = INIT_FS; | |||
11 | static struct files_struct init_files = INIT_FILES; | 11 | static struct files_struct init_files = INIT_FILES; |
12 | static struct signal_struct init_signals = INIT_SIGNALS(init_signals); | 12 | static struct signal_struct init_signals = INIT_SIGNALS(init_signals); |
13 | static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); | 13 | static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); |
14 | struct pt_regs fake_swapper_regs; | ||
14 | struct mm_struct init_mm = INIT_MM(init_mm); | 15 | struct mm_struct init_mm = INIT_MM(init_mm); |
15 | |||
16 | EXPORT_SYMBOL(init_mm); | 16 | EXPORT_SYMBOL(init_mm); |
17 | 17 | ||
18 | /* | 18 | /* |
@@ -22,7 +22,7 @@ EXPORT_SYMBOL(init_mm); | |||
22 | * way process stacks are handled. This is done by having a special | 22 | * way process stacks are handled. This is done by having a special |
23 | * "init_task" linker map entry.. | 23 | * "init_task" linker map entry.. |
24 | */ | 24 | */ |
25 | union thread_union init_thread_union | 25 | union thread_union init_thread_union |
26 | __attribute__((__section__(".data.init_task"))) = | 26 | __attribute__((__section__(".data.init_task"))) = |
27 | { INIT_THREAD_INFO(init_task) }; | 27 | { INIT_THREAD_INFO(init_task) }; |
28 | 28 | ||
diff --git a/arch/sh/kernel/io.c b/arch/sh/kernel/io.c index 501fe03e3715..71c9fde2fd90 100644 --- a/arch/sh/kernel/io.c +++ b/arch/sh/kernel/io.c | |||
@@ -61,73 +61,6 @@ void memset_io(volatile void __iomem *dst, int c, unsigned long count) | |||
61 | } | 61 | } |
62 | EXPORT_SYMBOL(memset_io); | 62 | EXPORT_SYMBOL(memset_io); |
63 | 63 | ||
64 | void __raw_readsl(unsigned long addr, void *datap, int len) | ||
65 | { | ||
66 | u32 *data; | ||
67 | |||
68 | for (data = datap; (len != 0) && (((u32)data & 0x1f) != 0); len--) | ||
69 | *data++ = ctrl_inl(addr); | ||
70 | |||
71 | if (likely(len >= (0x20 >> 2))) { | ||
72 | int tmp2, tmp3, tmp4, tmp5, tmp6; | ||
73 | |||
74 | __asm__ __volatile__( | ||
75 | "1: \n\t" | ||
76 | "mov.l @%7, r0 \n\t" | ||
77 | "mov.l @%7, %2 \n\t" | ||
78 | #ifdef CONFIG_CPU_SH4 | ||
79 | "movca.l r0, @%0 \n\t" | ||
80 | #else | ||
81 | "mov.l r0, @%0 \n\t" | ||
82 | #endif | ||
83 | "mov.l @%7, %3 \n\t" | ||
84 | "mov.l @%7, %4 \n\t" | ||
85 | "mov.l @%7, %5 \n\t" | ||
86 | "mov.l @%7, %6 \n\t" | ||
87 | "mov.l @%7, r7 \n\t" | ||
88 | "mov.l @%7, r0 \n\t" | ||
89 | "mov.l %2, @(0x04,%0) \n\t" | ||
90 | "mov #0x20>>2, %2 \n\t" | ||
91 | "mov.l %3, @(0x08,%0) \n\t" | ||
92 | "sub %2, %1 \n\t" | ||
93 | "mov.l %4, @(0x0c,%0) \n\t" | ||
94 | "cmp/hi %1, %2 ! T if 32 > len \n\t" | ||
95 | "mov.l %5, @(0x10,%0) \n\t" | ||
96 | "mov.l %6, @(0x14,%0) \n\t" | ||
97 | "mov.l r7, @(0x18,%0) \n\t" | ||
98 | "mov.l r0, @(0x1c,%0) \n\t" | ||
99 | "bf.s 1b \n\t" | ||
100 | " add #0x20, %0 \n\t" | ||
101 | : "=&r" (data), "=&r" (len), | ||
102 | "=&r" (tmp2), "=&r" (tmp3), "=&r" (tmp4), | ||
103 | "=&r" (tmp5), "=&r" (tmp6) | ||
104 | : "r"(addr), "0" (data), "1" (len) | ||
105 | : "r0", "r7", "t", "memory"); | ||
106 | } | ||
107 | |||
108 | for (; len != 0; len--) | ||
109 | *data++ = ctrl_inl(addr); | ||
110 | } | ||
111 | EXPORT_SYMBOL(__raw_readsl); | ||
112 | |||
113 | void __raw_writesl(unsigned long addr, const void *data, int len) | ||
114 | { | ||
115 | if (likely(len != 0)) { | ||
116 | int tmp1; | ||
117 | |||
118 | __asm__ __volatile__ ( | ||
119 | "1: \n\t" | ||
120 | "mov.l @%0+, %1 \n\t" | ||
121 | "dt %3 \n\t" | ||
122 | "bf.s 1b \n\t" | ||
123 | " mov.l %1, @%4 \n\t" | ||
124 | : "=&r" (data), "=&r" (tmp1) | ||
125 | : "0" (data), "r" (len), "r"(addr) | ||
126 | : "t", "memory"); | ||
127 | } | ||
128 | } | ||
129 | EXPORT_SYMBOL(__raw_writesl); | ||
130 | |||
131 | void __iomem *ioport_map(unsigned long port, unsigned int nr) | 64 | void __iomem *ioport_map(unsigned long port, unsigned int nr) |
132 | { | 65 | { |
133 | return sh_mv.mv_ioport_map(port, nr); | 66 | return sh_mv.mv_ioport_map(port, nr); |
diff --git a/arch/sh/kernel/module.c b/arch/sh/kernel/module.c index 142a4e5b7ebc..b3d0a03b4c76 100644 --- a/arch/sh/kernel/module.c +++ b/arch/sh/kernel/module.c | |||
@@ -1,5 +1,15 @@ | |||
1 | /* Kernel module help for SH. | 1 | /* Kernel module help for SH. |
2 | 2 | ||
3 | SHcompact version by Kaz Kojima and Paul Mundt. | ||
4 | |||
5 | SHmedia bits: | ||
6 | |||
7 | Copyright 2004 SuperH (UK) Ltd | ||
8 | Author: Richard Curnow | ||
9 | |||
10 | Based on the sh version, and on code from the sh64-specific parts of | ||
11 | modutils, originally written by Richard Curnow and Ben Gaster. | ||
12 | |||
3 | This program is free software; you can redistribute it and/or modify | 13 | This program is free software; you can redistribute it and/or modify |
4 | it under the terms of the GNU General Public License as published by | 14 | it under the terms of the GNU General Public License as published by |
5 | the Free Software Foundation; either version 2 of the License, or | 15 | the Free Software Foundation; either version 2 of the License, or |
@@ -21,12 +31,6 @@ | |||
21 | #include <linux/string.h> | 31 | #include <linux/string.h> |
22 | #include <linux/kernel.h> | 32 | #include <linux/kernel.h> |
23 | 33 | ||
24 | #if 0 | ||
25 | #define DEBUGP printk | ||
26 | #else | ||
27 | #define DEBUGP(fmt...) | ||
28 | #endif | ||
29 | |||
30 | void *module_alloc(unsigned long size) | 34 | void *module_alloc(unsigned long size) |
31 | { | 35 | { |
32 | if (size == 0) | 36 | if (size == 0) |
@@ -52,6 +56,7 @@ int module_frob_arch_sections(Elf_Ehdr *hdr, | |||
52 | return 0; | 56 | return 0; |
53 | } | 57 | } |
54 | 58 | ||
59 | #ifdef CONFIG_SUPERH32 | ||
55 | #define COPY_UNALIGNED_WORD(sw, tw, align) \ | 60 | #define COPY_UNALIGNED_WORD(sw, tw, align) \ |
56 | { \ | 61 | { \ |
57 | void *__s = &(sw), *__t = &(tw); \ | 62 | void *__s = &(sw), *__t = &(tw); \ |
@@ -74,6 +79,10 @@ int module_frob_arch_sections(Elf_Ehdr *hdr, | |||
74 | break; \ | 79 | break; \ |
75 | } \ | 80 | } \ |
76 | } | 81 | } |
82 | #else | ||
83 | /* One thing SHmedia doesn't screw up! */ | ||
84 | #define COPY_UNALIGNED_WORD(sw, tw, align) { (tw) = (sw); } | ||
85 | #endif | ||
77 | 86 | ||
78 | int apply_relocate_add(Elf32_Shdr *sechdrs, | 87 | int apply_relocate_add(Elf32_Shdr *sechdrs, |
79 | const char *strtab, | 88 | const char *strtab, |
@@ -89,8 +98,8 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, | |||
89 | uint32_t value; | 98 | uint32_t value; |
90 | int align; | 99 | int align; |
91 | 100 | ||
92 | DEBUGP("Applying relocate section %u to %u\n", relsec, | 101 | pr_debug("Applying relocate section %u to %u\n", relsec, |
93 | sechdrs[relsec].sh_info); | 102 | sechdrs[relsec].sh_info); |
94 | for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) { | 103 | for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) { |
95 | /* This is where to make the change */ | 104 | /* This is where to make the change */ |
96 | location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr | 105 | location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr |
@@ -102,17 +111,44 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, | |||
102 | relocation = sym->st_value + rel[i].r_addend; | 111 | relocation = sym->st_value + rel[i].r_addend; |
103 | align = (int)location & 3; | 112 | align = (int)location & 3; |
104 | 113 | ||
114 | #ifdef CONFIG_SUPERH64 | ||
115 | /* For text addresses, bit2 of the st_other field indicates | ||
116 | * whether the symbol is SHmedia (1) or SHcompact (0). If | ||
117 | * SHmedia, the LSB of the symbol needs to be asserted | ||
118 | * for the CPU to be in SHmedia mode when it starts executing | ||
119 | * the branch target. */ | ||
120 | relocation |= (sym->st_other & 4); | ||
121 | #endif | ||
122 | |||
105 | switch (ELF32_R_TYPE(rel[i].r_info)) { | 123 | switch (ELF32_R_TYPE(rel[i].r_info)) { |
106 | case R_SH_DIR32: | 124 | case R_SH_DIR32: |
107 | COPY_UNALIGNED_WORD (*location, value, align); | 125 | COPY_UNALIGNED_WORD (*location, value, align); |
108 | value += relocation; | 126 | value += relocation; |
109 | COPY_UNALIGNED_WORD (value, *location, align); | 127 | COPY_UNALIGNED_WORD (value, *location, align); |
110 | break; | 128 | break; |
111 | case R_SH_REL32: | 129 | case R_SH_REL32: |
112 | relocation = (relocation - (Elf32_Addr) location); | 130 | relocation = (relocation - (Elf32_Addr) location); |
113 | COPY_UNALIGNED_WORD (*location, value, align); | 131 | COPY_UNALIGNED_WORD (*location, value, align); |
114 | value += relocation; | 132 | value += relocation; |
115 | COPY_UNALIGNED_WORD (value, *location, align); | 133 | COPY_UNALIGNED_WORD (value, *location, align); |
134 | break; | ||
135 | case R_SH_IMM_LOW16: | ||
136 | *location = (*location & ~0x3fffc00) | | ||
137 | ((relocation & 0xffff) << 10); | ||
138 | break; | ||
139 | case R_SH_IMM_MEDLOW16: | ||
140 | *location = (*location & ~0x3fffc00) | | ||
141 | (((relocation >> 16) & 0xffff) << 10); | ||
142 | break; | ||
143 | case R_SH_IMM_LOW16_PCREL: | ||
144 | relocation -= (Elf32_Addr) location; | ||
145 | *location = (*location & ~0x3fffc00) | | ||
146 | ((relocation & 0xffff) << 10); | ||
147 | break; | ||
148 | case R_SH_IMM_MEDLOW16_PCREL: | ||
149 | relocation -= (Elf32_Addr) location; | ||
150 | *location = (*location & ~0x3fffc00) | | ||
151 | (((relocation >> 16) & 0xffff) << 10); | ||
116 | break; | 152 | break; |
117 | default: | 153 | default: |
118 | printk(KERN_ERR "module %s: Unknown relocation: %u\n", | 154 | printk(KERN_ERR "module %s: Unknown relocation: %u\n", |
diff --git a/arch/sh/kernel/process.c b/arch/sh/kernel/process_32.c index 6d7f2b07e491..9ab1926b9d10 100644 --- a/arch/sh/kernel/process.c +++ b/arch/sh/kernel/process_32.c | |||
@@ -230,34 +230,6 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu) | |||
230 | return fpvalid; | 230 | return fpvalid; |
231 | } | 231 | } |
232 | 232 | ||
233 | /* | ||
234 | * Capture the user space registers if the task is not running (in user space) | ||
235 | */ | ||
236 | int dump_task_regs(struct task_struct *tsk, elf_gregset_t *regs) | ||
237 | { | ||
238 | struct pt_regs ptregs; | ||
239 | |||
240 | ptregs = *task_pt_regs(tsk); | ||
241 | elf_core_copy_regs(regs, &ptregs); | ||
242 | |||
243 | return 1; | ||
244 | } | ||
245 | |||
246 | int dump_task_fpu(struct task_struct *tsk, elf_fpregset_t *fpu) | ||
247 | { | ||
248 | int fpvalid = 0; | ||
249 | |||
250 | #if defined(CONFIG_SH_FPU) | ||
251 | fpvalid = !!tsk_used_math(tsk); | ||
252 | if (fpvalid) { | ||
253 | unlazy_fpu(tsk, task_pt_regs(tsk)); | ||
254 | memcpy(fpu, &tsk->thread.fpu.hard, sizeof(*fpu)); | ||
255 | } | ||
256 | #endif | ||
257 | |||
258 | return fpvalid; | ||
259 | } | ||
260 | |||
261 | asmlinkage void ret_from_fork(void); | 233 | asmlinkage void ret_from_fork(void); |
262 | 234 | ||
263 | int copy_thread(int nr, unsigned long clone_flags, unsigned long usp, | 235 | int copy_thread(int nr, unsigned long clone_flags, unsigned long usp, |
@@ -350,25 +322,6 @@ struct task_struct *__switch_to(struct task_struct *prev, | |||
350 | unlazy_fpu(prev, task_pt_regs(prev)); | 322 | unlazy_fpu(prev, task_pt_regs(prev)); |
351 | #endif | 323 | #endif |
352 | 324 | ||
353 | #if defined(CONFIG_GUSA) && defined(CONFIG_PREEMPT) | ||
354 | { | ||
355 | struct pt_regs *regs; | ||
356 | |||
357 | preempt_disable(); | ||
358 | regs = task_pt_regs(prev); | ||
359 | if (user_mode(regs) && regs->regs[15] >= 0xc0000000) { | ||
360 | int offset = (int)regs->regs[15]; | ||
361 | |||
362 | /* Reset stack pointer: clear critical region mark */ | ||
363 | regs->regs[15] = regs->regs[1]; | ||
364 | if (regs->pc < regs->regs[0]) | ||
365 | /* Go to rewind point */ | ||
366 | regs->pc = regs->regs[0] + offset; | ||
367 | } | ||
368 | preempt_enable_no_resched(); | ||
369 | } | ||
370 | #endif | ||
371 | |||
372 | #ifdef CONFIG_MMU | 325 | #ifdef CONFIG_MMU |
373 | /* | 326 | /* |
374 | * Restore the kernel mode register | 327 | * Restore the kernel mode register |
@@ -510,49 +463,3 @@ asmlinkage void break_point_trap(void) | |||
510 | 463 | ||
511 | force_sig(SIGTRAP, current); | 464 | force_sig(SIGTRAP, current); |
512 | } | 465 | } |
513 | |||
514 | /* | ||
515 | * Generic trap handler. | ||
516 | */ | ||
517 | asmlinkage void debug_trap_handler(unsigned long r4, unsigned long r5, | ||
518 | unsigned long r6, unsigned long r7, | ||
519 | struct pt_regs __regs) | ||
520 | { | ||
521 | struct pt_regs *regs = RELOC_HIDE(&__regs, 0); | ||
522 | |||
523 | /* Rewind */ | ||
524 | regs->pc -= instruction_size(ctrl_inw(regs->pc - 4)); | ||
525 | |||
526 | if (notify_die(DIE_TRAP, "debug trap", regs, 0, regs->tra & 0xff, | ||
527 | SIGTRAP) == NOTIFY_STOP) | ||
528 | return; | ||
529 | |||
530 | force_sig(SIGTRAP, current); | ||
531 | } | ||
532 | |||
533 | /* | ||
534 | * Special handler for BUG() traps. | ||
535 | */ | ||
536 | asmlinkage void bug_trap_handler(unsigned long r4, unsigned long r5, | ||
537 | unsigned long r6, unsigned long r7, | ||
538 | struct pt_regs __regs) | ||
539 | { | ||
540 | struct pt_regs *regs = RELOC_HIDE(&__regs, 0); | ||
541 | |||
542 | /* Rewind */ | ||
543 | regs->pc -= instruction_size(ctrl_inw(regs->pc - 4)); | ||
544 | |||
545 | if (notify_die(DIE_TRAP, "bug trap", regs, 0, TRAPA_BUG_OPCODE & 0xff, | ||
546 | SIGTRAP) == NOTIFY_STOP) | ||
547 | return; | ||
548 | |||
549 | #ifdef CONFIG_BUG | ||
550 | if (__kernel_text_address(instruction_pointer(regs))) { | ||
551 | u16 insn = *(u16 *)instruction_pointer(regs); | ||
552 | if (insn == TRAPA_BUG_OPCODE) | ||
553 | handle_BUG(regs); | ||
554 | } | ||
555 | #endif | ||
556 | |||
557 | force_sig(SIGTRAP, current); | ||
558 | } | ||
diff --git a/arch/sh64/kernel/process.c b/arch/sh/kernel/process_64.c index 0761af4d2a42..cff3b7dc9c56 100644 --- a/arch/sh64/kernel/process.c +++ b/arch/sh/kernel/process_64.c | |||
@@ -1,12 +1,10 @@ | |||
1 | /* | 1 | /* |
2 | * This file is subject to the terms and conditions of the GNU General Public | 2 | * arch/sh/kernel/process_64.c |
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | 3 | * |
6 | * arch/sh64/kernel/process.c | 4 | * This file handles the architecture-dependent parts of process handling.. |
7 | * | 5 | * |
8 | * Copyright (C) 2000, 2001 Paolo Alberelli | 6 | * Copyright (C) 2000, 2001 Paolo Alberelli |
9 | * Copyright (C) 2003 Paul Mundt | 7 | * Copyright (C) 2003 - 2007 Paul Mundt |
10 | * Copyright (C) 2003, 2004 Richard Curnow | 8 | * Copyright (C) 2003, 2004 Richard Curnow |
11 | * | 9 | * |
12 | * Started from SH3/4 version: | 10 | * Started from SH3/4 version: |
@@ -15,10 +13,9 @@ | |||
15 | * In turn started from i386 version: | 13 | * In turn started from i386 version: |
16 | * Copyright (C) 1995 Linus Torvalds | 14 | * Copyright (C) 1995 Linus Torvalds |
17 | * | 15 | * |
18 | */ | 16 | * This file is subject to the terms and conditions of the GNU General Public |
19 | 17 | * License. See the file "COPYING" in the main directory of this archive | |
20 | /* | 18 | * for more details. |
21 | * This file handles the architecture-dependent parts of process handling.. | ||
22 | */ | 19 | */ |
23 | #include <linux/mm.h> | 20 | #include <linux/mm.h> |
24 | #include <linux/fs.h> | 21 | #include <linux/fs.h> |
@@ -27,8 +24,10 @@ | |||
27 | #include <linux/init.h> | 24 | #include <linux/init.h> |
28 | #include <linux/module.h> | 25 | #include <linux/module.h> |
29 | #include <linux/proc_fs.h> | 26 | #include <linux/proc_fs.h> |
27 | #include <linux/io.h> | ||
30 | #include <asm/uaccess.h> | 28 | #include <asm/uaccess.h> |
31 | #include <asm/pgtable.h> | 29 | #include <asm/pgtable.h> |
30 | #include <asm/mmu_context.h> | ||
32 | 31 | ||
33 | struct task_struct *last_task_used_math = NULL; | 32 | struct task_struct *last_task_used_math = NULL; |
34 | 33 | ||
@@ -106,9 +105,20 @@ void machine_halt(void) | |||
106 | 105 | ||
107 | void machine_power_off(void) | 106 | void machine_power_off(void) |
108 | { | 107 | { |
109 | extern void enter_deep_standby(void); | 108 | #if 0 |
109 | /* Disable watchdog timer */ | ||
110 | ctrl_outl(0xa5000000, WTCSR); | ||
111 | /* Configure deep standby on sleep */ | ||
112 | ctrl_outl(0x03, STBCR); | ||
113 | #endif | ||
114 | |||
115 | __asm__ __volatile__ ( | ||
116 | "sleep\n\t" | ||
117 | "synci\n\t" | ||
118 | "nop;nop;nop;nop\n\t" | ||
119 | ); | ||
110 | 120 | ||
111 | enter_deep_standby(); | 121 | panic("Unexpected wakeup!\n"); |
112 | } | 122 | } |
113 | 123 | ||
114 | void (*pm_power_off)(void) = machine_power_off; | 124 | void (*pm_power_off)(void) = machine_power_off; |
@@ -411,19 +421,22 @@ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) | |||
411 | */ | 421 | */ |
412 | void exit_thread(void) | 422 | void exit_thread(void) |
413 | { | 423 | { |
414 | /* See arch/sparc/kernel/process.c for the precedent for doing this -- RPC. | 424 | /* |
415 | 425 | * See arch/sparc/kernel/process.c for the precedent for doing | |
416 | The SH-5 FPU save/restore approach relies on last_task_used_math | 426 | * this -- RPC. |
417 | pointing to a live task_struct. When another task tries to use the | 427 | * |
418 | FPU for the 1st time, the FPUDIS trap handling (see | 428 | * The SH-5 FPU save/restore approach relies on |
419 | arch/sh64/kernel/fpu.c) will save the existing FPU state to the | 429 | * last_task_used_math pointing to a live task_struct. When |
420 | FP regs field within last_task_used_math before re-loading the new | 430 | * another task tries to use the FPU for the 1st time, the FPUDIS |
421 | task's FPU state (or initialising it if the FPU has been used | 431 | * trap handling (see arch/sh/kernel/cpu/sh5/fpu.c) will save the |
422 | before). So if last_task_used_math is stale, and its page has already been | 432 | * existing FPU state to the FP regs field within |
423 | re-allocated for another use, the consequences are rather grim. Unless we | 433 | * last_task_used_math before re-loading the new task's FPU state |
424 | null it here, there is no other path through which it would get safely | 434 | * (or initialising it if the FPU has been used before). So if |
425 | nulled. */ | 435 | * last_task_used_math is stale, and its page has already been |
426 | 436 | * re-allocated for another use, the consequences are rather | |
437 | * grim. Unless we null it here, there is no other path through | ||
438 | * which it would get safely nulled. | ||
439 | */ | ||
427 | #ifdef CONFIG_SH_FPU | 440 | #ifdef CONFIG_SH_FPU |
428 | if (last_task_used_math == current) { | 441 | if (last_task_used_math == current) { |
429 | last_task_used_math = NULL; | 442 | last_task_used_math = NULL; |
@@ -469,9 +482,9 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu) | |||
469 | fpvalid = !!tsk_used_math(tsk); | 482 | fpvalid = !!tsk_used_math(tsk); |
470 | if (fpvalid) { | 483 | if (fpvalid) { |
471 | if (current == last_task_used_math) { | 484 | if (current == last_task_used_math) { |
472 | grab_fpu(); | 485 | enable_fpu(); |
473 | fpsave(&tsk->thread.fpu.hard); | 486 | save_fpu(tsk, regs); |
474 | release_fpu(); | 487 | disable_fpu(); |
475 | last_task_used_math = 0; | 488 | last_task_used_math = 0; |
476 | regs->sr |= SR_FD; | 489 | regs->sr |= SR_FD; |
477 | } | 490 | } |
@@ -496,9 +509,9 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp, | |||
496 | 509 | ||
497 | #ifdef CONFIG_SH_FPU | 510 | #ifdef CONFIG_SH_FPU |
498 | if(last_task_used_math == current) { | 511 | if(last_task_used_math == current) { |
499 | grab_fpu(); | 512 | enable_fpu(); |
500 | fpsave(¤t->thread.fpu.hard); | 513 | save_fpu(current, regs); |
501 | release_fpu(); | 514 | disable_fpu(); |
502 | last_task_used_math = NULL; | 515 | last_task_used_math = NULL; |
503 | regs->sr |= SR_FD; | 516 | regs->sr |= SR_FD; |
504 | } | 517 | } |
@@ -665,17 +678,14 @@ asids_proc_info(char *buf, char **start, off_t fpos, int length, int *eof, void | |||
665 | read_lock(&tasklist_lock); | 678 | read_lock(&tasklist_lock); |
666 | for_each_process(p) { | 679 | for_each_process(p) { |
667 | int pid = p->pid; | 680 | int pid = p->pid; |
668 | struct mm_struct *mm; | 681 | |
669 | if (!pid) continue; | 682 | if (!pid) |
670 | mm = p->mm; | 683 | continue; |
671 | if (mm) { | 684 | if (p->mm) |
672 | unsigned long asid, context; | 685 | len += sprintf(buf+len, "%5d : %02lx\n", pid, |
673 | context = mm->context; | 686 | asid_cache(smp_processor_id())); |
674 | asid = (context & 0xff); | 687 | else |
675 | len += sprintf(buf+len, "%5d : %02lx\n", pid, asid); | ||
676 | } else { | ||
677 | len += sprintf(buf+len, "%5d : (none)\n", pid); | 688 | len += sprintf(buf+len, "%5d : (none)\n", pid); |
678 | } | ||
679 | } | 689 | } |
680 | read_unlock(&tasklist_lock); | 690 | read_unlock(&tasklist_lock); |
681 | *eof = 1; | 691 | *eof = 1; |
diff --git a/arch/sh/kernel/ptrace.c b/arch/sh/kernel/ptrace_32.c index ac725f0aeb72..ce0664a58b49 100644 --- a/arch/sh/kernel/ptrace.c +++ b/arch/sh/kernel/ptrace_32.c | |||
@@ -6,7 +6,7 @@ | |||
6 | * edited by Linus Torvalds | 6 | * edited by Linus Torvalds |
7 | * | 7 | * |
8 | * SuperH version: Copyright (C) 1999, 2000 Kaz Kojima & Niibe Yutaka | 8 | * SuperH version: Copyright (C) 1999, 2000 Kaz Kojima & Niibe Yutaka |
9 | * | 9 | * Audit support: Yuichi Nakamura <ynakam@hitachisoft.jp> |
10 | */ | 10 | */ |
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/sched.h> | 12 | #include <linux/sched.h> |
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/security.h> | 19 | #include <linux/security.h> |
20 | #include <linux/signal.h> | 20 | #include <linux/signal.h> |
21 | #include <linux/io.h> | 21 | #include <linux/io.h> |
22 | #include <linux/audit.h> | ||
22 | #include <asm/uaccess.h> | 23 | #include <asm/uaccess.h> |
23 | #include <asm/pgtable.h> | 24 | #include <asm/pgtable.h> |
24 | #include <asm/system.h> | 25 | #include <asm/system.h> |
@@ -248,15 +249,20 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
248 | return ret; | 249 | return ret; |
249 | } | 250 | } |
250 | 251 | ||
251 | asmlinkage void do_syscall_trace(void) | 252 | asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit) |
252 | { | 253 | { |
253 | struct task_struct *tsk = current; | 254 | struct task_struct *tsk = current; |
254 | 255 | ||
256 | if (unlikely(current->audit_context) && entryexit) | ||
257 | audit_syscall_exit(AUDITSC_RESULT(regs->regs[0]), | ||
258 | regs->regs[0]); | ||
259 | |||
255 | if (!test_thread_flag(TIF_SYSCALL_TRACE) && | 260 | if (!test_thread_flag(TIF_SYSCALL_TRACE) && |
256 | !test_thread_flag(TIF_SINGLESTEP)) | 261 | !test_thread_flag(TIF_SINGLESTEP)) |
257 | return; | 262 | goto out; |
258 | if (!(tsk->ptrace & PT_PTRACED)) | 263 | if (!(tsk->ptrace & PT_PTRACED)) |
259 | return; | 264 | goto out; |
265 | |||
260 | /* the 0x80 provides a way for the tracing parent to distinguish | 266 | /* the 0x80 provides a way for the tracing parent to distinguish |
261 | between a syscall stop and SIGTRAP delivery */ | 267 | between a syscall stop and SIGTRAP delivery */ |
262 | ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) && | 268 | ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) && |
@@ -271,4 +277,11 @@ asmlinkage void do_syscall_trace(void) | |||
271 | send_sig(tsk->exit_code, tsk, 1); | 277 | send_sig(tsk->exit_code, tsk, 1); |
272 | tsk->exit_code = 0; | 278 | tsk->exit_code = 0; |
273 | } | 279 | } |
280 | |||
281 | out: | ||
282 | if (unlikely(current->audit_context) && !entryexit) | ||
283 | audit_syscall_entry(AUDIT_ARCH_SH, regs->regs[3], | ||
284 | regs->regs[4], regs->regs[5], | ||
285 | regs->regs[6], regs->regs[7]); | ||
286 | |||
274 | } | 287 | } |
diff --git a/arch/sh64/kernel/ptrace.c b/arch/sh/kernel/ptrace_64.c index 8a2d339cf760..f6fbdfa6876d 100644 --- a/arch/sh64/kernel/ptrace.c +++ b/arch/sh/kernel/ptrace_64.c | |||
@@ -1,12 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | * This file is subject to the terms and conditions of the GNU General Public | 2 | * arch/sh/kernel/ptrace_64.c |
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * arch/sh64/kernel/ptrace.c | ||
7 | * | 3 | * |
8 | * Copyright (C) 2000, 2001 Paolo Alberelli | 4 | * Copyright (C) 2000, 2001 Paolo Alberelli |
9 | * Copyright (C) 2003 Paul Mundt | 5 | * Copyright (C) 2003 - 2007 Paul Mundt |
10 | * | 6 | * |
11 | * Started from SH3/4 version: | 7 | * Started from SH3/4 version: |
12 | * SuperH version: Copyright (C) 1999, 2000 Kaz Kojima & Niibe Yutaka | 8 | * SuperH version: Copyright (C) 1999, 2000 Kaz Kojima & Niibe Yutaka |
@@ -15,8 +11,10 @@ | |||
15 | * By Ross Biro 1/23/92 | 11 | * By Ross Biro 1/23/92 |
16 | * edited by Linus Torvalds | 12 | * edited by Linus Torvalds |
17 | * | 13 | * |
14 | * This file is subject to the terms and conditions of the GNU General Public | ||
15 | * License. See the file "COPYING" in the main directory of this archive | ||
16 | * for more details. | ||
18 | */ | 17 | */ |
19 | |||
20 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
21 | #include <linux/rwsem.h> | 19 | #include <linux/rwsem.h> |
22 | #include <linux/sched.h> | 20 | #include <linux/sched.h> |
@@ -28,7 +26,7 @@ | |||
28 | #include <linux/user.h> | 26 | #include <linux/user.h> |
29 | #include <linux/signal.h> | 27 | #include <linux/signal.h> |
30 | #include <linux/syscalls.h> | 28 | #include <linux/syscalls.h> |
31 | 29 | #include <linux/audit.h> | |
32 | #include <asm/io.h> | 30 | #include <asm/io.h> |
33 | #include <asm/uaccess.h> | 31 | #include <asm/uaccess.h> |
34 | #include <asm/pgtable.h> | 32 | #include <asm/pgtable.h> |
@@ -74,9 +72,9 @@ get_fpu_long(struct task_struct *task, unsigned long addr) | |||
74 | } | 72 | } |
75 | 73 | ||
76 | if (last_task_used_math == task) { | 74 | if (last_task_used_math == task) { |
77 | grab_fpu(); | 75 | enable_fpu(); |
78 | fpsave(&task->thread.fpu.hard); | 76 | save_fpu(task, regs); |
79 | release_fpu(); | 77 | disable_fpu(); |
80 | last_task_used_math = 0; | 78 | last_task_used_math = 0; |
81 | regs->sr |= SR_FD; | 79 | regs->sr |= SR_FD; |
82 | } | 80 | } |
@@ -110,9 +108,9 @@ put_fpu_long(struct task_struct *task, unsigned long addr, unsigned long data) | |||
110 | fpinit(&task->thread.fpu.hard); | 108 | fpinit(&task->thread.fpu.hard); |
111 | set_stopped_child_used_math(task); | 109 | set_stopped_child_used_math(task); |
112 | } else if (last_task_used_math == task) { | 110 | } else if (last_task_used_math == task) { |
113 | grab_fpu(); | 111 | enable_fpu(); |
114 | fpsave(&task->thread.fpu.hard); | 112 | save_fpu(task, regs); |
115 | release_fpu(); | 113 | disable_fpu(); |
116 | last_task_used_math = 0; | 114 | last_task_used_math = 0; |
117 | regs->sr |= SR_FD; | 115 | regs->sr |= SR_FD; |
118 | } | 116 | } |
@@ -253,7 +251,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
253 | 251 | ||
254 | asmlinkage int sh64_ptrace(long request, long pid, long addr, long data) | 252 | asmlinkage int sh64_ptrace(long request, long pid, long addr, long data) |
255 | { | 253 | { |
256 | extern void poke_real_address_q(unsigned long long addr, unsigned long long data); | ||
257 | #define WPC_DBRMODE 0x0d104008 | 254 | #define WPC_DBRMODE 0x0d104008 |
258 | static int first_call = 1; | 255 | static int first_call = 1; |
259 | 256 | ||
@@ -275,17 +272,23 @@ asmlinkage int sh64_ptrace(long request, long pid, long addr, long data) | |||
275 | return sys_ptrace(request, pid, addr, data); | 272 | return sys_ptrace(request, pid, addr, data); |
276 | } | 273 | } |
277 | 274 | ||
278 | asmlinkage void syscall_trace(void) | 275 | asmlinkage void syscall_trace(struct pt_regs *regs, int entryexit) |
279 | { | 276 | { |
280 | struct task_struct *tsk = current; | 277 | struct task_struct *tsk = current; |
281 | 278 | ||
282 | if (!test_thread_flag(TIF_SYSCALL_TRACE)) | 279 | if (unlikely(current->audit_context) && entryexit) |
283 | return; | 280 | audit_syscall_exit(AUDITSC_RESULT(regs->regs[9]), |
281 | regs->regs[9]); | ||
282 | |||
283 | if (!test_thread_flag(TIF_SYSCALL_TRACE) && | ||
284 | !test_thread_flag(TIF_SINGLESTEP)) | ||
285 | goto out; | ||
284 | if (!(tsk->ptrace & PT_PTRACED)) | 286 | if (!(tsk->ptrace & PT_PTRACED)) |
285 | return; | 287 | goto out; |
288 | |||
289 | ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) && | ||
290 | !test_thread_flag(TIF_SINGLESTEP) ? 0x80 : 0)); | ||
286 | 291 | ||
287 | ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) | ||
288 | ? 0x80 : 0)); | ||
289 | /* | 292 | /* |
290 | * this isn't the same as continuing with a signal, but it will do | 293 | * this isn't the same as continuing with a signal, but it will do |
291 | * for normal use. strace only continues with a signal if the | 294 | * for normal use. strace only continues with a signal if the |
@@ -295,6 +298,12 @@ asmlinkage void syscall_trace(void) | |||
295 | send_sig(tsk->exit_code, tsk, 1); | 298 | send_sig(tsk->exit_code, tsk, 1); |
296 | tsk->exit_code = 0; | 299 | tsk->exit_code = 0; |
297 | } | 300 | } |
301 | |||
302 | out: | ||
303 | if (unlikely(current->audit_context) && !entryexit) | ||
304 | audit_syscall_entry(AUDIT_ARCH_SH, regs->regs[1], | ||
305 | regs->regs[2], regs->regs[3], | ||
306 | regs->regs[4], regs->regs[5]); | ||
298 | } | 307 | } |
299 | 308 | ||
300 | /* Called with interrupts disabled */ | 309 | /* Called with interrupts disabled */ |
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c index 4156aac8c27d..855cdf9d85b1 100644 --- a/arch/sh/kernel/setup.c +++ b/arch/sh/kernel/setup.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <asm/uaccess.h> | 26 | #include <asm/uaccess.h> |
27 | #include <asm/io.h> | 27 | #include <asm/io.h> |
28 | #include <asm/page.h> | 28 | #include <asm/page.h> |
29 | #include <asm/elf.h> | ||
29 | #include <asm/sections.h> | 30 | #include <asm/sections.h> |
30 | #include <asm/irq.h> | 31 | #include <asm/irq.h> |
31 | #include <asm/setup.h> | 32 | #include <asm/setup.h> |
@@ -78,12 +79,25 @@ EXPORT_SYMBOL(memory_start); | |||
78 | unsigned long memory_end = 0; | 79 | unsigned long memory_end = 0; |
79 | EXPORT_SYMBOL(memory_end); | 80 | EXPORT_SYMBOL(memory_end); |
80 | 81 | ||
82 | int l1i_cache_shape, l1d_cache_shape, l2_cache_shape; | ||
83 | |||
81 | static int __init early_parse_mem(char *p) | 84 | static int __init early_parse_mem(char *p) |
82 | { | 85 | { |
83 | unsigned long size; | 86 | unsigned long size; |
84 | 87 | ||
85 | memory_start = (unsigned long)PAGE_OFFSET+__MEMORY_START; | 88 | memory_start = (unsigned long)__va(__MEMORY_START); |
86 | size = memparse(p, &p); | 89 | size = memparse(p, &p); |
90 | |||
91 | if (size > __MEMORY_SIZE) { | ||
92 | static char msg[] __initdata = KERN_ERR | ||
93 | "Using mem= to increase the size of kernel memory " | ||
94 | "is not allowed.\n" | ||
95 | " Recompile the kernel with the correct value for " | ||
96 | "CONFIG_MEMORY_SIZE.\n"; | ||
97 | printk(msg); | ||
98 | return 0; | ||
99 | } | ||
100 | |||
87 | memory_end = memory_start + size; | 101 | memory_end = memory_start + size; |
88 | 102 | ||
89 | return 0; | 103 | return 0; |
@@ -243,7 +257,7 @@ void __init setup_arch(char **cmdline_p) | |||
243 | data_resource.start = virt_to_phys(_etext); | 257 | data_resource.start = virt_to_phys(_etext); |
244 | data_resource.end = virt_to_phys(_edata)-1; | 258 | data_resource.end = virt_to_phys(_edata)-1; |
245 | 259 | ||
246 | memory_start = (unsigned long)PAGE_OFFSET+__MEMORY_START; | 260 | memory_start = (unsigned long)__va(__MEMORY_START); |
247 | if (!memory_end) | 261 | if (!memory_end) |
248 | memory_end = memory_start + __MEMORY_SIZE; | 262 | memory_end = memory_start + __MEMORY_SIZE; |
249 | 263 | ||
@@ -294,20 +308,23 @@ void __init setup_arch(char **cmdline_p) | |||
294 | } | 308 | } |
295 | 309 | ||
296 | static const char *cpu_name[] = { | 310 | static const char *cpu_name[] = { |
311 | [CPU_SH7203] = "SH7203", [CPU_SH7263] = "SH7263", | ||
297 | [CPU_SH7206] = "SH7206", [CPU_SH7619] = "SH7619", | 312 | [CPU_SH7206] = "SH7206", [CPU_SH7619] = "SH7619", |
298 | [CPU_SH7705] = "SH7705", [CPU_SH7706] = "SH7706", | 313 | [CPU_SH7705] = "SH7705", [CPU_SH7706] = "SH7706", |
299 | [CPU_SH7707] = "SH7707", [CPU_SH7708] = "SH7708", | 314 | [CPU_SH7707] = "SH7707", [CPU_SH7708] = "SH7708", |
300 | [CPU_SH7709] = "SH7709", [CPU_SH7710] = "SH7710", | 315 | [CPU_SH7709] = "SH7709", [CPU_SH7710] = "SH7710", |
301 | [CPU_SH7712] = "SH7712", [CPU_SH7720] = "SH7720", | 316 | [CPU_SH7712] = "SH7712", [CPU_SH7720] = "SH7720", |
302 | [CPU_SH7729] = "SH7729", [CPU_SH7750] = "SH7750", | 317 | [CPU_SH7721] = "SH7721", [CPU_SH7729] = "SH7729", |
303 | [CPU_SH7750S] = "SH7750S", [CPU_SH7750R] = "SH7750R", | 318 | [CPU_SH7750] = "SH7750", [CPU_SH7750S] = "SH7750S", |
304 | [CPU_SH7751] = "SH7751", [CPU_SH7751R] = "SH7751R", | 319 | [CPU_SH7750R] = "SH7750R", [CPU_SH7751] = "SH7751", |
305 | [CPU_SH7760] = "SH7760", | 320 | [CPU_SH7751R] = "SH7751R", [CPU_SH7760] = "SH7760", |
306 | [CPU_SH4_202] = "SH4-202", [CPU_SH4_501] = "SH4-501", | 321 | [CPU_SH4_202] = "SH4-202", [CPU_SH4_501] = "SH4-501", |
307 | [CPU_SH7770] = "SH7770", [CPU_SH7780] = "SH7780", | 322 | [CPU_SH7763] = "SH7763", [CPU_SH7770] = "SH7770", |
308 | [CPU_SH7781] = "SH7781", [CPU_SH7343] = "SH7343", | 323 | [CPU_SH7780] = "SH7780", [CPU_SH7781] = "SH7781", |
309 | [CPU_SH7785] = "SH7785", [CPU_SH7722] = "SH7722", | 324 | [CPU_SH7343] = "SH7343", [CPU_SH7785] = "SH7785", |
310 | [CPU_SHX3] = "SH-X3", [CPU_SH_NONE] = "Unknown" | 325 | [CPU_SH7722] = "SH7722", [CPU_SHX3] = "SH-X3", |
326 | [CPU_SH5_101] = "SH5-101", [CPU_SH5_103] = "SH5-103", | ||
327 | [CPU_SH_NONE] = "Unknown" | ||
311 | }; | 328 | }; |
312 | 329 | ||
313 | const char *get_cpu_subtype(struct sh_cpuinfo *c) | 330 | const char *get_cpu_subtype(struct sh_cpuinfo *c) |
@@ -410,7 +427,7 @@ static void *c_next(struct seq_file *m, void *v, loff_t *pos) | |||
410 | static void c_stop(struct seq_file *m, void *v) | 427 | static void c_stop(struct seq_file *m, void *v) |
411 | { | 428 | { |
412 | } | 429 | } |
413 | struct seq_operations cpuinfo_op = { | 430 | const struct seq_operations cpuinfo_op = { |
414 | .start = c_start, | 431 | .start = c_start, |
415 | .next = c_next, | 432 | .next = c_next, |
416 | .stop = c_stop, | 433 | .stop = c_stop, |
diff --git a/arch/sh/kernel/sh_ksyms.c b/arch/sh/kernel/sh_ksyms_32.c index e1a6de9088b5..e1a6de9088b5 100644 --- a/arch/sh/kernel/sh_ksyms.c +++ b/arch/sh/kernel/sh_ksyms_32.c | |||
diff --git a/arch/sh64/kernel/sh_ksyms.c b/arch/sh/kernel/sh_ksyms_64.c index b1705acc8e64..8004c38d3d37 100644 --- a/arch/sh64/kernel/sh_ksyms.c +++ b/arch/sh/kernel/sh_ksyms_64.c | |||
@@ -1,14 +1,12 @@ | |||
1 | /* | 1 | /* |
2 | * This file is subject to the terms and conditions of the GNU General Public | 2 | * arch/sh/kernel/sh_ksyms_64.c |
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * arch/sh64/kernel/sh_ksyms.c | ||
7 | * | 3 | * |
8 | * Copyright (C) 2000, 2001 Paolo Alberelli | 4 | * Copyright (C) 2000, 2001 Paolo Alberelli |
9 | * | 5 | * |
6 | * This file is subject to the terms and conditions of the GNU General Public | ||
7 | * License. See the file "COPYING" in the main directory of this archive | ||
8 | * for more details. | ||
10 | */ | 9 | */ |
11 | |||
12 | #include <linux/rwsem.h> | 10 | #include <linux/rwsem.h> |
13 | #include <linux/module.h> | 11 | #include <linux/module.h> |
14 | #include <linux/smp.h> | 12 | #include <linux/smp.h> |
@@ -18,7 +16,6 @@ | |||
18 | #include <linux/in6.h> | 16 | #include <linux/in6.h> |
19 | #include <linux/interrupt.h> | 17 | #include <linux/interrupt.h> |
20 | #include <linux/screen_info.h> | 18 | #include <linux/screen_info.h> |
21 | |||
22 | #include <asm/semaphore.h> | 19 | #include <asm/semaphore.h> |
23 | #include <asm/processor.h> | 20 | #include <asm/processor.h> |
24 | #include <asm/uaccess.h> | 21 | #include <asm/uaccess.h> |
@@ -47,12 +44,8 @@ EXPORT_SYMBOL(__put_user_asm_l); | |||
47 | EXPORT_SYMBOL(__get_user_asm_l); | 44 | EXPORT_SYMBOL(__get_user_asm_l); |
48 | EXPORT_SYMBOL(__copy_user); | 45 | EXPORT_SYMBOL(__copy_user); |
49 | EXPORT_SYMBOL(memcpy); | 46 | EXPORT_SYMBOL(memcpy); |
50 | EXPORT_SYMBOL(udelay); | ||
51 | EXPORT_SYMBOL(__udelay); | 47 | EXPORT_SYMBOL(__udelay); |
52 | EXPORT_SYMBOL(ndelay); | ||
53 | EXPORT_SYMBOL(__ndelay); | 48 | EXPORT_SYMBOL(__ndelay); |
54 | EXPORT_SYMBOL(flush_dcache_page); | ||
55 | EXPORT_SYMBOL(sh64_page_clear); | ||
56 | 49 | ||
57 | /* Ugh. These come in from libgcc.a at link time. */ | 50 | /* Ugh. These come in from libgcc.a at link time. */ |
58 | #define DECLARE_EXPORT(name) extern void name(void);EXPORT_SYMBOL(name) | 51 | #define DECLARE_EXPORT(name) extern void name(void);EXPORT_SYMBOL(name) |
diff --git a/arch/sh/kernel/signal.c b/arch/sh/kernel/signal_32.c index ca754fd42437..f6b5fbfe75c4 100644 --- a/arch/sh/kernel/signal.c +++ b/arch/sh/kernel/signal_32.c | |||
@@ -507,24 +507,6 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info, | |||
507 | ctrl_inw(regs->pc - 4)); | 507 | ctrl_inw(regs->pc - 4)); |
508 | break; | 508 | break; |
509 | } | 509 | } |
510 | #ifdef CONFIG_GUSA | ||
511 | } else { | ||
512 | /* gUSA handling */ | ||
513 | preempt_disable(); | ||
514 | |||
515 | if (regs->regs[15] >= 0xc0000000) { | ||
516 | int offset = (int)regs->regs[15]; | ||
517 | |||
518 | /* Reset stack pointer: clear critical region mark */ | ||
519 | regs->regs[15] = regs->regs[1]; | ||
520 | if (regs->pc < regs->regs[0]) | ||
521 | /* Go to rewind point #1 */ | ||
522 | regs->pc = regs->regs[0] + offset - | ||
523 | instruction_size(ctrl_inw(regs->pc-4)); | ||
524 | } | ||
525 | |||
526 | preempt_enable_no_resched(); | ||
527 | #endif | ||
528 | } | 510 | } |
529 | 511 | ||
530 | /* Set up the stack frame */ | 512 | /* Set up the stack frame */ |
diff --git a/arch/sh64/kernel/signal.c b/arch/sh/kernel/signal_64.c index 79fc48cf54c6..80bde19d445b 100644 --- a/arch/sh64/kernel/signal.c +++ b/arch/sh/kernel/signal_64.c | |||
@@ -1,16 +1,13 @@ | |||
1 | /* | 1 | /* |
2 | * This file is subject to the terms and conditions of the GNU General Public | 2 | * arch/sh/kernel/signal_64.c |
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * arch/sh64/kernel/signal.c | ||
7 | * | 3 | * |
8 | * Copyright (C) 2000, 2001 Paolo Alberelli | 4 | * Copyright (C) 2000, 2001 Paolo Alberelli |
9 | * Copyright (C) 2003 Paul Mundt | 5 | * Copyright (C) 2003 Paul Mundt |
10 | * Copyright (C) 2004 Richard Curnow | 6 | * Copyright (C) 2004 Richard Curnow |
11 | * | 7 | * |
12 | * Started from sh version. | 8 | * This file is subject to the terms and conditions of the GNU General Public |
13 | * | 9 | * License. See the file "COPYING" in the main directory of this archive |
10 | * for more details. | ||
14 | */ | 11 | */ |
15 | #include <linux/rwsem.h> | 12 | #include <linux/rwsem.h> |
16 | #include <linux/sched.h> | 13 | #include <linux/sched.h> |
@@ -28,7 +25,7 @@ | |||
28 | #include <asm/ucontext.h> | 25 | #include <asm/ucontext.h> |
29 | #include <asm/uaccess.h> | 26 | #include <asm/uaccess.h> |
30 | #include <asm/pgtable.h> | 27 | #include <asm/pgtable.h> |
31 | 28 | #include <asm/cacheflush.h> | |
32 | 29 | ||
33 | #define REG_RET 9 | 30 | #define REG_RET 9 |
34 | #define REG_ARG1 2 | 31 | #define REG_ARG1 2 |
@@ -211,9 +208,9 @@ setup_sigcontext_fpu(struct pt_regs *regs, struct sigcontext __user *sc) | |||
211 | return err; | 208 | return err; |
212 | 209 | ||
213 | if (current == last_task_used_math) { | 210 | if (current == last_task_used_math) { |
214 | grab_fpu(); | 211 | enable_fpu(); |
215 | fpsave(¤t->thread.fpu.hard); | 212 | save_fpu(current, regs); |
216 | release_fpu(); | 213 | disable_fpu(); |
217 | last_task_used_math = NULL; | 214 | last_task_used_math = NULL; |
218 | regs->sr |= SR_FD; | 215 | regs->sr |= SR_FD; |
219 | } | 216 | } |
@@ -227,10 +224,14 @@ setup_sigcontext_fpu(struct pt_regs *regs, struct sigcontext __user *sc) | |||
227 | #else | 224 | #else |
228 | static inline int | 225 | static inline int |
229 | restore_sigcontext_fpu(struct pt_regs *regs, struct sigcontext __user *sc) | 226 | restore_sigcontext_fpu(struct pt_regs *regs, struct sigcontext __user *sc) |
230 | {} | 227 | { |
228 | return 0; | ||
229 | } | ||
231 | static inline int | 230 | static inline int |
232 | setup_sigcontext_fpu(struct pt_regs *regs, struct sigcontext __user *sc) | 231 | setup_sigcontext_fpu(struct pt_regs *regs, struct sigcontext __user *sc) |
233 | {} | 232 | { |
233 | return 0; | ||
234 | } | ||
234 | #endif | 235 | #endif |
235 | 236 | ||
236 | static int | 237 | static int |
@@ -477,7 +478,7 @@ static void setup_frame(int sig, struct k_sigaction *ka, | |||
477 | goto give_sigsegv; | 478 | goto give_sigsegv; |
478 | 479 | ||
479 | /* Cohere the trampoline with the I-cache. */ | 480 | /* Cohere the trampoline with the I-cache. */ |
480 | flush_cache_sigtramp(DEREF_REG_PR-1, DEREF_REG_PR-1+16); | 481 | flush_cache_sigtramp(DEREF_REG_PR-1); |
481 | } | 482 | } |
482 | 483 | ||
483 | /* | 484 | /* |
diff --git a/arch/sh/kernel/sys_sh.c b/arch/sh/kernel/sys_sh.c index d545a686a201..59cd2859ce9b 100644 --- a/arch/sh/kernel/sys_sh.c +++ b/arch/sh/kernel/sys_sh.c | |||
@@ -7,7 +7,6 @@ | |||
7 | * | 7 | * |
8 | * Taken from i386 version. | 8 | * Taken from i386 version. |
9 | */ | 9 | */ |
10 | |||
11 | #include <linux/errno.h> | 10 | #include <linux/errno.h> |
12 | #include <linux/sched.h> | 11 | #include <linux/sched.h> |
13 | #include <linux/mm.h> | 12 | #include <linux/mm.h> |
@@ -27,28 +26,7 @@ | |||
27 | #include <asm/uaccess.h> | 26 | #include <asm/uaccess.h> |
28 | #include <asm/unistd.h> | 27 | #include <asm/unistd.h> |
29 | 28 | ||
30 | /* | ||
31 | * sys_pipe() is the normal C calling standard for creating | ||
32 | * a pipe. It's not the way Unix traditionally does this, though. | ||
33 | */ | ||
34 | asmlinkage int sys_pipe(unsigned long r4, unsigned long r5, | ||
35 | unsigned long r6, unsigned long r7, | ||
36 | struct pt_regs __regs) | ||
37 | { | ||
38 | struct pt_regs *regs = RELOC_HIDE(&__regs, 0); | ||
39 | int fd[2]; | ||
40 | int error; | ||
41 | |||
42 | error = do_pipe(fd); | ||
43 | if (!error) { | ||
44 | regs->regs[1] = fd[1]; | ||
45 | return fd[0]; | ||
46 | } | ||
47 | return error; | ||
48 | } | ||
49 | |||
50 | unsigned long shm_align_mask = PAGE_SIZE - 1; /* Sane caches */ | 29 | unsigned long shm_align_mask = PAGE_SIZE - 1; /* Sane caches */ |
51 | |||
52 | EXPORT_SYMBOL(shm_align_mask); | 30 | EXPORT_SYMBOL(shm_align_mask); |
53 | 31 | ||
54 | #ifdef CONFIG_MMU | 32 | #ifdef CONFIG_MMU |
@@ -140,7 +118,7 @@ full_search: | |||
140 | #endif /* CONFIG_MMU */ | 118 | #endif /* CONFIG_MMU */ |
141 | 119 | ||
142 | static inline long | 120 | static inline long |
143 | do_mmap2(unsigned long addr, unsigned long len, unsigned long prot, | 121 | do_mmap2(unsigned long addr, unsigned long len, unsigned long prot, |
144 | unsigned long flags, int fd, unsigned long pgoff) | 122 | unsigned long flags, int fd, unsigned long pgoff) |
145 | { | 123 | { |
146 | int error = -EBADF; | 124 | int error = -EBADF; |
@@ -195,12 +173,13 @@ asmlinkage int sys_ipc(uint call, int first, int second, | |||
195 | if (call <= SEMCTL) | 173 | if (call <= SEMCTL) |
196 | switch (call) { | 174 | switch (call) { |
197 | case SEMOP: | 175 | case SEMOP: |
198 | return sys_semtimedop(first, (struct sembuf __user *)ptr, | 176 | return sys_semtimedop(first, |
177 | (struct sembuf __user *)ptr, | ||
199 | second, NULL); | 178 | second, NULL); |
200 | case SEMTIMEDOP: | 179 | case SEMTIMEDOP: |
201 | return sys_semtimedop(first, (struct sembuf __user *)ptr, | 180 | return sys_semtimedop(first, |
202 | second, | 181 | (struct sembuf __user *)ptr, second, |
203 | (const struct timespec __user *)fifth); | 182 | (const struct timespec __user *)fifth); |
204 | case SEMGET: | 183 | case SEMGET: |
205 | return sys_semget (first, second, third); | 184 | return sys_semget (first, second, third); |
206 | case SEMCTL: { | 185 | case SEMCTL: { |
@@ -215,25 +194,28 @@ asmlinkage int sys_ipc(uint call, int first, int second, | |||
215 | return -EINVAL; | 194 | return -EINVAL; |
216 | } | 195 | } |
217 | 196 | ||
218 | if (call <= MSGCTL) | 197 | if (call <= MSGCTL) |
219 | switch (call) { | 198 | switch (call) { |
220 | case MSGSND: | 199 | case MSGSND: |
221 | return sys_msgsnd (first, (struct msgbuf __user *) ptr, | 200 | return sys_msgsnd (first, (struct msgbuf __user *) ptr, |
222 | second, third); | 201 | second, third); |
223 | case MSGRCV: | 202 | case MSGRCV: |
224 | switch (version) { | 203 | switch (version) { |
225 | case 0: { | 204 | case 0: |
205 | { | ||
226 | struct ipc_kludge tmp; | 206 | struct ipc_kludge tmp; |
207 | |||
227 | if (!ptr) | 208 | if (!ptr) |
228 | return -EINVAL; | 209 | return -EINVAL; |
229 | 210 | ||
230 | if (copy_from_user(&tmp, | 211 | if (copy_from_user(&tmp, |
231 | (struct ipc_kludge __user *) ptr, | 212 | (struct ipc_kludge __user *) ptr, |
232 | sizeof (tmp))) | 213 | sizeof (tmp))) |
233 | return -EFAULT; | 214 | return -EFAULT; |
215 | |||
234 | return sys_msgrcv (first, tmp.msgp, second, | 216 | return sys_msgrcv (first, tmp.msgp, second, |
235 | tmp.msgtyp, third); | 217 | tmp.msgtyp, third); |
236 | } | 218 | } |
237 | default: | 219 | default: |
238 | return sys_msgrcv (first, | 220 | return sys_msgrcv (first, |
239 | (struct msgbuf __user *) ptr, | 221 | (struct msgbuf __user *) ptr, |
@@ -247,7 +229,7 @@ asmlinkage int sys_ipc(uint call, int first, int second, | |||
247 | default: | 229 | default: |
248 | return -EINVAL; | 230 | return -EINVAL; |
249 | } | 231 | } |
250 | if (call <= SHMCTL) | 232 | if (call <= SHMCTL) |
251 | switch (call) { | 233 | switch (call) { |
252 | case SHMAT: | 234 | case SHMAT: |
253 | switch (version) { | 235 | switch (version) { |
@@ -265,7 +247,7 @@ asmlinkage int sys_ipc(uint call, int first, int second, | |||
265 | return do_shmat (first, (char __user *) ptr, | 247 | return do_shmat (first, (char __user *) ptr, |
266 | second, (ulong *) third); | 248 | second, (ulong *) third); |
267 | } | 249 | } |
268 | case SHMDT: | 250 | case SHMDT: |
269 | return sys_shmdt ((char __user *)ptr); | 251 | return sys_shmdt ((char __user *)ptr); |
270 | case SHMGET: | 252 | case SHMGET: |
271 | return sys_shmget (first, second, third); | 253 | return sys_shmget (first, second, third); |
@@ -275,7 +257,7 @@ asmlinkage int sys_ipc(uint call, int first, int second, | |||
275 | default: | 257 | default: |
276 | return -EINVAL; | 258 | return -EINVAL; |
277 | } | 259 | } |
278 | 260 | ||
279 | return -EINVAL; | 261 | return -EINVAL; |
280 | } | 262 | } |
281 | 263 | ||
@@ -289,49 +271,3 @@ asmlinkage int sys_uname(struct old_utsname * name) | |||
289 | up_read(&uts_sem); | 271 | up_read(&uts_sem); |
290 | return err?-EFAULT:0; | 272 | return err?-EFAULT:0; |
291 | } | 273 | } |
292 | |||
293 | asmlinkage ssize_t sys_pread_wrapper(unsigned int fd, char * buf, | ||
294 | size_t count, long dummy, loff_t pos) | ||
295 | { | ||
296 | return sys_pread64(fd, buf, count, pos); | ||
297 | } | ||
298 | |||
299 | asmlinkage ssize_t sys_pwrite_wrapper(unsigned int fd, const char * buf, | ||
300 | size_t count, long dummy, loff_t pos) | ||
301 | { | ||
302 | return sys_pwrite64(fd, buf, count, pos); | ||
303 | } | ||
304 | |||
305 | asmlinkage int sys_fadvise64_64_wrapper(int fd, u32 offset0, u32 offset1, | ||
306 | u32 len0, u32 len1, int advice) | ||
307 | { | ||
308 | #ifdef __LITTLE_ENDIAN__ | ||
309 | return sys_fadvise64_64(fd, (u64)offset1 << 32 | offset0, | ||
310 | (u64)len1 << 32 | len0, advice); | ||
311 | #else | ||
312 | return sys_fadvise64_64(fd, (u64)offset0 << 32 | offset1, | ||
313 | (u64)len0 << 32 | len1, advice); | ||
314 | #endif | ||
315 | } | ||
316 | |||
317 | #if defined(CONFIG_CPU_SH2) || defined(CONFIG_CPU_SH2A) | ||
318 | #define SYSCALL_ARG3 "trapa #0x23" | ||
319 | #else | ||
320 | #define SYSCALL_ARG3 "trapa #0x13" | ||
321 | #endif | ||
322 | |||
323 | /* | ||
324 | * Do a system call from kernel instead of calling sys_execve so we | ||
325 | * end up with proper pt_regs. | ||
326 | */ | ||
327 | int kernel_execve(const char *filename, char *const argv[], char *const envp[]) | ||
328 | { | ||
329 | register long __sc0 __asm__ ("r3") = __NR_execve; | ||
330 | register long __sc4 __asm__ ("r4") = (long) filename; | ||
331 | register long __sc5 __asm__ ("r5") = (long) argv; | ||
332 | register long __sc6 __asm__ ("r6") = (long) envp; | ||
333 | __asm__ __volatile__ (SYSCALL_ARG3 : "=z" (__sc0) | ||
334 | : "0" (__sc0), "r" (__sc4), "r" (__sc5), "r" (__sc6) | ||
335 | : "memory"); | ||
336 | return __sc0; | ||
337 | } | ||
diff --git a/arch/sh/kernel/sys_sh32.c b/arch/sh/kernel/sys_sh32.c new file mode 100644 index 000000000000..125e493ead82 --- /dev/null +++ b/arch/sh/kernel/sys_sh32.c | |||
@@ -0,0 +1,84 @@ | |||
1 | #include <linux/errno.h> | ||
2 | #include <linux/sched.h> | ||
3 | #include <linux/mm.h> | ||
4 | #include <linux/smp.h> | ||
5 | #include <linux/sem.h> | ||
6 | #include <linux/msg.h> | ||
7 | #include <linux/shm.h> | ||
8 | #include <linux/stat.h> | ||
9 | #include <linux/syscalls.h> | ||
10 | #include <linux/mman.h> | ||
11 | #include <linux/file.h> | ||
12 | #include <linux/utsname.h> | ||
13 | #include <linux/module.h> | ||
14 | #include <linux/fs.h> | ||
15 | #include <linux/ipc.h> | ||
16 | #include <asm/cacheflush.h> | ||
17 | #include <asm/uaccess.h> | ||
18 | #include <asm/unistd.h> | ||
19 | |||
20 | /* | ||
21 | * sys_pipe() is the normal C calling standard for creating | ||
22 | * a pipe. It's not the way Unix traditionally does this, though. | ||
23 | */ | ||
24 | asmlinkage int sys_pipe(unsigned long r4, unsigned long r5, | ||
25 | unsigned long r6, unsigned long r7, | ||
26 | struct pt_regs __regs) | ||
27 | { | ||
28 | struct pt_regs *regs = RELOC_HIDE(&__regs, 0); | ||
29 | int fd[2]; | ||
30 | int error; | ||
31 | |||
32 | error = do_pipe(fd); | ||
33 | if (!error) { | ||
34 | regs->regs[1] = fd[1]; | ||
35 | return fd[0]; | ||
36 | } | ||
37 | return error; | ||
38 | } | ||
39 | |||
40 | asmlinkage ssize_t sys_pread_wrapper(unsigned int fd, char * buf, | ||
41 | size_t count, long dummy, loff_t pos) | ||
42 | { | ||
43 | return sys_pread64(fd, buf, count, pos); | ||
44 | } | ||
45 | |||
46 | asmlinkage ssize_t sys_pwrite_wrapper(unsigned int fd, const char * buf, | ||
47 | size_t count, long dummy, loff_t pos) | ||
48 | { | ||
49 | return sys_pwrite64(fd, buf, count, pos); | ||
50 | } | ||
51 | |||
52 | asmlinkage int sys_fadvise64_64_wrapper(int fd, u32 offset0, u32 offset1, | ||
53 | u32 len0, u32 len1, int advice) | ||
54 | { | ||
55 | #ifdef __LITTLE_ENDIAN__ | ||
56 | return sys_fadvise64_64(fd, (u64)offset1 << 32 | offset0, | ||
57 | (u64)len1 << 32 | len0, advice); | ||
58 | #else | ||
59 | return sys_fadvise64_64(fd, (u64)offset0 << 32 | offset1, | ||
60 | (u64)len0 << 32 | len1, advice); | ||
61 | #endif | ||
62 | } | ||
63 | |||
64 | #if defined(CONFIG_CPU_SH2) || defined(CONFIG_CPU_SH2A) | ||
65 | #define SYSCALL_ARG3 "trapa #0x23" | ||
66 | #else | ||
67 | #define SYSCALL_ARG3 "trapa #0x13" | ||
68 | #endif | ||
69 | |||
70 | /* | ||
71 | * Do a system call from kernel instead of calling sys_execve so we | ||
72 | * end up with proper pt_regs. | ||
73 | */ | ||
74 | int kernel_execve(const char *filename, char *const argv[], char *const envp[]) | ||
75 | { | ||
76 | register long __sc0 __asm__ ("r3") = __NR_execve; | ||
77 | register long __sc4 __asm__ ("r4") = (long) filename; | ||
78 | register long __sc5 __asm__ ("r5") = (long) argv; | ||
79 | register long __sc6 __asm__ ("r6") = (long) envp; | ||
80 | __asm__ __volatile__ (SYSCALL_ARG3 : "=z" (__sc0) | ||
81 | : "0" (__sc0), "r" (__sc4), "r" (__sc5), "r" (__sc6) | ||
82 | : "memory"); | ||
83 | return __sc0; | ||
84 | } | ||
diff --git a/arch/sh/kernel/sys_sh64.c b/arch/sh/kernel/sys_sh64.c new file mode 100644 index 000000000000..578004d71e02 --- /dev/null +++ b/arch/sh/kernel/sys_sh64.c | |||
@@ -0,0 +1,66 @@ | |||
1 | /* | ||
2 | * arch/sh/kernel/sys_sh64.c | ||
3 | * | ||
4 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
5 | * | ||
6 | * This file contains various random system calls that | ||
7 | * have a non-standard calling sequence on the Linux/SH5 | ||
8 | * platform. | ||
9 | * | ||
10 | * This file is subject to the terms and conditions of the GNU General Public | ||
11 | * License. See the file "COPYING" in the main directory of this archive | ||
12 | * for more details. | ||
13 | */ | ||
14 | #include <linux/errno.h> | ||
15 | #include <linux/rwsem.h> | ||
16 | #include <linux/sched.h> | ||
17 | #include <linux/mm.h> | ||
18 | #include <linux/fs.h> | ||
19 | #include <linux/smp.h> | ||
20 | #include <linux/sem.h> | ||
21 | #include <linux/msg.h> | ||
22 | #include <linux/shm.h> | ||
23 | #include <linux/stat.h> | ||
24 | #include <linux/mman.h> | ||
25 | #include <linux/file.h> | ||
26 | #include <linux/utsname.h> | ||
27 | #include <linux/syscalls.h> | ||
28 | #include <linux/ipc.h> | ||
29 | #include <asm/uaccess.h> | ||
30 | #include <asm/ptrace.h> | ||
31 | #include <asm/unistd.h> | ||
32 | |||
33 | /* | ||
34 | * sys_pipe() is the normal C calling standard for creating | ||
35 | * a pipe. It's not the way Unix traditionally does this, though. | ||
36 | */ | ||
37 | asmlinkage int sys_pipe(unsigned long * fildes) | ||
38 | { | ||
39 | int fd[2]; | ||
40 | int error; | ||
41 | |||
42 | error = do_pipe(fd); | ||
43 | if (!error) { | ||
44 | if (copy_to_user(fildes, fd, 2*sizeof(int))) | ||
45 | error = -EFAULT; | ||
46 | } | ||
47 | return error; | ||
48 | } | ||
49 | |||
50 | /* | ||
51 | * Do a system call from kernel instead of calling sys_execve so we | ||
52 | * end up with proper pt_regs. | ||
53 | */ | ||
54 | int kernel_execve(const char *filename, char *const argv[], char *const envp[]) | ||
55 | { | ||
56 | register unsigned long __sc0 __asm__ ("r9") = ((0x13 << 16) | __NR_execve); | ||
57 | register unsigned long __sc2 __asm__ ("r2") = (unsigned long) filename; | ||
58 | register unsigned long __sc3 __asm__ ("r3") = (unsigned long) argv; | ||
59 | register unsigned long __sc4 __asm__ ("r4") = (unsigned long) envp; | ||
60 | __asm__ __volatile__ ("trapa %1 !\t\t\t execve(%2,%3,%4)" | ||
61 | : "=r" (__sc0) | ||
62 | : "r" (__sc0), "r" (__sc2), "r" (__sc3), "r" (__sc4) ); | ||
63 | __asm__ __volatile__ ("!dummy %0 %1 %2 %3" | ||
64 | : : "r" (__sc0), "r" (__sc2), "r" (__sc3), "r" (__sc4) : "memory"); | ||
65 | return __sc0; | ||
66 | } | ||
diff --git a/arch/sh/kernel/syscalls.S b/arch/sh/kernel/syscalls_32.S index 10bec45415ba..10bec45415ba 100644 --- a/arch/sh/kernel/syscalls.S +++ b/arch/sh/kernel/syscalls_32.S | |||
diff --git a/arch/sh64/kernel/syscalls.S b/arch/sh/kernel/syscalls_64.S index abb94c05d07a..98a93efe3691 100644 --- a/arch/sh64/kernel/syscalls.S +++ b/arch/sh/kernel/syscalls_64.S | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * arch/sh64/kernel/syscalls.S | 2 | * arch/sh/kernel/syscalls_64.S |
3 | * | 3 | * |
4 | * Copyright (C) 2000, 2001 Paolo Alberelli | 4 | * Copyright (C) 2000, 2001 Paolo Alberelli |
5 | * Copyright (C) 2004 - 2007 Paul Mundt | 5 | * Copyright (C) 2004 - 2007 Paul Mundt |
diff --git a/arch/sh/kernel/time.c b/arch/sh/kernel/time_32.c index 2bc04bfee738..2bc04bfee738 100644 --- a/arch/sh/kernel/time.c +++ b/arch/sh/kernel/time_32.c | |||
diff --git a/arch/sh64/kernel/time.c b/arch/sh/kernel/time_64.c index 06f3c179e345..f819ba38a6ce 100644 --- a/arch/sh64/kernel/time.c +++ b/arch/sh/kernel/time_64.c | |||
@@ -1,20 +1,19 @@ | |||
1 | /* | 1 | /* |
2 | * This file is subject to the terms and conditions of the GNU General Public | 2 | * arch/sh/kernel/time_64.c |
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * arch/sh64/kernel/time.c | ||
7 | * | 3 | * |
8 | * Copyright (C) 2000, 2001 Paolo Alberelli | 4 | * Copyright (C) 2000, 2001 Paolo Alberelli |
9 | * Copyright (C) 2003, 2004 Paul Mundt | 5 | * Copyright (C) 2003 - 2007 Paul Mundt |
10 | * Copyright (C) 2003 Richard Curnow | 6 | * Copyright (C) 2003 Richard Curnow |
11 | * | 7 | * |
12 | * Original TMU/RTC code taken from sh version. | 8 | * Original TMU/RTC code taken from sh version. |
13 | * Copyright (C) 1999 Tetsuya Okada & Niibe Yutaka | 9 | * Copyright (C) 1999 Tetsuya Okada & Niibe Yutaka |
14 | * Some code taken from i386 version. | 10 | * Some code taken from i386 version. |
15 | * Copyright (C) 1991, 1992, 1995 Linus Torvalds | 11 | * Copyright (C) 1991, 1992, 1995 Linus Torvalds |
12 | * | ||
13 | * This file is subject to the terms and conditions of the GNU General Public | ||
14 | * License. See the file "COPYING" in the main directory of this archive | ||
15 | * for more details. | ||
16 | */ | 16 | */ |
17 | |||
18 | #include <linux/errno.h> | 17 | #include <linux/errno.h> |
19 | #include <linux/rwsem.h> | 18 | #include <linux/rwsem.h> |
20 | #include <linux/sched.h> | 19 | #include <linux/sched.h> |
@@ -30,37 +29,27 @@ | |||
30 | #include <linux/smp.h> | 29 | #include <linux/smp.h> |
31 | #include <linux/module.h> | 30 | #include <linux/module.h> |
32 | #include <linux/bcd.h> | 31 | #include <linux/bcd.h> |
33 | 32 | #include <linux/timex.h> | |
34 | #include <asm/registers.h> /* required by inline __asm__ stmt. */ | 33 | #include <linux/irq.h> |
35 | 34 | #include <linux/io.h> | |
35 | #include <linux/platform_device.h> | ||
36 | #include <asm/cpu/registers.h> /* required by inline __asm__ stmt. */ | ||
37 | #include <asm/cpu/irq.h> | ||
38 | #include <asm/addrspace.h> | ||
36 | #include <asm/processor.h> | 39 | #include <asm/processor.h> |
37 | #include <asm/uaccess.h> | 40 | #include <asm/uaccess.h> |
38 | #include <asm/io.h> | ||
39 | #include <asm/irq.h> | ||
40 | #include <asm/delay.h> | 41 | #include <asm/delay.h> |
41 | 42 | ||
42 | #include <linux/timex.h> | ||
43 | #include <linux/irq.h> | ||
44 | #include <asm/hardware.h> | ||
45 | |||
46 | #define TMU_TOCR_INIT 0x00 | 43 | #define TMU_TOCR_INIT 0x00 |
47 | #define TMU0_TCR_INIT 0x0020 | 44 | #define TMU0_TCR_INIT 0x0020 |
48 | #define TMU_TSTR_INIT 1 | 45 | #define TMU_TSTR_INIT 1 |
49 | #define TMU_TSTR_OFF 0 | 46 | #define TMU_TSTR_OFF 0 |
50 | 47 | ||
51 | /* RCR1 Bits */ | 48 | /* Real Time Clock */ |
52 | #define RCR1_CF 0x80 /* Carry Flag */ | 49 | #define RTC_BLOCK_OFF 0x01040000 |
53 | #define RCR1_CIE 0x10 /* Carry Interrupt Enable */ | 50 | #define RTC_BASE PHYS_PERIPHERAL_BLOCK + RTC_BLOCK_OFF |
54 | #define RCR1_AIE 0x08 /* Alarm Interrupt Enable */ | 51 | #define RTC_RCR1_CIE 0x10 /* Carry Interrupt Enable */ |
55 | #define RCR1_AF 0x01 /* Alarm Flag */ | 52 | #define RTC_RCR1 (rtc_base + 0x38) |
56 | |||
57 | /* RCR2 Bits */ | ||
58 | #define RCR2_PEF 0x80 /* PEriodic interrupt Flag */ | ||
59 | #define RCR2_PESMASK 0x70 /* Periodic interrupt Set */ | ||
60 | #define RCR2_RTCEN 0x08 /* ENable RTC */ | ||
61 | #define RCR2_ADJ 0x04 /* ADJustment (30-second) */ | ||
62 | #define RCR2_RESET 0x02 /* Reset bit */ | ||
63 | #define RCR2_START 0x01 /* Start bit */ | ||
64 | 53 | ||
65 | /* Clock, Power and Reset Controller */ | 54 | /* Clock, Power and Reset Controller */ |
66 | #define CPRC_BLOCK_OFF 0x01010000 | 55 | #define CPRC_BLOCK_OFF 0x01010000 |
@@ -84,27 +73,6 @@ | |||
84 | #define TMU0_TCNT TMU0_BASE+0x4 /* Long access */ | 73 | #define TMU0_TCNT TMU0_BASE+0x4 /* Long access */ |
85 | #define TMU0_TCR TMU0_BASE+0x8 /* Word access */ | 74 | #define TMU0_TCR TMU0_BASE+0x8 /* Word access */ |
86 | 75 | ||
87 | /* Real Time Clock */ | ||
88 | #define RTC_BLOCK_OFF 0x01040000 | ||
89 | #define RTC_BASE PHYS_PERIPHERAL_BLOCK + RTC_BLOCK_OFF | ||
90 | |||
91 | #define R64CNT rtc_base+0x00 | ||
92 | #define RSECCNT rtc_base+0x04 | ||
93 | #define RMINCNT rtc_base+0x08 | ||
94 | #define RHRCNT rtc_base+0x0c | ||
95 | #define RWKCNT rtc_base+0x10 | ||
96 | #define RDAYCNT rtc_base+0x14 | ||
97 | #define RMONCNT rtc_base+0x18 | ||
98 | #define RYRCNT rtc_base+0x1c /* 16bit */ | ||
99 | #define RSECAR rtc_base+0x20 | ||
100 | #define RMINAR rtc_base+0x24 | ||
101 | #define RHRAR rtc_base+0x28 | ||
102 | #define RWKAR rtc_base+0x2c | ||
103 | #define RDAYAR rtc_base+0x30 | ||
104 | #define RMONAR rtc_base+0x34 | ||
105 | #define RCR1 rtc_base+0x38 | ||
106 | #define RCR2 rtc_base+0x3c | ||
107 | |||
108 | #define TICK_SIZE (tick_nsec / 1000) | 76 | #define TICK_SIZE (tick_nsec / 1000) |
109 | 77 | ||
110 | static unsigned long tmu_base, rtc_base; | 78 | static unsigned long tmu_base, rtc_base; |
@@ -236,47 +204,23 @@ int do_settimeofday(struct timespec *tv) | |||
236 | } | 204 | } |
237 | EXPORT_SYMBOL(do_settimeofday); | 205 | EXPORT_SYMBOL(do_settimeofday); |
238 | 206 | ||
239 | static int set_rtc_time(unsigned long nowtime) | 207 | /* Dummy RTC ops */ |
208 | static void null_rtc_get_time(struct timespec *tv) | ||
240 | { | 209 | { |
241 | int retval = 0; | 210 | tv->tv_sec = mktime(2000, 1, 1, 0, 0, 0); |
242 | int real_seconds, real_minutes, cmos_minutes; | 211 | tv->tv_nsec = 0; |
243 | 212 | } | |
244 | ctrl_outb(RCR2_RESET, RCR2); /* Reset pre-scaler & stop RTC */ | ||
245 | |||
246 | cmos_minutes = ctrl_inb(RMINCNT); | ||
247 | BCD_TO_BIN(cmos_minutes); | ||
248 | |||
249 | /* | ||
250 | * since we're only adjusting minutes and seconds, | ||
251 | * don't interfere with hour overflow. This avoids | ||
252 | * messing with unknown time zones but requires your | ||
253 | * RTC not to be off by more than 15 minutes | ||
254 | */ | ||
255 | real_seconds = nowtime % 60; | ||
256 | real_minutes = nowtime / 60; | ||
257 | if (((abs(real_minutes - cmos_minutes) + 15)/30) & 1) | ||
258 | real_minutes += 30; /* correct for half hour time zone */ | ||
259 | real_minutes %= 60; | ||
260 | |||
261 | if (abs(real_minutes - cmos_minutes) < 30) { | ||
262 | BIN_TO_BCD(real_seconds); | ||
263 | BIN_TO_BCD(real_minutes); | ||
264 | ctrl_outb(real_seconds, RSECCNT); | ||
265 | ctrl_outb(real_minutes, RMINCNT); | ||
266 | } else { | ||
267 | printk(KERN_WARNING | ||
268 | "set_rtc_time: can't update from %d to %d\n", | ||
269 | cmos_minutes, real_minutes); | ||
270 | retval = -1; | ||
271 | } | ||
272 | |||
273 | ctrl_outb(RCR2_RTCEN|RCR2_START, RCR2); /* Start RTC */ | ||
274 | 213 | ||
275 | return retval; | 214 | static int null_rtc_set_time(const time_t secs) |
215 | { | ||
216 | return 0; | ||
276 | } | 217 | } |
277 | 218 | ||
219 | void (*rtc_sh_get_time)(struct timespec *) = null_rtc_get_time; | ||
220 | int (*rtc_sh_set_time)(const time_t) = null_rtc_set_time; | ||
221 | |||
278 | /* last time the RTC clock got updated */ | 222 | /* last time the RTC clock got updated */ |
279 | static long last_rtc_update = 0; | 223 | static long last_rtc_update; |
280 | 224 | ||
281 | /* | 225 | /* |
282 | * timer_interrupt() needs to keep up the real-time clock, | 226 | * timer_interrupt() needs to keep up the real-time clock, |
@@ -296,11 +240,8 @@ static inline void do_timer_interrupt(void) | |||
296 | profile_tick(CPU_PROFILING); | 240 | profile_tick(CPU_PROFILING); |
297 | 241 | ||
298 | #ifdef CONFIG_HEARTBEAT | 242 | #ifdef CONFIG_HEARTBEAT |
299 | { | 243 | if (sh_mv.mv_heartbeat != NULL) |
300 | extern void heartbeat(void); | 244 | sh_mv.mv_heartbeat(); |
301 | |||
302 | heartbeat(); | ||
303 | } | ||
304 | #endif | 245 | #endif |
305 | 246 | ||
306 | /* | 247 | /* |
@@ -312,10 +253,11 @@ static inline void do_timer_interrupt(void) | |||
312 | xtime.tv_sec > last_rtc_update + 660 && | 253 | xtime.tv_sec > last_rtc_update + 660 && |
313 | (xtime.tv_nsec / 1000) >= 500000 - ((unsigned) TICK_SIZE) / 2 && | 254 | (xtime.tv_nsec / 1000) >= 500000 - ((unsigned) TICK_SIZE) / 2 && |
314 | (xtime.tv_nsec / 1000) <= 500000 + ((unsigned) TICK_SIZE) / 2) { | 255 | (xtime.tv_nsec / 1000) <= 500000 + ((unsigned) TICK_SIZE) / 2) { |
315 | if (set_rtc_time(xtime.tv_sec) == 0) | 256 | if (rtc_sh_set_time(xtime.tv_sec) == 0) |
316 | last_rtc_update = xtime.tv_sec; | 257 | last_rtc_update = xtime.tv_sec; |
317 | else | 258 | else |
318 | last_rtc_update = xtime.tv_sec - 600; /* do it again in 60 s */ | 259 | /* do it again in 60 s */ |
260 | last_rtc_update = xtime.tv_sec - 600; | ||
319 | } | 261 | } |
320 | } | 262 | } |
321 | 263 | ||
@@ -347,50 +289,6 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id) | |||
347 | return IRQ_HANDLED; | 289 | return IRQ_HANDLED; |
348 | } | 290 | } |
349 | 291 | ||
350 | static unsigned long get_rtc_time(void) | ||
351 | { | ||
352 | unsigned int sec, min, hr, wk, day, mon, yr, yr100; | ||
353 | |||
354 | again: | ||
355 | do { | ||
356 | ctrl_outb(0, RCR1); /* Clear CF-bit */ | ||
357 | sec = ctrl_inb(RSECCNT); | ||
358 | min = ctrl_inb(RMINCNT); | ||
359 | hr = ctrl_inb(RHRCNT); | ||
360 | wk = ctrl_inb(RWKCNT); | ||
361 | day = ctrl_inb(RDAYCNT); | ||
362 | mon = ctrl_inb(RMONCNT); | ||
363 | yr = ctrl_inw(RYRCNT); | ||
364 | yr100 = (yr >> 8); | ||
365 | yr &= 0xff; | ||
366 | } while ((ctrl_inb(RCR1) & RCR1_CF) != 0); | ||
367 | |||
368 | BCD_TO_BIN(yr100); | ||
369 | BCD_TO_BIN(yr); | ||
370 | BCD_TO_BIN(mon); | ||
371 | BCD_TO_BIN(day); | ||
372 | BCD_TO_BIN(hr); | ||
373 | BCD_TO_BIN(min); | ||
374 | BCD_TO_BIN(sec); | ||
375 | |||
376 | if (yr > 99 || mon < 1 || mon > 12 || day > 31 || day < 1 || | ||
377 | hr > 23 || min > 59 || sec > 59) { | ||
378 | printk(KERN_ERR | ||
379 | "SH RTC: invalid value, resetting to 1 Jan 2000\n"); | ||
380 | ctrl_outb(RCR2_RESET, RCR2); /* Reset & Stop */ | ||
381 | ctrl_outb(0, RSECCNT); | ||
382 | ctrl_outb(0, RMINCNT); | ||
383 | ctrl_outb(0, RHRCNT); | ||
384 | ctrl_outb(6, RWKCNT); | ||
385 | ctrl_outb(1, RDAYCNT); | ||
386 | ctrl_outb(1, RMONCNT); | ||
387 | ctrl_outw(0x2000, RYRCNT); | ||
388 | ctrl_outb(RCR2_RTCEN|RCR2_START, RCR2); /* Start */ | ||
389 | goto again; | ||
390 | } | ||
391 | |||
392 | return mktime(yr100 * 100 + yr, mon, day, hr, min, sec); | ||
393 | } | ||
394 | 292 | ||
395 | static __init unsigned int get_cpu_hz(void) | 293 | static __init unsigned int get_cpu_hz(void) |
396 | { | 294 | { |
@@ -406,8 +304,8 @@ static __init unsigned int get_cpu_hz(void) | |||
406 | register unsigned long long __rtc_irq_flag __asm__ ("r3"); | 304 | register unsigned long long __rtc_irq_flag __asm__ ("r3"); |
407 | 305 | ||
408 | local_irq_enable(); | 306 | local_irq_enable(); |
409 | do {} while (ctrl_inb(R64CNT) != 0); | 307 | do {} while (ctrl_inb(rtc_base) != 0); |
410 | ctrl_outb(RCR1_CIE, RCR1); /* Enable carry interrupt */ | 308 | ctrl_outb(RTC_RCR1_CIE, RTC_RCR1); /* Enable carry interrupt */ |
411 | 309 | ||
412 | /* | 310 | /* |
413 | * r3 is arbitrary. CDC does not support "=z". | 311 | * r3 is arbitrary. CDC does not support "=z". |
@@ -449,28 +347,19 @@ static __init unsigned int get_cpu_hz(void) | |||
449 | 347 | ||
450 | count = ctc_val_init - ctc_val; /* CTC counts down */ | 348 | count = ctc_val_init - ctc_val; /* CTC counts down */ |
451 | 349 | ||
452 | #if defined (CONFIG_SH_SIMULATOR) | ||
453 | /* | ||
454 | * Let's pretend we are a 5MHz SH-5 to avoid a too | ||
455 | * little timer interval. Also to keep delay | ||
456 | * calibration within a reasonable time. | ||
457 | */ | ||
458 | return 5000000; | ||
459 | #else | ||
460 | /* | 350 | /* |
461 | * This really is count by the number of clock cycles | 351 | * This really is count by the number of clock cycles |
462 | * by the ratio between a complete R64CNT | 352 | * by the ratio between a complete R64CNT |
463 | * wrap-around (128) and CUI interrupt being raised (64). | 353 | * wrap-around (128) and CUI interrupt being raised (64). |
464 | */ | 354 | */ |
465 | return count*2; | 355 | return count*2; |
466 | #endif | ||
467 | } | 356 | } |
468 | 357 | ||
469 | static irqreturn_t sh64_rtc_interrupt(int irq, void *dev_id) | 358 | static irqreturn_t sh64_rtc_interrupt(int irq, void *dev_id) |
470 | { | 359 | { |
471 | struct pt_regs *regs = get_irq_regs(); | 360 | struct pt_regs *regs = get_irq_regs(); |
472 | 361 | ||
473 | ctrl_outb(0, RCR1); /* Disable Carry Interrupts */ | 362 | ctrl_outb(0, RTC_RCR1); /* Disable Carry Interrupts */ |
474 | regs->regs[3] = 1; /* Using r3 */ | 363 | regs->regs[3] = 1; /* Using r3 */ |
475 | 364 | ||
476 | return IRQ_HANDLED; | 365 | return IRQ_HANDLED; |
@@ -513,8 +402,7 @@ void __init time_init(void) | |||
513 | panic("Unable to remap CPRC\n"); | 402 | panic("Unable to remap CPRC\n"); |
514 | } | 403 | } |
515 | 404 | ||
516 | xtime.tv_sec = get_rtc_time(); | 405 | rtc_sh_get_time(&xtime); |
517 | xtime.tv_nsec = 0; | ||
518 | 406 | ||
519 | setup_irq(TIMER_IRQ, &irq0); | 407 | setup_irq(TIMER_IRQ, &irq0); |
520 | setup_irq(RTC_IRQ, &irq1); | 408 | setup_irq(RTC_IRQ, &irq1); |
@@ -525,7 +413,7 @@ void __init time_init(void) | |||
525 | /* Note careful order of operations to maintain reasonable precision and avoid overflow. */ | 413 | /* Note careful order of operations to maintain reasonable precision and avoid overflow. */ |
526 | scaled_recip_ctc_ticks_per_jiffy = ((1ULL << CTC_JIFFY_SCALE_SHIFT) / (unsigned long long)(cpu_clock / HZ)); | 414 | scaled_recip_ctc_ticks_per_jiffy = ((1ULL << CTC_JIFFY_SCALE_SHIFT) / (unsigned long long)(cpu_clock / HZ)); |
527 | 415 | ||
528 | disable_irq(RTC_IRQ); | 416 | free_irq(RTC_IRQ, NULL); |
529 | 417 | ||
530 | printk("CPU clock: %d.%02dMHz\n", | 418 | printk("CPU clock: %d.%02dMHz\n", |
531 | (cpu_clock / 1000000), (cpu_clock % 1000000)/10000); | 419 | (cpu_clock / 1000000), (cpu_clock % 1000000)/10000); |
@@ -591,3 +479,41 @@ void enter_deep_standby(void) | |||
591 | asm __volatile__ ("nop"); | 479 | asm __volatile__ ("nop"); |
592 | panic("Unexpected wakeup!\n"); | 480 | panic("Unexpected wakeup!\n"); |
593 | } | 481 | } |
482 | |||
483 | static struct resource rtc_resources[] = { | ||
484 | [0] = { | ||
485 | /* RTC base, filled in by rtc_init */ | ||
486 | .flags = IORESOURCE_IO, | ||
487 | }, | ||
488 | [1] = { | ||
489 | /* Period IRQ */ | ||
490 | .start = IRQ_PRI, | ||
491 | .flags = IORESOURCE_IRQ, | ||
492 | }, | ||
493 | [2] = { | ||
494 | /* Carry IRQ */ | ||
495 | .start = IRQ_CUI, | ||
496 | .flags = IORESOURCE_IRQ, | ||
497 | }, | ||
498 | [3] = { | ||
499 | /* Alarm IRQ */ | ||
500 | .start = IRQ_ATI, | ||
501 | .flags = IORESOURCE_IRQ, | ||
502 | }, | ||
503 | }; | ||
504 | |||
505 | static struct platform_device rtc_device = { | ||
506 | .name = "sh-rtc", | ||
507 | .id = -1, | ||
508 | .num_resources = ARRAY_SIZE(rtc_resources), | ||
509 | .resource = rtc_resources, | ||
510 | }; | ||
511 | |||
512 | static int __init rtc_init(void) | ||
513 | { | ||
514 | rtc_resources[0].start = rtc_base; | ||
515 | rtc_resources[0].end = rtc_resources[0].start + 0x58 - 1; | ||
516 | |||
517 | return platform_device_register(&rtc_device); | ||
518 | } | ||
519 | device_initcall(rtc_init); | ||
diff --git a/arch/sh/kernel/timers/timer-cmt.c b/arch/sh/kernel/timers/timer-cmt.c index 82de6895ade5..499e07beebe2 100644 --- a/arch/sh/kernel/timers/timer-cmt.c +++ b/arch/sh/kernel/timers/timer-cmt.c | |||
@@ -31,7 +31,9 @@ | |||
31 | #define cmt_clock_enable() do { ctrl_outb(ctrl_inb(STBCR3) & ~0x10, STBCR3); } while(0) | 31 | #define cmt_clock_enable() do { ctrl_outb(ctrl_inb(STBCR3) & ~0x10, STBCR3); } while(0) |
32 | #define CMT_CMCSR_INIT 0x0040 | 32 | #define CMT_CMCSR_INIT 0x0040 |
33 | #define CMT_CMCSR_CALIB 0x0000 | 33 | #define CMT_CMCSR_CALIB 0x0000 |
34 | #elif defined(CONFIG_CPU_SUBTYPE_SH7206) | 34 | #elif defined(CONFIG_CPU_SUBTYPE_SH7203) || \ |
35 | defined(CONFIG_CPU_SUBTYPE_SH7206) || \ | ||
36 | defined(CONFIG_CPU_SUBTYPE_SH7263) | ||
35 | #define CMT_CMSTR 0xfffec000 | 37 | #define CMT_CMSTR 0xfffec000 |
36 | #define CMT_CMCSR_0 0xfffec002 | 38 | #define CMT_CMCSR_0 0xfffec002 |
37 | #define CMT_CMCNT_0 0xfffec004 | 39 | #define CMT_CMCNT_0 0xfffec004 |
diff --git a/arch/sh/kernel/timers/timer-tmu.c b/arch/sh/kernel/timers/timer-tmu.c index 628ec9a15e38..8935570008d2 100644 --- a/arch/sh/kernel/timers/timer-tmu.c +++ b/arch/sh/kernel/timers/timer-tmu.c | |||
@@ -174,6 +174,7 @@ static int tmu_timer_init(void) | |||
174 | tmu_timer_stop(); | 174 | tmu_timer_stop(); |
175 | 175 | ||
176 | #if !defined(CONFIG_CPU_SUBTYPE_SH7720) && \ | 176 | #if !defined(CONFIG_CPU_SUBTYPE_SH7720) && \ |
177 | !defined(CONFIG_CPU_SUBTYPE_SH7721) && \ | ||
177 | !defined(CONFIG_CPU_SUBTYPE_SH7760) && \ | 178 | !defined(CONFIG_CPU_SUBTYPE_SH7760) && \ |
178 | !defined(CONFIG_CPU_SUBTYPE_SH7785) && \ | 179 | !defined(CONFIG_CPU_SUBTYPE_SH7785) && \ |
179 | !defined(CONFIG_CPU_SUBTYPE_SHX3) | 180 | !defined(CONFIG_CPU_SUBTYPE_SHX3) |
diff --git a/arch/sh/kernel/traps.c b/arch/sh/kernel/traps.c index cf99111cb33f..a3bdc68ef02c 100644 --- a/arch/sh/kernel/traps.c +++ b/arch/sh/kernel/traps.c | |||
@@ -1,947 +1,68 @@ | |||
1 | /* | ||
2 | * 'traps.c' handles hardware traps and faults after we have saved some | ||
3 | * state in 'entry.S'. | ||
4 | * | ||
5 | * SuperH version: Copyright (C) 1999 Niibe Yutaka | ||
6 | * Copyright (C) 2000 Philipp Rumpf | ||
7 | * Copyright (C) 2000 David Howells | ||
8 | * Copyright (C) 2002 - 2007 Paul Mundt | ||
9 | * | ||
10 | * This file is subject to the terms and conditions of the GNU General Public | ||
11 | * License. See the file "COPYING" in the main directory of this archive | ||
12 | * for more details. | ||
13 | */ | ||
14 | #include <linux/kernel.h> | ||
15 | #include <linux/ptrace.h> | ||
16 | #include <linux/init.h> | ||
17 | #include <linux/spinlock.h> | ||
18 | #include <linux/module.h> | ||
19 | #include <linux/kallsyms.h> | ||
20 | #include <linux/io.h> | ||
21 | #include <linux/bug.h> | 1 | #include <linux/bug.h> |
22 | #include <linux/debug_locks.h> | 2 | #include <linux/io.h> |
3 | #include <linux/types.h> | ||
23 | #include <linux/kdebug.h> | 4 | #include <linux/kdebug.h> |
24 | #include <linux/kexec.h> | 5 | #include <linux/signal.h> |
25 | #include <linux/limits.h> | 6 | #include <linux/sched.h> |
26 | #include <asm/system.h> | 7 | #include <asm/system.h> |
27 | #include <asm/uaccess.h> | ||
28 | |||
29 | #ifdef CONFIG_SH_KGDB | ||
30 | #include <asm/kgdb.h> | ||
31 | #define CHK_REMOTE_DEBUG(regs) \ | ||
32 | { \ | ||
33 | if (kgdb_debug_hook && !user_mode(regs))\ | ||
34 | (*kgdb_debug_hook)(regs); \ | ||
35 | } | ||
36 | #else | ||
37 | #define CHK_REMOTE_DEBUG(regs) | ||
38 | #endif | ||
39 | |||
40 | #ifdef CONFIG_CPU_SH2 | ||
41 | # define TRAP_RESERVED_INST 4 | ||
42 | # define TRAP_ILLEGAL_SLOT_INST 6 | ||
43 | # define TRAP_ADDRESS_ERROR 9 | ||
44 | # ifdef CONFIG_CPU_SH2A | ||
45 | # define TRAP_DIVZERO_ERROR 17 | ||
46 | # define TRAP_DIVOVF_ERROR 18 | ||
47 | # endif | ||
48 | #else | ||
49 | #define TRAP_RESERVED_INST 12 | ||
50 | #define TRAP_ILLEGAL_SLOT_INST 13 | ||
51 | #endif | ||
52 | |||
53 | static void dump_mem(const char *str, unsigned long bottom, unsigned long top) | ||
54 | { | ||
55 | unsigned long p; | ||
56 | int i; | ||
57 | |||
58 | printk("%s(0x%08lx to 0x%08lx)\n", str, bottom, top); | ||
59 | |||
60 | for (p = bottom & ~31; p < top; ) { | ||
61 | printk("%04lx: ", p & 0xffff); | ||
62 | |||
63 | for (i = 0; i < 8; i++, p += 4) { | ||
64 | unsigned int val; | ||
65 | |||
66 | if (p < bottom || p >= top) | ||
67 | printk(" "); | ||
68 | else { | ||
69 | if (__get_user(val, (unsigned int __user *)p)) { | ||
70 | printk("\n"); | ||
71 | return; | ||
72 | } | ||
73 | printk("%08x ", val); | ||
74 | } | ||
75 | } | ||
76 | printk("\n"); | ||
77 | } | ||
78 | } | ||
79 | |||
80 | static DEFINE_SPINLOCK(die_lock); | ||
81 | |||
82 | void die(const char * str, struct pt_regs * regs, long err) | ||
83 | { | ||
84 | static int die_counter; | ||
85 | |||
86 | oops_enter(); | ||
87 | |||
88 | console_verbose(); | ||
89 | spin_lock_irq(&die_lock); | ||
90 | bust_spinlocks(1); | ||
91 | |||
92 | printk("%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter); | ||
93 | |||
94 | CHK_REMOTE_DEBUG(regs); | ||
95 | print_modules(); | ||
96 | show_regs(regs); | ||
97 | |||
98 | printk("Process: %s (pid: %d, stack limit = %p)\n", current->comm, | ||
99 | task_pid_nr(current), task_stack_page(current) + 1); | ||
100 | |||
101 | if (!user_mode(regs) || in_interrupt()) | ||
102 | dump_mem("Stack: ", regs->regs[15], THREAD_SIZE + | ||
103 | (unsigned long)task_stack_page(current)); | ||
104 | |||
105 | bust_spinlocks(0); | ||
106 | add_taint(TAINT_DIE); | ||
107 | spin_unlock_irq(&die_lock); | ||
108 | |||
109 | if (kexec_should_crash(current)) | ||
110 | crash_kexec(regs); | ||
111 | |||
112 | if (in_interrupt()) | ||
113 | panic("Fatal exception in interrupt"); | ||
114 | |||
115 | if (panic_on_oops) | ||
116 | panic("Fatal exception"); | ||
117 | |||
118 | oops_exit(); | ||
119 | do_exit(SIGSEGV); | ||
120 | } | ||
121 | |||
122 | static inline void die_if_kernel(const char *str, struct pt_regs *regs, | ||
123 | long err) | ||
124 | { | ||
125 | if (!user_mode(regs)) | ||
126 | die(str, regs, err); | ||
127 | } | ||
128 | |||
129 | /* | ||
130 | * try and fix up kernelspace address errors | ||
131 | * - userspace errors just cause EFAULT to be returned, resulting in SEGV | ||
132 | * - kernel/userspace interfaces cause a jump to an appropriate handler | ||
133 | * - other kernel errors are bad | ||
134 | * - return 0 if fixed-up, -EFAULT if non-fatal (to the kernel) fault | ||
135 | */ | ||
136 | static int die_if_no_fixup(const char * str, struct pt_regs * regs, long err) | ||
137 | { | ||
138 | if (!user_mode(regs)) { | ||
139 | const struct exception_table_entry *fixup; | ||
140 | fixup = search_exception_tables(regs->pc); | ||
141 | if (fixup) { | ||
142 | regs->pc = fixup->fixup; | ||
143 | return 0; | ||
144 | } | ||
145 | die(str, regs, err); | ||
146 | } | ||
147 | return -EFAULT; | ||
148 | } | ||
149 | |||
150 | /* | ||
151 | * handle an instruction that does an unaligned memory access by emulating the | ||
152 | * desired behaviour | ||
153 | * - note that PC _may not_ point to the faulting instruction | ||
154 | * (if that instruction is in a branch delay slot) | ||
155 | * - return 0 if emulation okay, -EFAULT on existential error | ||
156 | */ | ||
157 | static int handle_unaligned_ins(u16 instruction, struct pt_regs *regs) | ||
158 | { | ||
159 | int ret, index, count; | ||
160 | unsigned long *rm, *rn; | ||
161 | unsigned char *src, *dst; | ||
162 | |||
163 | index = (instruction>>8)&15; /* 0x0F00 */ | ||
164 | rn = ®s->regs[index]; | ||
165 | |||
166 | index = (instruction>>4)&15; /* 0x00F0 */ | ||
167 | rm = ®s->regs[index]; | ||
168 | |||
169 | count = 1<<(instruction&3); | ||
170 | |||
171 | ret = -EFAULT; | ||
172 | switch (instruction>>12) { | ||
173 | case 0: /* mov.[bwl] to/from memory via r0+rn */ | ||
174 | if (instruction & 8) { | ||
175 | /* from memory */ | ||
176 | src = (unsigned char*) *rm; | ||
177 | src += regs->regs[0]; | ||
178 | dst = (unsigned char*) rn; | ||
179 | *(unsigned long*)dst = 0; | ||
180 | |||
181 | #ifdef __LITTLE_ENDIAN__ | ||
182 | if (copy_from_user(dst, src, count)) | ||
183 | goto fetch_fault; | ||
184 | |||
185 | if ((count == 2) && dst[1] & 0x80) { | ||
186 | dst[2] = 0xff; | ||
187 | dst[3] = 0xff; | ||
188 | } | ||
189 | #else | ||
190 | dst += 4-count; | ||
191 | |||
192 | if (__copy_user(dst, src, count)) | ||
193 | goto fetch_fault; | ||
194 | |||
195 | if ((count == 2) && dst[2] & 0x80) { | ||
196 | dst[0] = 0xff; | ||
197 | dst[1] = 0xff; | ||
198 | } | ||
199 | #endif | ||
200 | } else { | ||
201 | /* to memory */ | ||
202 | src = (unsigned char*) rm; | ||
203 | #if !defined(__LITTLE_ENDIAN__) | ||
204 | src += 4-count; | ||
205 | #endif | ||
206 | dst = (unsigned char*) *rn; | ||
207 | dst += regs->regs[0]; | ||
208 | |||
209 | if (copy_to_user(dst, src, count)) | ||
210 | goto fetch_fault; | ||
211 | } | ||
212 | ret = 0; | ||
213 | break; | ||
214 | |||
215 | case 1: /* mov.l Rm,@(disp,Rn) */ | ||
216 | src = (unsigned char*) rm; | ||
217 | dst = (unsigned char*) *rn; | ||
218 | dst += (instruction&0x000F)<<2; | ||
219 | |||
220 | if (copy_to_user(dst,src,4)) | ||
221 | goto fetch_fault; | ||
222 | ret = 0; | ||
223 | break; | ||
224 | |||
225 | case 2: /* mov.[bwl] to memory, possibly with pre-decrement */ | ||
226 | if (instruction & 4) | ||
227 | *rn -= count; | ||
228 | src = (unsigned char*) rm; | ||
229 | dst = (unsigned char*) *rn; | ||
230 | #if !defined(__LITTLE_ENDIAN__) | ||
231 | src += 4-count; | ||
232 | #endif | ||
233 | if (copy_to_user(dst, src, count)) | ||
234 | goto fetch_fault; | ||
235 | ret = 0; | ||
236 | break; | ||
237 | |||
238 | case 5: /* mov.l @(disp,Rm),Rn */ | ||
239 | src = (unsigned char*) *rm; | ||
240 | src += (instruction&0x000F)<<2; | ||
241 | dst = (unsigned char*) rn; | ||
242 | *(unsigned long*)dst = 0; | ||
243 | |||
244 | if (copy_from_user(dst,src,4)) | ||
245 | goto fetch_fault; | ||
246 | ret = 0; | ||
247 | break; | ||
248 | 8 | ||
249 | case 6: /* mov.[bwl] from memory, possibly with post-increment */ | 9 | #ifdef CONFIG_BUG |
250 | src = (unsigned char*) *rm; | 10 | static void handle_BUG(struct pt_regs *regs) |
251 | if (instruction & 4) | ||
252 | *rm += count; | ||
253 | dst = (unsigned char*) rn; | ||
254 | *(unsigned long*)dst = 0; | ||
255 | |||
256 | #ifdef __LITTLE_ENDIAN__ | ||
257 | if (copy_from_user(dst, src, count)) | ||
258 | goto fetch_fault; | ||
259 | |||
260 | if ((count == 2) && dst[1] & 0x80) { | ||
261 | dst[2] = 0xff; | ||
262 | dst[3] = 0xff; | ||
263 | } | ||
264 | #else | ||
265 | dst += 4-count; | ||
266 | |||
267 | if (copy_from_user(dst, src, count)) | ||
268 | goto fetch_fault; | ||
269 | |||
270 | if ((count == 2) && dst[2] & 0x80) { | ||
271 | dst[0] = 0xff; | ||
272 | dst[1] = 0xff; | ||
273 | } | ||
274 | #endif | ||
275 | ret = 0; | ||
276 | break; | ||
277 | |||
278 | case 8: | ||
279 | switch ((instruction&0xFF00)>>8) { | ||
280 | case 0x81: /* mov.w R0,@(disp,Rn) */ | ||
281 | src = (unsigned char*) ®s->regs[0]; | ||
282 | #if !defined(__LITTLE_ENDIAN__) | ||
283 | src += 2; | ||
284 | #endif | ||
285 | dst = (unsigned char*) *rm; /* called Rn in the spec */ | ||
286 | dst += (instruction&0x000F)<<1; | ||
287 | |||
288 | if (copy_to_user(dst, src, 2)) | ||
289 | goto fetch_fault; | ||
290 | ret = 0; | ||
291 | break; | ||
292 | |||
293 | case 0x85: /* mov.w @(disp,Rm),R0 */ | ||
294 | src = (unsigned char*) *rm; | ||
295 | src += (instruction&0x000F)<<1; | ||
296 | dst = (unsigned char*) ®s->regs[0]; | ||
297 | *(unsigned long*)dst = 0; | ||
298 | |||
299 | #if !defined(__LITTLE_ENDIAN__) | ||
300 | dst += 2; | ||
301 | #endif | ||
302 | |||
303 | if (copy_from_user(dst, src, 2)) | ||
304 | goto fetch_fault; | ||
305 | |||
306 | #ifdef __LITTLE_ENDIAN__ | ||
307 | if (dst[1] & 0x80) { | ||
308 | dst[2] = 0xff; | ||
309 | dst[3] = 0xff; | ||
310 | } | ||
311 | #else | ||
312 | if (dst[2] & 0x80) { | ||
313 | dst[0] = 0xff; | ||
314 | dst[1] = 0xff; | ||
315 | } | ||
316 | #endif | ||
317 | ret = 0; | ||
318 | break; | ||
319 | } | ||
320 | break; | ||
321 | } | ||
322 | return ret; | ||
323 | |||
324 | fetch_fault: | ||
325 | /* Argh. Address not only misaligned but also non-existent. | ||
326 | * Raise an EFAULT and see if it's trapped | ||
327 | */ | ||
328 | return die_if_no_fixup("Fault in unaligned fixup", regs, 0); | ||
329 | } | ||
330 | |||
331 | /* | ||
332 | * emulate the instruction in the delay slot | ||
333 | * - fetches the instruction from PC+2 | ||
334 | */ | ||
335 | static inline int handle_unaligned_delayslot(struct pt_regs *regs) | ||
336 | { | 11 | { |
337 | u16 instruction; | 12 | enum bug_trap_type tt; |
338 | 13 | tt = report_bug(regs->pc, regs); | |
339 | if (copy_from_user(&instruction, (u16 *)(regs->pc+2), 2)) { | 14 | if (tt == BUG_TRAP_TYPE_WARN) { |
340 | /* the instruction-fetch faulted */ | 15 | regs->pc += instruction_size(regs->pc); |
341 | if (user_mode(regs)) | 16 | return; |
342 | return -EFAULT; | ||
343 | |||
344 | /* kernel */ | ||
345 | die("delay-slot-insn faulting in handle_unaligned_delayslot", | ||
346 | regs, 0); | ||
347 | } | 17 | } |
348 | 18 | ||
349 | return handle_unaligned_ins(instruction,regs); | 19 | die("Kernel BUG", regs, TRAPA_BUG_OPCODE & 0xff); |
350 | } | 20 | } |
351 | 21 | ||
352 | /* | 22 | int is_valid_bugaddr(unsigned long addr) |
353 | * handle an instruction that does an unaligned memory access | ||
354 | * - have to be careful of branch delay-slot instructions that fault | ||
355 | * SH3: | ||
356 | * - if the branch would be taken PC points to the branch | ||
357 | * - if the branch would not be taken, PC points to delay-slot | ||
358 | * SH4: | ||
359 | * - PC always points to delayed branch | ||
360 | * - return 0 if handled, -EFAULT if failed (may not return if in kernel) | ||
361 | */ | ||
362 | |||
363 | /* Macros to determine offset from current PC for branch instructions */ | ||
364 | /* Explicit type coercion is used to force sign extension where needed */ | ||
365 | #define SH_PC_8BIT_OFFSET(instr) ((((signed char)(instr))*2) + 4) | ||
366 | #define SH_PC_12BIT_OFFSET(instr) ((((signed short)(instr<<4))>>3) + 4) | ||
367 | |||
368 | /* | ||
369 | * XXX: SH-2A needs this too, but it needs an overhaul thanks to mixed 32-bit | ||
370 | * opcodes.. | ||
371 | */ | ||
372 | #ifndef CONFIG_CPU_SH2A | ||
373 | static int handle_unaligned_notify_count = 10; | ||
374 | |||
375 | static int handle_unaligned_access(u16 instruction, struct pt_regs *regs) | ||
376 | { | 23 | { |
377 | u_int rm; | 24 | return addr >= PAGE_OFFSET; |
378 | int ret, index; | ||
379 | |||
380 | index = (instruction>>8)&15; /* 0x0F00 */ | ||
381 | rm = regs->regs[index]; | ||
382 | |||
383 | /* shout about the first ten userspace fixups */ | ||
384 | if (user_mode(regs) && handle_unaligned_notify_count>0) { | ||
385 | handle_unaligned_notify_count--; | ||
386 | |||
387 | printk(KERN_NOTICE "Fixing up unaligned userspace access " | ||
388 | "in \"%s\" pid=%d pc=0x%p ins=0x%04hx\n", | ||
389 | current->comm, task_pid_nr(current), | ||
390 | (u16 *)regs->pc, instruction); | ||
391 | } | ||
392 | |||
393 | ret = -EFAULT; | ||
394 | switch (instruction&0xF000) { | ||
395 | case 0x0000: | ||
396 | if (instruction==0x000B) { | ||
397 | /* rts */ | ||
398 | ret = handle_unaligned_delayslot(regs); | ||
399 | if (ret==0) | ||
400 | regs->pc = regs->pr; | ||
401 | } | ||
402 | else if ((instruction&0x00FF)==0x0023) { | ||
403 | /* braf @Rm */ | ||
404 | ret = handle_unaligned_delayslot(regs); | ||
405 | if (ret==0) | ||
406 | regs->pc += rm + 4; | ||
407 | } | ||
408 | else if ((instruction&0x00FF)==0x0003) { | ||
409 | /* bsrf @Rm */ | ||
410 | ret = handle_unaligned_delayslot(regs); | ||
411 | if (ret==0) { | ||
412 | regs->pr = regs->pc + 4; | ||
413 | regs->pc += rm + 4; | ||
414 | } | ||
415 | } | ||
416 | else { | ||
417 | /* mov.[bwl] to/from memory via r0+rn */ | ||
418 | goto simple; | ||
419 | } | ||
420 | break; | ||
421 | |||
422 | case 0x1000: /* mov.l Rm,@(disp,Rn) */ | ||
423 | goto simple; | ||
424 | |||
425 | case 0x2000: /* mov.[bwl] to memory, possibly with pre-decrement */ | ||
426 | goto simple; | ||
427 | |||
428 | case 0x4000: | ||
429 | if ((instruction&0x00FF)==0x002B) { | ||
430 | /* jmp @Rm */ | ||
431 | ret = handle_unaligned_delayslot(regs); | ||
432 | if (ret==0) | ||
433 | regs->pc = rm; | ||
434 | } | ||
435 | else if ((instruction&0x00FF)==0x000B) { | ||
436 | /* jsr @Rm */ | ||
437 | ret = handle_unaligned_delayslot(regs); | ||
438 | if (ret==0) { | ||
439 | regs->pr = regs->pc + 4; | ||
440 | regs->pc = rm; | ||
441 | } | ||
442 | } | ||
443 | else { | ||
444 | /* mov.[bwl] to/from memory via r0+rn */ | ||
445 | goto simple; | ||
446 | } | ||
447 | break; | ||
448 | |||
449 | case 0x5000: /* mov.l @(disp,Rm),Rn */ | ||
450 | goto simple; | ||
451 | |||
452 | case 0x6000: /* mov.[bwl] from memory, possibly with post-increment */ | ||
453 | goto simple; | ||
454 | |||
455 | case 0x8000: /* bf lab, bf/s lab, bt lab, bt/s lab */ | ||
456 | switch (instruction&0x0F00) { | ||
457 | case 0x0100: /* mov.w R0,@(disp,Rm) */ | ||
458 | goto simple; | ||
459 | case 0x0500: /* mov.w @(disp,Rm),R0 */ | ||
460 | goto simple; | ||
461 | case 0x0B00: /* bf lab - no delayslot*/ | ||
462 | break; | ||
463 | case 0x0F00: /* bf/s lab */ | ||
464 | ret = handle_unaligned_delayslot(regs); | ||
465 | if (ret==0) { | ||
466 | #if defined(CONFIG_CPU_SH4) || defined(CONFIG_SH7705_CACHE_32KB) | ||
467 | if ((regs->sr & 0x00000001) != 0) | ||
468 | regs->pc += 4; /* next after slot */ | ||
469 | else | ||
470 | #endif | ||
471 | regs->pc += SH_PC_8BIT_OFFSET(instruction); | ||
472 | } | ||
473 | break; | ||
474 | case 0x0900: /* bt lab - no delayslot */ | ||
475 | break; | ||
476 | case 0x0D00: /* bt/s lab */ | ||
477 | ret = handle_unaligned_delayslot(regs); | ||
478 | if (ret==0) { | ||
479 | #if defined(CONFIG_CPU_SH4) || defined(CONFIG_SH7705_CACHE_32KB) | ||
480 | if ((regs->sr & 0x00000001) == 0) | ||
481 | regs->pc += 4; /* next after slot */ | ||
482 | else | ||
483 | #endif | ||
484 | regs->pc += SH_PC_8BIT_OFFSET(instruction); | ||
485 | } | ||
486 | break; | ||
487 | } | ||
488 | break; | ||
489 | |||
490 | case 0xA000: /* bra label */ | ||
491 | ret = handle_unaligned_delayslot(regs); | ||
492 | if (ret==0) | ||
493 | regs->pc += SH_PC_12BIT_OFFSET(instruction); | ||
494 | break; | ||
495 | |||
496 | case 0xB000: /* bsr label */ | ||
497 | ret = handle_unaligned_delayslot(regs); | ||
498 | if (ret==0) { | ||
499 | regs->pr = regs->pc + 4; | ||
500 | regs->pc += SH_PC_12BIT_OFFSET(instruction); | ||
501 | } | ||
502 | break; | ||
503 | } | ||
504 | return ret; | ||
505 | |||
506 | /* handle non-delay-slot instruction */ | ||
507 | simple: | ||
508 | ret = handle_unaligned_ins(instruction,regs); | ||
509 | if (ret==0) | ||
510 | regs->pc += instruction_size(instruction); | ||
511 | return ret; | ||
512 | } | 25 | } |
513 | #endif /* CONFIG_CPU_SH2A */ | ||
514 | |||
515 | #ifdef CONFIG_CPU_HAS_SR_RB | ||
516 | #define lookup_exception_vector(x) \ | ||
517 | __asm__ __volatile__ ("stc r2_bank, %0\n\t" : "=r" ((x))) | ||
518 | #else | ||
519 | #define lookup_exception_vector(x) \ | ||
520 | __asm__ __volatile__ ("mov r4, %0\n\t" : "=r" ((x))) | ||
521 | #endif | 26 | #endif |
522 | 27 | ||
523 | /* | 28 | /* |
524 | * Handle various address error exceptions: | 29 | * Generic trap handler. |
525 | * - instruction address error: | ||
526 | * misaligned PC | ||
527 | * PC >= 0x80000000 in user mode | ||
528 | * - data address error (read and write) | ||
529 | * misaligned data access | ||
530 | * access to >= 0x80000000 is user mode | ||
531 | * Unfortuntaly we can't distinguish between instruction address error | ||
532 | * and data address errors caused by read accesses. | ||
533 | */ | 30 | */ |
534 | asmlinkage void do_address_error(struct pt_regs *regs, | 31 | BUILD_TRAP_HANDLER(debug) |
535 | unsigned long writeaccess, | ||
536 | unsigned long address) | ||
537 | { | 32 | { |
538 | unsigned long error_code = 0; | 33 | TRAP_HANDLER_DECL; |
539 | mm_segment_t oldfs; | ||
540 | siginfo_t info; | ||
541 | #ifndef CONFIG_CPU_SH2A | ||
542 | u16 instruction; | ||
543 | int tmp; | ||
544 | #endif | ||
545 | |||
546 | /* Intentional ifdef */ | ||
547 | #ifdef CONFIG_CPU_HAS_SR_RB | ||
548 | lookup_exception_vector(error_code); | ||
549 | #endif | ||
550 | |||
551 | oldfs = get_fs(); | ||
552 | |||
553 | if (user_mode(regs)) { | ||
554 | int si_code = BUS_ADRERR; | ||
555 | |||
556 | local_irq_enable(); | ||
557 | 34 | ||
558 | /* bad PC is not something we can fix */ | 35 | /* Rewind */ |
559 | if (regs->pc & 1) { | 36 | regs->pc -= instruction_size(ctrl_inw(regs->pc - 4)); |
560 | si_code = BUS_ADRALN; | ||
561 | goto uspace_segv; | ||
562 | } | ||
563 | 37 | ||
564 | #ifndef CONFIG_CPU_SH2A | 38 | if (notify_die(DIE_TRAP, "debug trap", regs, 0, vec & 0xff, |
565 | set_fs(USER_DS); | 39 | SIGTRAP) == NOTIFY_STOP) |
566 | if (copy_from_user(&instruction, (u16 *)(regs->pc), 2)) { | 40 | return; |
567 | /* Argh. Fault on the instruction itself. | ||
568 | This should never happen non-SMP | ||
569 | */ | ||
570 | set_fs(oldfs); | ||
571 | goto uspace_segv; | ||
572 | } | ||
573 | |||
574 | tmp = handle_unaligned_access(instruction, regs); | ||
575 | set_fs(oldfs); | ||
576 | |||
577 | if (tmp==0) | ||
578 | return; /* sorted */ | ||
579 | #endif | ||
580 | |||
581 | uspace_segv: | ||
582 | printk(KERN_NOTICE "Sending SIGBUS to \"%s\" due to unaligned " | ||
583 | "access (PC %lx PR %lx)\n", current->comm, regs->pc, | ||
584 | regs->pr); | ||
585 | |||
586 | info.si_signo = SIGBUS; | ||
587 | info.si_errno = 0; | ||
588 | info.si_code = si_code; | ||
589 | info.si_addr = (void __user *)address; | ||
590 | force_sig_info(SIGBUS, &info, current); | ||
591 | } else { | ||
592 | if (regs->pc & 1) | ||
593 | die("unaligned program counter", regs, error_code); | ||
594 | |||
595 | #ifndef CONFIG_CPU_SH2A | ||
596 | set_fs(KERNEL_DS); | ||
597 | if (copy_from_user(&instruction, (u16 *)(regs->pc), 2)) { | ||
598 | /* Argh. Fault on the instruction itself. | ||
599 | This should never happen non-SMP | ||
600 | */ | ||
601 | set_fs(oldfs); | ||
602 | die("insn faulting in do_address_error", regs, 0); | ||
603 | } | ||
604 | |||
605 | handle_unaligned_access(instruction, regs); | ||
606 | set_fs(oldfs); | ||
607 | #else | ||
608 | printk(KERN_NOTICE "Killing process \"%s\" due to unaligned " | ||
609 | "access\n", current->comm); | ||
610 | 41 | ||
611 | force_sig(SIGSEGV, current); | 42 | force_sig(SIGTRAP, current); |
612 | #endif | ||
613 | } | ||
614 | } | 43 | } |
615 | 44 | ||
616 | #ifdef CONFIG_SH_DSP | ||
617 | /* | 45 | /* |
618 | * SH-DSP support gerg@snapgear.com. | 46 | * Special handler for BUG() traps. |
619 | */ | 47 | */ |
620 | int is_dsp_inst(struct pt_regs *regs) | 48 | BUILD_TRAP_HANDLER(bug) |
621 | { | 49 | { |
622 | unsigned short inst = 0; | 50 | TRAP_HANDLER_DECL; |
623 | |||
624 | /* | ||
625 | * Safe guard if DSP mode is already enabled or we're lacking | ||
626 | * the DSP altogether. | ||
627 | */ | ||
628 | if (!(current_cpu_data.flags & CPU_HAS_DSP) || (regs->sr & SR_DSP)) | ||
629 | return 0; | ||
630 | |||
631 | get_user(inst, ((unsigned short *) regs->pc)); | ||
632 | |||
633 | inst &= 0xf000; | ||
634 | |||
635 | /* Check for any type of DSP or support instruction */ | ||
636 | if ((inst == 0xf000) || (inst == 0x4000)) | ||
637 | return 1; | ||
638 | |||
639 | return 0; | ||
640 | } | ||
641 | #else | ||
642 | #define is_dsp_inst(regs) (0) | ||
643 | #endif /* CONFIG_SH_DSP */ | ||
644 | 51 | ||
645 | #ifdef CONFIG_CPU_SH2A | 52 | /* Rewind */ |
646 | asmlinkage void do_divide_error(unsigned long r4, unsigned long r5, | 53 | regs->pc -= instruction_size(ctrl_inw(regs->pc - 4)); |
647 | unsigned long r6, unsigned long r7, | ||
648 | struct pt_regs __regs) | ||
649 | { | ||
650 | siginfo_t info; | ||
651 | |||
652 | switch (r4) { | ||
653 | case TRAP_DIVZERO_ERROR: | ||
654 | info.si_code = FPE_INTDIV; | ||
655 | break; | ||
656 | case TRAP_DIVOVF_ERROR: | ||
657 | info.si_code = FPE_INTOVF; | ||
658 | break; | ||
659 | } | ||
660 | |||
661 | force_sig_info(SIGFPE, &info, current); | ||
662 | } | ||
663 | #endif | ||
664 | |||
665 | /* arch/sh/kernel/cpu/sh4/fpu.c */ | ||
666 | extern int do_fpu_inst(unsigned short, struct pt_regs *); | ||
667 | extern asmlinkage void do_fpu_state_restore(unsigned long r4, unsigned long r5, | ||
668 | unsigned long r6, unsigned long r7, struct pt_regs __regs); | ||
669 | |||
670 | asmlinkage void do_reserved_inst(unsigned long r4, unsigned long r5, | ||
671 | unsigned long r6, unsigned long r7, | ||
672 | struct pt_regs __regs) | ||
673 | { | ||
674 | struct pt_regs *regs = RELOC_HIDE(&__regs, 0); | ||
675 | unsigned long error_code; | ||
676 | struct task_struct *tsk = current; | ||
677 | |||
678 | #ifdef CONFIG_SH_FPU_EMU | ||
679 | unsigned short inst = 0; | ||
680 | int err; | ||
681 | |||
682 | get_user(inst, (unsigned short*)regs->pc); | ||
683 | |||
684 | err = do_fpu_inst(inst, regs); | ||
685 | if (!err) { | ||
686 | regs->pc += instruction_size(inst); | ||
687 | return; | ||
688 | } | ||
689 | /* not a FPU inst. */ | ||
690 | #endif | ||
691 | 54 | ||
692 | #ifdef CONFIG_SH_DSP | 55 | if (notify_die(DIE_TRAP, "bug trap", regs, 0, TRAPA_BUG_OPCODE & 0xff, |
693 | /* Check if it's a DSP instruction */ | 56 | SIGTRAP) == NOTIFY_STOP) |
694 | if (is_dsp_inst(regs)) { | ||
695 | /* Enable DSP mode, and restart instruction. */ | ||
696 | regs->sr |= SR_DSP; | ||
697 | return; | 57 | return; |
698 | } | ||
699 | #endif | ||
700 | |||
701 | lookup_exception_vector(error_code); | ||
702 | |||
703 | local_irq_enable(); | ||
704 | CHK_REMOTE_DEBUG(regs); | ||
705 | force_sig(SIGILL, tsk); | ||
706 | die_if_no_fixup("reserved instruction", regs, error_code); | ||
707 | } | ||
708 | |||
709 | #ifdef CONFIG_SH_FPU_EMU | ||
710 | static int emulate_branch(unsigned short inst, struct pt_regs* regs) | ||
711 | { | ||
712 | /* | ||
713 | * bfs: 8fxx: PC+=d*2+4; | ||
714 | * bts: 8dxx: PC+=d*2+4; | ||
715 | * bra: axxx: PC+=D*2+4; | ||
716 | * bsr: bxxx: PC+=D*2+4 after PR=PC+4; | ||
717 | * braf:0x23: PC+=Rn*2+4; | ||
718 | * bsrf:0x03: PC+=Rn*2+4 after PR=PC+4; | ||
719 | * jmp: 4x2b: PC=Rn; | ||
720 | * jsr: 4x0b: PC=Rn after PR=PC+4; | ||
721 | * rts: 000b: PC=PR; | ||
722 | */ | ||
723 | if ((inst & 0xfd00) == 0x8d00) { | ||
724 | regs->pc += SH_PC_8BIT_OFFSET(inst); | ||
725 | return 0; | ||
726 | } | ||
727 | |||
728 | if ((inst & 0xe000) == 0xa000) { | ||
729 | regs->pc += SH_PC_12BIT_OFFSET(inst); | ||
730 | return 0; | ||
731 | } | ||
732 | |||
733 | if ((inst & 0xf0df) == 0x0003) { | ||
734 | regs->pc += regs->regs[(inst & 0x0f00) >> 8] + 4; | ||
735 | return 0; | ||
736 | } | ||
737 | |||
738 | if ((inst & 0xf0df) == 0x400b) { | ||
739 | regs->pc = regs->regs[(inst & 0x0f00) >> 8]; | ||
740 | return 0; | ||
741 | } | ||
742 | |||
743 | if ((inst & 0xffff) == 0x000b) { | ||
744 | regs->pc = regs->pr; | ||
745 | return 0; | ||
746 | } | ||
747 | |||
748 | return 1; | ||
749 | } | ||
750 | #endif | ||
751 | |||
752 | asmlinkage void do_illegal_slot_inst(unsigned long r4, unsigned long r5, | ||
753 | unsigned long r6, unsigned long r7, | ||
754 | struct pt_regs __regs) | ||
755 | { | ||
756 | struct pt_regs *regs = RELOC_HIDE(&__regs, 0); | ||
757 | unsigned long error_code; | ||
758 | struct task_struct *tsk = current; | ||
759 | #ifdef CONFIG_SH_FPU_EMU | ||
760 | unsigned short inst = 0; | ||
761 | |||
762 | get_user(inst, (unsigned short *)regs->pc + 1); | ||
763 | if (!do_fpu_inst(inst, regs)) { | ||
764 | get_user(inst, (unsigned short *)regs->pc); | ||
765 | if (!emulate_branch(inst, regs)) | ||
766 | return; | ||
767 | /* fault in branch.*/ | ||
768 | } | ||
769 | /* not a FPU inst. */ | ||
770 | #endif | ||
771 | |||
772 | lookup_exception_vector(error_code); | ||
773 | |||
774 | local_irq_enable(); | ||
775 | CHK_REMOTE_DEBUG(regs); | ||
776 | force_sig(SIGILL, tsk); | ||
777 | die_if_no_fixup("illegal slot instruction", regs, error_code); | ||
778 | } | ||
779 | |||
780 | asmlinkage void do_exception_error(unsigned long r4, unsigned long r5, | ||
781 | unsigned long r6, unsigned long r7, | ||
782 | struct pt_regs __regs) | ||
783 | { | ||
784 | struct pt_regs *regs = RELOC_HIDE(&__regs, 0); | ||
785 | long ex; | ||
786 | |||
787 | lookup_exception_vector(ex); | ||
788 | die_if_kernel("exception", regs, ex); | ||
789 | } | ||
790 | |||
791 | #if defined(CONFIG_SH_STANDARD_BIOS) | ||
792 | void *gdb_vbr_vector; | ||
793 | |||
794 | static inline void __init gdb_vbr_init(void) | ||
795 | { | ||
796 | register unsigned long vbr; | ||
797 | |||
798 | /* | ||
799 | * Read the old value of the VBR register to initialise | ||
800 | * the vector through which debug and BIOS traps are | ||
801 | * delegated by the Linux trap handler. | ||
802 | */ | ||
803 | asm volatile("stc vbr, %0" : "=r" (vbr)); | ||
804 | |||
805 | gdb_vbr_vector = (void *)(vbr + 0x100); | ||
806 | printk("Setting GDB trap vector to 0x%08lx\n", | ||
807 | (unsigned long)gdb_vbr_vector); | ||
808 | } | ||
809 | #endif | ||
810 | |||
811 | void __cpuinit per_cpu_trap_init(void) | ||
812 | { | ||
813 | extern void *vbr_base; | ||
814 | |||
815 | #ifdef CONFIG_SH_STANDARD_BIOS | ||
816 | if (raw_smp_processor_id() == 0) | ||
817 | gdb_vbr_init(); | ||
818 | #endif | ||
819 | |||
820 | /* NOTE: The VBR value should be at P1 | ||
821 | (or P2, virtural "fixed" address space). | ||
822 | It's definitely should not in physical address. */ | ||
823 | |||
824 | asm volatile("ldc %0, vbr" | ||
825 | : /* no output */ | ||
826 | : "r" (&vbr_base) | ||
827 | : "memory"); | ||
828 | } | ||
829 | |||
830 | void *set_exception_table_vec(unsigned int vec, void *handler) | ||
831 | { | ||
832 | extern void *exception_handling_table[]; | ||
833 | void *old_handler; | ||
834 | |||
835 | old_handler = exception_handling_table[vec]; | ||
836 | exception_handling_table[vec] = handler; | ||
837 | return old_handler; | ||
838 | } | ||
839 | |||
840 | extern asmlinkage void address_error_handler(unsigned long r4, unsigned long r5, | ||
841 | unsigned long r6, unsigned long r7, | ||
842 | struct pt_regs __regs); | ||
843 | |||
844 | void __init trap_init(void) | ||
845 | { | ||
846 | set_exception_table_vec(TRAP_RESERVED_INST, do_reserved_inst); | ||
847 | set_exception_table_vec(TRAP_ILLEGAL_SLOT_INST, do_illegal_slot_inst); | ||
848 | |||
849 | #if defined(CONFIG_CPU_SH4) && !defined(CONFIG_SH_FPU) || \ | ||
850 | defined(CONFIG_SH_FPU_EMU) | ||
851 | /* | ||
852 | * For SH-4 lacking an FPU, treat floating point instructions as | ||
853 | * reserved. They'll be handled in the math-emu case, or faulted on | ||
854 | * otherwise. | ||
855 | */ | ||
856 | set_exception_table_evt(0x800, do_reserved_inst); | ||
857 | set_exception_table_evt(0x820, do_illegal_slot_inst); | ||
858 | #elif defined(CONFIG_SH_FPU) | ||
859 | #ifdef CONFIG_CPU_SUBTYPE_SHX3 | ||
860 | set_exception_table_evt(0xd80, do_fpu_state_restore); | ||
861 | set_exception_table_evt(0xda0, do_fpu_state_restore); | ||
862 | #else | ||
863 | set_exception_table_evt(0x800, do_fpu_state_restore); | ||
864 | set_exception_table_evt(0x820, do_fpu_state_restore); | ||
865 | #endif | ||
866 | #endif | ||
867 | |||
868 | #ifdef CONFIG_CPU_SH2 | ||
869 | set_exception_table_vec(TRAP_ADDRESS_ERROR, address_error_handler); | ||
870 | #endif | ||
871 | #ifdef CONFIG_CPU_SH2A | ||
872 | set_exception_table_vec(TRAP_DIVZERO_ERROR, do_divide_error); | ||
873 | set_exception_table_vec(TRAP_DIVOVF_ERROR, do_divide_error); | ||
874 | #endif | ||
875 | |||
876 | /* Setup VBR for boot cpu */ | ||
877 | per_cpu_trap_init(); | ||
878 | } | ||
879 | 58 | ||
880 | #ifdef CONFIG_BUG | 59 | #ifdef CONFIG_BUG |
881 | void handle_BUG(struct pt_regs *regs) | 60 | if (__kernel_text_address(instruction_pointer(regs))) { |
882 | { | 61 | opcode_t insn = *(opcode_t *)instruction_pointer(regs); |
883 | enum bug_trap_type tt; | 62 | if (insn == TRAPA_BUG_OPCODE) |
884 | tt = report_bug(regs->pc, regs); | 63 | handle_BUG(regs); |
885 | if (tt == BUG_TRAP_TYPE_WARN) { | ||
886 | regs->pc += 2; | ||
887 | return; | ||
888 | } | 64 | } |
889 | |||
890 | die("Kernel BUG", regs, TRAPA_BUG_OPCODE & 0xff); | ||
891 | } | ||
892 | |||
893 | int is_valid_bugaddr(unsigned long addr) | ||
894 | { | ||
895 | return addr >= PAGE_OFFSET; | ||
896 | } | ||
897 | #endif | ||
898 | |||
899 | void show_trace(struct task_struct *tsk, unsigned long *sp, | ||
900 | struct pt_regs *regs) | ||
901 | { | ||
902 | unsigned long addr; | ||
903 | |||
904 | if (regs && user_mode(regs)) | ||
905 | return; | ||
906 | |||
907 | printk("\nCall trace: "); | ||
908 | #ifdef CONFIG_KALLSYMS | ||
909 | printk("\n"); | ||
910 | #endif | 65 | #endif |
911 | 66 | ||
912 | while (!kstack_end(sp)) { | 67 | force_sig(SIGTRAP, current); |
913 | addr = *sp++; | ||
914 | if (kernel_text_address(addr)) | ||
915 | print_ip_sym(addr); | ||
916 | } | ||
917 | |||
918 | printk("\n"); | ||
919 | |||
920 | if (!tsk) | ||
921 | tsk = current; | ||
922 | |||
923 | debug_show_held_locks(tsk); | ||
924 | } | ||
925 | |||
926 | void show_stack(struct task_struct *tsk, unsigned long *sp) | ||
927 | { | ||
928 | unsigned long stack; | ||
929 | |||
930 | if (!tsk) | ||
931 | tsk = current; | ||
932 | if (tsk == current) | ||
933 | sp = (unsigned long *)current_stack_pointer; | ||
934 | else | ||
935 | sp = (unsigned long *)tsk->thread.sp; | ||
936 | |||
937 | stack = (unsigned long)sp; | ||
938 | dump_mem("Stack: ", stack, THREAD_SIZE + | ||
939 | (unsigned long)task_stack_page(tsk)); | ||
940 | show_trace(tsk, sp, NULL); | ||
941 | } | ||
942 | |||
943 | void dump_stack(void) | ||
944 | { | ||
945 | show_stack(NULL, NULL); | ||
946 | } | 68 | } |
947 | EXPORT_SYMBOL(dump_stack); | ||
diff --git a/arch/sh/kernel/traps_32.c b/arch/sh/kernel/traps_32.c new file mode 100644 index 000000000000..2e58f7a6b746 --- /dev/null +++ b/arch/sh/kernel/traps_32.c | |||
@@ -0,0 +1,919 @@ | |||
1 | /* | ||
2 | * 'traps.c' handles hardware traps and faults after we have saved some | ||
3 | * state in 'entry.S'. | ||
4 | * | ||
5 | * SuperH version: Copyright (C) 1999 Niibe Yutaka | ||
6 | * Copyright (C) 2000 Philipp Rumpf | ||
7 | * Copyright (C) 2000 David Howells | ||
8 | * Copyright (C) 2002 - 2007 Paul Mundt | ||
9 | * | ||
10 | * This file is subject to the terms and conditions of the GNU General Public | ||
11 | * License. See the file "COPYING" in the main directory of this archive | ||
12 | * for more details. | ||
13 | */ | ||
14 | #include <linux/kernel.h> | ||
15 | #include <linux/ptrace.h> | ||
16 | #include <linux/init.h> | ||
17 | #include <linux/spinlock.h> | ||
18 | #include <linux/module.h> | ||
19 | #include <linux/kallsyms.h> | ||
20 | #include <linux/io.h> | ||
21 | #include <linux/bug.h> | ||
22 | #include <linux/debug_locks.h> | ||
23 | #include <linux/kdebug.h> | ||
24 | #include <linux/kexec.h> | ||
25 | #include <linux/limits.h> | ||
26 | #include <asm/system.h> | ||
27 | #include <asm/uaccess.h> | ||
28 | |||
29 | #ifdef CONFIG_SH_KGDB | ||
30 | #include <asm/kgdb.h> | ||
31 | #define CHK_REMOTE_DEBUG(regs) \ | ||
32 | { \ | ||
33 | if (kgdb_debug_hook && !user_mode(regs))\ | ||
34 | (*kgdb_debug_hook)(regs); \ | ||
35 | } | ||
36 | #else | ||
37 | #define CHK_REMOTE_DEBUG(regs) | ||
38 | #endif | ||
39 | |||
40 | #ifdef CONFIG_CPU_SH2 | ||
41 | # define TRAP_RESERVED_INST 4 | ||
42 | # define TRAP_ILLEGAL_SLOT_INST 6 | ||
43 | # define TRAP_ADDRESS_ERROR 9 | ||
44 | # ifdef CONFIG_CPU_SH2A | ||
45 | # define TRAP_DIVZERO_ERROR 17 | ||
46 | # define TRAP_DIVOVF_ERROR 18 | ||
47 | # endif | ||
48 | #else | ||
49 | #define TRAP_RESERVED_INST 12 | ||
50 | #define TRAP_ILLEGAL_SLOT_INST 13 | ||
51 | #endif | ||
52 | |||
53 | static void dump_mem(const char *str, unsigned long bottom, unsigned long top) | ||
54 | { | ||
55 | unsigned long p; | ||
56 | int i; | ||
57 | |||
58 | printk("%s(0x%08lx to 0x%08lx)\n", str, bottom, top); | ||
59 | |||
60 | for (p = bottom & ~31; p < top; ) { | ||
61 | printk("%04lx: ", p & 0xffff); | ||
62 | |||
63 | for (i = 0; i < 8; i++, p += 4) { | ||
64 | unsigned int val; | ||
65 | |||
66 | if (p < bottom || p >= top) | ||
67 | printk(" "); | ||
68 | else { | ||
69 | if (__get_user(val, (unsigned int __user *)p)) { | ||
70 | printk("\n"); | ||
71 | return; | ||
72 | } | ||
73 | printk("%08x ", val); | ||
74 | } | ||
75 | } | ||
76 | printk("\n"); | ||
77 | } | ||
78 | } | ||
79 | |||
80 | static DEFINE_SPINLOCK(die_lock); | ||
81 | |||
82 | void die(const char * str, struct pt_regs * regs, long err) | ||
83 | { | ||
84 | static int die_counter; | ||
85 | |||
86 | oops_enter(); | ||
87 | |||
88 | console_verbose(); | ||
89 | spin_lock_irq(&die_lock); | ||
90 | bust_spinlocks(1); | ||
91 | |||
92 | printk("%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter); | ||
93 | |||
94 | CHK_REMOTE_DEBUG(regs); | ||
95 | print_modules(); | ||
96 | show_regs(regs); | ||
97 | |||
98 | printk("Process: %s (pid: %d, stack limit = %p)\n", current->comm, | ||
99 | task_pid_nr(current), task_stack_page(current) + 1); | ||
100 | |||
101 | if (!user_mode(regs) || in_interrupt()) | ||
102 | dump_mem("Stack: ", regs->regs[15], THREAD_SIZE + | ||
103 | (unsigned long)task_stack_page(current)); | ||
104 | |||
105 | bust_spinlocks(0); | ||
106 | add_taint(TAINT_DIE); | ||
107 | spin_unlock_irq(&die_lock); | ||
108 | |||
109 | if (kexec_should_crash(current)) | ||
110 | crash_kexec(regs); | ||
111 | |||
112 | if (in_interrupt()) | ||
113 | panic("Fatal exception in interrupt"); | ||
114 | |||
115 | if (panic_on_oops) | ||
116 | panic("Fatal exception"); | ||
117 | |||
118 | oops_exit(); | ||
119 | do_exit(SIGSEGV); | ||
120 | } | ||
121 | |||
122 | static inline void die_if_kernel(const char *str, struct pt_regs *regs, | ||
123 | long err) | ||
124 | { | ||
125 | if (!user_mode(regs)) | ||
126 | die(str, regs, err); | ||
127 | } | ||
128 | |||
129 | /* | ||
130 | * try and fix up kernelspace address errors | ||
131 | * - userspace errors just cause EFAULT to be returned, resulting in SEGV | ||
132 | * - kernel/userspace interfaces cause a jump to an appropriate handler | ||
133 | * - other kernel errors are bad | ||
134 | * - return 0 if fixed-up, -EFAULT if non-fatal (to the kernel) fault | ||
135 | */ | ||
136 | static int die_if_no_fixup(const char * str, struct pt_regs * regs, long err) | ||
137 | { | ||
138 | if (!user_mode(regs)) { | ||
139 | const struct exception_table_entry *fixup; | ||
140 | fixup = search_exception_tables(regs->pc); | ||
141 | if (fixup) { | ||
142 | regs->pc = fixup->fixup; | ||
143 | return 0; | ||
144 | } | ||
145 | die(str, regs, err); | ||
146 | } | ||
147 | return -EFAULT; | ||
148 | } | ||
149 | |||
150 | /* | ||
151 | * handle an instruction that does an unaligned memory access by emulating the | ||
152 | * desired behaviour | ||
153 | * - note that PC _may not_ point to the faulting instruction | ||
154 | * (if that instruction is in a branch delay slot) | ||
155 | * - return 0 if emulation okay, -EFAULT on existential error | ||
156 | */ | ||
157 | static int handle_unaligned_ins(u16 instruction, struct pt_regs *regs) | ||
158 | { | ||
159 | int ret, index, count; | ||
160 | unsigned long *rm, *rn; | ||
161 | unsigned char *src, *dst; | ||
162 | |||
163 | index = (instruction>>8)&15; /* 0x0F00 */ | ||
164 | rn = ®s->regs[index]; | ||
165 | |||
166 | index = (instruction>>4)&15; /* 0x00F0 */ | ||
167 | rm = ®s->regs[index]; | ||
168 | |||
169 | count = 1<<(instruction&3); | ||
170 | |||
171 | ret = -EFAULT; | ||
172 | switch (instruction>>12) { | ||
173 | case 0: /* mov.[bwl] to/from memory via r0+rn */ | ||
174 | if (instruction & 8) { | ||
175 | /* from memory */ | ||
176 | src = (unsigned char*) *rm; | ||
177 | src += regs->regs[0]; | ||
178 | dst = (unsigned char*) rn; | ||
179 | *(unsigned long*)dst = 0; | ||
180 | |||
181 | #ifdef __LITTLE_ENDIAN__ | ||
182 | if (copy_from_user(dst, src, count)) | ||
183 | goto fetch_fault; | ||
184 | |||
185 | if ((count == 2) && dst[1] & 0x80) { | ||
186 | dst[2] = 0xff; | ||
187 | dst[3] = 0xff; | ||
188 | } | ||
189 | #else | ||
190 | dst += 4-count; | ||
191 | |||
192 | if (__copy_user(dst, src, count)) | ||
193 | goto fetch_fault; | ||
194 | |||
195 | if ((count == 2) && dst[2] & 0x80) { | ||
196 | dst[0] = 0xff; | ||
197 | dst[1] = 0xff; | ||
198 | } | ||
199 | #endif | ||
200 | } else { | ||
201 | /* to memory */ | ||
202 | src = (unsigned char*) rm; | ||
203 | #if !defined(__LITTLE_ENDIAN__) | ||
204 | src += 4-count; | ||
205 | #endif | ||
206 | dst = (unsigned char*) *rn; | ||
207 | dst += regs->regs[0]; | ||
208 | |||
209 | if (copy_to_user(dst, src, count)) | ||
210 | goto fetch_fault; | ||
211 | } | ||
212 | ret = 0; | ||
213 | break; | ||
214 | |||
215 | case 1: /* mov.l Rm,@(disp,Rn) */ | ||
216 | src = (unsigned char*) rm; | ||
217 | dst = (unsigned char*) *rn; | ||
218 | dst += (instruction&0x000F)<<2; | ||
219 | |||
220 | if (copy_to_user(dst,src,4)) | ||
221 | goto fetch_fault; | ||
222 | ret = 0; | ||
223 | break; | ||
224 | |||
225 | case 2: /* mov.[bwl] to memory, possibly with pre-decrement */ | ||
226 | if (instruction & 4) | ||
227 | *rn -= count; | ||
228 | src = (unsigned char*) rm; | ||
229 | dst = (unsigned char*) *rn; | ||
230 | #if !defined(__LITTLE_ENDIAN__) | ||
231 | src += 4-count; | ||
232 | #endif | ||
233 | if (copy_to_user(dst, src, count)) | ||
234 | goto fetch_fault; | ||
235 | ret = 0; | ||
236 | break; | ||
237 | |||
238 | case 5: /* mov.l @(disp,Rm),Rn */ | ||
239 | src = (unsigned char*) *rm; | ||
240 | src += (instruction&0x000F)<<2; | ||
241 | dst = (unsigned char*) rn; | ||
242 | *(unsigned long*)dst = 0; | ||
243 | |||
244 | if (copy_from_user(dst,src,4)) | ||
245 | goto fetch_fault; | ||
246 | ret = 0; | ||
247 | break; | ||
248 | |||
249 | case 6: /* mov.[bwl] from memory, possibly with post-increment */ | ||
250 | src = (unsigned char*) *rm; | ||
251 | if (instruction & 4) | ||
252 | *rm += count; | ||
253 | dst = (unsigned char*) rn; | ||
254 | *(unsigned long*)dst = 0; | ||
255 | |||
256 | #ifdef __LITTLE_ENDIAN__ | ||
257 | if (copy_from_user(dst, src, count)) | ||
258 | goto fetch_fault; | ||
259 | |||
260 | if ((count == 2) && dst[1] & 0x80) { | ||
261 | dst[2] = 0xff; | ||
262 | dst[3] = 0xff; | ||
263 | } | ||
264 | #else | ||
265 | dst += 4-count; | ||
266 | |||
267 | if (copy_from_user(dst, src, count)) | ||
268 | goto fetch_fault; | ||
269 | |||
270 | if ((count == 2) && dst[2] & 0x80) { | ||
271 | dst[0] = 0xff; | ||
272 | dst[1] = 0xff; | ||
273 | } | ||
274 | #endif | ||
275 | ret = 0; | ||
276 | break; | ||
277 | |||
278 | case 8: | ||
279 | switch ((instruction&0xFF00)>>8) { | ||
280 | case 0x81: /* mov.w R0,@(disp,Rn) */ | ||
281 | src = (unsigned char*) ®s->regs[0]; | ||
282 | #if !defined(__LITTLE_ENDIAN__) | ||
283 | src += 2; | ||
284 | #endif | ||
285 | dst = (unsigned char*) *rm; /* called Rn in the spec */ | ||
286 | dst += (instruction&0x000F)<<1; | ||
287 | |||
288 | if (copy_to_user(dst, src, 2)) | ||
289 | goto fetch_fault; | ||
290 | ret = 0; | ||
291 | break; | ||
292 | |||
293 | case 0x85: /* mov.w @(disp,Rm),R0 */ | ||
294 | src = (unsigned char*) *rm; | ||
295 | src += (instruction&0x000F)<<1; | ||
296 | dst = (unsigned char*) ®s->regs[0]; | ||
297 | *(unsigned long*)dst = 0; | ||
298 | |||
299 | #if !defined(__LITTLE_ENDIAN__) | ||
300 | dst += 2; | ||
301 | #endif | ||
302 | |||
303 | if (copy_from_user(dst, src, 2)) | ||
304 | goto fetch_fault; | ||
305 | |||
306 | #ifdef __LITTLE_ENDIAN__ | ||
307 | if (dst[1] & 0x80) { | ||
308 | dst[2] = 0xff; | ||
309 | dst[3] = 0xff; | ||
310 | } | ||
311 | #else | ||
312 | if (dst[2] & 0x80) { | ||
313 | dst[0] = 0xff; | ||
314 | dst[1] = 0xff; | ||
315 | } | ||
316 | #endif | ||
317 | ret = 0; | ||
318 | break; | ||
319 | } | ||
320 | break; | ||
321 | } | ||
322 | return ret; | ||
323 | |||
324 | fetch_fault: | ||
325 | /* Argh. Address not only misaligned but also non-existent. | ||
326 | * Raise an EFAULT and see if it's trapped | ||
327 | */ | ||
328 | return die_if_no_fixup("Fault in unaligned fixup", regs, 0); | ||
329 | } | ||
330 | |||
331 | /* | ||
332 | * emulate the instruction in the delay slot | ||
333 | * - fetches the instruction from PC+2 | ||
334 | */ | ||
335 | static inline int handle_unaligned_delayslot(struct pt_regs *regs) | ||
336 | { | ||
337 | u16 instruction; | ||
338 | |||
339 | if (copy_from_user(&instruction, (u16 *)(regs->pc+2), 2)) { | ||
340 | /* the instruction-fetch faulted */ | ||
341 | if (user_mode(regs)) | ||
342 | return -EFAULT; | ||
343 | |||
344 | /* kernel */ | ||
345 | die("delay-slot-insn faulting in handle_unaligned_delayslot", | ||
346 | regs, 0); | ||
347 | } | ||
348 | |||
349 | return handle_unaligned_ins(instruction,regs); | ||
350 | } | ||
351 | |||
352 | /* | ||
353 | * handle an instruction that does an unaligned memory access | ||
354 | * - have to be careful of branch delay-slot instructions that fault | ||
355 | * SH3: | ||
356 | * - if the branch would be taken PC points to the branch | ||
357 | * - if the branch would not be taken, PC points to delay-slot | ||
358 | * SH4: | ||
359 | * - PC always points to delayed branch | ||
360 | * - return 0 if handled, -EFAULT if failed (may not return if in kernel) | ||
361 | */ | ||
362 | |||
363 | /* Macros to determine offset from current PC for branch instructions */ | ||
364 | /* Explicit type coercion is used to force sign extension where needed */ | ||
365 | #define SH_PC_8BIT_OFFSET(instr) ((((signed char)(instr))*2) + 4) | ||
366 | #define SH_PC_12BIT_OFFSET(instr) ((((signed short)(instr<<4))>>3) + 4) | ||
367 | |||
368 | /* | ||
369 | * XXX: SH-2A needs this too, but it needs an overhaul thanks to mixed 32-bit | ||
370 | * opcodes.. | ||
371 | */ | ||
372 | #ifndef CONFIG_CPU_SH2A | ||
373 | static int handle_unaligned_notify_count = 10; | ||
374 | |||
375 | static int handle_unaligned_access(u16 instruction, struct pt_regs *regs) | ||
376 | { | ||
377 | u_int rm; | ||
378 | int ret, index; | ||
379 | |||
380 | index = (instruction>>8)&15; /* 0x0F00 */ | ||
381 | rm = regs->regs[index]; | ||
382 | |||
383 | /* shout about the first ten userspace fixups */ | ||
384 | if (user_mode(regs) && handle_unaligned_notify_count>0) { | ||
385 | handle_unaligned_notify_count--; | ||
386 | |||
387 | printk(KERN_NOTICE "Fixing up unaligned userspace access " | ||
388 | "in \"%s\" pid=%d pc=0x%p ins=0x%04hx\n", | ||
389 | current->comm, task_pid_nr(current), | ||
390 | (u16 *)regs->pc, instruction); | ||
391 | } | ||
392 | |||
393 | ret = -EFAULT; | ||
394 | switch (instruction&0xF000) { | ||
395 | case 0x0000: | ||
396 | if (instruction==0x000B) { | ||
397 | /* rts */ | ||
398 | ret = handle_unaligned_delayslot(regs); | ||
399 | if (ret==0) | ||
400 | regs->pc = regs->pr; | ||
401 | } | ||
402 | else if ((instruction&0x00FF)==0x0023) { | ||
403 | /* braf @Rm */ | ||
404 | ret = handle_unaligned_delayslot(regs); | ||
405 | if (ret==0) | ||
406 | regs->pc += rm + 4; | ||
407 | } | ||
408 | else if ((instruction&0x00FF)==0x0003) { | ||
409 | /* bsrf @Rm */ | ||
410 | ret = handle_unaligned_delayslot(regs); | ||
411 | if (ret==0) { | ||
412 | regs->pr = regs->pc + 4; | ||
413 | regs->pc += rm + 4; | ||
414 | } | ||
415 | } | ||
416 | else { | ||
417 | /* mov.[bwl] to/from memory via r0+rn */ | ||
418 | goto simple; | ||
419 | } | ||
420 | break; | ||
421 | |||
422 | case 0x1000: /* mov.l Rm,@(disp,Rn) */ | ||
423 | goto simple; | ||
424 | |||
425 | case 0x2000: /* mov.[bwl] to memory, possibly with pre-decrement */ | ||
426 | goto simple; | ||
427 | |||
428 | case 0x4000: | ||
429 | if ((instruction&0x00FF)==0x002B) { | ||
430 | /* jmp @Rm */ | ||
431 | ret = handle_unaligned_delayslot(regs); | ||
432 | if (ret==0) | ||
433 | regs->pc = rm; | ||
434 | } | ||
435 | else if ((instruction&0x00FF)==0x000B) { | ||
436 | /* jsr @Rm */ | ||
437 | ret = handle_unaligned_delayslot(regs); | ||
438 | if (ret==0) { | ||
439 | regs->pr = regs->pc + 4; | ||
440 | regs->pc = rm; | ||
441 | } | ||
442 | } | ||
443 | else { | ||
444 | /* mov.[bwl] to/from memory via r0+rn */ | ||
445 | goto simple; | ||
446 | } | ||
447 | break; | ||
448 | |||
449 | case 0x5000: /* mov.l @(disp,Rm),Rn */ | ||
450 | goto simple; | ||
451 | |||
452 | case 0x6000: /* mov.[bwl] from memory, possibly with post-increment */ | ||
453 | goto simple; | ||
454 | |||
455 | case 0x8000: /* bf lab, bf/s lab, bt lab, bt/s lab */ | ||
456 | switch (instruction&0x0F00) { | ||
457 | case 0x0100: /* mov.w R0,@(disp,Rm) */ | ||
458 | goto simple; | ||
459 | case 0x0500: /* mov.w @(disp,Rm),R0 */ | ||
460 | goto simple; | ||
461 | case 0x0B00: /* bf lab - no delayslot*/ | ||
462 | break; | ||
463 | case 0x0F00: /* bf/s lab */ | ||
464 | ret = handle_unaligned_delayslot(regs); | ||
465 | if (ret==0) { | ||
466 | #if defined(CONFIG_CPU_SH4) || defined(CONFIG_SH7705_CACHE_32KB) | ||
467 | if ((regs->sr & 0x00000001) != 0) | ||
468 | regs->pc += 4; /* next after slot */ | ||
469 | else | ||
470 | #endif | ||
471 | regs->pc += SH_PC_8BIT_OFFSET(instruction); | ||
472 | } | ||
473 | break; | ||
474 | case 0x0900: /* bt lab - no delayslot */ | ||
475 | break; | ||
476 | case 0x0D00: /* bt/s lab */ | ||
477 | ret = handle_unaligned_delayslot(regs); | ||
478 | if (ret==0) { | ||
479 | #if defined(CONFIG_CPU_SH4) || defined(CONFIG_SH7705_CACHE_32KB) | ||
480 | if ((regs->sr & 0x00000001) == 0) | ||
481 | regs->pc += 4; /* next after slot */ | ||
482 | else | ||
483 | #endif | ||
484 | regs->pc += SH_PC_8BIT_OFFSET(instruction); | ||
485 | } | ||
486 | break; | ||
487 | } | ||
488 | break; | ||
489 | |||
490 | case 0xA000: /* bra label */ | ||
491 | ret = handle_unaligned_delayslot(regs); | ||
492 | if (ret==0) | ||
493 | regs->pc += SH_PC_12BIT_OFFSET(instruction); | ||
494 | break; | ||
495 | |||
496 | case 0xB000: /* bsr label */ | ||
497 | ret = handle_unaligned_delayslot(regs); | ||
498 | if (ret==0) { | ||
499 | regs->pr = regs->pc + 4; | ||
500 | regs->pc += SH_PC_12BIT_OFFSET(instruction); | ||
501 | } | ||
502 | break; | ||
503 | } | ||
504 | return ret; | ||
505 | |||
506 | /* handle non-delay-slot instruction */ | ||
507 | simple: | ||
508 | ret = handle_unaligned_ins(instruction,regs); | ||
509 | if (ret==0) | ||
510 | regs->pc += instruction_size(instruction); | ||
511 | return ret; | ||
512 | } | ||
513 | #endif /* CONFIG_CPU_SH2A */ | ||
514 | |||
515 | #ifdef CONFIG_CPU_HAS_SR_RB | ||
516 | #define lookup_exception_vector(x) \ | ||
517 | __asm__ __volatile__ ("stc r2_bank, %0\n\t" : "=r" ((x))) | ||
518 | #else | ||
519 | #define lookup_exception_vector(x) \ | ||
520 | __asm__ __volatile__ ("mov r4, %0\n\t" : "=r" ((x))) | ||
521 | #endif | ||
522 | |||
523 | /* | ||
524 | * Handle various address error exceptions: | ||
525 | * - instruction address error: | ||
526 | * misaligned PC | ||
527 | * PC >= 0x80000000 in user mode | ||
528 | * - data address error (read and write) | ||
529 | * misaligned data access | ||
530 | * access to >= 0x80000000 is user mode | ||
531 | * Unfortuntaly we can't distinguish between instruction address error | ||
532 | * and data address errors caused by read accesses. | ||
533 | */ | ||
534 | asmlinkage void do_address_error(struct pt_regs *regs, | ||
535 | unsigned long writeaccess, | ||
536 | unsigned long address) | ||
537 | { | ||
538 | unsigned long error_code = 0; | ||
539 | mm_segment_t oldfs; | ||
540 | siginfo_t info; | ||
541 | #ifndef CONFIG_CPU_SH2A | ||
542 | u16 instruction; | ||
543 | int tmp; | ||
544 | #endif | ||
545 | |||
546 | /* Intentional ifdef */ | ||
547 | #ifdef CONFIG_CPU_HAS_SR_RB | ||
548 | lookup_exception_vector(error_code); | ||
549 | #endif | ||
550 | |||
551 | oldfs = get_fs(); | ||
552 | |||
553 | if (user_mode(regs)) { | ||
554 | int si_code = BUS_ADRERR; | ||
555 | |||
556 | local_irq_enable(); | ||
557 | |||
558 | /* bad PC is not something we can fix */ | ||
559 | if (regs->pc & 1) { | ||
560 | si_code = BUS_ADRALN; | ||
561 | goto uspace_segv; | ||
562 | } | ||
563 | |||
564 | #ifndef CONFIG_CPU_SH2A | ||
565 | set_fs(USER_DS); | ||
566 | if (copy_from_user(&instruction, (u16 *)(regs->pc), 2)) { | ||
567 | /* Argh. Fault on the instruction itself. | ||
568 | This should never happen non-SMP | ||
569 | */ | ||
570 | set_fs(oldfs); | ||
571 | goto uspace_segv; | ||
572 | } | ||
573 | |||
574 | tmp = handle_unaligned_access(instruction, regs); | ||
575 | set_fs(oldfs); | ||
576 | |||
577 | if (tmp==0) | ||
578 | return; /* sorted */ | ||
579 | #endif | ||
580 | |||
581 | uspace_segv: | ||
582 | printk(KERN_NOTICE "Sending SIGBUS to \"%s\" due to unaligned " | ||
583 | "access (PC %lx PR %lx)\n", current->comm, regs->pc, | ||
584 | regs->pr); | ||
585 | |||
586 | info.si_signo = SIGBUS; | ||
587 | info.si_errno = 0; | ||
588 | info.si_code = si_code; | ||
589 | info.si_addr = (void __user *)address; | ||
590 | force_sig_info(SIGBUS, &info, current); | ||
591 | } else { | ||
592 | if (regs->pc & 1) | ||
593 | die("unaligned program counter", regs, error_code); | ||
594 | |||
595 | #ifndef CONFIG_CPU_SH2A | ||
596 | set_fs(KERNEL_DS); | ||
597 | if (copy_from_user(&instruction, (u16 *)(regs->pc), 2)) { | ||
598 | /* Argh. Fault on the instruction itself. | ||
599 | This should never happen non-SMP | ||
600 | */ | ||
601 | set_fs(oldfs); | ||
602 | die("insn faulting in do_address_error", regs, 0); | ||
603 | } | ||
604 | |||
605 | handle_unaligned_access(instruction, regs); | ||
606 | set_fs(oldfs); | ||
607 | #else | ||
608 | printk(KERN_NOTICE "Killing process \"%s\" due to unaligned " | ||
609 | "access\n", current->comm); | ||
610 | |||
611 | force_sig(SIGSEGV, current); | ||
612 | #endif | ||
613 | } | ||
614 | } | ||
615 | |||
616 | #ifdef CONFIG_SH_DSP | ||
617 | /* | ||
618 | * SH-DSP support gerg@snapgear.com. | ||
619 | */ | ||
620 | int is_dsp_inst(struct pt_regs *regs) | ||
621 | { | ||
622 | unsigned short inst = 0; | ||
623 | |||
624 | /* | ||
625 | * Safe guard if DSP mode is already enabled or we're lacking | ||
626 | * the DSP altogether. | ||
627 | */ | ||
628 | if (!(current_cpu_data.flags & CPU_HAS_DSP) || (regs->sr & SR_DSP)) | ||
629 | return 0; | ||
630 | |||
631 | get_user(inst, ((unsigned short *) regs->pc)); | ||
632 | |||
633 | inst &= 0xf000; | ||
634 | |||
635 | /* Check for any type of DSP or support instruction */ | ||
636 | if ((inst == 0xf000) || (inst == 0x4000)) | ||
637 | return 1; | ||
638 | |||
639 | return 0; | ||
640 | } | ||
641 | #else | ||
642 | #define is_dsp_inst(regs) (0) | ||
643 | #endif /* CONFIG_SH_DSP */ | ||
644 | |||
645 | #ifdef CONFIG_CPU_SH2A | ||
646 | asmlinkage void do_divide_error(unsigned long r4, unsigned long r5, | ||
647 | unsigned long r6, unsigned long r7, | ||
648 | struct pt_regs __regs) | ||
649 | { | ||
650 | siginfo_t info; | ||
651 | |||
652 | switch (r4) { | ||
653 | case TRAP_DIVZERO_ERROR: | ||
654 | info.si_code = FPE_INTDIV; | ||
655 | break; | ||
656 | case TRAP_DIVOVF_ERROR: | ||
657 | info.si_code = FPE_INTOVF; | ||
658 | break; | ||
659 | } | ||
660 | |||
661 | force_sig_info(SIGFPE, &info, current); | ||
662 | } | ||
663 | #endif | ||
664 | |||
665 | asmlinkage void do_reserved_inst(unsigned long r4, unsigned long r5, | ||
666 | unsigned long r6, unsigned long r7, | ||
667 | struct pt_regs __regs) | ||
668 | { | ||
669 | struct pt_regs *regs = RELOC_HIDE(&__regs, 0); | ||
670 | unsigned long error_code; | ||
671 | struct task_struct *tsk = current; | ||
672 | |||
673 | #ifdef CONFIG_SH_FPU_EMU | ||
674 | unsigned short inst = 0; | ||
675 | int err; | ||
676 | |||
677 | get_user(inst, (unsigned short*)regs->pc); | ||
678 | |||
679 | err = do_fpu_inst(inst, regs); | ||
680 | if (!err) { | ||
681 | regs->pc += instruction_size(inst); | ||
682 | return; | ||
683 | } | ||
684 | /* not a FPU inst. */ | ||
685 | #endif | ||
686 | |||
687 | #ifdef CONFIG_SH_DSP | ||
688 | /* Check if it's a DSP instruction */ | ||
689 | if (is_dsp_inst(regs)) { | ||
690 | /* Enable DSP mode, and restart instruction. */ | ||
691 | regs->sr |= SR_DSP; | ||
692 | return; | ||
693 | } | ||
694 | #endif | ||
695 | |||
696 | lookup_exception_vector(error_code); | ||
697 | |||
698 | local_irq_enable(); | ||
699 | CHK_REMOTE_DEBUG(regs); | ||
700 | force_sig(SIGILL, tsk); | ||
701 | die_if_no_fixup("reserved instruction", regs, error_code); | ||
702 | } | ||
703 | |||
704 | #ifdef CONFIG_SH_FPU_EMU | ||
705 | static int emulate_branch(unsigned short inst, struct pt_regs* regs) | ||
706 | { | ||
707 | /* | ||
708 | * bfs: 8fxx: PC+=d*2+4; | ||
709 | * bts: 8dxx: PC+=d*2+4; | ||
710 | * bra: axxx: PC+=D*2+4; | ||
711 | * bsr: bxxx: PC+=D*2+4 after PR=PC+4; | ||
712 | * braf:0x23: PC+=Rn*2+4; | ||
713 | * bsrf:0x03: PC+=Rn*2+4 after PR=PC+4; | ||
714 | * jmp: 4x2b: PC=Rn; | ||
715 | * jsr: 4x0b: PC=Rn after PR=PC+4; | ||
716 | * rts: 000b: PC=PR; | ||
717 | */ | ||
718 | if ((inst & 0xfd00) == 0x8d00) { | ||
719 | regs->pc += SH_PC_8BIT_OFFSET(inst); | ||
720 | return 0; | ||
721 | } | ||
722 | |||
723 | if ((inst & 0xe000) == 0xa000) { | ||
724 | regs->pc += SH_PC_12BIT_OFFSET(inst); | ||
725 | return 0; | ||
726 | } | ||
727 | |||
728 | if ((inst & 0xf0df) == 0x0003) { | ||
729 | regs->pc += regs->regs[(inst & 0x0f00) >> 8] + 4; | ||
730 | return 0; | ||
731 | } | ||
732 | |||
733 | if ((inst & 0xf0df) == 0x400b) { | ||
734 | regs->pc = regs->regs[(inst & 0x0f00) >> 8]; | ||
735 | return 0; | ||
736 | } | ||
737 | |||
738 | if ((inst & 0xffff) == 0x000b) { | ||
739 | regs->pc = regs->pr; | ||
740 | return 0; | ||
741 | } | ||
742 | |||
743 | return 1; | ||
744 | } | ||
745 | #endif | ||
746 | |||
747 | asmlinkage void do_illegal_slot_inst(unsigned long r4, unsigned long r5, | ||
748 | unsigned long r6, unsigned long r7, | ||
749 | struct pt_regs __regs) | ||
750 | { | ||
751 | struct pt_regs *regs = RELOC_HIDE(&__regs, 0); | ||
752 | unsigned long error_code; | ||
753 | struct task_struct *tsk = current; | ||
754 | #ifdef CONFIG_SH_FPU_EMU | ||
755 | unsigned short inst = 0; | ||
756 | |||
757 | get_user(inst, (unsigned short *)regs->pc + 1); | ||
758 | if (!do_fpu_inst(inst, regs)) { | ||
759 | get_user(inst, (unsigned short *)regs->pc); | ||
760 | if (!emulate_branch(inst, regs)) | ||
761 | return; | ||
762 | /* fault in branch.*/ | ||
763 | } | ||
764 | /* not a FPU inst. */ | ||
765 | #endif | ||
766 | |||
767 | lookup_exception_vector(error_code); | ||
768 | |||
769 | local_irq_enable(); | ||
770 | CHK_REMOTE_DEBUG(regs); | ||
771 | force_sig(SIGILL, tsk); | ||
772 | die_if_no_fixup("illegal slot instruction", regs, error_code); | ||
773 | } | ||
774 | |||
775 | asmlinkage void do_exception_error(unsigned long r4, unsigned long r5, | ||
776 | unsigned long r6, unsigned long r7, | ||
777 | struct pt_regs __regs) | ||
778 | { | ||
779 | struct pt_regs *regs = RELOC_HIDE(&__regs, 0); | ||
780 | long ex; | ||
781 | |||
782 | lookup_exception_vector(ex); | ||
783 | die_if_kernel("exception", regs, ex); | ||
784 | } | ||
785 | |||
786 | #if defined(CONFIG_SH_STANDARD_BIOS) | ||
787 | void *gdb_vbr_vector; | ||
788 | |||
789 | static inline void __init gdb_vbr_init(void) | ||
790 | { | ||
791 | register unsigned long vbr; | ||
792 | |||
793 | /* | ||
794 | * Read the old value of the VBR register to initialise | ||
795 | * the vector through which debug and BIOS traps are | ||
796 | * delegated by the Linux trap handler. | ||
797 | */ | ||
798 | asm volatile("stc vbr, %0" : "=r" (vbr)); | ||
799 | |||
800 | gdb_vbr_vector = (void *)(vbr + 0x100); | ||
801 | printk("Setting GDB trap vector to 0x%08lx\n", | ||
802 | (unsigned long)gdb_vbr_vector); | ||
803 | } | ||
804 | #endif | ||
805 | |||
806 | void __cpuinit per_cpu_trap_init(void) | ||
807 | { | ||
808 | extern void *vbr_base; | ||
809 | |||
810 | #ifdef CONFIG_SH_STANDARD_BIOS | ||
811 | if (raw_smp_processor_id() == 0) | ||
812 | gdb_vbr_init(); | ||
813 | #endif | ||
814 | |||
815 | /* NOTE: The VBR value should be at P1 | ||
816 | (or P2, virtural "fixed" address space). | ||
817 | It's definitely should not in physical address. */ | ||
818 | |||
819 | asm volatile("ldc %0, vbr" | ||
820 | : /* no output */ | ||
821 | : "r" (&vbr_base) | ||
822 | : "memory"); | ||
823 | } | ||
824 | |||
825 | void *set_exception_table_vec(unsigned int vec, void *handler) | ||
826 | { | ||
827 | extern void *exception_handling_table[]; | ||
828 | void *old_handler; | ||
829 | |||
830 | old_handler = exception_handling_table[vec]; | ||
831 | exception_handling_table[vec] = handler; | ||
832 | return old_handler; | ||
833 | } | ||
834 | |||
835 | void __init trap_init(void) | ||
836 | { | ||
837 | set_exception_table_vec(TRAP_RESERVED_INST, do_reserved_inst); | ||
838 | set_exception_table_vec(TRAP_ILLEGAL_SLOT_INST, do_illegal_slot_inst); | ||
839 | |||
840 | #if defined(CONFIG_CPU_SH4) && !defined(CONFIG_SH_FPU) || \ | ||
841 | defined(CONFIG_SH_FPU_EMU) | ||
842 | /* | ||
843 | * For SH-4 lacking an FPU, treat floating point instructions as | ||
844 | * reserved. They'll be handled in the math-emu case, or faulted on | ||
845 | * otherwise. | ||
846 | */ | ||
847 | set_exception_table_evt(0x800, do_reserved_inst); | ||
848 | set_exception_table_evt(0x820, do_illegal_slot_inst); | ||
849 | #elif defined(CONFIG_SH_FPU) | ||
850 | #ifdef CONFIG_CPU_SUBTYPE_SHX3 | ||
851 | set_exception_table_evt(0xd80, fpu_state_restore_trap_handler); | ||
852 | set_exception_table_evt(0xda0, fpu_state_restore_trap_handler); | ||
853 | #else | ||
854 | set_exception_table_evt(0x800, fpu_state_restore_trap_handler); | ||
855 | set_exception_table_evt(0x820, fpu_state_restore_trap_handler); | ||
856 | #endif | ||
857 | #endif | ||
858 | |||
859 | #ifdef CONFIG_CPU_SH2 | ||
860 | set_exception_table_vec(TRAP_ADDRESS_ERROR, address_error_trap_handler); | ||
861 | #endif | ||
862 | #ifdef CONFIG_CPU_SH2A | ||
863 | set_exception_table_vec(TRAP_DIVZERO_ERROR, do_divide_error); | ||
864 | set_exception_table_vec(TRAP_DIVOVF_ERROR, do_divide_error); | ||
865 | #endif | ||
866 | |||
867 | /* Setup VBR for boot cpu */ | ||
868 | per_cpu_trap_init(); | ||
869 | } | ||
870 | |||
871 | void show_trace(struct task_struct *tsk, unsigned long *sp, | ||
872 | struct pt_regs *regs) | ||
873 | { | ||
874 | unsigned long addr; | ||
875 | |||
876 | if (regs && user_mode(regs)) | ||
877 | return; | ||
878 | |||
879 | printk("\nCall trace: "); | ||
880 | #ifdef CONFIG_KALLSYMS | ||
881 | printk("\n"); | ||
882 | #endif | ||
883 | |||
884 | while (!kstack_end(sp)) { | ||
885 | addr = *sp++; | ||
886 | if (kernel_text_address(addr)) | ||
887 | print_ip_sym(addr); | ||
888 | } | ||
889 | |||
890 | printk("\n"); | ||
891 | |||
892 | if (!tsk) | ||
893 | tsk = current; | ||
894 | |||
895 | debug_show_held_locks(tsk); | ||
896 | } | ||
897 | |||
898 | void show_stack(struct task_struct *tsk, unsigned long *sp) | ||
899 | { | ||
900 | unsigned long stack; | ||
901 | |||
902 | if (!tsk) | ||
903 | tsk = current; | ||
904 | if (tsk == current) | ||
905 | sp = (unsigned long *)current_stack_pointer; | ||
906 | else | ||
907 | sp = (unsigned long *)tsk->thread.sp; | ||
908 | |||
909 | stack = (unsigned long)sp; | ||
910 | dump_mem("Stack: ", stack, THREAD_SIZE + | ||
911 | (unsigned long)task_stack_page(tsk)); | ||
912 | show_trace(tsk, sp, NULL); | ||
913 | } | ||
914 | |||
915 | void dump_stack(void) | ||
916 | { | ||
917 | show_stack(NULL, NULL); | ||
918 | } | ||
919 | EXPORT_SYMBOL(dump_stack); | ||
diff --git a/arch/sh64/kernel/traps.c b/arch/sh/kernel/traps_64.c index f32df3831f45..c0b3c6f6edb5 100644 --- a/arch/sh64/kernel/traps.c +++ b/arch/sh/kernel/traps_64.c | |||
@@ -1,19 +1,13 @@ | |||
1 | /* | 1 | /* |
2 | * This file is subject to the terms and conditions of the GNU General Public | 2 | * arch/sh/kernel/traps_64.c |
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * arch/sh64/kernel/traps.c | ||
7 | * | 3 | * |
8 | * Copyright (C) 2000, 2001 Paolo Alberelli | 4 | * Copyright (C) 2000, 2001 Paolo Alberelli |
9 | * Copyright (C) 2003, 2004 Paul Mundt | 5 | * Copyright (C) 2003, 2004 Paul Mundt |
10 | * Copyright (C) 2003, 2004 Richard Curnow | 6 | * Copyright (C) 2003, 2004 Richard Curnow |
11 | * | 7 | * |
12 | */ | 8 | * This file is subject to the terms and conditions of the GNU General Public |
13 | 9 | * License. See the file "COPYING" in the main directory of this archive | |
14 | /* | 10 | * for more details. |
15 | * 'Traps.c' handles hardware traps and faults after we have saved some | ||
16 | * state in 'entry.S'. | ||
17 | */ | 11 | */ |
18 | #include <linux/sched.h> | 12 | #include <linux/sched.h> |
19 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
@@ -244,7 +238,6 @@ DO_ERROR(12, SIGILL, "reserved instruction", reserved_inst, current) | |||
244 | /* Called with interrupts disabled */ | 238 | /* Called with interrupts disabled */ |
245 | asmlinkage void do_exception_error(unsigned long ex, struct pt_regs *regs) | 239 | asmlinkage void do_exception_error(unsigned long ex, struct pt_regs *regs) |
246 | { | 240 | { |
247 | PLS(); | ||
248 | show_excp_regs(__FUNCTION__, -1, -1, regs); | 241 | show_excp_regs(__FUNCTION__, -1, -1, regs); |
249 | die_if_kernel("exception", regs, ex); | 242 | die_if_kernel("exception", regs, ex); |
250 | } | 243 | } |
@@ -618,9 +611,9 @@ static int misaligned_fpu_load(struct pt_regs *regs, | |||
618 | context switch the registers into memory so they can be | 611 | context switch the registers into memory so they can be |
619 | indexed by register number. */ | 612 | indexed by register number. */ |
620 | if (last_task_used_math == current) { | 613 | if (last_task_used_math == current) { |
621 | grab_fpu(); | 614 | enable_fpu(); |
622 | fpsave(¤t->thread.fpu.hard); | 615 | save_fpu(current, regs); |
623 | release_fpu(); | 616 | disable_fpu(); |
624 | last_task_used_math = NULL; | 617 | last_task_used_math = NULL; |
625 | regs->sr |= SR_FD; | 618 | regs->sr |= SR_FD; |
626 | } | 619 | } |
@@ -691,9 +684,9 @@ static int misaligned_fpu_store(struct pt_regs *regs, | |||
691 | context switch the registers into memory so they can be | 684 | context switch the registers into memory so they can be |
692 | indexed by register number. */ | 685 | indexed by register number. */ |
693 | if (last_task_used_math == current) { | 686 | if (last_task_used_math == current) { |
694 | grab_fpu(); | 687 | enable_fpu(); |
695 | fpsave(¤t->thread.fpu.hard); | 688 | save_fpu(current, regs); |
696 | release_fpu(); | 689 | disable_fpu(); |
697 | last_task_used_math = NULL; | 690 | last_task_used_math = NULL; |
698 | regs->sr |= SR_FD; | 691 | regs->sr |= SR_FD; |
699 | } | 692 | } |
diff --git a/arch/sh/kernel/vmlinux.lds.S b/arch/sh/kernel/vmlinux.lds.S index 0956fb3681a3..d7d4991f32af 100644 --- a/arch/sh/kernel/vmlinux.lds.S +++ b/arch/sh/kernel/vmlinux.lds.S | |||
@@ -1,138 +1,5 @@ | |||
1 | /* | 1 | #ifdef CONFIG_SUPERH32 |
2 | * ld script to make SuperH Linux kernel | 2 | # include "vmlinux_32.lds.S" |
3 | * Written by Niibe Yutaka | ||
4 | */ | ||
5 | #include <asm/thread_info.h> | ||
6 | #include <asm/cache.h> | ||
7 | #include <asm-generic/vmlinux.lds.h> | ||
8 | |||
9 | #ifdef CONFIG_CPU_LITTLE_ENDIAN | ||
10 | OUTPUT_FORMAT("elf32-sh-linux", "elf32-sh-linux", "elf32-sh-linux") | ||
11 | #else | 3 | #else |
12 | OUTPUT_FORMAT("elf32-shbig-linux", "elf32-shbig-linux", "elf32-shbig-linux") | 4 | # include "vmlinux_64.lds.S" |
13 | #endif | 5 | #endif |
14 | OUTPUT_ARCH(sh) | ||
15 | ENTRY(_start) | ||
16 | SECTIONS | ||
17 | { | ||
18 | . = CONFIG_PAGE_OFFSET + CONFIG_MEMORY_START + CONFIG_ZERO_PAGE_OFFSET; | ||
19 | _text = .; /* Text and read-only data */ | ||
20 | |||
21 | .empty_zero_page : { | ||
22 | *(.empty_zero_page) | ||
23 | } = 0 | ||
24 | |||
25 | .text : { | ||
26 | *(.text.head) | ||
27 | TEXT_TEXT | ||
28 | SCHED_TEXT | ||
29 | LOCK_TEXT | ||
30 | KPROBES_TEXT | ||
31 | *(.fixup) | ||
32 | *(.gnu.warning) | ||
33 | } = 0x0009 | ||
34 | |||
35 | . = ALIGN(16); /* Exception table */ | ||
36 | __start___ex_table = .; | ||
37 | __ex_table : { *(__ex_table) } | ||
38 | __stop___ex_table = .; | ||
39 | |||
40 | _etext = .; /* End of text section */ | ||
41 | |||
42 | BUG_TABLE | ||
43 | NOTES | ||
44 | RO_DATA(PAGE_SIZE) | ||
45 | |||
46 | . = ALIGN(THREAD_SIZE); | ||
47 | .data : { /* Data */ | ||
48 | *(.data.init_task) | ||
49 | |||
50 | . = ALIGN(L1_CACHE_BYTES); | ||
51 | *(.data.cacheline_aligned) | ||
52 | |||
53 | . = ALIGN(L1_CACHE_BYTES); | ||
54 | *(.data.read_mostly) | ||
55 | |||
56 | . = ALIGN(PAGE_SIZE); | ||
57 | *(.data.page_aligned) | ||
58 | |||
59 | __nosave_begin = .; | ||
60 | *(.data.nosave) | ||
61 | . = ALIGN(PAGE_SIZE); | ||
62 | __nosave_end = .; | ||
63 | |||
64 | DATA_DATA | ||
65 | CONSTRUCTORS | ||
66 | } | ||
67 | |||
68 | _edata = .; /* End of data section */ | ||
69 | |||
70 | . = ALIGN(PAGE_SIZE); /* Init code and data */ | ||
71 | __init_begin = .; | ||
72 | _sinittext = .; | ||
73 | .init.text : { *(.init.text) } | ||
74 | _einittext = .; | ||
75 | .init.data : { *(.init.data) } | ||
76 | |||
77 | . = ALIGN(16); | ||
78 | __setup_start = .; | ||
79 | .init.setup : { *(.init.setup) } | ||
80 | __setup_end = .; | ||
81 | |||
82 | __initcall_start = .; | ||
83 | .initcall.init : { | ||
84 | INITCALLS | ||
85 | } | ||
86 | __initcall_end = .; | ||
87 | __con_initcall_start = .; | ||
88 | .con_initcall.init : { *(.con_initcall.init) } | ||
89 | __con_initcall_end = .; | ||
90 | |||
91 | SECURITY_INIT | ||
92 | |||
93 | #ifdef CONFIG_BLK_DEV_INITRD | ||
94 | . = ALIGN(PAGE_SIZE); | ||
95 | __initramfs_start = .; | ||
96 | .init.ramfs : { *(.init.ramfs) } | ||
97 | __initramfs_end = .; | ||
98 | #endif | ||
99 | |||
100 | . = ALIGN(4); | ||
101 | __machvec_start = .; | ||
102 | .machvec.init : { *(.machvec.init) } | ||
103 | __machvec_end = .; | ||
104 | |||
105 | PERCPU(PAGE_SIZE) | ||
106 | |||
107 | /* | ||
108 | * .exit.text is discarded at runtime, not link time, to deal with | ||
109 | * references from __bug_table | ||
110 | */ | ||
111 | .exit.text : { *(.exit.text) } | ||
112 | .exit.data : { *(.exit.data) } | ||
113 | |||
114 | . = ALIGN(PAGE_SIZE); | ||
115 | .bss : { | ||
116 | __init_end = .; | ||
117 | __bss_start = .; /* BSS */ | ||
118 | *(.bss.page_aligned) | ||
119 | *(.bss) | ||
120 | *(COMMON) | ||
121 | . = ALIGN(4); | ||
122 | _ebss = .; /* uClinux MTD sucks */ | ||
123 | _end = . ; | ||
124 | } | ||
125 | |||
126 | /* | ||
127 | * When something in the kernel is NOT compiled as a module, the | ||
128 | * module cleanup code and data are put into these segments. Both | ||
129 | * can then be thrown away, as cleanup code is never called unless | ||
130 | * it's a module. | ||
131 | */ | ||
132 | /DISCARD/ : { | ||
133 | *(.exitcall.exit) | ||
134 | } | ||
135 | |||
136 | STABS_DEBUG | ||
137 | DWARF_DEBUG | ||
138 | } | ||
diff --git a/arch/sh/kernel/vmlinux_32.lds.S b/arch/sh/kernel/vmlinux_32.lds.S new file mode 100644 index 000000000000..d549fac6d3e7 --- /dev/null +++ b/arch/sh/kernel/vmlinux_32.lds.S | |||
@@ -0,0 +1,152 @@ | |||
1 | /* | ||
2 | * ld script to make SuperH Linux kernel | ||
3 | * Written by Niibe Yutaka | ||
4 | */ | ||
5 | #include <asm/thread_info.h> | ||
6 | #include <asm/cache.h> | ||
7 | #include <asm-generic/vmlinux.lds.h> | ||
8 | |||
9 | #ifdef CONFIG_CPU_LITTLE_ENDIAN | ||
10 | OUTPUT_FORMAT("elf32-sh-linux", "elf32-sh-linux", "elf32-sh-linux") | ||
11 | #else | ||
12 | OUTPUT_FORMAT("elf32-shbig-linux", "elf32-shbig-linux", "elf32-shbig-linux") | ||
13 | #endif | ||
14 | OUTPUT_ARCH(sh) | ||
15 | ENTRY(_start) | ||
16 | SECTIONS | ||
17 | { | ||
18 | #ifdef CONFIG_32BIT | ||
19 | . = CONFIG_PAGE_OFFSET + CONFIG_ZERO_PAGE_OFFSET; | ||
20 | #else | ||
21 | . = CONFIG_PAGE_OFFSET + CONFIG_MEMORY_START + CONFIG_ZERO_PAGE_OFFSET; | ||
22 | #endif | ||
23 | |||
24 | _text = .; /* Text and read-only data */ | ||
25 | |||
26 | .empty_zero_page : { | ||
27 | *(.empty_zero_page) | ||
28 | } = 0 | ||
29 | |||
30 | .text : { | ||
31 | *(.text.head) | ||
32 | TEXT_TEXT | ||
33 | SCHED_TEXT | ||
34 | LOCK_TEXT | ||
35 | KPROBES_TEXT | ||
36 | *(.fixup) | ||
37 | *(.gnu.warning) | ||
38 | } = 0x0009 | ||
39 | |||
40 | . = ALIGN(16); /* Exception table */ | ||
41 | __start___ex_table = .; | ||
42 | __ex_table : { *(__ex_table) } | ||
43 | __stop___ex_table = .; | ||
44 | |||
45 | _etext = .; /* End of text section */ | ||
46 | |||
47 | BUG_TABLE | ||
48 | NOTES | ||
49 | RO_DATA(PAGE_SIZE) | ||
50 | |||
51 | /* | ||
52 | * Code which must be executed uncached and the associated data | ||
53 | */ | ||
54 | . = ALIGN(PAGE_SIZE); | ||
55 | __uncached_start = .; | ||
56 | .uncached.text : { *(.uncached.text) } | ||
57 | .uncached.data : { *(.uncached.data) } | ||
58 | __uncached_end = .; | ||
59 | |||
60 | . = ALIGN(THREAD_SIZE); | ||
61 | .data : { /* Data */ | ||
62 | *(.data.init_task) | ||
63 | |||
64 | . = ALIGN(L1_CACHE_BYTES); | ||
65 | *(.data.cacheline_aligned) | ||
66 | |||
67 | . = ALIGN(L1_CACHE_BYTES); | ||
68 | *(.data.read_mostly) | ||
69 | |||
70 | . = ALIGN(PAGE_SIZE); | ||
71 | *(.data.page_aligned) | ||
72 | |||
73 | __nosave_begin = .; | ||
74 | *(.data.nosave) | ||
75 | . = ALIGN(PAGE_SIZE); | ||
76 | __nosave_end = .; | ||
77 | |||
78 | DATA_DATA | ||
79 | CONSTRUCTORS | ||
80 | } | ||
81 | |||
82 | _edata = .; /* End of data section */ | ||
83 | |||
84 | . = ALIGN(PAGE_SIZE); /* Init code and data */ | ||
85 | __init_begin = .; | ||
86 | _sinittext = .; | ||
87 | .init.text : { *(.init.text) } | ||
88 | _einittext = .; | ||
89 | .init.data : { *(.init.data) } | ||
90 | |||
91 | . = ALIGN(16); | ||
92 | __setup_start = .; | ||
93 | .init.setup : { *(.init.setup) } | ||
94 | __setup_end = .; | ||
95 | |||
96 | __initcall_start = .; | ||
97 | .initcall.init : { | ||
98 | INITCALLS | ||
99 | } | ||
100 | __initcall_end = .; | ||
101 | __con_initcall_start = .; | ||
102 | .con_initcall.init : { *(.con_initcall.init) } | ||
103 | __con_initcall_end = .; | ||
104 | |||
105 | SECURITY_INIT | ||
106 | |||
107 | #ifdef CONFIG_BLK_DEV_INITRD | ||
108 | . = ALIGN(PAGE_SIZE); | ||
109 | __initramfs_start = .; | ||
110 | .init.ramfs : { *(.init.ramfs) } | ||
111 | __initramfs_end = .; | ||
112 | #endif | ||
113 | |||
114 | . = ALIGN(4); | ||
115 | __machvec_start = .; | ||
116 | .machvec.init : { *(.machvec.init) } | ||
117 | __machvec_end = .; | ||
118 | |||
119 | PERCPU(PAGE_SIZE) | ||
120 | |||
121 | /* | ||
122 | * .exit.text is discarded at runtime, not link time, to deal with | ||
123 | * references from __bug_table | ||
124 | */ | ||
125 | .exit.text : { *(.exit.text) } | ||
126 | .exit.data : { *(.exit.data) } | ||
127 | |||
128 | . = ALIGN(PAGE_SIZE); | ||
129 | .bss : { | ||
130 | __init_end = .; | ||
131 | __bss_start = .; /* BSS */ | ||
132 | *(.bss.page_aligned) | ||
133 | *(.bss) | ||
134 | *(COMMON) | ||
135 | . = ALIGN(4); | ||
136 | _ebss = .; /* uClinux MTD sucks */ | ||
137 | _end = . ; | ||
138 | } | ||
139 | |||
140 | /* | ||
141 | * When something in the kernel is NOT compiled as a module, the | ||
142 | * module cleanup code and data are put into these segments. Both | ||
143 | * can then be thrown away, as cleanup code is never called unless | ||
144 | * it's a module. | ||
145 | */ | ||
146 | /DISCARD/ : { | ||
147 | *(.exitcall.exit) | ||
148 | } | ||
149 | |||
150 | STABS_DEBUG | ||
151 | DWARF_DEBUG | ||
152 | } | ||
diff --git a/arch/sh/kernel/vmlinux_64.lds.S b/arch/sh/kernel/vmlinux_64.lds.S new file mode 100644 index 000000000000..2fd0f7401484 --- /dev/null +++ b/arch/sh/kernel/vmlinux_64.lds.S | |||
@@ -0,0 +1,164 @@ | |||
1 | /* | ||
2 | * ld script to make SH64 Linux kernel | ||
3 | * | ||
4 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
5 | * | ||
6 | * benedict.gaster@superh.com: 2nd May 2002 | ||
7 | * Add definition of empty_zero_page to be the first page of kernel image. | ||
8 | * | ||
9 | * benedict.gaster@superh.com: 3rd May 2002 | ||
10 | * Added support for ramdisk, removing statically linked romfs at the | ||
11 | * same time. | ||
12 | * | ||
13 | * lethal@linux-sh.org: 9th May 2003 | ||
14 | * Kill off GLOBAL_NAME() usage and other CDC-isms. | ||
15 | * | ||
16 | * lethal@linux-sh.org: 19th May 2003 | ||
17 | * Remove support for ancient toolchains. | ||
18 | * | ||
19 | * This file is subject to the terms and conditions of the GNU General Public | ||
20 | * License. See the file "COPYING" in the main directory of this archive | ||
21 | * for more details. | ||
22 | */ | ||
23 | #include <asm/page.h> | ||
24 | #include <asm/cache.h> | ||
25 | #include <asm/thread_info.h> | ||
26 | |||
27 | #define LOAD_OFFSET CONFIG_PAGE_OFFSET | ||
28 | #include <asm-generic/vmlinux.lds.h> | ||
29 | |||
30 | OUTPUT_ARCH(sh:sh5) | ||
31 | |||
32 | #define C_PHYS(x) AT (ADDR(x) - LOAD_OFFSET) | ||
33 | |||
34 | ENTRY(__start) | ||
35 | SECTIONS | ||
36 | { | ||
37 | . = CONFIG_PAGE_OFFSET + CONFIG_MEMORY_START + PAGE_SIZE; | ||
38 | _text = .; /* Text and read-only data */ | ||
39 | |||
40 | .empty_zero_page : C_PHYS(.empty_zero_page) { | ||
41 | *(.empty_zero_page) | ||
42 | } = 0 | ||
43 | |||
44 | .text : C_PHYS(.text) { | ||
45 | *(.text.head) | ||
46 | TEXT_TEXT | ||
47 | *(.text64) | ||
48 | *(.text..SHmedia32) | ||
49 | SCHED_TEXT | ||
50 | LOCK_TEXT | ||
51 | KPROBES_TEXT | ||
52 | *(.fixup) | ||
53 | *(.gnu.warning) | ||
54 | #ifdef CONFIG_LITTLE_ENDIAN | ||
55 | } = 0x6ff0fff0 | ||
56 | #else | ||
57 | } = 0xf0fff06f | ||
58 | #endif | ||
59 | |||
60 | /* We likely want __ex_table to be Cache Line aligned */ | ||
61 | . = ALIGN(L1_CACHE_BYTES); /* Exception table */ | ||
62 | __start___ex_table = .; | ||
63 | __ex_table : C_PHYS(__ex_table) { *(__ex_table) } | ||
64 | __stop___ex_table = .; | ||
65 | |||
66 | _etext = .; /* End of text section */ | ||
67 | |||
68 | BUG_TABLE | ||
69 | NOTES | ||
70 | RO_DATA(PAGE_SIZE) | ||
71 | |||
72 | . = ALIGN(THREAD_SIZE); | ||
73 | .data : C_PHYS(.data) { /* Data */ | ||
74 | *(.data.init_task) | ||
75 | |||
76 | . = ALIGN(L1_CACHE_BYTES); | ||
77 | *(.data.cacheline_aligned) | ||
78 | |||
79 | . = ALIGN(L1_CACHE_BYTES); | ||
80 | *(.data.read_mostly) | ||
81 | |||
82 | . = ALIGN(PAGE_SIZE); | ||
83 | *(.data.page_aligned) | ||
84 | |||
85 | __nosave_begin = .; | ||
86 | *(.data.nosave) | ||
87 | . = ALIGN(PAGE_SIZE); | ||
88 | __nosave_end = .; | ||
89 | |||
90 | DATA_DATA | ||
91 | CONSTRUCTORS | ||
92 | } | ||
93 | |||
94 | _edata = .; /* End of data section */ | ||
95 | |||
96 | . = ALIGN(PAGE_SIZE); /* Init code and data */ | ||
97 | __init_begin = .; | ||
98 | _sinittext = .; | ||
99 | .init.text : C_PHYS(.init.text) { *(.init.text) } | ||
100 | _einittext = .; | ||
101 | .init.data : C_PHYS(.init.data) { *(.init.data) } | ||
102 | . = ALIGN(L1_CACHE_BYTES); /* Better if Cache Line aligned */ | ||
103 | __setup_start = .; | ||
104 | .init.setup : C_PHYS(.init.setup) { *(.init.setup) } | ||
105 | __setup_end = .; | ||
106 | __initcall_start = .; | ||
107 | .initcall.init : C_PHYS(.initcall.init) { | ||
108 | INITCALLS | ||
109 | } | ||
110 | __initcall_end = .; | ||
111 | __con_initcall_start = .; | ||
112 | .con_initcall.init : C_PHYS(.con_initcall.init) { | ||
113 | *(.con_initcall.init) | ||
114 | } | ||
115 | __con_initcall_end = .; | ||
116 | |||
117 | SECURITY_INIT | ||
118 | |||
119 | #ifdef CONFIG_BLK_DEV_INITRD | ||
120 | . = ALIGN(PAGE_SIZE); | ||
121 | __initramfs_start = .; | ||
122 | .init.ramfs : C_PHYS(.init.ramfs) { *(.init.ramfs) } | ||
123 | __initramfs_end = .; | ||
124 | #endif | ||
125 | |||
126 | . = ALIGN(8); | ||
127 | __machvec_start = .; | ||
128 | .machvec.init : C_PHYS(.machvec.init) { *(.machvec.init) } | ||
129 | __machvec_end = .; | ||
130 | |||
131 | PERCPU(PAGE_SIZE) | ||
132 | |||
133 | /* | ||
134 | * .exit.text is discarded at runtime, not link time, to deal with | ||
135 | * references from __bug_table | ||
136 | */ | ||
137 | .exit.text : C_PHYS(.exit.text) { *(.exit.text) } | ||
138 | .exit.data : C_PHYS(.exit.data) { *(.exit.data) } | ||
139 | |||
140 | . = ALIGN(PAGE_SIZE); | ||
141 | .bss : C_PHYS(.bss) { | ||
142 | __init_end = .; | ||
143 | __bss_start = .; /* BSS */ | ||
144 | *(.bss.page_aligned) | ||
145 | *(.bss) | ||
146 | *(COMMON) | ||
147 | . = ALIGN(4); | ||
148 | _ebss = .; /* uClinux MTD sucks */ | ||
149 | _end = . ; | ||
150 | } | ||
151 | |||
152 | /* | ||
153 | * When something in the kernel is NOT compiled as a module, the | ||
154 | * module cleanup code and data are put into these segments. Both | ||
155 | * can then be thrown away, as cleanup code is never called unless | ||
156 | * it's a module. | ||
157 | */ | ||
158 | /DISCARD/ : { | ||
159 | *(.exitcall.exit) | ||
160 | } | ||
161 | |||
162 | STABS_DEBUG | ||
163 | DWARF_DEBUG | ||
164 | } | ||
diff --git a/arch/sh/lib/Makefile b/arch/sh/lib/Makefile index 9dc7b6985052..ebb55d1149f5 100644 --- a/arch/sh/lib/Makefile +++ b/arch/sh/lib/Makefile | |||
@@ -2,12 +2,13 @@ | |||
2 | # Makefile for SuperH-specific library files.. | 2 | # Makefile for SuperH-specific library files.. |
3 | # | 3 | # |
4 | 4 | ||
5 | lib-y = delay.o memset.o memmove.o memchr.o \ | 5 | lib-y = delay.o io.o memset.o memmove.o memchr.o \ |
6 | checksum.o strlen.o div64.o div64-generic.o | 6 | checksum.o strlen.o div64.o div64-generic.o |
7 | 7 | ||
8 | memcpy-y := memcpy.o | 8 | memcpy-y := memcpy.o |
9 | memcpy-$(CONFIG_CPU_SH4) := memcpy-sh4.o | 9 | memcpy-$(CONFIG_CPU_SH4) := memcpy-sh4.o |
10 | 10 | ||
11 | lib-y += $(memcpy-y) | 11 | lib-$(CONFIG_MMU) += copy_page.o clear_page.o |
12 | lib-y += $(memcpy-y) | ||
12 | 13 | ||
13 | EXTRA_CFLAGS += -Werror | 14 | EXTRA_CFLAGS += -Werror |
diff --git a/arch/sh/mm/clear_page.S b/arch/sh/lib/clear_page.S index 7a7c81ee3f01..3539123fe517 100644 --- a/arch/sh/mm/clear_page.S +++ b/arch/sh/lib/clear_page.S | |||
@@ -9,10 +9,10 @@ | |||
9 | #include <asm/page.h> | 9 | #include <asm/page.h> |
10 | 10 | ||
11 | /* | 11 | /* |
12 | * clear_page_slow | 12 | * clear_page |
13 | * @to: P1 address | 13 | * @to: P1 address |
14 | * | 14 | * |
15 | * void clear_page_slow(void *to) | 15 | * void clear_page(void *to) |
16 | */ | 16 | */ |
17 | 17 | ||
18 | /* | 18 | /* |
@@ -20,7 +20,7 @@ | |||
20 | * r4 --- to | 20 | * r4 --- to |
21 | * r5 --- to + PAGE_SIZE | 21 | * r5 --- to + PAGE_SIZE |
22 | */ | 22 | */ |
23 | ENTRY(clear_page_slow) | 23 | ENTRY(clear_page) |
24 | mov r4,r5 | 24 | mov r4,r5 |
25 | mov.l .Llimit,r0 | 25 | mov.l .Llimit,r0 |
26 | add r0,r5 | 26 | add r0,r5 |
@@ -50,6 +50,8 @@ ENTRY(clear_page_slow) | |||
50 | ! | 50 | ! |
51 | rts | 51 | rts |
52 | nop | 52 | nop |
53 | |||
54 | .balign 4 | ||
53 | .Llimit: .long (PAGE_SIZE-28) | 55 | .Llimit: .long (PAGE_SIZE-28) |
54 | 56 | ||
55 | ENTRY(__clear_user) | 57 | ENTRY(__clear_user) |
diff --git a/arch/sh/mm/copy_page.S b/arch/sh/lib/copy_page.S index 40685018b952..e002b91c8752 100644 --- a/arch/sh/mm/copy_page.S +++ b/arch/sh/lib/copy_page.S | |||
@@ -9,11 +9,11 @@ | |||
9 | #include <asm/page.h> | 9 | #include <asm/page.h> |
10 | 10 | ||
11 | /* | 11 | /* |
12 | * copy_page_slow | 12 | * copy_page |
13 | * @to: P1 address | 13 | * @to: P1 address |
14 | * @from: P1 address | 14 | * @from: P1 address |
15 | * | 15 | * |
16 | * void copy_page_slow(void *to, void *from) | 16 | * void copy_page(void *to, void *from) |
17 | */ | 17 | */ |
18 | 18 | ||
19 | /* | 19 | /* |
@@ -23,7 +23,7 @@ | |||
23 | * r10 --- to | 23 | * r10 --- to |
24 | * r11 --- from | 24 | * r11 --- from |
25 | */ | 25 | */ |
26 | ENTRY(copy_page_slow) | 26 | ENTRY(copy_page) |
27 | mov.l r8,@-r15 | 27 | mov.l r8,@-r15 |
28 | mov.l r10,@-r15 | 28 | mov.l r10,@-r15 |
29 | mov.l r11,@-r15 | 29 | mov.l r11,@-r15 |
@@ -68,8 +68,9 @@ ENTRY(copy_page_slow) | |||
68 | rts | 68 | rts |
69 | nop | 69 | nop |
70 | 70 | ||
71 | .align 2 | 71 | .balign 4 |
72 | .Lpsz: .long PAGE_SIZE | 72 | .Lpsz: .long PAGE_SIZE |
73 | |||
73 | /* | 74 | /* |
74 | * __kernel_size_t __copy_user(void *to, const void *from, __kernel_size_t n); | 75 | * __kernel_size_t __copy_user(void *to, const void *from, __kernel_size_t n); |
75 | * Return the number of bytes NOT copied | 76 | * Return the number of bytes NOT copied |
diff --git a/arch/sh/lib/io.c b/arch/sh/lib/io.c new file mode 100644 index 000000000000..4f54ec43516f --- /dev/null +++ b/arch/sh/lib/io.c | |||
@@ -0,0 +1,82 @@ | |||
1 | /* | ||
2 | * arch/sh/lib/io.c - SH32 optimized I/O routines | ||
3 | * | ||
4 | * Copyright (C) 2000 Stuart Menefy | ||
5 | * Copyright (C) 2005 Paul Mundt | ||
6 | * | ||
7 | * Provide real functions which expand to whatever the header file defined. | ||
8 | * Also definitions of machine independent IO functions. | ||
9 | * | ||
10 | * This file is subject to the terms and conditions of the GNU General Public | ||
11 | * License. See the file "COPYING" in the main directory of this archive | ||
12 | * for more details. | ||
13 | */ | ||
14 | #include <linux/module.h> | ||
15 | #include <linux/io.h> | ||
16 | |||
17 | void __raw_readsl(unsigned long addr, void *datap, int len) | ||
18 | { | ||
19 | u32 *data; | ||
20 | |||
21 | for (data = datap; (len != 0) && (((u32)data & 0x1f) != 0); len--) | ||
22 | *data++ = ctrl_inl(addr); | ||
23 | |||
24 | if (likely(len >= (0x20 >> 2))) { | ||
25 | int tmp2, tmp3, tmp4, tmp5, tmp6; | ||
26 | |||
27 | __asm__ __volatile__( | ||
28 | "1: \n\t" | ||
29 | "mov.l @%7, r0 \n\t" | ||
30 | "mov.l @%7, %2 \n\t" | ||
31 | #ifdef CONFIG_CPU_SH4 | ||
32 | "movca.l r0, @%0 \n\t" | ||
33 | #else | ||
34 | "mov.l r0, @%0 \n\t" | ||
35 | #endif | ||
36 | "mov.l @%7, %3 \n\t" | ||
37 | "mov.l @%7, %4 \n\t" | ||
38 | "mov.l @%7, %5 \n\t" | ||
39 | "mov.l @%7, %6 \n\t" | ||
40 | "mov.l @%7, r7 \n\t" | ||
41 | "mov.l @%7, r0 \n\t" | ||
42 | "mov.l %2, @(0x04,%0) \n\t" | ||
43 | "mov #0x20>>2, %2 \n\t" | ||
44 | "mov.l %3, @(0x08,%0) \n\t" | ||
45 | "sub %2, %1 \n\t" | ||
46 | "mov.l %4, @(0x0c,%0) \n\t" | ||
47 | "cmp/hi %1, %2 ! T if 32 > len \n\t" | ||
48 | "mov.l %5, @(0x10,%0) \n\t" | ||
49 | "mov.l %6, @(0x14,%0) \n\t" | ||
50 | "mov.l r7, @(0x18,%0) \n\t" | ||
51 | "mov.l r0, @(0x1c,%0) \n\t" | ||
52 | "bf.s 1b \n\t" | ||
53 | " add #0x20, %0 \n\t" | ||
54 | : "=&r" (data), "=&r" (len), | ||
55 | "=&r" (tmp2), "=&r" (tmp3), "=&r" (tmp4), | ||
56 | "=&r" (tmp5), "=&r" (tmp6) | ||
57 | : "r"(addr), "0" (data), "1" (len) | ||
58 | : "r0", "r7", "t", "memory"); | ||
59 | } | ||
60 | |||
61 | for (; len != 0; len--) | ||
62 | *data++ = ctrl_inl(addr); | ||
63 | } | ||
64 | EXPORT_SYMBOL(__raw_readsl); | ||
65 | |||
66 | void __raw_writesl(unsigned long addr, const void *data, int len) | ||
67 | { | ||
68 | if (likely(len != 0)) { | ||
69 | int tmp1; | ||
70 | |||
71 | __asm__ __volatile__ ( | ||
72 | "1: \n\t" | ||
73 | "mov.l @%0+, %1 \n\t" | ||
74 | "dt %3 \n\t" | ||
75 | "bf.s 1b \n\t" | ||
76 | " mov.l %1, @%4 \n\t" | ||
77 | : "=&r" (data), "=&r" (tmp1) | ||
78 | : "0" (data), "r" (len), "r"(addr) | ||
79 | : "t", "memory"); | ||
80 | } | ||
81 | } | ||
82 | EXPORT_SYMBOL(__raw_writesl); | ||
diff --git a/arch/sh64/lib/.gitignore b/arch/sh/lib64/.gitignore index 3508c2cb23c4..3508c2cb23c4 100644 --- a/arch/sh64/lib/.gitignore +++ b/arch/sh/lib64/.gitignore | |||
diff --git a/arch/sh/lib64/Makefile b/arch/sh/lib64/Makefile new file mode 100644 index 000000000000..9950966923a0 --- /dev/null +++ b/arch/sh/lib64/Makefile | |||
@@ -0,0 +1,15 @@ | |||
1 | # | ||
2 | # Makefile for the SH-5 specific library files.. | ||
3 | # | ||
4 | # Copyright (C) 2000, 2001 Paolo Alberelli | ||
5 | # Copyright (C) 2003 Paul Mundt | ||
6 | # | ||
7 | # This file is subject to the terms and conditions of the GNU General Public | ||
8 | # License. See the file "COPYING" in the main directory of this archive | ||
9 | # for more details. | ||
10 | # | ||
11 | |||
12 | # Panic should really be compiled as PIC | ||
13 | lib-y := udelay.o c-checksum.o dbg.o panic.o memcpy.o copy_user_memcpy.o \ | ||
14 | copy_page.o clear_page.o | ||
15 | |||
diff --git a/arch/sh64/lib/c-checksum.c b/arch/sh/lib64/c-checksum.c index 053137abd8a0..5dfbd8b5e558 100644 --- a/arch/sh64/lib/c-checksum.c +++ b/arch/sh/lib64/c-checksum.c | |||
@@ -1,12 +1,9 @@ | |||
1 | /* | 1 | /* |
2 | * arch/sh64/lib/c-checksum.c | 2 | * arch/sh/lib64/c-checksum.c |
3 | * | 3 | * |
4 | * This file contains network checksum routines that are better done | 4 | * This file contains network checksum routines that are better done |
5 | * in an architecture-specific manner due to speed.. | 5 | * in an architecture-specific manner due to speed.. |
6 | */ | 6 | */ |
7 | |||
8 | #undef DEBUG | ||
9 | |||
10 | #include <linux/string.h> | 7 | #include <linux/string.h> |
11 | #include <linux/errno.h> | 8 | #include <linux/errno.h> |
12 | #include <linux/kernel.h> | 9 | #include <linux/kernel.h> |
diff --git a/arch/sh64/lib/page_clear.S b/arch/sh/lib64/clear_page.S index ac0111d669a3..007ab48ecc1c 100644 --- a/arch/sh64/lib/page_clear.S +++ b/arch/sh/lib64/clear_page.S | |||
@@ -25,8 +25,8 @@ | |||
25 | .little | 25 | .little |
26 | 26 | ||
27 | .balign 8 | 27 | .balign 8 |
28 | .global sh64_page_clear | 28 | .global clear_page |
29 | sh64_page_clear: | 29 | clear_page: |
30 | pta/l 1f, tr1 | 30 | pta/l 1f, tr1 |
31 | pta/l 2f, tr2 | 31 | pta/l 2f, tr2 |
32 | ptabs/l r18, tr0 | 32 | ptabs/l r18, tr0 |
diff --git a/arch/sh64/lib/page_copy.S b/arch/sh/lib64/copy_page.S index e159c3cd2582..0ec6fca63b56 100644 --- a/arch/sh64/lib/page_copy.S +++ b/arch/sh/lib64/copy_page.S | |||
@@ -10,8 +10,8 @@ | |||
10 | of SH5-101 cut2 eval chip with Cayman board DDR memory. | 10 | of SH5-101 cut2 eval chip with Cayman board DDR memory. |
11 | 11 | ||
12 | Parameters: | 12 | Parameters: |
13 | r2 : source effective address (start of page) | 13 | r2 : destination effective address (start of page) |
14 | r3 : destination effective address (start of page) | 14 | r3 : source effective address (start of page) |
15 | 15 | ||
16 | Always copies 4096 bytes. | 16 | Always copies 4096 bytes. |
17 | 17 | ||
@@ -27,10 +27,10 @@ | |||
27 | .little | 27 | .little |
28 | 28 | ||
29 | .balign 8 | 29 | .balign 8 |
30 | .global sh64_page_copy | 30 | .global copy_page |
31 | sh64_page_copy: | 31 | copy_page: |
32 | 32 | ||
33 | /* Copy 4096 bytes worth of data from r2 to r3. | 33 | /* Copy 4096 bytes worth of data from r3 to r2. |
34 | Do prefetches 4 lines ahead. | 34 | Do prefetches 4 lines ahead. |
35 | Do alloco 2 lines ahead */ | 35 | Do alloco 2 lines ahead */ |
36 | 36 | ||
@@ -41,21 +41,21 @@ sh64_page_copy: | |||
41 | 41 | ||
42 | #if 0 | 42 | #if 0 |
43 | /* TAKum03020 */ | 43 | /* TAKum03020 */ |
44 | ld.q r2, 0x00, r63 | 44 | ld.q r3, 0x00, r63 |
45 | ld.q r2, 0x20, r63 | 45 | ld.q r3, 0x20, r63 |
46 | ld.q r2, 0x40, r63 | 46 | ld.q r3, 0x40, r63 |
47 | ld.q r2, 0x60, r63 | 47 | ld.q r3, 0x60, r63 |
48 | #endif | 48 | #endif |
49 | alloco r3, 0x00 | 49 | alloco r2, 0x00 |
50 | synco ! TAKum03020 | 50 | synco ! TAKum03020 |
51 | alloco r3, 0x20 | 51 | alloco r2, 0x20 |
52 | synco ! TAKum03020 | 52 | synco ! TAKum03020 |
53 | 53 | ||
54 | movi 3968, r6 | 54 | movi 3968, r6 |
55 | add r3, r6, r6 | 55 | add r2, r6, r6 |
56 | addi r6, 64, r7 | 56 | addi r6, 64, r7 |
57 | addi r7, 64, r8 | 57 | addi r7, 64, r8 |
58 | sub r2, r3, r60 | 58 | sub r3, r2, r60 |
59 | addi r60, 8, r61 | 59 | addi r60, 8, r61 |
60 | addi r61, 8, r62 | 60 | addi r61, 8, r62 |
61 | addi r62, 8, r23 | 61 | addi r62, 8, r23 |
@@ -67,25 +67,23 @@ sh64_page_copy: | |||
67 | 1: | 67 | 1: |
68 | #if 0 | 68 | #if 0 |
69 | /* TAKum03020 */ | 69 | /* TAKum03020 */ |
70 | bge/u r3, r6, tr2 ! skip prefetch for last 4 lines | 70 | bge/u r2, r6, tr2 ! skip prefetch for last 4 lines |
71 | ldx.q r3, r22, r63 ! prefetch 4 lines hence | 71 | ldx.q r2, r22, r63 ! prefetch 4 lines hence |
72 | #endif | 72 | #endif |
73 | 2: | 73 | 2: |
74 | bge/u r3, r7, tr3 ! skip alloco for last 2 lines | 74 | bge/u r2, r7, tr3 ! skip alloco for last 2 lines |
75 | alloco r3, 0x40 ! alloc destination line 2 lines ahead | 75 | alloco r2, 0x40 ! alloc destination line 2 lines ahead |
76 | synco ! TAKum03020 | 76 | synco ! TAKum03020 |
77 | 3: | 77 | 3: |
78 | ldx.q r3, r60, r36 | 78 | ldx.q r2, r60, r36 |
79 | ldx.q r3, r61, r37 | 79 | ldx.q r2, r61, r37 |
80 | ldx.q r3, r62, r38 | 80 | ldx.q r2, r62, r38 |
81 | ldx.q r3, r23, r39 | 81 | ldx.q r2, r23, r39 |
82 | st.q r3, 0, r36 | 82 | st.q r2, 0, r36 |
83 | st.q r3, 8, r37 | 83 | st.q r2, 8, r37 |
84 | st.q r3, 16, r38 | 84 | st.q r2, 16, r38 |
85 | st.q r3, 24, r39 | 85 | st.q r2, 24, r39 |
86 | addi r3, 32, r3 | 86 | addi r2, 32, r2 |
87 | bgt/l r8, r3, tr1 | 87 | bgt/l r8, r2, tr1 |
88 | 88 | ||
89 | blink tr0, r63 ! return | 89 | blink tr0, r63 ! return |
90 | |||
91 | |||
diff --git a/arch/sh64/lib/copy_user_memcpy.S b/arch/sh/lib64/copy_user_memcpy.S index 2a62816d2ddd..2a62816d2ddd 100644 --- a/arch/sh64/lib/copy_user_memcpy.S +++ b/arch/sh/lib64/copy_user_memcpy.S | |||
diff --git a/arch/sh64/lib/dbg.c b/arch/sh/lib64/dbg.c index 97816e0baf19..75825ef6e084 100644 --- a/arch/sh64/lib/dbg.c +++ b/arch/sh/lib64/dbg.c | |||
@@ -2,7 +2,7 @@ | |||
2 | -- | 2 | -- |
3 | -- Identity : Linux50 Debug Funcions | 3 | -- Identity : Linux50 Debug Funcions |
4 | -- | 4 | -- |
5 | -- File : arch/sh64/lib/dbg.C | 5 | -- File : arch/sh/lib64/dbg.c |
6 | -- | 6 | -- |
7 | -- Copyright 2000, 2001 STMicroelectronics Limited. | 7 | -- Copyright 2000, 2001 STMicroelectronics Limited. |
8 | -- Copyright 2004 Richard Curnow (evt_debug etc) | 8 | -- Copyright 2004 Richard Curnow (evt_debug etc) |
diff --git a/arch/sh64/lib/memcpy.c b/arch/sh/lib64/memcpy.c index fba436a92bfa..fba436a92bfa 100644 --- a/arch/sh64/lib/memcpy.c +++ b/arch/sh/lib64/memcpy.c | |||
diff --git a/arch/sh64/lib/panic.c b/arch/sh/lib64/panic.c index c9eb1cb50d97..ff559e2a96f7 100644 --- a/arch/sh64/lib/panic.c +++ b/arch/sh/lib64/panic.c | |||
@@ -8,7 +8,7 @@ | |||
8 | 8 | ||
9 | #include <linux/kernel.h> | 9 | #include <linux/kernel.h> |
10 | #include <asm/io.h> | 10 | #include <asm/io.h> |
11 | #include <asm/registers.h> | 11 | #include <asm/cpu/registers.h> |
12 | 12 | ||
13 | /* THIS IS A PHYSICAL ADDRESS */ | 13 | /* THIS IS A PHYSICAL ADDRESS */ |
14 | #define HDSP2534_ADDR (0x04002100) | 14 | #define HDSP2534_ADDR (0x04002100) |
diff --git a/arch/sh64/lib/udelay.c b/arch/sh/lib64/udelay.c index 327653914007..23c7d17fb9f7 100644 --- a/arch/sh64/lib/udelay.c +++ b/arch/sh/lib64/udelay.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * arch/sh64/lib/udelay.c | 2 | * arch/sh/lib64/udelay.c |
3 | * | 3 | * |
4 | * Delay routines, using a pre-computed "loops_per_jiffy" value. | 4 | * Delay routines, using a pre-computed "loops_per_jiffy" value. |
5 | * | 5 | * |
@@ -13,8 +13,6 @@ | |||
13 | #include <linux/sched.h> | 13 | #include <linux/sched.h> |
14 | #include <asm/param.h> | 14 | #include <asm/param.h> |
15 | 15 | ||
16 | extern unsigned long loops_per_jiffy; | ||
17 | |||
18 | /* | 16 | /* |
19 | * Use only for very small delays (< 1 msec). | 17 | * Use only for very small delays (< 1 msec). |
20 | * | 18 | * |
@@ -49,11 +47,10 @@ void __ndelay(unsigned long long nsecs, unsigned long lpj) | |||
49 | 47 | ||
50 | void udelay(unsigned long usecs) | 48 | void udelay(unsigned long usecs) |
51 | { | 49 | { |
52 | __udelay(usecs, loops_per_jiffy); | 50 | __udelay(usecs, cpu_data[raw_smp_processor_id()].loops_per_jiffy); |
53 | } | 51 | } |
54 | 52 | ||
55 | void ndelay(unsigned long nsecs) | 53 | void ndelay(unsigned long nsecs) |
56 | { | 54 | { |
57 | __ndelay(nsecs, loops_per_jiffy); | 55 | __ndelay(nsecs, cpu_data[raw_smp_processor_id()].loops_per_jiffy); |
58 | } | 56 | } |
59 | |||
diff --git a/arch/sh/mm/Kconfig b/arch/sh/mm/Kconfig index 1265f204f7d1..f549b8cd2501 100644 --- a/arch/sh/mm/Kconfig +++ b/arch/sh/mm/Kconfig | |||
@@ -1,193 +1,3 @@ | |||
1 | # | ||
2 | # Processor families | ||
3 | # | ||
4 | config CPU_SH2 | ||
5 | bool | ||
6 | |||
7 | config CPU_SH2A | ||
8 | bool | ||
9 | select CPU_SH2 | ||
10 | |||
11 | config CPU_SH3 | ||
12 | bool | ||
13 | select CPU_HAS_INTEVT | ||
14 | select CPU_HAS_SR_RB | ||
15 | |||
16 | config CPU_SH4 | ||
17 | bool | ||
18 | select CPU_HAS_INTEVT | ||
19 | select CPU_HAS_SR_RB | ||
20 | select CPU_HAS_PTEA if !CPU_SH4A || CPU_SHX2 | ||
21 | select CPU_HAS_FPU if !CPU_SH4AL_DSP | ||
22 | |||
23 | config CPU_SH4A | ||
24 | bool | ||
25 | select CPU_SH4 | ||
26 | |||
27 | config CPU_SH4AL_DSP | ||
28 | bool | ||
29 | select CPU_SH4A | ||
30 | select CPU_HAS_DSP | ||
31 | |||
32 | config CPU_SHX2 | ||
33 | bool | ||
34 | |||
35 | config CPU_SHX3 | ||
36 | bool | ||
37 | |||
38 | choice | ||
39 | prompt "Processor sub-type selection" | ||
40 | |||
41 | # | ||
42 | # Processor subtypes | ||
43 | # | ||
44 | |||
45 | # SH-2 Processor Support | ||
46 | |||
47 | config CPU_SUBTYPE_SH7619 | ||
48 | bool "Support SH7619 processor" | ||
49 | select CPU_SH2 | ||
50 | |||
51 | # SH-2A Processor Support | ||
52 | |||
53 | config CPU_SUBTYPE_SH7206 | ||
54 | bool "Support SH7206 processor" | ||
55 | select CPU_SH2A | ||
56 | |||
57 | # SH-3 Processor Support | ||
58 | |||
59 | config CPU_SUBTYPE_SH7705 | ||
60 | bool "Support SH7705 processor" | ||
61 | select CPU_SH3 | ||
62 | |||
63 | config CPU_SUBTYPE_SH7706 | ||
64 | bool "Support SH7706 processor" | ||
65 | select CPU_SH3 | ||
66 | help | ||
67 | Select SH7706 if you have a 133 Mhz SH-3 HD6417706 CPU. | ||
68 | |||
69 | config CPU_SUBTYPE_SH7707 | ||
70 | bool "Support SH7707 processor" | ||
71 | select CPU_SH3 | ||
72 | help | ||
73 | Select SH7707 if you have a 60 Mhz SH-3 HD6417707 CPU. | ||
74 | |||
75 | config CPU_SUBTYPE_SH7708 | ||
76 | bool "Support SH7708 processor" | ||
77 | select CPU_SH3 | ||
78 | help | ||
79 | Select SH7708 if you have a 60 Mhz SH-3 HD6417708S or | ||
80 | if you have a 100 Mhz SH-3 HD6417708R CPU. | ||
81 | |||
82 | config CPU_SUBTYPE_SH7709 | ||
83 | bool "Support SH7709 processor" | ||
84 | select CPU_SH3 | ||
85 | help | ||
86 | Select SH7709 if you have a 80 Mhz SH-3 HD6417709 CPU. | ||
87 | |||
88 | config CPU_SUBTYPE_SH7710 | ||
89 | bool "Support SH7710 processor" | ||
90 | select CPU_SH3 | ||
91 | select CPU_HAS_DSP | ||
92 | help | ||
93 | Select SH7710 if you have a SH3-DSP SH7710 CPU. | ||
94 | |||
95 | config CPU_SUBTYPE_SH7712 | ||
96 | bool "Support SH7712 processor" | ||
97 | select CPU_SH3 | ||
98 | select CPU_HAS_DSP | ||
99 | help | ||
100 | Select SH7712 if you have a SH3-DSP SH7712 CPU. | ||
101 | |||
102 | config CPU_SUBTYPE_SH7720 | ||
103 | bool "Support SH7720 processor" | ||
104 | select CPU_SH3 | ||
105 | select CPU_HAS_DSP | ||
106 | help | ||
107 | Select SH7720 if you have a SH3-DSP SH7720 CPU. | ||
108 | |||
109 | # SH-4 Processor Support | ||
110 | |||
111 | config CPU_SUBTYPE_SH7750 | ||
112 | bool "Support SH7750 processor" | ||
113 | select CPU_SH4 | ||
114 | help | ||
115 | Select SH7750 if you have a 200 Mhz SH-4 HD6417750 CPU. | ||
116 | |||
117 | config CPU_SUBTYPE_SH7091 | ||
118 | bool "Support SH7091 processor" | ||
119 | select CPU_SH4 | ||
120 | help | ||
121 | Select SH7091 if you have an SH-4 based Sega device (such as | ||
122 | the Dreamcast, Naomi, and Naomi 2). | ||
123 | |||
124 | config CPU_SUBTYPE_SH7750R | ||
125 | bool "Support SH7750R processor" | ||
126 | select CPU_SH4 | ||
127 | |||
128 | config CPU_SUBTYPE_SH7750S | ||
129 | bool "Support SH7750S processor" | ||
130 | select CPU_SH4 | ||
131 | |||
132 | config CPU_SUBTYPE_SH7751 | ||
133 | bool "Support SH7751 processor" | ||
134 | select CPU_SH4 | ||
135 | help | ||
136 | Select SH7751 if you have a 166 Mhz SH-4 HD6417751 CPU, | ||
137 | or if you have a HD6417751R CPU. | ||
138 | |||
139 | config CPU_SUBTYPE_SH7751R | ||
140 | bool "Support SH7751R processor" | ||
141 | select CPU_SH4 | ||
142 | |||
143 | config CPU_SUBTYPE_SH7760 | ||
144 | bool "Support SH7760 processor" | ||
145 | select CPU_SH4 | ||
146 | |||
147 | config CPU_SUBTYPE_SH4_202 | ||
148 | bool "Support SH4-202 processor" | ||
149 | select CPU_SH4 | ||
150 | |||
151 | # SH-4A Processor Support | ||
152 | |||
153 | config CPU_SUBTYPE_SH7770 | ||
154 | bool "Support SH7770 processor" | ||
155 | select CPU_SH4A | ||
156 | |||
157 | config CPU_SUBTYPE_SH7780 | ||
158 | bool "Support SH7780 processor" | ||
159 | select CPU_SH4A | ||
160 | |||
161 | config CPU_SUBTYPE_SH7785 | ||
162 | bool "Support SH7785 processor" | ||
163 | select CPU_SH4A | ||
164 | select CPU_SHX2 | ||
165 | select ARCH_SPARSEMEM_ENABLE | ||
166 | select SYS_SUPPORTS_NUMA | ||
167 | |||
168 | config CPU_SUBTYPE_SHX3 | ||
169 | bool "Support SH-X3 processor" | ||
170 | select CPU_SH4A | ||
171 | select CPU_SHX3 | ||
172 | select ARCH_SPARSEMEM_ENABLE | ||
173 | select SYS_SUPPORTS_NUMA | ||
174 | select SYS_SUPPORTS_SMP | ||
175 | |||
176 | # SH4AL-DSP Processor Support | ||
177 | |||
178 | config CPU_SUBTYPE_SH7343 | ||
179 | bool "Support SH7343 processor" | ||
180 | select CPU_SH4AL_DSP | ||
181 | |||
182 | config CPU_SUBTYPE_SH7722 | ||
183 | bool "Support SH7722 processor" | ||
184 | select CPU_SH4AL_DSP | ||
185 | select CPU_SHX2 | ||
186 | select ARCH_SPARSEMEM_ENABLE | ||
187 | select SYS_SUPPORTS_NUMA | ||
188 | |||
189 | endchoice | ||
190 | |||
191 | menu "Memory management options" | 1 | menu "Memory management options" |
192 | 2 | ||
193 | config QUICKLIST | 3 | config QUICKLIST |
@@ -207,7 +17,8 @@ config MMU | |||
207 | 17 | ||
208 | config PAGE_OFFSET | 18 | config PAGE_OFFSET |
209 | hex | 19 | hex |
210 | default "0x80000000" if MMU | 20 | default "0x80000000" if MMU && SUPERH32 |
21 | default "0x20000000" if MMU && SUPERH64 | ||
211 | default "0x00000000" | 22 | default "0x00000000" |
212 | 23 | ||
213 | config MEMORY_START | 24 | config MEMORY_START |
@@ -228,17 +39,28 @@ config MEMORY_START | |||
228 | 39 | ||
229 | config MEMORY_SIZE | 40 | config MEMORY_SIZE |
230 | hex "Physical memory size" | 41 | hex "Physical memory size" |
231 | default "0x00400000" | 42 | default "0x04000000" |
232 | help | 43 | help |
233 | This sets the default memory size assumed by your SH kernel. It can | 44 | This sets the default memory size assumed by your SH kernel. It can |
234 | be overridden as normal by the 'mem=' argument on the kernel command | 45 | be overridden as normal by the 'mem=' argument on the kernel command |
235 | line. If unsure, consult your board specifications or just leave it | 46 | line. If unsure, consult your board specifications or just leave it |
236 | as 0x00400000 which was the default value before this became | 47 | as 0x04000000 which was the default value before this became |
237 | configurable. | 48 | configurable. |
238 | 49 | ||
50 | # Physical addressing modes | ||
51 | |||
52 | config 29BIT | ||
53 | def_bool !32BIT | ||
54 | depends on SUPERH32 | ||
55 | |||
239 | config 32BIT | 56 | config 32BIT |
57 | bool | ||
58 | default y if CPU_SH5 | ||
59 | |||
60 | config PMB | ||
240 | bool "Support 32-bit physical addressing through PMB" | 61 | bool "Support 32-bit physical addressing through PMB" |
241 | depends on MMU && (CPU_SUBTYPE_SH7780 || CPU_SUBTYPE_SH7785) | 62 | depends on MMU && (CPU_SUBTYPE_SH7780 || CPU_SUBTYPE_SH7785) |
63 | select 32BIT | ||
242 | default y | 64 | default y |
243 | help | 65 | help |
244 | If you say Y here, physical addressing will be extended to | 66 | If you say Y here, physical addressing will be extended to |
@@ -256,7 +78,7 @@ config X2TLB | |||
256 | 78 | ||
257 | config VSYSCALL | 79 | config VSYSCALL |
258 | bool "Support vsyscall page" | 80 | bool "Support vsyscall page" |
259 | depends on MMU | 81 | depends on MMU && (CPU_SH3 || CPU_SH4) |
260 | default y | 82 | default y |
261 | help | 83 | help |
262 | This will enable support for the kernel mapping a vDSO page | 84 | This will enable support for the kernel mapping a vDSO page |
@@ -335,7 +157,7 @@ config PAGE_SIZE_8KB | |||
335 | 157 | ||
336 | config PAGE_SIZE_64KB | 158 | config PAGE_SIZE_64KB |
337 | bool "64kB" | 159 | bool "64kB" |
338 | depends on CPU_SH4 | 160 | depends on CPU_SH4 || CPU_SH5 |
339 | help | 161 | help |
340 | This enables support for 64kB pages, possible on all SH-4 | 162 | This enables support for 64kB pages, possible on all SH-4 |
341 | CPUs and later. | 163 | CPUs and later. |
@@ -344,7 +166,7 @@ endchoice | |||
344 | 166 | ||
345 | choice | 167 | choice |
346 | prompt "HugeTLB page size" | 168 | prompt "HugeTLB page size" |
347 | depends on HUGETLB_PAGE && CPU_SH4 && MMU | 169 | depends on HUGETLB_PAGE && (CPU_SH4 || CPU_SH5) && MMU |
348 | default HUGETLB_PAGE_SIZE_64K | 170 | default HUGETLB_PAGE_SIZE_64K |
349 | 171 | ||
350 | config HUGETLB_PAGE_SIZE_64K | 172 | config HUGETLB_PAGE_SIZE_64K |
@@ -365,6 +187,10 @@ config HUGETLB_PAGE_SIZE_64MB | |||
365 | bool "64MB" | 187 | bool "64MB" |
366 | depends on X2TLB | 188 | depends on X2TLB |
367 | 189 | ||
190 | config HUGETLB_PAGE_SIZE_512MB | ||
191 | bool "512MB" | ||
192 | depends on CPU_SH5 | ||
193 | |||
368 | endchoice | 194 | endchoice |
369 | 195 | ||
370 | source "mm/Kconfig" | 196 | source "mm/Kconfig" |
@@ -392,12 +218,12 @@ config SH_DIRECT_MAPPED | |||
392 | 218 | ||
393 | choice | 219 | choice |
394 | prompt "Cache mode" | 220 | prompt "Cache mode" |
395 | default CACHE_WRITEBACK if CPU_SH2A || CPU_SH3 || CPU_SH4 | 221 | default CACHE_WRITEBACK if CPU_SH2A || CPU_SH3 || CPU_SH4 || CPU_SH5 |
396 | default CACHE_WRITETHROUGH if (CPU_SH2 && !CPU_SH2A) | 222 | default CACHE_WRITETHROUGH if (CPU_SH2 && !CPU_SH2A) |
397 | 223 | ||
398 | config CACHE_WRITEBACK | 224 | config CACHE_WRITEBACK |
399 | bool "Write-back" | 225 | bool "Write-back" |
400 | depends on CPU_SH2A || CPU_SH3 || CPU_SH4 | 226 | depends on CPU_SH2A || CPU_SH3 || CPU_SH4 || CPU_SH5 |
401 | 227 | ||
402 | config CACHE_WRITETHROUGH | 228 | config CACHE_WRITETHROUGH |
403 | bool "Write-through" | 229 | bool "Write-through" |
diff --git a/arch/sh/mm/Makefile b/arch/sh/mm/Makefile index aa44607f072d..9f4bc3d90b1e 100644 --- a/arch/sh/mm/Makefile +++ b/arch/sh/mm/Makefile | |||
@@ -1,37 +1,5 @@ | |||
1 | # | 1 | ifeq ($(CONFIG_SUPERH32),y) |
2 | # Makefile for the Linux SuperH-specific parts of the memory manager. | 2 | include ${srctree}/arch/sh/mm/Makefile_32 |
3 | # | 3 | else |
4 | 4 | include ${srctree}/arch/sh/mm/Makefile_64 | |
5 | obj-y := init.o extable.o consistent.o | ||
6 | |||
7 | ifndef CONFIG_CACHE_OFF | ||
8 | obj-$(CONFIG_CPU_SH2) += cache-sh2.o | ||
9 | obj-$(CONFIG_CPU_SH3) += cache-sh3.o | ||
10 | obj-$(CONFIG_CPU_SH4) += cache-sh4.o | ||
11 | obj-$(CONFIG_SH7705_CACHE_32KB) += cache-sh7705.o | ||
12 | endif | 5 | endif |
13 | |||
14 | mmu-y := tlb-nommu.o pg-nommu.o | ||
15 | mmu-$(CONFIG_MMU) := fault.o clear_page.o copy_page.o tlb-flush.o \ | ||
16 | ioremap.o | ||
17 | |||
18 | obj-y += $(mmu-y) | ||
19 | |||
20 | ifdef CONFIG_DEBUG_FS | ||
21 | obj-$(CONFIG_CPU_SH4) += cache-debugfs.o | ||
22 | endif | ||
23 | |||
24 | ifdef CONFIG_MMU | ||
25 | obj-$(CONFIG_CPU_SH3) += tlb-sh3.o | ||
26 | obj-$(CONFIG_CPU_SH4) += tlb-sh4.o | ||
27 | ifndef CONFIG_CACHE_OFF | ||
28 | obj-$(CONFIG_CPU_SH4) += pg-sh4.o | ||
29 | obj-$(CONFIG_SH7705_CACHE_32KB) += pg-sh7705.o | ||
30 | endif | ||
31 | endif | ||
32 | |||
33 | obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o | ||
34 | obj-$(CONFIG_32BIT) += pmb.o | ||
35 | obj-$(CONFIG_NUMA) += numa.o | ||
36 | |||
37 | EXTRA_CFLAGS += -Werror | ||
diff --git a/arch/sh/mm/Makefile_32 b/arch/sh/mm/Makefile_32 new file mode 100644 index 000000000000..e295db60b91b --- /dev/null +++ b/arch/sh/mm/Makefile_32 | |||
@@ -0,0 +1,36 @@ | |||
1 | # | ||
2 | # Makefile for the Linux SuperH-specific parts of the memory manager. | ||
3 | # | ||
4 | |||
5 | obj-y := init.o extable_32.o consistent.o | ||
6 | |||
7 | ifndef CONFIG_CACHE_OFF | ||
8 | obj-$(CONFIG_CPU_SH2) += cache-sh2.o | ||
9 | obj-$(CONFIG_CPU_SH3) += cache-sh3.o | ||
10 | obj-$(CONFIG_CPU_SH4) += cache-sh4.o | ||
11 | obj-$(CONFIG_SH7705_CACHE_32KB) += cache-sh7705.o | ||
12 | endif | ||
13 | |||
14 | mmu-y := tlb-nommu.o pg-nommu.o | ||
15 | mmu-$(CONFIG_MMU) := fault_32.o tlbflush_32.o ioremap_32.o | ||
16 | |||
17 | obj-y += $(mmu-y) | ||
18 | |||
19 | ifdef CONFIG_DEBUG_FS | ||
20 | obj-$(CONFIG_CPU_SH4) += cache-debugfs.o | ||
21 | endif | ||
22 | |||
23 | ifdef CONFIG_MMU | ||
24 | obj-$(CONFIG_CPU_SH3) += tlb-sh3.o | ||
25 | obj-$(CONFIG_CPU_SH4) += tlb-sh4.o | ||
26 | ifndef CONFIG_CACHE_OFF | ||
27 | obj-$(CONFIG_CPU_SH4) += pg-sh4.o | ||
28 | obj-$(CONFIG_SH7705_CACHE_32KB) += pg-sh7705.o | ||
29 | endif | ||
30 | endif | ||
31 | |||
32 | obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o | ||
33 | obj-$(CONFIG_PMB) += pmb.o | ||
34 | obj-$(CONFIG_NUMA) += numa.o | ||
35 | |||
36 | EXTRA_CFLAGS += -Werror | ||
diff --git a/arch/sh64/mm/Makefile b/arch/sh/mm/Makefile_64 index d0e813632480..cbd6aa33c5ac 100644 --- a/arch/sh64/mm/Makefile +++ b/arch/sh/mm/Makefile_64 | |||
@@ -1,24 +1,24 @@ | |||
1 | # | 1 | # |
2 | # This file is subject to the terms and conditions of the GNU General Public | 2 | # Makefile for the Linux SuperH-specific parts of the memory manager. |
3 | # License. See the file "COPYING" in the main directory of this archive | ||
4 | # for more details. | ||
5 | # | ||
6 | # Copyright (C) 2000, 2001 Paolo Alberelli | ||
7 | # Copyright (C) 2003, 2004 Paul Mundt | ||
8 | # | ||
9 | # Makefile for the sh64-specific parts of the Linux memory manager. | ||
10 | # | ||
11 | # Note! Dependencies are done automagically by 'make dep', which also | ||
12 | # removes any old dependencies. DON'T put your own dependencies here | ||
13 | # unless it's something special (ie not a .c file). | ||
14 | # | 3 | # |
15 | 4 | ||
16 | obj-y := cache.o consistent.o extable.o fault.o init.o ioremap.o \ | 5 | obj-y := init.o extable_64.o consistent.o |
17 | tlbmiss.o tlb.o | 6 | |
7 | mmu-y := tlb-nommu.o pg-nommu.o | ||
8 | mmu-$(CONFIG_MMU) := fault_64.o ioremap_64.o tlbflush_64.o tlb-sh5.o | ||
9 | |||
10 | ifndef CONFIG_CACHE_OFF | ||
11 | obj-y += cache-sh5.o | ||
12 | endif | ||
13 | |||
14 | obj-y += $(mmu-y) | ||
18 | 15 | ||
19 | obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o | 16 | obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o |
17 | obj-$(CONFIG_NUMA) += numa.o | ||
18 | |||
19 | EXTRA_CFLAGS += -Werror | ||
20 | 20 | ||
21 | # Special flags for tlbmiss.o. This puts restrictions on the number of | 21 | # Special flags for fault_64.o. This puts restrictions on the number of |
22 | # caller-save registers that the compiler can target when building this file. | 22 | # caller-save registers that the compiler can target when building this file. |
23 | # This is required because the code is called from a context in entry.S where | 23 | # This is required because the code is called from a context in entry.S where |
24 | # very few registers have been saved in the exception handler (for speed | 24 | # very few registers have been saved in the exception handler (for speed |
@@ -33,7 +33,7 @@ obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o | |||
33 | # The resources not listed below are callee save, i.e. the compiler is free to | 33 | # The resources not listed below are callee save, i.e. the compiler is free to |
34 | # use any of them and will spill them to the stack itself. | 34 | # use any of them and will spill them to the stack itself. |
35 | 35 | ||
36 | CFLAGS_tlbmiss.o += -ffixed-r7 \ | 36 | CFLAGS_fault_64.o += -ffixed-r7 \ |
37 | -ffixed-r8 -ffixed-r9 -ffixed-r10 -ffixed-r11 -ffixed-r12 \ | 37 | -ffixed-r8 -ffixed-r9 -ffixed-r10 -ffixed-r11 -ffixed-r12 \ |
38 | -ffixed-r13 -ffixed-r14 -ffixed-r16 -ffixed-r17 -ffixed-r19 \ | 38 | -ffixed-r13 -ffixed-r14 -ffixed-r16 -ffixed-r17 -ffixed-r19 \ |
39 | -ffixed-r20 -ffixed-r21 -ffixed-r22 -ffixed-r23 \ | 39 | -ffixed-r20 -ffixed-r21 -ffixed-r22 -ffixed-r23 \ |
diff --git a/arch/sh/mm/cache-debugfs.c b/arch/sh/mm/cache-debugfs.c index de6d2c9aa477..db6d950b6f5e 100644 --- a/arch/sh/mm/cache-debugfs.c +++ b/arch/sh/mm/cache-debugfs.c | |||
@@ -22,7 +22,8 @@ enum cache_type { | |||
22 | CACHE_TYPE_UNIFIED, | 22 | CACHE_TYPE_UNIFIED, |
23 | }; | 23 | }; |
24 | 24 | ||
25 | static int cache_seq_show(struct seq_file *file, void *iter) | 25 | static int __uses_jump_to_uncached cache_seq_show(struct seq_file *file, |
26 | void *iter) | ||
26 | { | 27 | { |
27 | unsigned int cache_type = (unsigned int)file->private; | 28 | unsigned int cache_type = (unsigned int)file->private; |
28 | struct cache_info *cache; | 29 | struct cache_info *cache; |
@@ -34,11 +35,11 @@ static int cache_seq_show(struct seq_file *file, void *iter) | |||
34 | * Go uncached immediately so we don't skew the results any | 35 | * Go uncached immediately so we don't skew the results any |
35 | * more than we already are.. | 36 | * more than we already are.. |
36 | */ | 37 | */ |
37 | jump_to_P2(); | 38 | jump_to_uncached(); |
38 | 39 | ||
39 | ccr = ctrl_inl(CCR); | 40 | ccr = ctrl_inl(CCR); |
40 | if ((ccr & CCR_CACHE_ENABLE) == 0) { | 41 | if ((ccr & CCR_CACHE_ENABLE) == 0) { |
41 | back_to_P1(); | 42 | back_to_cached(); |
42 | 43 | ||
43 | seq_printf(file, "disabled\n"); | 44 | seq_printf(file, "disabled\n"); |
44 | return 0; | 45 | return 0; |
@@ -104,7 +105,7 @@ static int cache_seq_show(struct seq_file *file, void *iter) | |||
104 | addrstart += cache->way_incr; | 105 | addrstart += cache->way_incr; |
105 | } | 106 | } |
106 | 107 | ||
107 | back_to_P1(); | 108 | back_to_cached(); |
108 | 109 | ||
109 | return 0; | 110 | return 0; |
110 | } | 111 | } |
diff --git a/arch/sh/mm/cache-sh4.c b/arch/sh/mm/cache-sh4.c index 226b190c5b9c..43d7ff6b6ec7 100644 --- a/arch/sh/mm/cache-sh4.c +++ b/arch/sh/mm/cache-sh4.c | |||
@@ -190,7 +190,7 @@ void flush_icache_range(unsigned long start, unsigned long end) | |||
190 | * .. which happens to be the same behavior as flush_icache_range(). | 190 | * .. which happens to be the same behavior as flush_icache_range(). |
191 | * So, we simply flush out a line. | 191 | * So, we simply flush out a line. |
192 | */ | 192 | */ |
193 | void flush_cache_sigtramp(unsigned long addr) | 193 | void __uses_jump_to_uncached flush_cache_sigtramp(unsigned long addr) |
194 | { | 194 | { |
195 | unsigned long v, index; | 195 | unsigned long v, index; |
196 | unsigned long flags; | 196 | unsigned long flags; |
@@ -205,13 +205,13 @@ void flush_cache_sigtramp(unsigned long addr) | |||
205 | (v & boot_cpu_data.icache.entry_mask); | 205 | (v & boot_cpu_data.icache.entry_mask); |
206 | 206 | ||
207 | local_irq_save(flags); | 207 | local_irq_save(flags); |
208 | jump_to_P2(); | 208 | jump_to_uncached(); |
209 | 209 | ||
210 | for (i = 0; i < boot_cpu_data.icache.ways; | 210 | for (i = 0; i < boot_cpu_data.icache.ways; |
211 | i++, index += boot_cpu_data.icache.way_incr) | 211 | i++, index += boot_cpu_data.icache.way_incr) |
212 | ctrl_outl(0, index); /* Clear out Valid-bit */ | 212 | ctrl_outl(0, index); /* Clear out Valid-bit */ |
213 | 213 | ||
214 | back_to_P1(); | 214 | back_to_cached(); |
215 | wmb(); | 215 | wmb(); |
216 | local_irq_restore(flags); | 216 | local_irq_restore(flags); |
217 | } | 217 | } |
@@ -256,12 +256,12 @@ void flush_dcache_page(struct page *page) | |||
256 | } | 256 | } |
257 | 257 | ||
258 | /* TODO: Selective icache invalidation through IC address array.. */ | 258 | /* TODO: Selective icache invalidation through IC address array.. */ |
259 | static inline void flush_icache_all(void) | 259 | static inline void __uses_jump_to_uncached flush_icache_all(void) |
260 | { | 260 | { |
261 | unsigned long flags, ccr; | 261 | unsigned long flags, ccr; |
262 | 262 | ||
263 | local_irq_save(flags); | 263 | local_irq_save(flags); |
264 | jump_to_P2(); | 264 | jump_to_uncached(); |
265 | 265 | ||
266 | /* Flush I-cache */ | 266 | /* Flush I-cache */ |
267 | ccr = ctrl_inl(CCR); | 267 | ccr = ctrl_inl(CCR); |
@@ -269,11 +269,11 @@ static inline void flush_icache_all(void) | |||
269 | ctrl_outl(ccr, CCR); | 269 | ctrl_outl(ccr, CCR); |
270 | 270 | ||
271 | /* | 271 | /* |
272 | * back_to_P1() will take care of the barrier for us, don't add | 272 | * back_to_cached() will take care of the barrier for us, don't add |
273 | * another one! | 273 | * another one! |
274 | */ | 274 | */ |
275 | 275 | ||
276 | back_to_P1(); | 276 | back_to_cached(); |
277 | local_irq_restore(flags); | 277 | local_irq_restore(flags); |
278 | } | 278 | } |
279 | 279 | ||
diff --git a/arch/sh64/mm/cache.c b/arch/sh/mm/cache-sh5.c index 421487cfff4c..4617e3aeee73 100644 --- a/arch/sh64/mm/cache.c +++ b/arch/sh/mm/cache-sh5.c | |||
@@ -1,18 +1,15 @@ | |||
1 | /* | 1 | /* |
2 | * This file is subject to the terms and conditions of the GNU General Public | 2 | * arch/sh/mm/cache-sh5.c |
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * arch/sh64/mm/cache.c | ||
7 | * | 3 | * |
8 | * Original version Copyright (C) 2000, 2001 Paolo Alberelli | 4 | * Original version Copyright (C) 2000, 2001 Paolo Alberelli |
9 | * Second version Copyright (C) benedict.gaster@superh.com 2002 | 5 | * Second version Copyright (C) benedict.gaster@superh.com 2002 |
10 | * Third version Copyright Richard.Curnow@superh.com 2003 | 6 | * Third version Copyright Richard.Curnow@superh.com 2003 |
11 | * Hacks to third version Copyright (C) 2003 Paul Mundt | 7 | * Hacks to third version Copyright (C) 2003 Paul Mundt |
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 | */ | 12 | */ |
13 | |||
14 | /****************************************************************************/ | ||
15 | |||
16 | #include <linux/init.h> | 13 | #include <linux/init.h> |
17 | #include <linux/mman.h> | 14 | #include <linux/mman.h> |
18 | #include <linux/mm.h> | 15 | #include <linux/mm.h> |
@@ -146,7 +143,7 @@ int __init sh64_cache_init(void) | |||
146 | /* The following group of functions deal with mapping and unmapping a temporary | 143 | /* The following group of functions deal with mapping and unmapping a temporary |
147 | page into the DTLB slot that have been set aside for our exclusive use. */ | 144 | page into the DTLB slot that have been set aside for our exclusive use. */ |
148 | /* In order to accomplish this, we use the generic interface for adding and | 145 | /* In order to accomplish this, we use the generic interface for adding and |
149 | removing a wired slot entry as defined in arch/sh64/mm/tlb.c */ | 146 | removing a wired slot entry as defined in arch/sh/mm/tlb-sh5.c */ |
150 | /****************************************************************************/ | 147 | /****************************************************************************/ |
151 | 148 | ||
152 | static unsigned long slot_own_flags; | 149 | static unsigned long slot_own_flags; |
diff --git a/arch/sh/mm/cache-sh7705.c b/arch/sh/mm/cache-sh7705.c index 4896d7376926..22dacc778823 100644 --- a/arch/sh/mm/cache-sh7705.c +++ b/arch/sh/mm/cache-sh7705.c | |||
@@ -71,7 +71,7 @@ void flush_icache_range(unsigned long start, unsigned long end) | |||
71 | /* | 71 | /* |
72 | * Writeback&Invalidate the D-cache of the page | 72 | * Writeback&Invalidate the D-cache of the page |
73 | */ | 73 | */ |
74 | static void __flush_dcache_page(unsigned long phys) | 74 | static void __uses_jump_to_uncached __flush_dcache_page(unsigned long phys) |
75 | { | 75 | { |
76 | unsigned long ways, waysize, addrstart; | 76 | unsigned long ways, waysize, addrstart; |
77 | unsigned long flags; | 77 | unsigned long flags; |
@@ -92,7 +92,7 @@ static void __flush_dcache_page(unsigned long phys) | |||
92 | * possible. | 92 | * possible. |
93 | */ | 93 | */ |
94 | local_irq_save(flags); | 94 | local_irq_save(flags); |
95 | jump_to_P2(); | 95 | jump_to_uncached(); |
96 | 96 | ||
97 | ways = current_cpu_data.dcache.ways; | 97 | ways = current_cpu_data.dcache.ways; |
98 | waysize = current_cpu_data.dcache.sets; | 98 | waysize = current_cpu_data.dcache.sets; |
@@ -118,7 +118,7 @@ static void __flush_dcache_page(unsigned long phys) | |||
118 | addrstart += current_cpu_data.dcache.way_incr; | 118 | addrstart += current_cpu_data.dcache.way_incr; |
119 | } while (--ways); | 119 | } while (--ways); |
120 | 120 | ||
121 | back_to_P1(); | 121 | back_to_cached(); |
122 | local_irq_restore(flags); | 122 | local_irq_restore(flags); |
123 | } | 123 | } |
124 | 124 | ||
@@ -132,15 +132,15 @@ void flush_dcache_page(struct page *page) | |||
132 | __flush_dcache_page(PHYSADDR(page_address(page))); | 132 | __flush_dcache_page(PHYSADDR(page_address(page))); |
133 | } | 133 | } |
134 | 134 | ||
135 | void flush_cache_all(void) | 135 | void __uses_jump_to_uncached flush_cache_all(void) |
136 | { | 136 | { |
137 | unsigned long flags; | 137 | unsigned long flags; |
138 | 138 | ||
139 | local_irq_save(flags); | 139 | local_irq_save(flags); |
140 | jump_to_P2(); | 140 | jump_to_uncached(); |
141 | 141 | ||
142 | cache_wback_all(); | 142 | cache_wback_all(); |
143 | back_to_P1(); | 143 | back_to_cached(); |
144 | local_irq_restore(flags); | 144 | local_irq_restore(flags); |
145 | } | 145 | } |
146 | 146 | ||
diff --git a/arch/sh/mm/consistent.c b/arch/sh/mm/consistent.c index e220c29a3c00..7b2131c9eeda 100644 --- a/arch/sh/mm/consistent.c +++ b/arch/sh/mm/consistent.c | |||
@@ -1,7 +1,9 @@ | |||
1 | /* | 1 | /* |
2 | * arch/sh/mm/consistent.c | 2 | * arch/sh/mm/consistent.c |
3 | * | 3 | * |
4 | * Copyright (C) 2004 Paul Mundt | 4 | * Copyright (C) 2004 - 2007 Paul Mundt |
5 | * | ||
6 | * Declared coherent memory functions based on arch/x86/kernel/pci-dma_32.c | ||
5 | * | 7 | * |
6 | * This file is subject to the terms and conditions of the GNU General Public | 8 | * This file is subject to the terms and conditions of the GNU General Public |
7 | * License. See the file "COPYING" in the main directory of this archive | 9 | * License. See the file "COPYING" in the main directory of this archive |
@@ -13,58 +15,152 @@ | |||
13 | #include <asm/addrspace.h> | 15 | #include <asm/addrspace.h> |
14 | #include <asm/io.h> | 16 | #include <asm/io.h> |
15 | 17 | ||
16 | void *consistent_alloc(gfp_t gfp, size_t size, dma_addr_t *handle) | 18 | struct dma_coherent_mem { |
19 | void *virt_base; | ||
20 | u32 device_base; | ||
21 | int size; | ||
22 | int flags; | ||
23 | unsigned long *bitmap; | ||
24 | }; | ||
25 | |||
26 | void *dma_alloc_coherent(struct device *dev, size_t size, | ||
27 | dma_addr_t *dma_handle, gfp_t gfp) | ||
17 | { | 28 | { |
18 | struct page *page, *end, *free; | ||
19 | void *ret; | 29 | void *ret; |
20 | int order; | 30 | struct dma_coherent_mem *mem = dev ? dev->dma_mem : NULL; |
31 | int order = get_order(size); | ||
21 | 32 | ||
22 | size = PAGE_ALIGN(size); | 33 | if (mem) { |
23 | order = get_order(size); | 34 | int page = bitmap_find_free_region(mem->bitmap, mem->size, |
35 | order); | ||
36 | if (page >= 0) { | ||
37 | *dma_handle = mem->device_base + (page << PAGE_SHIFT); | ||
38 | ret = mem->virt_base + (page << PAGE_SHIFT); | ||
39 | memset(ret, 0, size); | ||
40 | return ret; | ||
41 | } | ||
42 | if (mem->flags & DMA_MEMORY_EXCLUSIVE) | ||
43 | return NULL; | ||
44 | } | ||
24 | 45 | ||
25 | page = alloc_pages(gfp, order); | 46 | ret = (void *)__get_free_pages(gfp, order); |
26 | if (!page) | ||
27 | return NULL; | ||
28 | split_page(page, order); | ||
29 | 47 | ||
30 | ret = page_address(page); | 48 | if (ret != NULL) { |
31 | memset(ret, 0, size); | 49 | memset(ret, 0, size); |
32 | *handle = virt_to_phys(ret); | 50 | /* |
51 | * Pages from the page allocator may have data present in | ||
52 | * cache. So flush the cache before using uncached memory. | ||
53 | */ | ||
54 | dma_cache_sync(NULL, ret, size, DMA_BIDIRECTIONAL); | ||
55 | *dma_handle = virt_to_phys(ret); | ||
56 | } | ||
57 | return ret; | ||
58 | } | ||
59 | EXPORT_SYMBOL(dma_alloc_coherent); | ||
33 | 60 | ||
34 | /* | 61 | void dma_free_coherent(struct device *dev, size_t size, |
35 | * We must flush the cache before we pass it on to the device | 62 | void *vaddr, dma_addr_t dma_handle) |
36 | */ | 63 | { |
37 | __flush_purge_region(ret, size); | 64 | struct dma_coherent_mem *mem = dev ? dev->dma_mem : NULL; |
65 | int order = get_order(size); | ||
38 | 66 | ||
39 | page = virt_to_page(ret); | 67 | if (mem && vaddr >= mem->virt_base && vaddr < (mem->virt_base + (mem->size << PAGE_SHIFT))) { |
40 | free = page + (size >> PAGE_SHIFT); | 68 | int page = (vaddr - mem->virt_base) >> PAGE_SHIFT; |
41 | end = page + (1 << order); | ||
42 | 69 | ||
43 | while (++page < end) { | 70 | bitmap_release_region(mem->bitmap, page, order); |
44 | /* Free any unused pages */ | 71 | } else { |
45 | if (page >= free) { | 72 | WARN_ON(irqs_disabled()); /* for portability */ |
46 | __free_page(page); | 73 | BUG_ON(mem && mem->flags & DMA_MEMORY_EXCLUSIVE); |
47 | } | 74 | free_pages((unsigned long)vaddr, order); |
48 | } | 75 | } |
76 | } | ||
77 | EXPORT_SYMBOL(dma_free_coherent); | ||
78 | |||
79 | int dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr, | ||
80 | dma_addr_t device_addr, size_t size, int flags) | ||
81 | { | ||
82 | void __iomem *mem_base = NULL; | ||
83 | int pages = size >> PAGE_SHIFT; | ||
84 | int bitmap_size = BITS_TO_LONGS(pages) * sizeof(long); | ||
85 | |||
86 | if ((flags & (DMA_MEMORY_MAP | DMA_MEMORY_IO)) == 0) | ||
87 | goto out; | ||
88 | if (!size) | ||
89 | goto out; | ||
90 | if (dev->dma_mem) | ||
91 | goto out; | ||
92 | |||
93 | /* FIXME: this routine just ignores DMA_MEMORY_INCLUDES_CHILDREN */ | ||
49 | 94 | ||
50 | return P2SEGADDR(ret); | 95 | mem_base = ioremap_nocache(bus_addr, size); |
96 | if (!mem_base) | ||
97 | goto out; | ||
98 | |||
99 | dev->dma_mem = kmalloc(sizeof(struct dma_coherent_mem), GFP_KERNEL); | ||
100 | if (!dev->dma_mem) | ||
101 | goto out; | ||
102 | dev->dma_mem->bitmap = kzalloc(bitmap_size, GFP_KERNEL); | ||
103 | if (!dev->dma_mem->bitmap) | ||
104 | goto free1_out; | ||
105 | |||
106 | dev->dma_mem->virt_base = mem_base; | ||
107 | dev->dma_mem->device_base = device_addr; | ||
108 | dev->dma_mem->size = pages; | ||
109 | dev->dma_mem->flags = flags; | ||
110 | |||
111 | if (flags & DMA_MEMORY_MAP) | ||
112 | return DMA_MEMORY_MAP; | ||
113 | |||
114 | return DMA_MEMORY_IO; | ||
115 | |||
116 | free1_out: | ||
117 | kfree(dev->dma_mem); | ||
118 | out: | ||
119 | if (mem_base) | ||
120 | iounmap(mem_base); | ||
121 | return 0; | ||
51 | } | 122 | } |
123 | EXPORT_SYMBOL(dma_declare_coherent_memory); | ||
52 | 124 | ||
53 | void consistent_free(void *vaddr, size_t size) | 125 | void dma_release_declared_memory(struct device *dev) |
54 | { | 126 | { |
55 | unsigned long addr = P1SEGADDR((unsigned long)vaddr); | 127 | struct dma_coherent_mem *mem = dev->dma_mem; |
56 | struct page *page=virt_to_page(addr); | ||
57 | int num_pages=(size+PAGE_SIZE-1) >> PAGE_SHIFT; | ||
58 | int i; | ||
59 | 128 | ||
60 | for(i=0;i<num_pages;i++) { | 129 | if (!mem) |
61 | __free_page((page+i)); | 130 | return; |
62 | } | 131 | dev->dma_mem = NULL; |
132 | iounmap(mem->virt_base); | ||
133 | kfree(mem->bitmap); | ||
134 | kfree(mem); | ||
63 | } | 135 | } |
136 | EXPORT_SYMBOL(dma_release_declared_memory); | ||
64 | 137 | ||
65 | void consistent_sync(void *vaddr, size_t size, int direction) | 138 | void *dma_mark_declared_memory_occupied(struct device *dev, |
139 | dma_addr_t device_addr, size_t size) | ||
66 | { | 140 | { |
67 | void * p1addr = (void*) P1SEGADDR((unsigned long)vaddr); | 141 | struct dma_coherent_mem *mem = dev->dma_mem; |
142 | int pages = (size + (device_addr & ~PAGE_MASK) + PAGE_SIZE - 1) >> PAGE_SHIFT; | ||
143 | int pos, err; | ||
144 | |||
145 | if (!mem) | ||
146 | return ERR_PTR(-EINVAL); | ||
147 | |||
148 | pos = (device_addr - mem->device_base) >> PAGE_SHIFT; | ||
149 | err = bitmap_allocate_region(mem->bitmap, pos, get_order(pages)); | ||
150 | if (err != 0) | ||
151 | return ERR_PTR(err); | ||
152 | return mem->virt_base + (pos << PAGE_SHIFT); | ||
153 | } | ||
154 | EXPORT_SYMBOL(dma_mark_declared_memory_occupied); | ||
155 | |||
156 | void dma_cache_sync(struct device *dev, void *vaddr, size_t size, | ||
157 | enum dma_data_direction direction) | ||
158 | { | ||
159 | #ifdef CONFIG_CPU_SH5 | ||
160 | void *p1addr = vaddr; | ||
161 | #else | ||
162 | void *p1addr = (void*) P1SEGADDR((unsigned long)vaddr); | ||
163 | #endif | ||
68 | 164 | ||
69 | switch (direction) { | 165 | switch (direction) { |
70 | case DMA_FROM_DEVICE: /* invalidate only */ | 166 | case DMA_FROM_DEVICE: /* invalidate only */ |
@@ -80,8 +176,4 @@ void consistent_sync(void *vaddr, size_t size, int direction) | |||
80 | BUG(); | 176 | BUG(); |
81 | } | 177 | } |
82 | } | 178 | } |
83 | 179 | EXPORT_SYMBOL(dma_cache_sync); | |
84 | EXPORT_SYMBOL(consistent_alloc); | ||
85 | EXPORT_SYMBOL(consistent_free); | ||
86 | EXPORT_SYMBOL(consistent_sync); | ||
87 | |||
diff --git a/arch/sh/mm/extable.c b/arch/sh/mm/extable_32.c index c1cf4463d09d..c1cf4463d09d 100644 --- a/arch/sh/mm/extable.c +++ b/arch/sh/mm/extable_32.c | |||
diff --git a/arch/sh64/mm/extable.c b/arch/sh/mm/extable_64.c index a2e6e0563772..f05499688d88 100644 --- a/arch/sh64/mm/extable.c +++ b/arch/sh/mm/extable_64.c | |||
@@ -1,14 +1,14 @@ | |||
1 | /* | 1 | /* |
2 | * This file is subject to the terms and conditions of the GNU General Public | 2 | * arch/sh/mm/extable_64.c |
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * arch/sh64/mm/extable.c | ||
7 | * | 3 | * |
8 | * Copyright (C) 2003 Richard Curnow | 4 | * Copyright (C) 2003 Richard Curnow |
9 | * Copyright (C) 2003, 2004 Paul Mundt | 5 | * Copyright (C) 2003, 2004 Paul Mundt |
10 | * | 6 | * |
11 | * Cloned from the 2.5 SH version.. | 7 | * Cloned from the 2.5 SH version.. |
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 | */ | 12 | */ |
13 | #include <linux/rwsem.h> | 13 | #include <linux/rwsem.h> |
14 | #include <linux/module.h> | 14 | #include <linux/module.h> |
@@ -21,13 +21,16 @@ static const struct exception_table_entry __copy_user_fixup_ex = { | |||
21 | .fixup = (unsigned long)&__copy_user_fixup, | 21 | .fixup = (unsigned long)&__copy_user_fixup, |
22 | }; | 22 | }; |
23 | 23 | ||
24 | /* Some functions that may trap due to a bad user-mode address have too many loads | 24 | /* |
25 | and stores in them to make it at all practical to label each one and put them all in | 25 | * Some functions that may trap due to a bad user-mode address have too |
26 | the main exception table. | 26 | * many loads and stores in them to make it at all practical to label |
27 | 27 | * each one and put them all in the main exception table. | |
28 | In particular, the fast memcpy routine is like this. It's fix-up is just to fall back | 28 | * |
29 | to a slow byte-at-a-time copy, which is handled the conventional way. So it's functionally | 29 | * In particular, the fast memcpy routine is like this. It's fix-up is |
30 | OK to just handle any trap occurring in the fast memcpy with that fixup. */ | 30 | * just to fall back to a slow byte-at-a-time copy, which is handled the |
31 | * conventional way. So it's functionally OK to just handle any trap | ||
32 | * occurring in the fast memcpy with that fixup. | ||
33 | */ | ||
31 | static const struct exception_table_entry *check_exception_ranges(unsigned long addr) | 34 | static const struct exception_table_entry *check_exception_ranges(unsigned long addr) |
32 | { | 35 | { |
33 | if ((addr >= (unsigned long)©_user_memcpy) && | 36 | if ((addr >= (unsigned long)©_user_memcpy) && |
@@ -77,4 +80,3 @@ int fixup_exception(struct pt_regs *regs) | |||
77 | 80 | ||
78 | return 0; | 81 | return 0; |
79 | } | 82 | } |
80 | |||
diff --git a/arch/sh/mm/fault.c b/arch/sh/mm/fault_32.c index 60d74f793a1d..33b43d20e9f6 100644 --- a/arch/sh/mm/fault.c +++ b/arch/sh/mm/fault_32.c | |||
@@ -172,7 +172,7 @@ no_context: | |||
172 | bust_spinlocks(1); | 172 | bust_spinlocks(1); |
173 | 173 | ||
174 | if (oops_may_print()) { | 174 | if (oops_may_print()) { |
175 | __typeof__(pte_val(__pte(0))) page; | 175 | unsigned long page; |
176 | 176 | ||
177 | if (address < PAGE_SIZE) | 177 | if (address < PAGE_SIZE) |
178 | printk(KERN_ALERT "Unable to handle kernel NULL " | 178 | printk(KERN_ALERT "Unable to handle kernel NULL " |
diff --git a/arch/sh64/mm/tlbmiss.c b/arch/sh/mm/fault_64.c index b767d6cff72f..399d53710d2f 100644 --- a/arch/sh64/mm/tlbmiss.c +++ b/arch/sh/mm/fault_64.c | |||
@@ -1,9 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * This file is subject to the terms and conditions of the GNU General Public | 2 | * The SH64 TLB miss. |
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * arch/sh64/mm/tlbmiss.c | ||
7 | * | 3 | * |
8 | * Original code from fault.c | 4 | * Original code from fault.c |
9 | * Copyright (C) 2000, 2001 Paolo Alberelli | 5 | * Copyright (C) 2000, 2001 Paolo Alberelli |
@@ -12,16 +8,20 @@ | |||
12 | * Copyright (C) 2003 Richard.Curnow@superh.com | 8 | * Copyright (C) 2003 Richard.Curnow@superh.com |
13 | * | 9 | * |
14 | * IMPORTANT NOTES : | 10 | * IMPORTANT NOTES : |
15 | * The do_fast_page_fault function is called from a context in entry.S where very few registers | 11 | * The do_fast_page_fault function is called from a context in entry.S |
16 | * have been saved. In particular, the code in this file must be compiled not to use ANY | 12 | * where very few registers have been saved. In particular, the code in |
17 | * caller-save registers that are not part of the restricted save set. Also, it means that | 13 | * this file must be compiled not to use ANY caller-save registers that |
18 | * code in this file must not make calls to functions elsewhere in the kernel, or else the | 14 | * are not part of the restricted save set. Also, it means that code in |
19 | * excepting context will see corruption in its caller-save registers. Plus, the entry.S save | 15 | * this file must not make calls to functions elsewhere in the kernel, or |
20 | * area is non-reentrant, so this code has to run with SR.BL==1, i.e. no interrupts taken inside | 16 | * else the excepting context will see corruption in its caller-save |
21 | * it and panic on any exception. | 17 | * registers. Plus, the entry.S save area is non-reentrant, so this code |
18 | * has to run with SR.BL==1, i.e. no interrupts taken inside it and panic | ||
19 | * on any exception. | ||
22 | * | 20 | * |
21 | * This file is subject to the terms and conditions of the GNU General Public | ||
22 | * License. See the file "COPYING" in the main directory of this archive | ||
23 | * for more details. | ||
23 | */ | 24 | */ |
24 | |||
25 | #include <linux/signal.h> | 25 | #include <linux/signal.h> |
26 | #include <linux/sched.h> | 26 | #include <linux/sched.h> |
27 | #include <linux/kernel.h> | 27 | #include <linux/kernel.h> |
@@ -33,14 +33,13 @@ | |||
33 | #include <linux/mm.h> | 33 | #include <linux/mm.h> |
34 | #include <linux/smp.h> | 34 | #include <linux/smp.h> |
35 | #include <linux/interrupt.h> | 35 | #include <linux/interrupt.h> |
36 | |||
37 | #include <asm/system.h> | 36 | #include <asm/system.h> |
38 | #include <asm/tlb.h> | 37 | #include <asm/tlb.h> |
39 | #include <asm/io.h> | 38 | #include <asm/io.h> |
40 | #include <asm/uaccess.h> | 39 | #include <asm/uaccess.h> |
41 | #include <asm/pgalloc.h> | 40 | #include <asm/pgalloc.h> |
42 | #include <asm/mmu_context.h> | 41 | #include <asm/mmu_context.h> |
43 | #include <asm/registers.h> /* required by inline asm statements */ | 42 | #include <asm/cpu/registers.h> |
44 | 43 | ||
45 | /* Callable from fault.c, so not static */ | 44 | /* Callable from fault.c, so not static */ |
46 | inline void __do_tlb_refill(unsigned long address, | 45 | inline void __do_tlb_refill(unsigned long address, |
@@ -88,48 +87,47 @@ inline void __do_tlb_refill(unsigned long address, | |||
88 | 87 | ||
89 | } | 88 | } |
90 | 89 | ||
91 | static int handle_vmalloc_fault(struct mm_struct *mm, unsigned long protection_flags, | 90 | static int handle_vmalloc_fault(struct mm_struct *mm, |
91 | unsigned long protection_flags, | ||
92 | unsigned long long textaccess, | 92 | unsigned long long textaccess, |
93 | unsigned long address) | 93 | unsigned long address) |
94 | { | 94 | { |
95 | pgd_t *dir; | 95 | pgd_t *dir; |
96 | pud_t *pud; | ||
96 | pmd_t *pmd; | 97 | pmd_t *pmd; |
97 | static pte_t *pte; | 98 | static pte_t *pte; |
98 | pte_t entry; | 99 | pte_t entry; |
99 | 100 | ||
100 | dir = pgd_offset_k(address); | 101 | dir = pgd_offset_k(address); |
101 | pmd = pmd_offset(dir, address); | ||
102 | 102 | ||
103 | if (pmd_none(*pmd)) { | 103 | pud = pud_offset(dir, address); |
104 | if (pud_none_or_clear_bad(pud)) | ||
104 | return 0; | 105 | return 0; |
105 | } | ||
106 | 106 | ||
107 | if (pmd_bad(*pmd)) { | 107 | pmd = pmd_offset(pud, address); |
108 | pmd_clear(pmd); | 108 | if (pmd_none_or_clear_bad(pmd)) |
109 | return 0; | 109 | return 0; |
110 | } | ||
111 | 110 | ||
112 | pte = pte_offset_kernel(pmd, address); | 111 | pte = pte_offset_kernel(pmd, address); |
113 | entry = *pte; | 112 | entry = *pte; |
114 | 113 | ||
115 | if (pte_none(entry) || !pte_present(entry)) { | 114 | if (pte_none(entry) || !pte_present(entry)) |
116 | return 0; | 115 | return 0; |
117 | } | 116 | if ((pte_val(entry) & protection_flags) != protection_flags) |
118 | |||
119 | if ((pte_val(entry) & protection_flags) != protection_flags) { | ||
120 | return 0; | 117 | return 0; |
121 | } | ||
122 | 118 | ||
123 | __do_tlb_refill(address, textaccess, pte); | 119 | __do_tlb_refill(address, textaccess, pte); |
124 | 120 | ||
125 | return 1; | 121 | return 1; |
126 | } | 122 | } |
127 | 123 | ||
128 | static int handle_tlbmiss(struct mm_struct *mm, unsigned long long protection_flags, | 124 | static int handle_tlbmiss(struct mm_struct *mm, |
129 | unsigned long long textaccess, | 125 | unsigned long long protection_flags, |
130 | unsigned long address) | 126 | unsigned long long textaccess, |
127 | unsigned long address) | ||
131 | { | 128 | { |
132 | pgd_t *dir; | 129 | pgd_t *dir; |
130 | pud_t *pud; | ||
133 | pmd_t *pmd; | 131 | pmd_t *pmd; |
134 | pte_t *pte; | 132 | pte_t *pte; |
135 | pte_t entry; | 133 | pte_t entry; |
@@ -144,49 +142,49 @@ static int handle_tlbmiss(struct mm_struct *mm, unsigned long long protection_fl | |||
144 | 142 | ||
145 | See how mm->pgd is allocated and initialised in pgd_alloc to see why | 143 | See how mm->pgd is allocated and initialised in pgd_alloc to see why |
146 | the next test is necessary. - RPC */ | 144 | the next test is necessary. - RPC */ |
147 | if (address >= (unsigned long) TASK_SIZE) { | 145 | if (address >= (unsigned long) TASK_SIZE) |
148 | /* upper half - never has page table entries. */ | 146 | /* upper half - never has page table entries. */ |
149 | return 0; | 147 | return 0; |
150 | } | 148 | |
151 | dir = pgd_offset(mm, address); | 149 | dir = pgd_offset(mm, address); |
152 | if (pgd_none(*dir)) { | 150 | if (pgd_none(*dir) || !pgd_present(*dir)) |
153 | return 0; | 151 | return 0; |
154 | } | 152 | if (!pgd_present(*dir)) |
155 | if (!pgd_present(*dir)) { | ||
156 | return 0; | 153 | return 0; |
157 | } | ||
158 | 154 | ||
159 | pmd = pmd_offset(dir, address); | 155 | pud = pud_offset(dir, address); |
160 | if (pmd_none(*pmd)) { | 156 | if (pud_none(*pud) || !pud_present(*pud)) |
161 | return 0; | 157 | return 0; |
162 | } | 158 | |
163 | if (!pmd_present(*pmd)) { | 159 | pmd = pmd_offset(pud, address); |
160 | if (pmd_none(*pmd) || !pmd_present(*pmd)) | ||
164 | return 0; | 161 | return 0; |
165 | } | 162 | |
166 | pte = pte_offset_kernel(pmd, address); | 163 | pte = pte_offset_kernel(pmd, address); |
167 | entry = *pte; | 164 | entry = *pte; |
168 | if (pte_none(entry)) { | 165 | |
169 | return 0; | 166 | if (pte_none(entry) || !pte_present(entry)) |
170 | } | ||
171 | if (!pte_present(entry)) { | ||
172 | return 0; | 167 | return 0; |
173 | } | ||
174 | 168 | ||
175 | /* If the page doesn't have sufficient protection bits set to service the | 169 | /* |
176 | kind of fault being handled, there's not much point doing the TLB refill. | 170 | * If the page doesn't have sufficient protection bits set to |
177 | Punt the fault to the general handler. */ | 171 | * service the kind of fault being handled, there's not much |
178 | if ((pte_val(entry) & protection_flags) != protection_flags) { | 172 | * point doing the TLB refill. Punt the fault to the general |
173 | * handler. | ||
174 | */ | ||
175 | if ((pte_val(entry) & protection_flags) != protection_flags) | ||
179 | return 0; | 176 | return 0; |
180 | } | ||
181 | 177 | ||
182 | __do_tlb_refill(address, textaccess, pte); | 178 | __do_tlb_refill(address, textaccess, pte); |
183 | 179 | ||
184 | return 1; | 180 | return 1; |
185 | } | 181 | } |
186 | 182 | ||
187 | /* Put all this information into one structure so that everything is just arithmetic | 183 | /* |
188 | relative to a single base address. This reduces the number of movi/shori pairs needed | 184 | * Put all this information into one structure so that everything is just |
189 | just to load addresses of static data. */ | 185 | * arithmetic relative to a single base address. This reduces the number |
186 | * of movi/shori pairs needed just to load addresses of static data. | ||
187 | */ | ||
190 | struct expevt_lookup { | 188 | struct expevt_lookup { |
191 | unsigned short protection_flags[8]; | 189 | unsigned short protection_flags[8]; |
192 | unsigned char is_text_access[8]; | 190 | unsigned char is_text_access[8]; |
@@ -216,7 +214,8 @@ static struct expevt_lookup expevt_lookup_table = { | |||
216 | general fault handling in fault.c which deals with mapping file-backed | 214 | general fault handling in fault.c which deals with mapping file-backed |
217 | pages, stack growth, segmentation faults, swapping etc etc) | 215 | pages, stack growth, segmentation faults, swapping etc etc) |
218 | */ | 216 | */ |
219 | asmlinkage int do_fast_page_fault(unsigned long long ssr_md, unsigned long long expevt, | 217 | asmlinkage int do_fast_page_fault(unsigned long long ssr_md, |
218 | unsigned long long expevt, | ||
220 | unsigned long address) | 219 | unsigned long address) |
221 | { | 220 | { |
222 | struct task_struct *tsk; | 221 | struct task_struct *tsk; |
@@ -226,26 +225,23 @@ asmlinkage int do_fast_page_fault(unsigned long long ssr_md, unsigned long long | |||
226 | unsigned long long index; | 225 | unsigned long long index; |
227 | unsigned long long expevt4; | 226 | unsigned long long expevt4; |
228 | 227 | ||
229 | /* The next few lines implement a way of hashing EXPEVT into a small array index | 228 | /* The next few lines implement a way of hashing EXPEVT into a |
230 | which can be used to lookup parameters specific to the type of TLBMISS being | 229 | * small array index which can be used to lookup parameters |
231 | handled. Note: | 230 | * specific to the type of TLBMISS being handled. |
232 | ITLBMISS has EXPEVT==0xa40 | 231 | * |
233 | RTLBMISS has EXPEVT==0x040 | 232 | * Note: |
234 | WTLBMISS has EXPEVT==0x060 | 233 | * ITLBMISS has EXPEVT==0xa40 |
235 | */ | 234 | * RTLBMISS has EXPEVT==0x040 |
236 | 235 | * WTLBMISS has EXPEVT==0x060 | |
236 | */ | ||
237 | expevt4 = (expevt >> 4); | 237 | expevt4 = (expevt >> 4); |
238 | /* TODO : xor ssr_md into this expression too. Then we can check that PRU is set | 238 | /* TODO : xor ssr_md into this expression too. Then we can check |
239 | when it needs to be. */ | 239 | * that PRU is set when it needs to be. */ |
240 | index = expevt4 ^ (expevt4 >> 5); | 240 | index = expevt4 ^ (expevt4 >> 5); |
241 | index &= 7; | 241 | index &= 7; |
242 | protection_flags = expevt_lookup_table.protection_flags[index]; | 242 | protection_flags = expevt_lookup_table.protection_flags[index]; |
243 | textaccess = expevt_lookup_table.is_text_access[index]; | 243 | textaccess = expevt_lookup_table.is_text_access[index]; |
244 | 244 | ||
245 | #ifdef CONFIG_SH64_PROC_TLB | ||
246 | ++calls_to_do_fast_page_fault; | ||
247 | #endif | ||
248 | |||
249 | /* SIM | 245 | /* SIM |
250 | * Note this is now called with interrupts still disabled | 246 | * Note this is now called with interrupts still disabled |
251 | * This is to cope with being called for a missing IO port | 247 | * This is to cope with being called for a missing IO port |
@@ -262,18 +258,18 @@ asmlinkage int do_fast_page_fault(unsigned long long ssr_md, unsigned long long | |||
262 | 258 | ||
263 | if ((address >= VMALLOC_START && address < VMALLOC_END) || | 259 | if ((address >= VMALLOC_START && address < VMALLOC_END) || |
264 | (address >= IOBASE_VADDR && address < IOBASE_END)) { | 260 | (address >= IOBASE_VADDR && address < IOBASE_END)) { |
265 | if (ssr_md) { | 261 | if (ssr_md) |
266 | /* Process-contexts can never have this address range mapped */ | 262 | /* |
267 | if (handle_vmalloc_fault(mm, protection_flags, textaccess, address)) { | 263 | * Process-contexts can never have this address |
264 | * range mapped | ||
265 | */ | ||
266 | if (handle_vmalloc_fault(mm, protection_flags, | ||
267 | textaccess, address)) | ||
268 | return 1; | 268 | return 1; |
269 | } | ||
270 | } | ||
271 | } else if (!in_interrupt() && mm) { | 269 | } else if (!in_interrupt() && mm) { |
272 | if (handle_tlbmiss(mm, protection_flags, textaccess, address)) { | 270 | if (handle_tlbmiss(mm, protection_flags, textaccess, address)) |
273 | return 1; | 271 | return 1; |
274 | } | ||
275 | } | 272 | } |
276 | 273 | ||
277 | return 0; | 274 | return 0; |
278 | } | 275 | } |
279 | |||
diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c index d5e160da64b2..2918c6b14659 100644 --- a/arch/sh/mm/init.c +++ b/arch/sh/mm/init.c | |||
@@ -23,9 +23,7 @@ | |||
23 | 23 | ||
24 | DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); | 24 | DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); |
25 | pgd_t swapper_pg_dir[PTRS_PER_PGD]; | 25 | pgd_t swapper_pg_dir[PTRS_PER_PGD]; |
26 | 26 | unsigned long cached_to_uncached = 0; | |
27 | void (*copy_page)(void *from, void *to); | ||
28 | void (*clear_page)(void *to); | ||
29 | 27 | ||
30 | void show_mem(void) | 28 | void show_mem(void) |
31 | { | 29 | { |
@@ -102,7 +100,8 @@ static void set_pte_phys(unsigned long addr, unsigned long phys, pgprot_t prot) | |||
102 | 100 | ||
103 | set_pte(pte, pfn_pte(phys >> PAGE_SHIFT, prot)); | 101 | set_pte(pte, pfn_pte(phys >> PAGE_SHIFT, prot)); |
104 | 102 | ||
105 | flush_tlb_one(get_asid(), addr); | 103 | if (cached_to_uncached) |
104 | flush_tlb_one(get_asid(), addr); | ||
106 | } | 105 | } |
107 | 106 | ||
108 | /* | 107 | /* |
@@ -131,6 +130,37 @@ void __set_fixmap(enum fixed_addresses idx, unsigned long phys, pgprot_t prot) | |||
131 | 130 | ||
132 | set_pte_phys(address, phys, prot); | 131 | set_pte_phys(address, phys, prot); |
133 | } | 132 | } |
133 | |||
134 | void __init page_table_range_init(unsigned long start, unsigned long end, | ||
135 | pgd_t *pgd_base) | ||
136 | { | ||
137 | pgd_t *pgd; | ||
138 | pud_t *pud; | ||
139 | pmd_t *pmd; | ||
140 | int pgd_idx; | ||
141 | unsigned long vaddr; | ||
142 | |||
143 | vaddr = start & PMD_MASK; | ||
144 | end = (end + PMD_SIZE - 1) & PMD_MASK; | ||
145 | pgd_idx = pgd_index(vaddr); | ||
146 | pgd = pgd_base + pgd_idx; | ||
147 | |||
148 | for ( ; (pgd_idx < PTRS_PER_PGD) && (vaddr != end); pgd++, pgd_idx++) { | ||
149 | BUG_ON(pgd_none(*pgd)); | ||
150 | pud = pud_offset(pgd, 0); | ||
151 | BUG_ON(pud_none(*pud)); | ||
152 | pmd = pmd_offset(pud, 0); | ||
153 | |||
154 | if (!pmd_present(*pmd)) { | ||
155 | pte_t *pte_table; | ||
156 | pte_table = (pte_t *)alloc_bootmem_low_pages(PAGE_SIZE); | ||
157 | memset(pte_table, 0, PAGE_SIZE); | ||
158 | pmd_populate_kernel(&init_mm, pmd, pte_table); | ||
159 | } | ||
160 | |||
161 | vaddr += PMD_SIZE; | ||
162 | } | ||
163 | } | ||
134 | #endif /* CONFIG_MMU */ | 164 | #endif /* CONFIG_MMU */ |
135 | 165 | ||
136 | /* | 166 | /* |
@@ -150,6 +180,11 @@ void __init paging_init(void) | |||
150 | * check for a null value. */ | 180 | * check for a null value. */ |
151 | set_TTB(swapper_pg_dir); | 181 | set_TTB(swapper_pg_dir); |
152 | 182 | ||
183 | /* Populate the relevant portions of swapper_pg_dir so that | ||
184 | * we can use the fixmap entries without calling kmalloc. | ||
185 | * pte's will be filled in by __set_fixmap(). */ | ||
186 | page_table_range_init(FIXADDR_START, FIXADDR_TOP, swapper_pg_dir); | ||
187 | |||
153 | memset(max_zone_pfns, 0, sizeof(max_zone_pfns)); | 188 | memset(max_zone_pfns, 0, sizeof(max_zone_pfns)); |
154 | 189 | ||
155 | for_each_online_node(nid) { | 190 | for_each_online_node(nid) { |
@@ -167,9 +202,22 @@ void __init paging_init(void) | |||
167 | } | 202 | } |
168 | 203 | ||
169 | free_area_init_nodes(max_zone_pfns); | 204 | free_area_init_nodes(max_zone_pfns); |
205 | |||
206 | /* Set up the uncached fixmap */ | ||
207 | set_fixmap_nocache(FIX_UNCACHED, __pa(&__uncached_start)); | ||
208 | |||
209 | #ifdef CONFIG_29BIT | ||
210 | /* | ||
211 | * Handle trivial transitions between cached and uncached | ||
212 | * segments, making use of the 1:1 mapping relationship in | ||
213 | * 512MB lowmem. | ||
214 | */ | ||
215 | cached_to_uncached = P2SEG - P1SEG; | ||
216 | #endif | ||
170 | } | 217 | } |
171 | 218 | ||
172 | static struct kcore_list kcore_mem, kcore_vmalloc; | 219 | static struct kcore_list kcore_mem, kcore_vmalloc; |
220 | int after_bootmem = 0; | ||
173 | 221 | ||
174 | void __init mem_init(void) | 222 | void __init mem_init(void) |
175 | { | 223 | { |
@@ -202,17 +250,7 @@ void __init mem_init(void) | |||
202 | memset(empty_zero_page, 0, PAGE_SIZE); | 250 | memset(empty_zero_page, 0, PAGE_SIZE); |
203 | __flush_wback_region(empty_zero_page, PAGE_SIZE); | 251 | __flush_wback_region(empty_zero_page, PAGE_SIZE); |
204 | 252 | ||
205 | /* | 253 | after_bootmem = 1; |
206 | * Setup wrappers for copy/clear_page(), these will get overridden | ||
207 | * later in the boot process if a better method is available. | ||
208 | */ | ||
209 | #ifdef CONFIG_MMU | ||
210 | copy_page = copy_page_slow; | ||
211 | clear_page = clear_page_slow; | ||
212 | #else | ||
213 | copy_page = copy_page_nommu; | ||
214 | clear_page = clear_page_nommu; | ||
215 | #endif | ||
216 | 254 | ||
217 | codesize = (unsigned long) &_etext - (unsigned long) &_text; | 255 | codesize = (unsigned long) &_etext - (unsigned long) &_text; |
218 | datasize = (unsigned long) &_edata - (unsigned long) &_etext; | 256 | datasize = (unsigned long) &_edata - (unsigned long) &_etext; |
diff --git a/arch/sh/mm/ioremap.c b/arch/sh/mm/ioremap_32.c index 0c7b7e33abdc..0c7b7e33abdc 100644 --- a/arch/sh/mm/ioremap.c +++ b/arch/sh/mm/ioremap_32.c | |||
diff --git a/arch/sh64/mm/ioremap.c b/arch/sh/mm/ioremap_64.c index 535304e6601f..e27d16519235 100644 --- a/arch/sh64/mm/ioremap.c +++ b/arch/sh/mm/ioremap_64.c | |||
@@ -1,30 +1,31 @@ | |||
1 | /* | 1 | /* |
2 | * This file is subject to the terms and conditions of the GNU General Public | 2 | * arch/sh/mm/ioremap_64.c |
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * arch/sh64/mm/ioremap.c | ||
7 | * | 3 | * |
8 | * Copyright (C) 2000, 2001 Paolo Alberelli | 4 | * Copyright (C) 2000, 2001 Paolo Alberelli |
9 | * Copyright (C) 2003, 2004 Paul Mundt | 5 | * Copyright (C) 2003 - 2007 Paul Mundt |
10 | * | 6 | * |
11 | * Mostly derived from arch/sh/mm/ioremap.c which, in turn is mostly | 7 | * Mostly derived from arch/sh/mm/ioremap.c which, in turn is mostly |
12 | * derived from arch/i386/mm/ioremap.c . | 8 | * derived from arch/i386/mm/ioremap.c . |
13 | * | 9 | * |
14 | * (C) Copyright 1995 1996 Linus Torvalds | 10 | * (C) Copyright 1995 1996 Linus Torvalds |
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 | */ | 15 | */ |
16 | #include <linux/kernel.h> | ||
17 | #include <linux/slab.h> | ||
18 | #include <linux/vmalloc.h> | 16 | #include <linux/vmalloc.h> |
19 | #include <linux/sched.h> | ||
20 | #include <linux/string.h> | ||
21 | #include <linux/io.h> | ||
22 | #include <linux/ioport.h> | 17 | #include <linux/ioport.h> |
18 | #include <linux/module.h> | ||
19 | #include <linux/mm.h> | ||
20 | #include <linux/io.h> | ||
23 | #include <linux/bootmem.h> | 21 | #include <linux/bootmem.h> |
24 | #include <linux/proc_fs.h> | 22 | #include <linux/proc_fs.h> |
25 | #include <linux/module.h> | 23 | #include <asm/page.h> |
26 | #include <asm/pgalloc.h> | 24 | #include <asm/pgalloc.h> |
25 | #include <asm/addrspace.h> | ||
26 | #include <asm/cacheflush.h> | ||
27 | #include <asm/tlbflush.h> | 27 | #include <asm/tlbflush.h> |
28 | #include <asm/mmu.h> | ||
28 | 29 | ||
29 | static void shmedia_mapioaddr(unsigned long, unsigned long); | 30 | static void shmedia_mapioaddr(unsigned long, unsigned long); |
30 | static unsigned long shmedia_ioremap(struct resource *, u32, int); | 31 | static unsigned long shmedia_ioremap(struct resource *, u32, int); |
@@ -42,7 +43,8 @@ static unsigned long shmedia_ioremap(struct resource *, u32, int); | |||
42 | * have to convert them into an offset in a page-aligned mapping, but the | 43 | * have to convert them into an offset in a page-aligned mapping, but the |
43 | * caller shouldn't need to know that small detail. | 44 | * caller shouldn't need to know that small detail. |
44 | */ | 45 | */ |
45 | void * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flags) | 46 | void *__ioremap(unsigned long phys_addr, unsigned long size, |
47 | unsigned long flags) | ||
46 | { | 48 | { |
47 | void * addr; | 49 | void * addr; |
48 | struct vm_struct * area; | 50 | struct vm_struct * area; |
@@ -83,7 +85,7 @@ void * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flag | |||
83 | } | 85 | } |
84 | EXPORT_SYMBOL(__ioremap); | 86 | EXPORT_SYMBOL(__ioremap); |
85 | 87 | ||
86 | void iounmap(void *addr) | 88 | void __iounmap(void *addr) |
87 | { | 89 | { |
88 | struct vm_struct *area; | 90 | struct vm_struct *area; |
89 | 91 | ||
@@ -96,7 +98,7 @@ void iounmap(void *addr) | |||
96 | 98 | ||
97 | kfree(area); | 99 | kfree(area); |
98 | } | 100 | } |
99 | EXPORT_SYMBOL(iounmap); | 101 | EXPORT_SYMBOL(__iounmap); |
100 | 102 | ||
101 | static struct resource shmedia_iomap = { | 103 | static struct resource shmedia_iomap = { |
102 | .name = "shmedia_iomap", | 104 | .name = "shmedia_iomap", |
@@ -265,6 +267,7 @@ static __init_refok void *sh64_get_page(void) | |||
265 | static void shmedia_mapioaddr(unsigned long pa, unsigned long va) | 267 | static void shmedia_mapioaddr(unsigned long pa, unsigned long va) |
266 | { | 268 | { |
267 | pgd_t *pgdp; | 269 | pgd_t *pgdp; |
270 | pud_t *pudp; | ||
268 | pmd_t *pmdp; | 271 | pmd_t *pmdp; |
269 | pte_t *ptep, pte; | 272 | pte_t *ptep, pte; |
270 | pgprot_t prot; | 273 | pgprot_t prot; |
@@ -274,11 +277,17 @@ static void shmedia_mapioaddr(unsigned long pa, unsigned long va) | |||
274 | 277 | ||
275 | pgdp = pgd_offset_k(va); | 278 | pgdp = pgd_offset_k(va); |
276 | if (pgd_none(*pgdp) || !pgd_present(*pgdp)) { | 279 | if (pgd_none(*pgdp) || !pgd_present(*pgdp)) { |
280 | pudp = (pud_t *)sh64_get_page(); | ||
281 | set_pgd(pgdp, __pgd((unsigned long)pudp | _KERNPG_TABLE)); | ||
282 | } | ||
283 | |||
284 | pudp = pud_offset(pgdp, va); | ||
285 | if (pud_none(*pudp) || !pud_present(*pudp)) { | ||
277 | pmdp = (pmd_t *)sh64_get_page(); | 286 | pmdp = (pmd_t *)sh64_get_page(); |
278 | set_pgd(pgdp, __pgd((unsigned long)pmdp | _KERNPG_TABLE)); | 287 | set_pud(pudp, __pud((unsigned long)pmdp | _KERNPG_TABLE)); |
279 | } | 288 | } |
280 | 289 | ||
281 | pmdp = pmd_offset(pgdp, va); | 290 | pmdp = pmd_offset(pudp, va); |
282 | if (pmd_none(*pmdp) || !pmd_present(*pmdp) ) { | 291 | if (pmd_none(*pmdp) || !pmd_present(*pmdp) ) { |
283 | ptep = (pte_t *)sh64_get_page(); | 292 | ptep = (pte_t *)sh64_get_page(); |
284 | set_pmd(pmdp, __pmd((unsigned long)ptep + _PAGE_TABLE)); | 293 | set_pmd(pmdp, __pmd((unsigned long)ptep + _PAGE_TABLE)); |
@@ -302,12 +311,19 @@ static void shmedia_mapioaddr(unsigned long pa, unsigned long va) | |||
302 | static void shmedia_unmapioaddr(unsigned long vaddr) | 311 | static void shmedia_unmapioaddr(unsigned long vaddr) |
303 | { | 312 | { |
304 | pgd_t *pgdp; | 313 | pgd_t *pgdp; |
314 | pud_t *pudp; | ||
305 | pmd_t *pmdp; | 315 | pmd_t *pmdp; |
306 | pte_t *ptep; | 316 | pte_t *ptep; |
307 | 317 | ||
308 | pgdp = pgd_offset_k(vaddr); | 318 | pgdp = pgd_offset_k(vaddr); |
309 | pmdp = pmd_offset(pgdp, vaddr); | 319 | if (pgd_none(*pgdp) || pgd_bad(*pgdp)) |
320 | return; | ||
321 | |||
322 | pudp = pud_offset(pgdp, vaddr); | ||
323 | if (pud_none(*pudp) || pud_bad(*pudp)) | ||
324 | return; | ||
310 | 325 | ||
326 | pmdp = pmd_offset(pudp, vaddr); | ||
311 | if (pmd_none(*pmdp) || pmd_bad(*pmdp)) | 327 | if (pmd_none(*pmdp) || pmd_bad(*pmdp)) |
312 | return; | 328 | return; |
313 | 329 | ||
diff --git a/arch/sh/mm/pg-nommu.c b/arch/sh/mm/pg-nommu.c index d15221beaa16..677dd57f0877 100644 --- a/arch/sh/mm/pg-nommu.c +++ b/arch/sh/mm/pg-nommu.c | |||
@@ -14,12 +14,12 @@ | |||
14 | #include <linux/string.h> | 14 | #include <linux/string.h> |
15 | #include <asm/page.h> | 15 | #include <asm/page.h> |
16 | 16 | ||
17 | void copy_page_nommu(void *to, void *from) | 17 | void copy_page(void *to, void *from) |
18 | { | 18 | { |
19 | memcpy(to, from, PAGE_SIZE); | 19 | memcpy(to, from, PAGE_SIZE); |
20 | } | 20 | } |
21 | 21 | ||
22 | void clear_page_nommu(void *to) | 22 | void clear_page(void *to) |
23 | { | 23 | { |
24 | memset(to, 0, PAGE_SIZE); | 24 | memset(to, 0, PAGE_SIZE); |
25 | } | 25 | } |
diff --git a/arch/sh/mm/pmb.c b/arch/sh/mm/pmb.c index 1d45b82f0a63..ab81c602295f 100644 --- a/arch/sh/mm/pmb.c +++ b/arch/sh/mm/pmb.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <asm/pgtable.h> | 27 | #include <asm/pgtable.h> |
28 | #include <asm/mmu.h> | 28 | #include <asm/mmu.h> |
29 | #include <asm/io.h> | 29 | #include <asm/io.h> |
30 | #include <asm/mmu_context.h> | ||
30 | 31 | ||
31 | #define NR_PMB_ENTRIES 16 | 32 | #define NR_PMB_ENTRIES 16 |
32 | 33 | ||
@@ -162,18 +163,18 @@ repeat: | |||
162 | return 0; | 163 | return 0; |
163 | } | 164 | } |
164 | 165 | ||
165 | int set_pmb_entry(struct pmb_entry *pmbe) | 166 | int __uses_jump_to_uncached set_pmb_entry(struct pmb_entry *pmbe) |
166 | { | 167 | { |
167 | int ret; | 168 | int ret; |
168 | 169 | ||
169 | jump_to_P2(); | 170 | jump_to_uncached(); |
170 | ret = __set_pmb_entry(pmbe->vpn, pmbe->ppn, pmbe->flags, &pmbe->entry); | 171 | ret = __set_pmb_entry(pmbe->vpn, pmbe->ppn, pmbe->flags, &pmbe->entry); |
171 | back_to_P1(); | 172 | back_to_cached(); |
172 | 173 | ||
173 | return ret; | 174 | return ret; |
174 | } | 175 | } |
175 | 176 | ||
176 | void clear_pmb_entry(struct pmb_entry *pmbe) | 177 | void __uses_jump_to_uncached clear_pmb_entry(struct pmb_entry *pmbe) |
177 | { | 178 | { |
178 | unsigned int entry = pmbe->entry; | 179 | unsigned int entry = pmbe->entry; |
179 | unsigned long addr; | 180 | unsigned long addr; |
@@ -187,7 +188,7 @@ void clear_pmb_entry(struct pmb_entry *pmbe) | |||
187 | entry >= NR_PMB_ENTRIES)) | 188 | entry >= NR_PMB_ENTRIES)) |
188 | return; | 189 | return; |
189 | 190 | ||
190 | jump_to_P2(); | 191 | jump_to_uncached(); |
191 | 192 | ||
192 | /* Clear V-bit */ | 193 | /* Clear V-bit */ |
193 | addr = mk_pmb_addr(entry); | 194 | addr = mk_pmb_addr(entry); |
@@ -196,7 +197,7 @@ void clear_pmb_entry(struct pmb_entry *pmbe) | |||
196 | addr = mk_pmb_data(entry); | 197 | addr = mk_pmb_data(entry); |
197 | ctrl_outl(ctrl_inl(addr) & ~PMB_V, addr); | 198 | ctrl_outl(ctrl_inl(addr) & ~PMB_V, addr); |
198 | 199 | ||
199 | back_to_P1(); | 200 | back_to_cached(); |
200 | 201 | ||
201 | clear_bit(entry, &pmb_map); | 202 | clear_bit(entry, &pmb_map); |
202 | } | 203 | } |
@@ -301,17 +302,17 @@ static void pmb_cache_ctor(struct kmem_cache *cachep, void *pmb) | |||
301 | pmbe->entry = PMB_NO_ENTRY; | 302 | pmbe->entry = PMB_NO_ENTRY; |
302 | } | 303 | } |
303 | 304 | ||
304 | static int __init pmb_init(void) | 305 | static int __uses_jump_to_uncached pmb_init(void) |
305 | { | 306 | { |
306 | unsigned int nr_entries = ARRAY_SIZE(pmb_init_map); | 307 | unsigned int nr_entries = ARRAY_SIZE(pmb_init_map); |
307 | unsigned int entry; | 308 | unsigned int entry, i; |
308 | 309 | ||
309 | BUG_ON(unlikely(nr_entries >= NR_PMB_ENTRIES)); | 310 | BUG_ON(unlikely(nr_entries >= NR_PMB_ENTRIES)); |
310 | 311 | ||
311 | pmb_cache = kmem_cache_create("pmb", sizeof(struct pmb_entry), 0, | 312 | pmb_cache = kmem_cache_create("pmb", sizeof(struct pmb_entry), 0, |
312 | SLAB_PANIC, pmb_cache_ctor); | 313 | SLAB_PANIC, pmb_cache_ctor); |
313 | 314 | ||
314 | jump_to_P2(); | 315 | jump_to_uncached(); |
315 | 316 | ||
316 | /* | 317 | /* |
317 | * Ordering is important, P2 must be mapped in the PMB before we | 318 | * Ordering is important, P2 must be mapped in the PMB before we |
@@ -329,7 +330,12 @@ static int __init pmb_init(void) | |||
329 | /* PMB.SE and UB[7] */ | 330 | /* PMB.SE and UB[7] */ |
330 | ctrl_outl((1 << 31) | (1 << 7), PMB_PASCR); | 331 | ctrl_outl((1 << 31) | (1 << 7), PMB_PASCR); |
331 | 332 | ||
332 | back_to_P1(); | 333 | /* Flush out the TLB */ |
334 | i = ctrl_inl(MMUCR); | ||
335 | i |= MMUCR_TI; | ||
336 | ctrl_outl(i, MMUCR); | ||
337 | |||
338 | back_to_cached(); | ||
333 | 339 | ||
334 | return 0; | 340 | return 0; |
335 | } | 341 | } |
diff --git a/arch/sh/mm/tlb-nommu.c b/arch/sh/mm/tlb-nommu.c index 1ccca7c0532e..15111bc7ddd6 100644 --- a/arch/sh/mm/tlb-nommu.c +++ b/arch/sh/mm/tlb-nommu.c | |||
@@ -9,6 +9,7 @@ | |||
9 | */ | 9 | */ |
10 | #include <linux/kernel.h> | 10 | #include <linux/kernel.h> |
11 | #include <linux/mm.h> | 11 | #include <linux/mm.h> |
12 | #include <asm/pgtable.h> | ||
12 | 13 | ||
13 | /* | 14 | /* |
14 | * Nothing too terribly exciting here .. | 15 | * Nothing too terribly exciting here .. |
@@ -49,3 +50,12 @@ void update_mmu_cache(struct vm_area_struct * vma, | |||
49 | { | 50 | { |
50 | BUG(); | 51 | BUG(); |
51 | } | 52 | } |
53 | |||
54 | void __init page_table_range_init(unsigned long start, unsigned long end, | ||
55 | pgd_t *pgd_base) | ||
56 | { | ||
57 | } | ||
58 | |||
59 | void __set_fixmap(enum fixed_addresses idx, unsigned long phys, pgprot_t prot) | ||
60 | { | ||
61 | } | ||
diff --git a/arch/sh/mm/tlb-sh4.c b/arch/sh/mm/tlb-sh4.c index 2d1dd6044307..f0c7b7397fa6 100644 --- a/arch/sh/mm/tlb-sh4.c +++ b/arch/sh/mm/tlb-sh4.c | |||
@@ -79,7 +79,8 @@ void update_mmu_cache(struct vm_area_struct * vma, | |||
79 | local_irq_restore(flags); | 79 | local_irq_restore(flags); |
80 | } | 80 | } |
81 | 81 | ||
82 | void local_flush_tlb_one(unsigned long asid, unsigned long page) | 82 | void __uses_jump_to_uncached local_flush_tlb_one(unsigned long asid, |
83 | unsigned long page) | ||
83 | { | 84 | { |
84 | unsigned long addr, data; | 85 | unsigned long addr, data; |
85 | 86 | ||
@@ -91,7 +92,7 @@ void local_flush_tlb_one(unsigned long asid, unsigned long page) | |||
91 | */ | 92 | */ |
92 | addr = MMU_UTLB_ADDRESS_ARRAY | MMU_PAGE_ASSOC_BIT; | 93 | addr = MMU_UTLB_ADDRESS_ARRAY | MMU_PAGE_ASSOC_BIT; |
93 | data = page | asid; /* VALID bit is off */ | 94 | data = page | asid; /* VALID bit is off */ |
94 | jump_to_P2(); | 95 | jump_to_uncached(); |
95 | ctrl_outl(data, addr); | 96 | ctrl_outl(data, addr); |
96 | back_to_P1(); | 97 | back_to_cached(); |
97 | } | 98 | } |
diff --git a/arch/sh64/mm/tlb.c b/arch/sh/mm/tlb-sh5.c index d517e7d70340..f34274a1ded3 100644 --- a/arch/sh64/mm/tlb.c +++ b/arch/sh/mm/tlb-sh5.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * arch/sh64/mm/tlb.c | 2 | * arch/sh/mm/tlb-sh5.c |
3 | * | 3 | * |
4 | * Copyright (C) 2003 Paul Mundt <lethal@linux-sh.org> | 4 | * Copyright (C) 2003 Paul Mundt <lethal@linux-sh.org> |
5 | * Copyright (C) 2003 Richard Curnow <richard.curnow@superh.com> | 5 | * Copyright (C) 2003 Richard Curnow <richard.curnow@superh.com> |
@@ -7,7 +7,6 @@ | |||
7 | * This file is subject to the terms and conditions of the GNU General Public | 7 | * This file is subject to the terms and conditions of the GNU General Public |
8 | * License. See the file "COPYING" in the main directory of this archive | 8 | * License. See the file "COPYING" in the main directory of this archive |
9 | * for more details. | 9 | * for more details. |
10 | * | ||
11 | */ | 10 | */ |
12 | #include <linux/mm.h> | 11 | #include <linux/mm.h> |
13 | #include <linux/init.h> | 12 | #include <linux/init.h> |
@@ -163,4 +162,3 @@ inline void sh64_setup_tlb_slot(unsigned long long config_addr, | |||
163 | */ | 162 | */ |
164 | inline void sh64_teardown_tlb_slot(unsigned long long config_addr) | 163 | inline void sh64_teardown_tlb_slot(unsigned long long config_addr) |
165 | __attribute__ ((alias("__flush_tlb_slot"))); | 164 | __attribute__ ((alias("__flush_tlb_slot"))); |
166 | |||
diff --git a/arch/sh/mm/tlb-flush.c b/arch/sh/mm/tlbflush_32.c index 6f45c1f8a7fe..6f45c1f8a7fe 100644 --- a/arch/sh/mm/tlb-flush.c +++ b/arch/sh/mm/tlbflush_32.c | |||
diff --git a/arch/sh64/mm/fault.c b/arch/sh/mm/tlbflush_64.c index 7c79a1ba8059..2a98c9ec88ff 100644 --- a/arch/sh64/mm/fault.c +++ b/arch/sh/mm/tlbflush_64.c | |||
@@ -1,16 +1,14 @@ | |||
1 | /* | 1 | /* |
2 | * This file is subject to the terms and conditions of the GNU General Public | 2 | * arch/sh/mm/tlb-flush_64.c |
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * arch/sh64/mm/fault.c | ||
7 | * | 3 | * |
8 | * Copyright (C) 2000, 2001 Paolo Alberelli | 4 | * Copyright (C) 2000, 2001 Paolo Alberelli |
9 | * Copyright (C) 2003 Richard Curnow (/proc/tlb, bug fixes) | 5 | * Copyright (C) 2003 Richard Curnow (/proc/tlb, bug fixes) |
10 | * Copyright (C) 2003 Paul Mundt | 6 | * Copyright (C) 2003 Paul Mundt |
11 | * | 7 | * |
8 | * This file is subject to the terms and conditions of the GNU General Public | ||
9 | * License. See the file "COPYING" in the main directory of this archive | ||
10 | * for more details. | ||
12 | */ | 11 | */ |
13 | |||
14 | #include <linux/signal.h> | 12 | #include <linux/signal.h> |
15 | #include <linux/rwsem.h> | 13 | #include <linux/rwsem.h> |
16 | #include <linux/sched.h> | 14 | #include <linux/sched.h> |
@@ -23,39 +21,12 @@ | |||
23 | #include <linux/mm.h> | 21 | #include <linux/mm.h> |
24 | #include <linux/smp.h> | 22 | #include <linux/smp.h> |
25 | #include <linux/interrupt.h> | 23 | #include <linux/interrupt.h> |
26 | |||
27 | #include <asm/system.h> | 24 | #include <asm/system.h> |
28 | #include <asm/io.h> | 25 | #include <asm/io.h> |
29 | #include <asm/tlb.h> | 26 | #include <asm/tlb.h> |
30 | #include <asm/uaccess.h> | 27 | #include <asm/uaccess.h> |
31 | #include <asm/pgalloc.h> | 28 | #include <asm/pgalloc.h> |
32 | #include <asm/mmu_context.h> | 29 | #include <asm/mmu_context.h> |
33 | #include <asm/registers.h> /* required by inline asm statements */ | ||
34 | |||
35 | #if defined(CONFIG_SH64_PROC_TLB) | ||
36 | #include <linux/init.h> | ||
37 | #include <linux/proc_fs.h> | ||
38 | /* Count numbers of tlb refills in each region */ | ||
39 | static unsigned long long calls_to_update_mmu_cache = 0ULL; | ||
40 | static unsigned long long calls_to_flush_tlb_page = 0ULL; | ||
41 | static unsigned long long calls_to_flush_tlb_range = 0ULL; | ||
42 | static unsigned long long calls_to_flush_tlb_mm = 0ULL; | ||
43 | static unsigned long long calls_to_flush_tlb_all = 0ULL; | ||
44 | unsigned long long calls_to_do_slow_page_fault = 0ULL; | ||
45 | unsigned long long calls_to_do_fast_page_fault = 0ULL; | ||
46 | |||
47 | /* Count size of ranges for flush_tlb_range */ | ||
48 | static unsigned long long flush_tlb_range_1 = 0ULL; | ||
49 | static unsigned long long flush_tlb_range_2 = 0ULL; | ||
50 | static unsigned long long flush_tlb_range_3_4 = 0ULL; | ||
51 | static unsigned long long flush_tlb_range_5_7 = 0ULL; | ||
52 | static unsigned long long flush_tlb_range_8_11 = 0ULL; | ||
53 | static unsigned long long flush_tlb_range_12_15 = 0ULL; | ||
54 | static unsigned long long flush_tlb_range_16_up = 0ULL; | ||
55 | |||
56 | static unsigned long long page_not_present = 0ULL; | ||
57 | |||
58 | #endif | ||
59 | 30 | ||
60 | extern void die(const char *,struct pt_regs *,long); | 31 | extern void die(const char *,struct pt_regs *,long); |
61 | 32 | ||
@@ -87,29 +58,27 @@ static inline void print_task(struct task_struct *tsk) | |||
87 | static pte_t *lookup_pte(struct mm_struct *mm, unsigned long address) | 58 | static pte_t *lookup_pte(struct mm_struct *mm, unsigned long address) |
88 | { | 59 | { |
89 | pgd_t *dir; | 60 | pgd_t *dir; |
61 | pud_t *pud; | ||
90 | pmd_t *pmd; | 62 | pmd_t *pmd; |
91 | pte_t *pte; | 63 | pte_t *pte; |
92 | pte_t entry; | 64 | pte_t entry; |
93 | 65 | ||
94 | dir = pgd_offset(mm, address); | 66 | dir = pgd_offset(mm, address); |
95 | if (pgd_none(*dir)) { | 67 | if (pgd_none(*dir)) |
96 | return NULL; | 68 | return NULL; |
97 | } | ||
98 | 69 | ||
99 | pmd = pmd_offset(dir, address); | 70 | pud = pud_offset(dir, address); |
100 | if (pmd_none(*pmd)) { | 71 | if (pud_none(*pud)) |
72 | return NULL; | ||
73 | |||
74 | pmd = pmd_offset(pud, address); | ||
75 | if (pmd_none(*pmd)) | ||
101 | return NULL; | 76 | return NULL; |
102 | } | ||
103 | 77 | ||
104 | pte = pte_offset_kernel(pmd, address); | 78 | pte = pte_offset_kernel(pmd, address); |
105 | entry = *pte; | 79 | entry = *pte; |
106 | 80 | if (pte_none(entry) || !pte_present(entry)) | |
107 | if (pte_none(entry)) { | ||
108 | return NULL; | 81 | return NULL; |
109 | } | ||
110 | if (!pte_present(entry)) { | ||
111 | return NULL; | ||
112 | } | ||
113 | 82 | ||
114 | return pte; | 83 | return pte; |
115 | } | 84 | } |
@@ -129,10 +98,6 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long writeaccess, | |||
129 | pte_t *pte; | 98 | pte_t *pte; |
130 | int fault; | 99 | int fault; |
131 | 100 | ||
132 | #if defined(CONFIG_SH64_PROC_TLB) | ||
133 | ++calls_to_do_slow_page_fault; | ||
134 | #endif | ||
135 | |||
136 | /* SIM | 101 | /* SIM |
137 | * Note this is now called with interrupts still disabled | 102 | * Note this is now called with interrupts still disabled |
138 | * This is to cope with being called for a missing IO port | 103 | * This is to cope with being called for a missing IO port |
@@ -355,16 +320,9 @@ do_sigbus: | |||
355 | goto no_context; | 320 | goto no_context; |
356 | } | 321 | } |
357 | 322 | ||
358 | |||
359 | void flush_tlb_all(void); | ||
360 | |||
361 | void update_mmu_cache(struct vm_area_struct * vma, | 323 | void update_mmu_cache(struct vm_area_struct * vma, |
362 | unsigned long address, pte_t pte) | 324 | unsigned long address, pte_t pte) |
363 | { | 325 | { |
364 | #if defined(CONFIG_SH64_PROC_TLB) | ||
365 | ++calls_to_update_mmu_cache; | ||
366 | #endif | ||
367 | |||
368 | /* | 326 | /* |
369 | * This appears to get called once for every pte entry that gets | 327 | * This appears to get called once for every pte entry that gets |
370 | * established => I don't think it's efficient to try refilling the | 328 | * established => I don't think it's efficient to try refilling the |
@@ -378,40 +336,29 @@ void update_mmu_cache(struct vm_area_struct * vma, | |||
378 | */ | 336 | */ |
379 | } | 337 | } |
380 | 338 | ||
381 | static void __flush_tlb_page(struct vm_area_struct *vma, unsigned long page) | 339 | void local_flush_tlb_one(unsigned long asid, unsigned long page) |
382 | { | 340 | { |
383 | unsigned long long match, pteh=0, lpage; | 341 | unsigned long long match, pteh=0, lpage; |
384 | unsigned long tlb; | 342 | unsigned long tlb; |
385 | struct mm_struct *mm; | ||
386 | |||
387 | mm = vma->vm_mm; | ||
388 | |||
389 | if (mm->context == NO_CONTEXT) | ||
390 | return; | ||
391 | 343 | ||
392 | /* | 344 | /* |
393 | * Sign-extend based on neff. | 345 | * Sign-extend based on neff. |
394 | */ | 346 | */ |
395 | lpage = (page & NEFF_SIGN) ? (page | NEFF_MASK) : page; | 347 | lpage = (page & NEFF_SIGN) ? (page | NEFF_MASK) : page; |
396 | match = ((mm->context & MMU_CONTEXT_ASID_MASK) << PTEH_ASID_SHIFT) | PTEH_VALID; | 348 | match = (asid << PTEH_ASID_SHIFT) | PTEH_VALID; |
397 | match |= lpage; | 349 | match |= lpage; |
398 | 350 | ||
399 | /* Do ITLB : don't bother for pages in non-exectutable VMAs */ | 351 | for_each_itlb_entry(tlb) { |
400 | if (vma->vm_flags & VM_EXEC) { | 352 | asm volatile ("getcfg %1, 0, %0" |
401 | for_each_itlb_entry(tlb) { | 353 | : "=r" (pteh) |
402 | asm volatile ("getcfg %1, 0, %0" | 354 | : "r" (tlb) ); |
403 | : "=r" (pteh) | ||
404 | : "r" (tlb) ); | ||
405 | |||
406 | if (pteh == match) { | ||
407 | __flush_tlb_slot(tlb); | ||
408 | break; | ||
409 | } | ||
410 | 355 | ||
356 | if (pteh == match) { | ||
357 | __flush_tlb_slot(tlb); | ||
358 | break; | ||
411 | } | 359 | } |
412 | } | 360 | } |
413 | 361 | ||
414 | /* Do DTLB : any page could potentially be in here. */ | ||
415 | for_each_dtlb_entry(tlb) { | 362 | for_each_dtlb_entry(tlb) { |
416 | asm volatile ("getcfg %1, 0, %0" | 363 | asm volatile ("getcfg %1, 0, %0" |
417 | : "=r" (pteh) | 364 | : "=r" (pteh) |
@@ -425,52 +372,29 @@ static void __flush_tlb_page(struct vm_area_struct *vma, unsigned long page) | |||
425 | } | 372 | } |
426 | } | 373 | } |
427 | 374 | ||
428 | void flush_tlb_page(struct vm_area_struct *vma, unsigned long page) | 375 | void local_flush_tlb_page(struct vm_area_struct *vma, unsigned long page) |
429 | { | 376 | { |
430 | unsigned long flags; | 377 | unsigned long flags; |
431 | 378 | ||
432 | #if defined(CONFIG_SH64_PROC_TLB) | ||
433 | ++calls_to_flush_tlb_page; | ||
434 | #endif | ||
435 | |||
436 | if (vma->vm_mm) { | 379 | if (vma->vm_mm) { |
437 | page &= PAGE_MASK; | 380 | page &= PAGE_MASK; |
438 | local_irq_save(flags); | 381 | local_irq_save(flags); |
439 | __flush_tlb_page(vma, page); | 382 | local_flush_tlb_one(get_asid(), page); |
440 | local_irq_restore(flags); | 383 | local_irq_restore(flags); |
441 | } | 384 | } |
442 | } | 385 | } |
443 | 386 | ||
444 | void flush_tlb_range(struct vm_area_struct *vma, unsigned long start, | 387 | void local_flush_tlb_range(struct vm_area_struct *vma, unsigned long start, |
445 | unsigned long end) | 388 | unsigned long end) |
446 | { | 389 | { |
447 | unsigned long flags; | 390 | unsigned long flags; |
448 | unsigned long long match, pteh=0, pteh_epn, pteh_low; | 391 | unsigned long long match, pteh=0, pteh_epn, pteh_low; |
449 | unsigned long tlb; | 392 | unsigned long tlb; |
393 | unsigned int cpu = smp_processor_id(); | ||
450 | struct mm_struct *mm; | 394 | struct mm_struct *mm; |
451 | 395 | ||
452 | mm = vma->vm_mm; | 396 | mm = vma->vm_mm; |
453 | 397 | if (cpu_context(cpu, mm) == NO_CONTEXT) | |
454 | #if defined(CONFIG_SH64_PROC_TLB) | ||
455 | ++calls_to_flush_tlb_range; | ||
456 | |||
457 | { | ||
458 | unsigned long size = (end - 1) - start; | ||
459 | size >>= 12; /* divide by PAGE_SIZE */ | ||
460 | size++; /* end=start+4096 => 1 page */ | ||
461 | switch (size) { | ||
462 | case 1 : flush_tlb_range_1++; break; | ||
463 | case 2 : flush_tlb_range_2++; break; | ||
464 | case 3 ... 4 : flush_tlb_range_3_4++; break; | ||
465 | case 5 ... 7 : flush_tlb_range_5_7++; break; | ||
466 | case 8 ... 11 : flush_tlb_range_8_11++; break; | ||
467 | case 12 ... 15 : flush_tlb_range_12_15++; break; | ||
468 | default : flush_tlb_range_16_up++; break; | ||
469 | } | ||
470 | } | ||
471 | #endif | ||
472 | |||
473 | if (mm->context == NO_CONTEXT) | ||
474 | return; | 398 | return; |
475 | 399 | ||
476 | local_irq_save(flags); | 400 | local_irq_save(flags); |
@@ -478,7 +402,7 @@ void flush_tlb_range(struct vm_area_struct *vma, unsigned long start, | |||
478 | start &= PAGE_MASK; | 402 | start &= PAGE_MASK; |
479 | end &= PAGE_MASK; | 403 | end &= PAGE_MASK; |
480 | 404 | ||
481 | match = ((mm->context & MMU_CONTEXT_ASID_MASK) << PTEH_ASID_SHIFT) | PTEH_VALID; | 405 | match = (cpu_asid(cpu, mm) << PTEH_ASID_SHIFT) | PTEH_VALID; |
482 | 406 | ||
483 | /* Flush ITLB */ | 407 | /* Flush ITLB */ |
484 | for_each_itlb_entry(tlb) { | 408 | for_each_itlb_entry(tlb) { |
@@ -509,94 +433,43 @@ void flush_tlb_range(struct vm_area_struct *vma, unsigned long start, | |||
509 | local_irq_restore(flags); | 433 | local_irq_restore(flags); |
510 | } | 434 | } |
511 | 435 | ||
512 | void flush_tlb_mm(struct mm_struct *mm) | 436 | void local_flush_tlb_mm(struct mm_struct *mm) |
513 | { | 437 | { |
514 | unsigned long flags; | 438 | unsigned long flags; |
439 | unsigned int cpu = smp_processor_id(); | ||
515 | 440 | ||
516 | #if defined(CONFIG_SH64_PROC_TLB) | 441 | if (cpu_context(cpu, mm) == NO_CONTEXT) |
517 | ++calls_to_flush_tlb_mm; | ||
518 | #endif | ||
519 | |||
520 | if (mm->context == NO_CONTEXT) | ||
521 | return; | 442 | return; |
522 | 443 | ||
523 | local_irq_save(flags); | 444 | local_irq_save(flags); |
524 | 445 | ||
525 | mm->context=NO_CONTEXT; | 446 | cpu_context(cpu, mm) = NO_CONTEXT; |
526 | if(mm==current->mm) | 447 | if (mm == current->mm) |
527 | activate_context(mm); | 448 | activate_context(mm, cpu); |
528 | 449 | ||
529 | local_irq_restore(flags); | 450 | local_irq_restore(flags); |
530 | |||
531 | } | 451 | } |
532 | 452 | ||
533 | void flush_tlb_all(void) | 453 | void local_flush_tlb_all(void) |
534 | { | 454 | { |
535 | /* Invalidate all, including shared pages, excluding fixed TLBs */ | 455 | /* Invalidate all, including shared pages, excluding fixed TLBs */ |
536 | |||
537 | unsigned long flags, tlb; | 456 | unsigned long flags, tlb; |
538 | 457 | ||
539 | #if defined(CONFIG_SH64_PROC_TLB) | ||
540 | ++calls_to_flush_tlb_all; | ||
541 | #endif | ||
542 | |||
543 | local_irq_save(flags); | 458 | local_irq_save(flags); |
544 | 459 | ||
545 | /* Flush each ITLB entry */ | 460 | /* Flush each ITLB entry */ |
546 | for_each_itlb_entry(tlb) { | 461 | for_each_itlb_entry(tlb) |
547 | __flush_tlb_slot(tlb); | 462 | __flush_tlb_slot(tlb); |
548 | } | ||
549 | 463 | ||
550 | /* Flush each DTLB entry */ | 464 | /* Flush each DTLB entry */ |
551 | for_each_dtlb_entry(tlb) { | 465 | for_each_dtlb_entry(tlb) |
552 | __flush_tlb_slot(tlb); | 466 | __flush_tlb_slot(tlb); |
553 | } | ||
554 | 467 | ||
555 | local_irq_restore(flags); | 468 | local_irq_restore(flags); |
556 | } | 469 | } |
557 | 470 | ||
558 | void flush_tlb_kernel_range(unsigned long start, unsigned long end) | 471 | void local_flush_tlb_kernel_range(unsigned long start, unsigned long end) |
559 | { | 472 | { |
560 | /* FIXME: Optimize this later.. */ | 473 | /* FIXME: Optimize this later.. */ |
561 | flush_tlb_all(); | 474 | flush_tlb_all(); |
562 | } | 475 | } |
563 | |||
564 | #if defined(CONFIG_SH64_PROC_TLB) | ||
565 | /* Procfs interface to read the performance information */ | ||
566 | |||
567 | static int | ||
568 | tlb_proc_info(char *buf, char **start, off_t fpos, int length, int *eof, void *data) | ||
569 | { | ||
570 | int len=0; | ||
571 | len += sprintf(buf+len, "do_fast_page_fault called %12lld times\n", calls_to_do_fast_page_fault); | ||
572 | len += sprintf(buf+len, "do_slow_page_fault called %12lld times\n", calls_to_do_slow_page_fault); | ||
573 | len += sprintf(buf+len, "update_mmu_cache called %12lld times\n", calls_to_update_mmu_cache); | ||
574 | len += sprintf(buf+len, "flush_tlb_page called %12lld times\n", calls_to_flush_tlb_page); | ||
575 | len += sprintf(buf+len, "flush_tlb_range called %12lld times\n", calls_to_flush_tlb_range); | ||
576 | len += sprintf(buf+len, "flush_tlb_mm called %12lld times\n", calls_to_flush_tlb_mm); | ||
577 | len += sprintf(buf+len, "flush_tlb_all called %12lld times\n", calls_to_flush_tlb_all); | ||
578 | len += sprintf(buf+len, "flush_tlb_range_sizes\n" | ||
579 | " 1 : %12lld\n" | ||
580 | " 2 : %12lld\n" | ||
581 | " 3 - 4 : %12lld\n" | ||
582 | " 5 - 7 : %12lld\n" | ||
583 | " 8 - 11 : %12lld\n" | ||
584 | "12 - 15 : %12lld\n" | ||
585 | "16+ : %12lld\n", | ||
586 | flush_tlb_range_1, flush_tlb_range_2, flush_tlb_range_3_4, | ||
587 | flush_tlb_range_5_7, flush_tlb_range_8_11, flush_tlb_range_12_15, | ||
588 | flush_tlb_range_16_up); | ||
589 | len += sprintf(buf+len, "page not present %12lld times\n", page_not_present); | ||
590 | *eof = 1; | ||
591 | return len; | ||
592 | } | ||
593 | |||
594 | static int __init register_proc_tlb(void) | ||
595 | { | ||
596 | create_proc_read_entry("tlb", 0, NULL, tlb_proc_info, NULL); | ||
597 | return 0; | ||
598 | } | ||
599 | |||
600 | __initcall(register_proc_tlb); | ||
601 | |||
602 | #endif | ||
diff --git a/arch/sh/tools/mach-types b/arch/sh/tools/mach-types index ff071693325c..25810670a0fa 100644 --- a/arch/sh/tools/mach-types +++ b/arch/sh/tools/mach-types | |||
@@ -29,7 +29,6 @@ HP6XX SH_HP6XX | |||
29 | DREAMCAST SH_DREAMCAST | 29 | DREAMCAST SH_DREAMCAST |
30 | MPC1211 SH_MPC1211 | 30 | MPC1211 SH_MPC1211 |
31 | SNAPGEAR SH_SECUREEDGE5410 | 31 | SNAPGEAR SH_SECUREEDGE5410 |
32 | HS7751RVOIP SH_HS7751RVOIP | ||
33 | EDOSK7705 SH_EDOSK7705 | 32 | EDOSK7705 SH_EDOSK7705 |
34 | SH4202_MICRODEV SH_SH4202_MICRODEV | 33 | SH4202_MICRODEV SH_SH4202_MICRODEV |
35 | SH03 SH_SH03 | 34 | SH03 SH_SH03 |
@@ -45,3 +44,4 @@ X3PROTO SH_X3PROTO | |||
45 | MAGICPANELR2 SH_MAGIC_PANEL_R2 | 44 | MAGICPANELR2 SH_MAGIC_PANEL_R2 |
46 | R2D_PLUS RTS7751R2D_PLUS | 45 | R2D_PLUS RTS7751R2D_PLUS |
47 | R2D_1 RTS7751R2D_1 | 46 | R2D_1 RTS7751R2D_1 |
47 | CAYMAN SH_CAYMAN | ||
diff --git a/arch/sh64/Kconfig b/arch/sh64/Kconfig deleted file mode 100644 index 6884d5a518ad..000000000000 --- a/arch/sh64/Kconfig +++ /dev/null | |||
@@ -1,295 +0,0 @@ | |||
1 | # | ||
2 | # For a description of the syntax of this configuration file, | ||
3 | # see Documentation/kbuild/kconfig-language.txt. | ||
4 | # | ||
5 | |||
6 | mainmenu "Linux/SH64 Kernel Configuration" | ||
7 | |||
8 | config SUPERH | ||
9 | bool | ||
10 | default y | ||
11 | |||
12 | config SUPERH64 | ||
13 | bool | ||
14 | default y | ||
15 | |||
16 | config MMU | ||
17 | bool | ||
18 | default y | ||
19 | |||
20 | config QUICKLIST | ||
21 | def_bool y | ||
22 | |||
23 | config RWSEM_GENERIC_SPINLOCK | ||
24 | bool | ||
25 | default y | ||
26 | |||
27 | config GENERIC_FIND_NEXT_BIT | ||
28 | bool | ||
29 | default y | ||
30 | |||
31 | config GENERIC_HWEIGHT | ||
32 | bool | ||
33 | default y | ||
34 | |||
35 | config GENERIC_CALIBRATE_DELAY | ||
36 | bool | ||
37 | default y | ||
38 | |||
39 | config GENERIC_HARDIRQS | ||
40 | bool | ||
41 | default y | ||
42 | |||
43 | config GENERIC_IRQ_PROBE | ||
44 | bool | ||
45 | default y | ||
46 | |||
47 | config RWSEM_XCHGADD_ALGORITHM | ||
48 | bool | ||
49 | |||
50 | config ARCH_HAS_ILOG2_U32 | ||
51 | bool | ||
52 | default n | ||
53 | |||
54 | config ARCH_HAS_ILOG2_U64 | ||
55 | bool | ||
56 | default n | ||
57 | |||
58 | config ARCH_NO_VIRT_TO_BUS | ||
59 | def_bool y | ||
60 | |||
61 | source init/Kconfig | ||
62 | |||
63 | menu "System type" | ||
64 | |||
65 | choice | ||
66 | prompt "SuperH system type" | ||
67 | default SH_SIMULATOR | ||
68 | |||
69 | config SH_SIMULATOR | ||
70 | bool "Simulator" | ||
71 | |||
72 | config SH_CAYMAN | ||
73 | bool "Cayman" | ||
74 | |||
75 | config SH_HARP | ||
76 | bool "ST50-Harp" | ||
77 | |||
78 | endchoice | ||
79 | |||
80 | choice | ||
81 | prompt "Processor family" | ||
82 | default CPU_SH5 | ||
83 | |||
84 | config CPU_SH5 | ||
85 | bool "SH-5" | ||
86 | |||
87 | endchoice | ||
88 | |||
89 | choice | ||
90 | prompt "Processor type" | ||
91 | |||
92 | config CPU_SUBTYPE_SH5_101 | ||
93 | bool "SH5-101" | ||
94 | depends on CPU_SH5 | ||
95 | |||
96 | config CPU_SUBTYPE_SH5_103 | ||
97 | bool "SH5-103" | ||
98 | depends on CPU_SH5 | ||
99 | |||
100 | endchoice | ||
101 | |||
102 | choice | ||
103 | prompt "Endianness" | ||
104 | default LITTLE_ENDIAN | ||
105 | |||
106 | config LITTLE_ENDIAN | ||
107 | bool "Little-Endian" | ||
108 | |||
109 | config BIG_ENDIAN | ||
110 | bool "Big-Endian" | ||
111 | |||
112 | endchoice | ||
113 | |||
114 | config SH_FPU | ||
115 | bool "FPU support" | ||
116 | default y | ||
117 | |||
118 | config SH64_FPU_DENORM_FLUSH | ||
119 | depends on SH_FPU | ||
120 | bool "Flush floating point denorms to zero" | ||
121 | |||
122 | choice | ||
123 | prompt "Page table levels" | ||
124 | default SH64_PGTABLE_2_LEVEL | ||
125 | |||
126 | config SH64_PGTABLE_2_LEVEL | ||
127 | bool "2" | ||
128 | |||
129 | config SH64_PGTABLE_3_LEVEL | ||
130 | bool "3" | ||
131 | |||
132 | endchoice | ||
133 | |||
134 | choice | ||
135 | prompt "HugeTLB page size" | ||
136 | depends on HUGETLB_PAGE && MMU | ||
137 | default HUGETLB_PAGE_SIZE_64K | ||
138 | |||
139 | config HUGETLB_PAGE_SIZE_64K | ||
140 | bool "64K" | ||
141 | |||
142 | config HUGETLB_PAGE_SIZE_1MB | ||
143 | bool "1MB" | ||
144 | |||
145 | config HUGETLB_PAGE_SIZE_512MB | ||
146 | bool "512MB" | ||
147 | |||
148 | endchoice | ||
149 | |||
150 | config SH64_USER_MISALIGNED_FIXUP | ||
151 | bool "Fixup misaligned loads/stores occurring in user mode" | ||
152 | |||
153 | comment "Memory options" | ||
154 | |||
155 | config CACHED_MEMORY_OFFSET | ||
156 | hex "Cached Area Offset" | ||
157 | default "20000000" | ||
158 | |||
159 | config MEMORY_START | ||
160 | hex "Physical memory start address" | ||
161 | default "80000000" | ||
162 | |||
163 | config MEMORY_SIZE_IN_MB | ||
164 | int "Memory size (in MB)" | ||
165 | default "8" if SH_SIMULATOR | ||
166 | default "64" | ||
167 | |||
168 | comment "Cache options" | ||
169 | |||
170 | choice | ||
171 | prompt "DCache mode" | ||
172 | default DCACHE_DISABLED if SH_SIMULATOR | ||
173 | default DCACHE_WRITE_BACK | ||
174 | |||
175 | config DCACHE_WRITE_BACK | ||
176 | bool "Write-back" | ||
177 | depends on !SH_SIMULATOR | ||
178 | |||
179 | config DCACHE_WRITE_THROUGH | ||
180 | bool "Write-through" | ||
181 | depends on !SH_SIMULATOR | ||
182 | |||
183 | config DCACHE_DISABLED | ||
184 | bool "Disabled" | ||
185 | |||
186 | endchoice | ||
187 | |||
188 | config ICACHE_DISABLED | ||
189 | bool "ICache Disabling" | ||
190 | |||
191 | config PCIDEVICE_MEMORY_START | ||
192 | hex | ||
193 | default "C0000000" | ||
194 | |||
195 | config DEVICE_MEMORY_START | ||
196 | hex | ||
197 | default "E0000000" | ||
198 | |||
199 | config FLASH_MEMORY_START | ||
200 | hex "Flash memory/on-chip devices start address" | ||
201 | default "00000000" | ||
202 | |||
203 | config PCI_BLOCK_START | ||
204 | hex "PCI block start address" | ||
205 | default "40000000" | ||
206 | |||
207 | comment "CPU Subtype specific options" | ||
208 | |||
209 | config SH64_ID2815_WORKAROUND | ||
210 | bool "Include workaround for SH5-101 cut2 silicon defect ID2815" | ||
211 | |||
212 | comment "Misc options" | ||
213 | |||
214 | config HEARTBEAT | ||
215 | bool "Heartbeat LED" | ||
216 | depends on SH_CAYMAN | ||
217 | |||
218 | config HDSP253_LED | ||
219 | bool "Support for HDSP-253 LED" | ||
220 | depends on SH_CAYMAN | ||
221 | |||
222 | config SH_DMA | ||
223 | tristate "DMA controller (DMAC) support" | ||
224 | |||
225 | config PREEMPT | ||
226 | bool "Preemptible Kernel (EXPERIMENTAL)" | ||
227 | depends on EXPERIMENTAL | ||
228 | |||
229 | source "mm/Kconfig" | ||
230 | |||
231 | endmenu | ||
232 | |||
233 | menu "Bus options (PCI, PCMCIA, EISA, MCA, ISA)" | ||
234 | |||
235 | config ISA | ||
236 | bool | ||
237 | |||
238 | config SBUS | ||
239 | bool | ||
240 | |||
241 | config PCI | ||
242 | bool "PCI support" | ||
243 | depends on SH_CAYMAN | ||
244 | help | ||
245 | Find out whether you have a PCI motherboard. PCI is the name of a | ||
246 | bus system, i.e. the way the CPU talks to the other stuff inside | ||
247 | your box. Other bus systems are ISA, EISA, MicroChannel (MCA) or | ||
248 | VESA. If you have PCI, say Y, otherwise N. | ||
249 | |||
250 | The PCI-HOWTO, available from | ||
251 | <http://www.tldp.org/docs.html#howto>, contains valuable | ||
252 | information about which PCI hardware does work under Linux and which | ||
253 | doesn't. | ||
254 | |||
255 | config SH_PCIDMA_NONCOHERENT | ||
256 | bool "Cache and PCI noncoherent" | ||
257 | depends on PCI | ||
258 | default y | ||
259 | help | ||
260 | Enable this option if your platform does not have a CPU cache which | ||
261 | remains coherent with PCI DMA. It is safest to say 'Y', although you | ||
262 | will see better performance if you can say 'N', because the PCI DMA | ||
263 | code will not have to flush the CPU's caches. If you have a PCI host | ||
264 | bridge integrated with your SH CPU, refer carefully to the chip specs | ||
265 | to see if you can say 'N' here. Otherwise, leave it as 'Y'. | ||
266 | |||
267 | source "drivers/pci/Kconfig" | ||
268 | |||
269 | source "drivers/pcmcia/Kconfig" | ||
270 | |||
271 | source "drivers/pci/hotplug/Kconfig" | ||
272 | |||
273 | endmenu | ||
274 | |||
275 | menu "Executable file formats" | ||
276 | |||
277 | source "fs/Kconfig.binfmt" | ||
278 | |||
279 | endmenu | ||
280 | |||
281 | source "net/Kconfig" | ||
282 | |||
283 | source "drivers/Kconfig" | ||
284 | |||
285 | source "fs/Kconfig" | ||
286 | |||
287 | source "kernel/Kconfig.instrumentation" | ||
288 | |||
289 | source "arch/sh64/Kconfig.debug" | ||
290 | |||
291 | source "security/Kconfig" | ||
292 | |||
293 | source "crypto/Kconfig" | ||
294 | |||
295 | source "lib/Kconfig" | ||
diff --git a/arch/sh64/Kconfig.debug b/arch/sh64/Kconfig.debug deleted file mode 100644 index 05c07c4e4ed6..000000000000 --- a/arch/sh64/Kconfig.debug +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | menu "Kernel hacking" | ||
2 | |||
3 | source "lib/Kconfig.debug" | ||
4 | |||
5 | config EARLY_PRINTK | ||
6 | bool "Early SCIF console support" | ||
7 | |||
8 | config SH64_PROC_TLB | ||
9 | bool "Debug: report TLB fill/purge activity through /proc/tlb" | ||
10 | depends on PROC_FS | ||
11 | |||
12 | config SH64_PROC_ASIDS | ||
13 | bool "Debug: report ASIDs through /proc/asids" | ||
14 | depends on PROC_FS | ||
15 | |||
16 | config SH64_SR_WATCH | ||
17 | bool "Debug: set SR.WATCH to enable hardware watchpoints and trace" | ||
18 | |||
19 | config POOR_MANS_STRACE | ||
20 | bool "Debug: enable rudimentary strace facility" | ||
21 | help | ||
22 | This option allows system calls to be traced to the console. It also | ||
23 | aids in detecting kernel stack underflow. It is useful for debugging | ||
24 | early-userland problems (e.g. init incurring fatal exceptions.) | ||
25 | |||
26 | config SH_ALPHANUMERIC | ||
27 | bool "Enable debug outputs to on-board alphanumeric display" | ||
28 | depends on SH_CAYMAN | ||
29 | |||
30 | config SH_NO_BSS_INIT | ||
31 | bool "Avoid zeroing BSS (to speed-up startup on suitable platforms)" | ||
32 | |||
33 | endmenu | ||
diff --git a/arch/sh64/Makefile b/arch/sh64/Makefile deleted file mode 100644 index 8dac7e1a2be6..000000000000 --- a/arch/sh64/Makefile +++ /dev/null | |||
@@ -1,111 +0,0 @@ | |||
1 | # | ||
2 | # This file is subject to the terms and conditions of the GNU General Public | ||
3 | # License. See the file "COPYING" in the main directory of this archive | ||
4 | # for more details. | ||
5 | # | ||
6 | # Copyright (C) 2000, 2001 Paolo Alberelli | ||
7 | # Copyright (C) 2003, 2004 Paul Mundt | ||
8 | # | ||
9 | # This file is included by the global makefile so that you can add your own | ||
10 | # architecture-specific flags and dependencies. Remember to do have actions | ||
11 | # for "archclean" and "archdep" for cleaning up and making dependencies for | ||
12 | # this architecture | ||
13 | # | ||
14 | |||
15 | cpu-y := -mb | ||
16 | cpu-$(CONFIG_LITTLE_ENDIAN) := -ml | ||
17 | |||
18 | cpu-$(CONFIG_CPU_SH5) += -m5-32media-nofpu | ||
19 | |||
20 | ifdef CONFIG_LITTLE_ENDIAN | ||
21 | LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64' | ||
22 | LDFLAGS += -EL -mshlelf32_linux | ||
23 | else | ||
24 | LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64+4' | ||
25 | LDFLAGS += -EB -mshelf32_linux | ||
26 | endif | ||
27 | |||
28 | # No requirements for endianess support from AFLAGS, 'as' always run through gcc | ||
29 | KBUILD_CFLAGS += $(cpu-y) | ||
30 | |||
31 | LDFLAGS_vmlinux += --defsym phys_stext=_stext-$(CONFIG_CACHED_MEMORY_OFFSET) \ | ||
32 | --defsym phys_stext_shmedia=phys_stext+1 \ | ||
33 | -e phys_stext_shmedia | ||
34 | |||
35 | OBJCOPYFLAGS := -O binary -R .note -R .comment -R .stab -R .stabstr -S | ||
36 | |||
37 | # | ||
38 | # arch/sh64/defconfig never had any hope of being | ||
39 | # frequently updated, so use one that does | ||
40 | # | ||
41 | KBUILD_DEFCONFIG := cayman_defconfig | ||
42 | |||
43 | KBUILD_IMAGE := arch/$(ARCH)/boot/zImage | ||
44 | |||
45 | ifdef LOADADDR | ||
46 | LINKFLAGS += -Ttext $(word 1,$(LOADADDR)) | ||
47 | endif | ||
48 | |||
49 | machine-$(CONFIG_SH_CAYMAN) := cayman | ||
50 | machine-$(CONFIG_SH_SIMULATOR) := sim | ||
51 | machine-$(CONFIG_SH_HARP) := harp | ||
52 | |||
53 | head-y := arch/$(ARCH)/kernel/head.o arch/$(ARCH)/kernel/init_task.o | ||
54 | |||
55 | core-y += arch/sh64/kernel/ arch/sh64/mm/ | ||
56 | |||
57 | ifneq ($(machine-y),) | ||
58 | core-y += arch/sh64/mach-$(machine-y)/ | ||
59 | endif | ||
60 | |||
61 | LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) | ||
62 | libs-y += arch/$(ARCH)/lib/ $(LIBGCC) | ||
63 | |||
64 | drivers-$(CONFIG_OPROFILE) += arch/sh64/oprofile/ | ||
65 | |||
66 | boot := arch/$(ARCH)/boot | ||
67 | |||
68 | zImage: vmlinux | ||
69 | $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ | ||
70 | |||
71 | compressed: zImage | ||
72 | |||
73 | archclean: | ||
74 | $(Q)$(MAKE) $(clean)=$(boot) | ||
75 | |||
76 | archprepare: arch/$(ARCH)/lib/syscalltab.h | ||
77 | |||
78 | define filechk_gen-syscalltab | ||
79 | (set -e; \ | ||
80 | echo "/*"; \ | ||
81 | echo " * DO NOT MODIFY."; \ | ||
82 | echo " *"; \ | ||
83 | echo " * This file was generated by arch/$(ARCH)/Makefile"; \ | ||
84 | echo " * Any changes will be reverted at build time."; \ | ||
85 | echo " */"; \ | ||
86 | echo ""; \ | ||
87 | echo "#ifndef __SYSCALLTAB_H"; \ | ||
88 | echo "#define __SYSCALLTAB_H"; \ | ||
89 | echo ""; \ | ||
90 | echo "#include <linux/kernel.h>"; \ | ||
91 | echo ""; \ | ||
92 | echo "struct syscall_info {"; \ | ||
93 | echo " const char *name;"; \ | ||
94 | echo "} syscall_info_table[] = {"; \ | ||
95 | sed -e '/^.*\.long /!d;s// { "/;s/\(\([^/]*\)\/\)\{1\}.*/\2/; \ | ||
96 | s/[ \t]*$$//g;s/$$/" },/;s/\("\)sys_/\1/g'; \ | ||
97 | echo "};"; \ | ||
98 | echo ""; \ | ||
99 | echo "#define NUM_SYSCALL_INFO_ENTRIES ARRAY_SIZE(syscall_info_table)"; \ | ||
100 | echo ""; \ | ||
101 | echo "#endif /* __SYSCALLTAB_H */" ) | ||
102 | endef | ||
103 | |||
104 | arch/$(ARCH)/lib/syscalltab.h: arch/sh64/kernel/syscalls.S | ||
105 | $(call filechk,gen-syscalltab) | ||
106 | |||
107 | CLEAN_FILES += arch/$(ARCH)/lib/syscalltab.h | ||
108 | |||
109 | define archhelp | ||
110 | @echo '* zImage - Compressed kernel image' | ||
111 | endef | ||
diff --git a/arch/sh64/boot/Makefile b/arch/sh64/boot/Makefile deleted file mode 100644 index fb71087b7b8a..000000000000 --- a/arch/sh64/boot/Makefile +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | # | ||
2 | # arch/sh64/boot/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 | # Copyright (C) 2002 Stuart Menefy | ||
9 | # | ||
10 | |||
11 | targets := zImage | ||
12 | subdir- := compressed | ||
13 | |||
14 | $(obj)/zImage: $(obj)/compressed/vmlinux FORCE | ||
15 | $(call if_changed,objcopy) | ||
16 | @echo 'Kernel: $@ is ready' | ||
17 | |||
18 | $(obj)/compressed/vmlinux: FORCE | ||
19 | $(Q)$(MAKE) $(build)=$(obj)/compressed $@ | ||
20 | |||
diff --git a/arch/sh64/boot/compressed/cache.c b/arch/sh64/boot/compressed/cache.c deleted file mode 100644 index 708707355ffa..000000000000 --- a/arch/sh64/boot/compressed/cache.c +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | /* | ||
2 | * arch/shmedia/boot/compressed/cache.c -- simple cache management functions | ||
3 | * | ||
4 | * Code extracted from sh-ipl+g, sh-stub.c, which has the copyright: | ||
5 | * | ||
6 | * This is originally based on an m68k software stub written by Glenn | ||
7 | * Engel at HP, but has changed quite a bit. | ||
8 | * | ||
9 | * Modifications for the SH by Ben Lee and Steve Chamberlain | ||
10 | * | ||
11 | **************************************************************************** | ||
12 | |||
13 | THIS SOFTWARE IS NOT COPYRIGHTED | ||
14 | |||
15 | HP offers the following for use in the public domain. HP makes no | ||
16 | warranty with regard to the software or it's performance and the | ||
17 | user accepts the software "AS IS" with all faults. | ||
18 | |||
19 | HP DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD | ||
20 | TO THIS SOFTWARE INCLUDING BUT NOT LIMITED TO THE WARRANTIES | ||
21 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
22 | |||
23 | ****************************************************************************/ | ||
24 | |||
25 | #define CACHE_ENABLE 0 | ||
26 | #define CACHE_DISABLE 1 | ||
27 | |||
28 | int cache_control(unsigned int command) | ||
29 | { | ||
30 | volatile unsigned int *p = (volatile unsigned int *) 0x80000000; | ||
31 | int i; | ||
32 | |||
33 | for (i = 0; i < (32 * 1024); i += 32) { | ||
34 | (void *) *p; | ||
35 | p += (32 / sizeof (int)); | ||
36 | } | ||
37 | |||
38 | return 0; | ||
39 | } | ||
diff --git a/arch/sh64/boot/compressed/install.sh b/arch/sh64/boot/compressed/install.sh deleted file mode 100644 index 90589f0fec12..000000000000 --- a/arch/sh64/boot/compressed/install.sh +++ /dev/null | |||
@@ -1,56 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # arch/sh/boot/install.sh | ||
4 | # | ||
5 | # This file is subject to the terms and conditions of the GNU General Public | ||
6 | # License. See the file "COPYING" in the main directory of this archive | ||
7 | # for more details. | ||
8 | # | ||
9 | # Copyright (C) 1995 by Linus Torvalds | ||
10 | # | ||
11 | # Adapted from code in arch/i386/boot/Makefile by H. Peter Anvin | ||
12 | # Adapted from code in arch/i386/boot/install.sh by Russell King | ||
13 | # Adapted from code in arch/arm/boot/install.sh by Stuart Menefy | ||
14 | # | ||
15 | # "make install" script for sh architecture | ||
16 | # | ||
17 | # Arguments: | ||
18 | # $1 - kernel version | ||
19 | # $2 - kernel image file | ||
20 | # $3 - kernel map file | ||
21 | # $4 - default install path (blank if root directory) | ||
22 | # | ||
23 | |||
24 | # User may have a custom install script | ||
25 | |||
26 | if [ -x /sbin/installkernel ]; then | ||
27 | exec /sbin/installkernel "$@" | ||
28 | fi | ||
29 | |||
30 | if [ "$2" = "zImage" ]; then | ||
31 | # Compressed install | ||
32 | echo "Installing compressed kernel" | ||
33 | if [ -f $4/vmlinuz-$1 ]; then | ||
34 | mv $4/vmlinuz-$1 $4/vmlinuz.old | ||
35 | fi | ||
36 | |||
37 | if [ -f $4/System.map-$1 ]; then | ||
38 | mv $4/System.map-$1 $4/System.old | ||
39 | fi | ||
40 | |||
41 | cat $2 > $4/vmlinuz-$1 | ||
42 | cp $3 $4/System.map-$1 | ||
43 | else | ||
44 | # Normal install | ||
45 | echo "Installing normal kernel" | ||
46 | if [ -f $4/vmlinux-$1 ]; then | ||
47 | mv $4/vmlinux-$1 $4/vmlinux.old | ||
48 | fi | ||
49 | |||
50 | if [ -f $4/System.map ]; then | ||
51 | mv $4/System.map $4/System.old | ||
52 | fi | ||
53 | |||
54 | cat $2 > $4/vmlinux-$1 | ||
55 | cp $3 $4/System.map | ||
56 | fi | ||
diff --git a/arch/sh64/configs/harp_defconfig b/arch/sh64/configs/harp_defconfig deleted file mode 100644 index ba302cd0c285..000000000000 --- a/arch/sh64/configs/harp_defconfig +++ /dev/null | |||
@@ -1,745 +0,0 @@ | |||
1 | # | ||
2 | # Automatically generated make config: don't edit | ||
3 | # Linux kernel version: 2.6.24-rc1 | ||
4 | # Fri Nov 2 14:35:57 2007 | ||
5 | # | ||
6 | CONFIG_SUPERH=y | ||
7 | CONFIG_SUPERH64=y | ||
8 | CONFIG_MMU=y | ||
9 | CONFIG_QUICKLIST=y | ||
10 | CONFIG_RWSEM_GENERIC_SPINLOCK=y | ||
11 | CONFIG_GENERIC_FIND_NEXT_BIT=y | ||
12 | CONFIG_GENERIC_HWEIGHT=y | ||
13 | CONFIG_GENERIC_CALIBRATE_DELAY=y | ||
14 | CONFIG_GENERIC_HARDIRQS=y | ||
15 | CONFIG_GENERIC_IRQ_PROBE=y | ||
16 | # CONFIG_ARCH_HAS_ILOG2_U32 is not set | ||
17 | # CONFIG_ARCH_HAS_ILOG2_U64 is not set | ||
18 | CONFIG_ARCH_NO_VIRT_TO_BUS=y | ||
19 | CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" | ||
20 | |||
21 | # | ||
22 | # General setup | ||
23 | # | ||
24 | CONFIG_EXPERIMENTAL=y | ||
25 | CONFIG_BROKEN_ON_SMP=y | ||
26 | CONFIG_LOCK_KERNEL=y | ||
27 | CONFIG_INIT_ENV_ARG_LIMIT=32 | ||
28 | CONFIG_LOCALVERSION="" | ||
29 | CONFIG_LOCALVERSION_AUTO=y | ||
30 | CONFIG_SWAP=y | ||
31 | # CONFIG_SYSVIPC is not set | ||
32 | CONFIG_POSIX_MQUEUE=y | ||
33 | # CONFIG_BSD_PROCESS_ACCT is not set | ||
34 | # CONFIG_TASKSTATS is not set | ||
35 | # CONFIG_USER_NS is not set | ||
36 | # CONFIG_AUDIT is not set | ||
37 | # CONFIG_IKCONFIG is not set | ||
38 | CONFIG_LOG_BUF_SHIFT=14 | ||
39 | # CONFIG_CGROUPS is not set | ||
40 | CONFIG_FAIR_GROUP_SCHED=y | ||
41 | CONFIG_FAIR_USER_SCHED=y | ||
42 | # CONFIG_FAIR_CGROUP_SCHED is not set | ||
43 | CONFIG_SYSFS_DEPRECATED=y | ||
44 | # CONFIG_RELAY is not set | ||
45 | # CONFIG_BLK_DEV_INITRD is not set | ||
46 | # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set | ||
47 | CONFIG_SYSCTL=y | ||
48 | # CONFIG_EMBEDDED is not set | ||
49 | CONFIG_UID16=y | ||
50 | CONFIG_SYSCTL_SYSCALL=y | ||
51 | CONFIG_KALLSYMS=y | ||
52 | # CONFIG_KALLSYMS_ALL is not set | ||
53 | # CONFIG_KALLSYMS_EXTRA_PASS is not set | ||
54 | CONFIG_HOTPLUG=y | ||
55 | CONFIG_PRINTK=y | ||
56 | CONFIG_BUG=y | ||
57 | CONFIG_ELF_CORE=y | ||
58 | CONFIG_BASE_FULL=y | ||
59 | CONFIG_FUTEX=y | ||
60 | CONFIG_ANON_INODES=y | ||
61 | CONFIG_EPOLL=y | ||
62 | CONFIG_SIGNALFD=y | ||
63 | CONFIG_EVENTFD=y | ||
64 | CONFIG_SHMEM=y | ||
65 | CONFIG_VM_EVENT_COUNTERS=y | ||
66 | CONFIG_SLAB=y | ||
67 | # CONFIG_SLUB is not set | ||
68 | # CONFIG_SLOB is not set | ||
69 | CONFIG_RT_MUTEXES=y | ||
70 | # CONFIG_TINY_SHMEM is not set | ||
71 | CONFIG_BASE_SMALL=0 | ||
72 | # CONFIG_MODULES is not set | ||
73 | CONFIG_BLOCK=y | ||
74 | # CONFIG_LBD is not set | ||
75 | # CONFIG_BLK_DEV_IO_TRACE is not set | ||
76 | # CONFIG_LSF is not set | ||
77 | # CONFIG_BLK_DEV_BSG is not set | ||
78 | |||
79 | # | ||
80 | # IO Schedulers | ||
81 | # | ||
82 | CONFIG_IOSCHED_NOOP=y | ||
83 | CONFIG_IOSCHED_AS=y | ||
84 | CONFIG_IOSCHED_DEADLINE=y | ||
85 | CONFIG_IOSCHED_CFQ=y | ||
86 | # CONFIG_DEFAULT_AS is not set | ||
87 | # CONFIG_DEFAULT_DEADLINE is not set | ||
88 | CONFIG_DEFAULT_CFQ=y | ||
89 | # CONFIG_DEFAULT_NOOP is not set | ||
90 | CONFIG_DEFAULT_IOSCHED="cfq" | ||
91 | |||
92 | # | ||
93 | # System type | ||
94 | # | ||
95 | # CONFIG_SH_SIMULATOR is not set | ||
96 | # CONFIG_SH_CAYMAN is not set | ||
97 | CONFIG_SH_HARP=y | ||
98 | CONFIG_CPU_SH5=y | ||
99 | CONFIG_CPU_SUBTYPE_SH5_101=y | ||
100 | # CONFIG_CPU_SUBTYPE_SH5_103 is not set | ||
101 | CONFIG_LITTLE_ENDIAN=y | ||
102 | # CONFIG_BIG_ENDIAN is not set | ||
103 | CONFIG_SH_FPU=y | ||
104 | # CONFIG_SH64_FPU_DENORM_FLUSH is not set | ||
105 | CONFIG_SH64_PGTABLE_2_LEVEL=y | ||
106 | # CONFIG_SH64_PGTABLE_3_LEVEL is not set | ||
107 | CONFIG_HUGETLB_PAGE_SIZE_64K=y | ||
108 | # CONFIG_HUGETLB_PAGE_SIZE_1MB is not set | ||
109 | # CONFIG_HUGETLB_PAGE_SIZE_512MB is not set | ||
110 | CONFIG_SH64_USER_MISALIGNED_FIXUP=y | ||
111 | |||
112 | # | ||
113 | # Memory options | ||
114 | # | ||
115 | CONFIG_CACHED_MEMORY_OFFSET=0x20000000 | ||
116 | CONFIG_MEMORY_START=0x80000000 | ||
117 | CONFIG_MEMORY_SIZE_IN_MB=128 | ||
118 | |||
119 | # | ||
120 | # Cache options | ||
121 | # | ||
122 | CONFIG_DCACHE_WRITE_BACK=y | ||
123 | # CONFIG_DCACHE_WRITE_THROUGH is not set | ||
124 | # CONFIG_DCACHE_DISABLED is not set | ||
125 | # CONFIG_ICACHE_DISABLED is not set | ||
126 | CONFIG_PCIDEVICE_MEMORY_START=C0000000 | ||
127 | CONFIG_DEVICE_MEMORY_START=E0000000 | ||
128 | CONFIG_FLASH_MEMORY_START=0x00000000 | ||
129 | CONFIG_PCI_BLOCK_START=0x40000000 | ||
130 | |||
131 | # | ||
132 | # CPU Subtype specific options | ||
133 | # | ||
134 | CONFIG_SH64_ID2815_WORKAROUND=y | ||
135 | |||
136 | # | ||
137 | # Misc options | ||
138 | # | ||
139 | # CONFIG_SH_DMA is not set | ||
140 | CONFIG_PREEMPT=y | ||
141 | CONFIG_SELECT_MEMORY_MODEL=y | ||
142 | CONFIG_FLATMEM_MANUAL=y | ||
143 | # CONFIG_DISCONTIGMEM_MANUAL is not set | ||
144 | # CONFIG_SPARSEMEM_MANUAL is not set | ||
145 | CONFIG_FLATMEM=y | ||
146 | CONFIG_FLAT_NODE_MEM_MAP=y | ||
147 | # CONFIG_SPARSEMEM_STATIC is not set | ||
148 | # CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set | ||
149 | CONFIG_SPLIT_PTLOCK_CPUS=4 | ||
150 | # CONFIG_RESOURCES_64BIT is not set | ||
151 | CONFIG_ZONE_DMA_FLAG=0 | ||
152 | CONFIG_NR_QUICK=1 | ||
153 | |||
154 | # | ||
155 | # Bus options (PCI, PCMCIA, EISA, MCA, ISA) | ||
156 | # | ||
157 | # CONFIG_ARCH_SUPPORTS_MSI is not set | ||
158 | # CONFIG_PCCARD is not set | ||
159 | |||
160 | # | ||
161 | # Executable file formats | ||
162 | # | ||
163 | CONFIG_BINFMT_ELF=y | ||
164 | # CONFIG_BINFMT_MISC is not set | ||
165 | |||
166 | # | ||
167 | # Networking | ||
168 | # | ||
169 | CONFIG_NET=y | ||
170 | |||
171 | # | ||
172 | # Networking options | ||
173 | # | ||
174 | CONFIG_PACKET=y | ||
175 | # CONFIG_PACKET_MMAP is not set | ||
176 | CONFIG_UNIX=y | ||
177 | CONFIG_XFRM=y | ||
178 | # CONFIG_XFRM_USER is not set | ||
179 | # CONFIG_XFRM_SUB_POLICY is not set | ||
180 | # CONFIG_XFRM_MIGRATE is not set | ||
181 | # CONFIG_NET_KEY is not set | ||
182 | CONFIG_INET=y | ||
183 | # CONFIG_IP_MULTICAST is not set | ||
184 | # CONFIG_IP_ADVANCED_ROUTER is not set | ||
185 | CONFIG_IP_FIB_HASH=y | ||
186 | CONFIG_IP_PNP=y | ||
187 | # CONFIG_IP_PNP_DHCP is not set | ||
188 | # CONFIG_IP_PNP_BOOTP is not set | ||
189 | # CONFIG_IP_PNP_RARP is not set | ||
190 | # CONFIG_NET_IPIP is not set | ||
191 | # CONFIG_NET_IPGRE is not set | ||
192 | # CONFIG_ARPD is not set | ||
193 | # CONFIG_SYN_COOKIES is not set | ||
194 | # CONFIG_INET_AH is not set | ||
195 | # CONFIG_INET_ESP is not set | ||
196 | # CONFIG_INET_IPCOMP is not set | ||
197 | # CONFIG_INET_XFRM_TUNNEL is not set | ||
198 | # CONFIG_INET_TUNNEL is not set | ||
199 | CONFIG_INET_XFRM_MODE_TRANSPORT=y | ||
200 | CONFIG_INET_XFRM_MODE_TUNNEL=y | ||
201 | CONFIG_INET_XFRM_MODE_BEET=y | ||
202 | # CONFIG_INET_LRO is not set | ||
203 | CONFIG_INET_DIAG=y | ||
204 | CONFIG_INET_TCP_DIAG=y | ||
205 | # CONFIG_TCP_CONG_ADVANCED is not set | ||
206 | CONFIG_TCP_CONG_CUBIC=y | ||
207 | CONFIG_DEFAULT_TCP_CONG="cubic" | ||
208 | # CONFIG_TCP_MD5SIG is not set | ||
209 | # CONFIG_IPV6 is not set | ||
210 | # CONFIG_INET6_XFRM_TUNNEL is not set | ||
211 | # CONFIG_INET6_TUNNEL is not set | ||
212 | # CONFIG_NETWORK_SECMARK is not set | ||
213 | # CONFIG_NETFILTER is not set | ||
214 | # CONFIG_IP_DCCP is not set | ||
215 | # CONFIG_IP_SCTP is not set | ||
216 | # CONFIG_TIPC is not set | ||
217 | # CONFIG_ATM is not set | ||
218 | # CONFIG_BRIDGE is not set | ||
219 | # CONFIG_VLAN_8021Q is not set | ||
220 | # CONFIG_DECNET is not set | ||
221 | # CONFIG_LLC2 is not set | ||
222 | # CONFIG_IPX is not set | ||
223 | # CONFIG_ATALK is not set | ||
224 | # CONFIG_X25 is not set | ||
225 | # CONFIG_LAPB is not set | ||
226 | # CONFIG_ECONET is not set | ||
227 | # CONFIG_WAN_ROUTER is not set | ||
228 | # CONFIG_NET_SCHED is not set | ||
229 | |||
230 | # | ||
231 | # Network testing | ||
232 | # | ||
233 | # CONFIG_NET_PKTGEN is not set | ||
234 | # CONFIG_HAMRADIO is not set | ||
235 | # CONFIG_IRDA is not set | ||
236 | # CONFIG_BT is not set | ||
237 | # CONFIG_AF_RXRPC is not set | ||
238 | |||
239 | # | ||
240 | # Wireless | ||
241 | # | ||
242 | # CONFIG_CFG80211 is not set | ||
243 | # CONFIG_WIRELESS_EXT is not set | ||
244 | # CONFIG_MAC80211 is not set | ||
245 | # CONFIG_IEEE80211 is not set | ||
246 | # CONFIG_RFKILL is not set | ||
247 | # CONFIG_NET_9P is not set | ||
248 | |||
249 | # | ||
250 | # Device Drivers | ||
251 | # | ||
252 | |||
253 | # | ||
254 | # Generic Driver Options | ||
255 | # | ||
256 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | ||
257 | CONFIG_STANDALONE=y | ||
258 | CONFIG_PREVENT_FIRMWARE_BUILD=y | ||
259 | # CONFIG_FW_LOADER is not set | ||
260 | # CONFIG_DEBUG_DRIVER is not set | ||
261 | # CONFIG_DEBUG_DEVRES is not set | ||
262 | # CONFIG_SYS_HYPERVISOR is not set | ||
263 | # CONFIG_CONNECTOR is not set | ||
264 | # CONFIG_MTD is not set | ||
265 | # CONFIG_PARPORT is not set | ||
266 | CONFIG_BLK_DEV=y | ||
267 | # CONFIG_BLK_DEV_COW_COMMON is not set | ||
268 | CONFIG_BLK_DEV_LOOP=y | ||
269 | # CONFIG_BLK_DEV_CRYPTOLOOP is not set | ||
270 | # CONFIG_BLK_DEV_NBD is not set | ||
271 | CONFIG_BLK_DEV_RAM=y | ||
272 | CONFIG_BLK_DEV_RAM_COUNT=16 | ||
273 | CONFIG_BLK_DEV_RAM_SIZE=4096 | ||
274 | CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 | ||
275 | # CONFIG_CDROM_PKTCDVD is not set | ||
276 | # CONFIG_ATA_OVER_ETH is not set | ||
277 | CONFIG_MISC_DEVICES=y | ||
278 | # CONFIG_EEPROM_93CX6 is not set | ||
279 | # CONFIG_IDE is not set | ||
280 | |||
281 | # | ||
282 | # SCSI device support | ||
283 | # | ||
284 | # CONFIG_RAID_ATTRS is not set | ||
285 | CONFIG_SCSI=y | ||
286 | CONFIG_SCSI_DMA=y | ||
287 | # CONFIG_SCSI_TGT is not set | ||
288 | # CONFIG_SCSI_NETLINK is not set | ||
289 | CONFIG_SCSI_PROC_FS=y | ||
290 | |||
291 | # | ||
292 | # SCSI support type (disk, tape, CD-ROM) | ||
293 | # | ||
294 | CONFIG_BLK_DEV_SD=y | ||
295 | # CONFIG_CHR_DEV_ST is not set | ||
296 | # CONFIG_CHR_DEV_OSST is not set | ||
297 | # CONFIG_BLK_DEV_SR is not set | ||
298 | # CONFIG_CHR_DEV_SG is not set | ||
299 | # CONFIG_CHR_DEV_SCH is not set | ||
300 | |||
301 | # | ||
302 | # Some SCSI devices (e.g. CD jukebox) support multiple LUNs | ||
303 | # | ||
304 | CONFIG_SCSI_MULTI_LUN=y | ||
305 | # CONFIG_SCSI_CONSTANTS is not set | ||
306 | # CONFIG_SCSI_LOGGING is not set | ||
307 | # CONFIG_SCSI_SCAN_ASYNC is not set | ||
308 | |||
309 | # | ||
310 | # SCSI Transports | ||
311 | # | ||
312 | CONFIG_SCSI_SPI_ATTRS=y | ||
313 | # CONFIG_SCSI_FC_ATTRS is not set | ||
314 | # CONFIG_SCSI_ISCSI_ATTRS is not set | ||
315 | # CONFIG_SCSI_SAS_LIBSAS is not set | ||
316 | # CONFIG_SCSI_SRP_ATTRS is not set | ||
317 | CONFIG_SCSI_LOWLEVEL=y | ||
318 | # CONFIG_ISCSI_TCP is not set | ||
319 | # CONFIG_SCSI_DEBUG is not set | ||
320 | # CONFIG_ATA is not set | ||
321 | # CONFIG_MD is not set | ||
322 | CONFIG_NETDEVICES=y | ||
323 | # CONFIG_NETDEVICES_MULTIQUEUE is not set | ||
324 | # CONFIG_DUMMY is not set | ||
325 | # CONFIG_BONDING is not set | ||
326 | # CONFIG_MACVLAN is not set | ||
327 | # CONFIG_EQUALIZER is not set | ||
328 | # CONFIG_TUN is not set | ||
329 | # CONFIG_VETH is not set | ||
330 | # CONFIG_PHYLIB is not set | ||
331 | CONFIG_NET_ETHERNET=y | ||
332 | # CONFIG_MII is not set | ||
333 | # CONFIG_STNIC is not set | ||
334 | # CONFIG_SMC91X is not set | ||
335 | # CONFIG_SMC911X is not set | ||
336 | # CONFIG_IBM_NEW_EMAC_ZMII is not set | ||
337 | # CONFIG_IBM_NEW_EMAC_RGMII is not set | ||
338 | # CONFIG_IBM_NEW_EMAC_TAH is not set | ||
339 | # CONFIG_IBM_NEW_EMAC_EMAC4 is not set | ||
340 | # CONFIG_B44 is not set | ||
341 | CONFIG_NETDEV_1000=y | ||
342 | CONFIG_NETDEV_10000=y | ||
343 | |||
344 | # | ||
345 | # Wireless LAN | ||
346 | # | ||
347 | # CONFIG_WLAN_PRE80211 is not set | ||
348 | # CONFIG_WLAN_80211 is not set | ||
349 | # CONFIG_WAN is not set | ||
350 | # CONFIG_PPP is not set | ||
351 | # CONFIG_SLIP is not set | ||
352 | # CONFIG_SHAPER is not set | ||
353 | # CONFIG_NETCONSOLE is not set | ||
354 | # CONFIG_NETPOLL is not set | ||
355 | # CONFIG_NET_POLL_CONTROLLER is not set | ||
356 | # CONFIG_ISDN is not set | ||
357 | # CONFIG_PHONE is not set | ||
358 | |||
359 | # | ||
360 | # Input device support | ||
361 | # | ||
362 | CONFIG_INPUT=y | ||
363 | # CONFIG_INPUT_FF_MEMLESS is not set | ||
364 | # CONFIG_INPUT_POLLDEV is not set | ||
365 | |||
366 | # | ||
367 | # Userland interfaces | ||
368 | # | ||
369 | CONFIG_INPUT_MOUSEDEV=y | ||
370 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set | ||
371 | CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 | ||
372 | CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 | ||
373 | # CONFIG_INPUT_JOYDEV is not set | ||
374 | # CONFIG_INPUT_EVDEV is not set | ||
375 | # CONFIG_INPUT_EVBUG is not set | ||
376 | |||
377 | # | ||
378 | # Input Device Drivers | ||
379 | # | ||
380 | # CONFIG_INPUT_KEYBOARD is not set | ||
381 | # CONFIG_INPUT_MOUSE is not set | ||
382 | # CONFIG_INPUT_JOYSTICK is not set | ||
383 | # CONFIG_INPUT_TABLET is not set | ||
384 | # CONFIG_INPUT_TOUCHSCREEN is not set | ||
385 | # CONFIG_INPUT_MISC is not set | ||
386 | |||
387 | # | ||
388 | # Hardware I/O ports | ||
389 | # | ||
390 | # CONFIG_SERIO is not set | ||
391 | # CONFIG_GAMEPORT is not set | ||
392 | |||
393 | # | ||
394 | # Character devices | ||
395 | # | ||
396 | CONFIG_VT=y | ||
397 | CONFIG_VT_CONSOLE=y | ||
398 | CONFIG_HW_CONSOLE=y | ||
399 | # CONFIG_VT_HW_CONSOLE_BINDING is not set | ||
400 | # CONFIG_SERIAL_NONSTANDARD is not set | ||
401 | |||
402 | # | ||
403 | # Serial drivers | ||
404 | # | ||
405 | # CONFIG_SERIAL_8250 is not set | ||
406 | |||
407 | # | ||
408 | # Non-8250 serial port support | ||
409 | # | ||
410 | CONFIG_SERIAL_SH_SCI=y | ||
411 | CONFIG_SERIAL_SH_SCI_NR_UARTS=2 | ||
412 | CONFIG_SERIAL_SH_SCI_CONSOLE=y | ||
413 | CONFIG_SERIAL_CORE=y | ||
414 | CONFIG_SERIAL_CORE_CONSOLE=y | ||
415 | CONFIG_UNIX98_PTYS=y | ||
416 | CONFIG_LEGACY_PTYS=y | ||
417 | CONFIG_LEGACY_PTY_COUNT=256 | ||
418 | # CONFIG_IPMI_HANDLER is not set | ||
419 | CONFIG_HW_RANDOM=y | ||
420 | # CONFIG_R3964 is not set | ||
421 | # CONFIG_RAW_DRIVER is not set | ||
422 | # CONFIG_TCG_TPM is not set | ||
423 | # CONFIG_I2C is not set | ||
424 | |||
425 | # | ||
426 | # SPI support | ||
427 | # | ||
428 | # CONFIG_SPI is not set | ||
429 | # CONFIG_SPI_MASTER is not set | ||
430 | # CONFIG_W1 is not set | ||
431 | # CONFIG_POWER_SUPPLY is not set | ||
432 | CONFIG_HWMON=y | ||
433 | # CONFIG_HWMON_VID is not set | ||
434 | # CONFIG_SENSORS_F71805F is not set | ||
435 | # CONFIG_SENSORS_F71882FG is not set | ||
436 | # CONFIG_SENSORS_IT87 is not set | ||
437 | # CONFIG_SENSORS_PC87360 is not set | ||
438 | # CONFIG_SENSORS_PC87427 is not set | ||
439 | # CONFIG_SENSORS_SMSC47M1 is not set | ||
440 | # CONFIG_SENSORS_SMSC47B397 is not set | ||
441 | # CONFIG_SENSORS_VT1211 is not set | ||
442 | # CONFIG_SENSORS_W83627HF is not set | ||
443 | # CONFIG_SENSORS_W83627EHF is not set | ||
444 | # CONFIG_HWMON_DEBUG_CHIP is not set | ||
445 | CONFIG_WATCHDOG=y | ||
446 | # CONFIG_WATCHDOG_NOWAYOUT is not set | ||
447 | |||
448 | # | ||
449 | # Watchdog Device Drivers | ||
450 | # | ||
451 | # CONFIG_SOFT_WATCHDOG is not set | ||
452 | |||
453 | # | ||
454 | # Sonics Silicon Backplane | ||
455 | # | ||
456 | CONFIG_SSB_POSSIBLE=y | ||
457 | # CONFIG_SSB is not set | ||
458 | |||
459 | # | ||
460 | # Multifunction device drivers | ||
461 | # | ||
462 | # CONFIG_MFD_SM501 is not set | ||
463 | |||
464 | # | ||
465 | # Multimedia devices | ||
466 | # | ||
467 | # CONFIG_VIDEO_DEV is not set | ||
468 | # CONFIG_DVB_CORE is not set | ||
469 | CONFIG_DAB=y | ||
470 | |||
471 | # | ||
472 | # Graphics support | ||
473 | # | ||
474 | # CONFIG_VGASTATE is not set | ||
475 | CONFIG_VIDEO_OUTPUT_CONTROL=y | ||
476 | CONFIG_FB=y | ||
477 | CONFIG_FIRMWARE_EDID=y | ||
478 | # CONFIG_FB_DDC is not set | ||
479 | # CONFIG_FB_CFB_FILLRECT is not set | ||
480 | # CONFIG_FB_CFB_COPYAREA is not set | ||
481 | # CONFIG_FB_CFB_IMAGEBLIT is not set | ||
482 | # CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set | ||
483 | # CONFIG_FB_SYS_FILLRECT is not set | ||
484 | # CONFIG_FB_SYS_COPYAREA is not set | ||
485 | # CONFIG_FB_SYS_IMAGEBLIT is not set | ||
486 | # CONFIG_FB_SYS_FOPS is not set | ||
487 | CONFIG_FB_DEFERRED_IO=y | ||
488 | # CONFIG_FB_SVGALIB is not set | ||
489 | # CONFIG_FB_MACMODES is not set | ||
490 | # CONFIG_FB_BACKLIGHT is not set | ||
491 | CONFIG_FB_MODE_HELPERS=y | ||
492 | # CONFIG_FB_TILEBLITTING is not set | ||
493 | |||
494 | # | ||
495 | # Frame buffer hardware drivers | ||
496 | # | ||
497 | # CONFIG_FB_S1D13XXX is not set | ||
498 | # CONFIG_FB_VIRTUAL is not set | ||
499 | # CONFIG_BACKLIGHT_LCD_SUPPORT is not set | ||
500 | |||
501 | # | ||
502 | # Display device support | ||
503 | # | ||
504 | # CONFIG_DISPLAY_SUPPORT is not set | ||
505 | |||
506 | # | ||
507 | # Console display driver support | ||
508 | # | ||
509 | CONFIG_DUMMY_CONSOLE=y | ||
510 | CONFIG_FRAMEBUFFER_CONSOLE=y | ||
511 | # CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set | ||
512 | # CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set | ||
513 | CONFIG_FONTS=y | ||
514 | # CONFIG_FONT_8x8 is not set | ||
515 | CONFIG_FONT_8x16=y | ||
516 | # CONFIG_FONT_6x11 is not set | ||
517 | # CONFIG_FONT_7x14 is not set | ||
518 | # CONFIG_FONT_PEARL_8x8 is not set | ||
519 | # CONFIG_FONT_ACORN_8x8 is not set | ||
520 | # CONFIG_FONT_MINI_4x6 is not set | ||
521 | # CONFIG_FONT_SUN8x16 is not set | ||
522 | # CONFIG_FONT_SUN12x22 is not set | ||
523 | # CONFIG_FONT_10x18 is not set | ||
524 | CONFIG_LOGO=y | ||
525 | # CONFIG_LOGO_LINUX_MONO is not set | ||
526 | # CONFIG_LOGO_LINUX_VGA16 is not set | ||
527 | # CONFIG_LOGO_LINUX_CLUT224 is not set | ||
528 | # CONFIG_LOGO_SUPERH_MONO is not set | ||
529 | # CONFIG_LOGO_SUPERH_VGA16 is not set | ||
530 | CONFIG_LOGO_SUPERH_CLUT224=y | ||
531 | |||
532 | # | ||
533 | # Sound | ||
534 | # | ||
535 | # CONFIG_SOUND is not set | ||
536 | CONFIG_HID_SUPPORT=y | ||
537 | CONFIG_HID=y | ||
538 | # CONFIG_HID_DEBUG is not set | ||
539 | # CONFIG_HIDRAW is not set | ||
540 | CONFIG_USB_SUPPORT=y | ||
541 | CONFIG_USB_ARCH_HAS_HCD=y | ||
542 | # CONFIG_USB_ARCH_HAS_OHCI is not set | ||
543 | # CONFIG_USB_ARCH_HAS_EHCI is not set | ||
544 | # CONFIG_USB is not set | ||
545 | |||
546 | # | ||
547 | # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' | ||
548 | # | ||
549 | |||
550 | # | ||
551 | # USB Gadget Support | ||
552 | # | ||
553 | # CONFIG_USB_GADGET is not set | ||
554 | # CONFIG_MMC is not set | ||
555 | # CONFIG_NEW_LEDS is not set | ||
556 | # CONFIG_RTC_CLASS is not set | ||
557 | |||
558 | # | ||
559 | # Userspace I/O | ||
560 | # | ||
561 | # CONFIG_UIO is not set | ||
562 | |||
563 | # | ||
564 | # File systems | ||
565 | # | ||
566 | CONFIG_EXT2_FS=y | ||
567 | # CONFIG_EXT2_FS_XATTR is not set | ||
568 | # CONFIG_EXT2_FS_XIP is not set | ||
569 | CONFIG_EXT3_FS=y | ||
570 | CONFIG_EXT3_FS_XATTR=y | ||
571 | # CONFIG_EXT3_FS_POSIX_ACL is not set | ||
572 | # CONFIG_EXT3_FS_SECURITY is not set | ||
573 | # CONFIG_EXT4DEV_FS is not set | ||
574 | CONFIG_JBD=y | ||
575 | # CONFIG_JBD_DEBUG is not set | ||
576 | CONFIG_FS_MBCACHE=y | ||
577 | # CONFIG_REISERFS_FS is not set | ||
578 | # CONFIG_JFS_FS is not set | ||
579 | # CONFIG_FS_POSIX_ACL is not set | ||
580 | # CONFIG_XFS_FS is not set | ||
581 | # CONFIG_GFS2_FS is not set | ||
582 | # CONFIG_OCFS2_FS is not set | ||
583 | CONFIG_MINIX_FS=y | ||
584 | CONFIG_ROMFS_FS=y | ||
585 | CONFIG_INOTIFY=y | ||
586 | CONFIG_INOTIFY_USER=y | ||
587 | # CONFIG_QUOTA is not set | ||
588 | CONFIG_DNOTIFY=y | ||
589 | # CONFIG_AUTOFS_FS is not set | ||
590 | # CONFIG_AUTOFS4_FS is not set | ||
591 | # CONFIG_FUSE_FS is not set | ||
592 | |||
593 | # | ||
594 | # CD-ROM/DVD Filesystems | ||
595 | # | ||
596 | # CONFIG_ISO9660_FS is not set | ||
597 | # CONFIG_UDF_FS is not set | ||
598 | |||
599 | # | ||
600 | # DOS/FAT/NT Filesystems | ||
601 | # | ||
602 | # CONFIG_MSDOS_FS is not set | ||
603 | # CONFIG_VFAT_FS is not set | ||
604 | # CONFIG_NTFS_FS is not set | ||
605 | |||
606 | # | ||
607 | # Pseudo filesystems | ||
608 | # | ||
609 | CONFIG_PROC_FS=y | ||
610 | CONFIG_PROC_KCORE=y | ||
611 | CONFIG_PROC_SYSCTL=y | ||
612 | CONFIG_SYSFS=y | ||
613 | CONFIG_TMPFS=y | ||
614 | # CONFIG_TMPFS_POSIX_ACL is not set | ||
615 | CONFIG_HUGETLBFS=y | ||
616 | CONFIG_HUGETLB_PAGE=y | ||
617 | # CONFIG_CONFIGFS_FS is not set | ||
618 | |||
619 | # | ||
620 | # Miscellaneous filesystems | ||
621 | # | ||
622 | # CONFIG_ADFS_FS is not set | ||
623 | # CONFIG_AFFS_FS is not set | ||
624 | # CONFIG_HFS_FS is not set | ||
625 | # CONFIG_HFSPLUS_FS is not set | ||
626 | # CONFIG_BEFS_FS is not set | ||
627 | # CONFIG_BFS_FS is not set | ||
628 | # CONFIG_EFS_FS is not set | ||
629 | # CONFIG_CRAMFS is not set | ||
630 | # CONFIG_VXFS_FS is not set | ||
631 | # CONFIG_HPFS_FS is not set | ||
632 | # CONFIG_QNX4FS_FS is not set | ||
633 | # CONFIG_SYSV_FS is not set | ||
634 | # CONFIG_UFS_FS is not set | ||
635 | CONFIG_NETWORK_FILESYSTEMS=y | ||
636 | CONFIG_NFS_FS=y | ||
637 | CONFIG_NFS_V3=y | ||
638 | # CONFIG_NFS_V3_ACL is not set | ||
639 | # CONFIG_NFS_V4 is not set | ||
640 | # CONFIG_NFS_DIRECTIO is not set | ||
641 | # CONFIG_NFSD is not set | ||
642 | CONFIG_ROOT_NFS=y | ||
643 | CONFIG_LOCKD=y | ||
644 | CONFIG_LOCKD_V4=y | ||
645 | CONFIG_NFS_COMMON=y | ||
646 | CONFIG_SUNRPC=y | ||
647 | # CONFIG_SUNRPC_BIND34 is not set | ||
648 | # CONFIG_RPCSEC_GSS_KRB5 is not set | ||
649 | # CONFIG_RPCSEC_GSS_SPKM3 is not set | ||
650 | # CONFIG_SMB_FS is not set | ||
651 | # CONFIG_CIFS is not set | ||
652 | # CONFIG_NCP_FS is not set | ||
653 | # CONFIG_CODA_FS is not set | ||
654 | # CONFIG_AFS_FS is not set | ||
655 | |||
656 | # | ||
657 | # Partition Types | ||
658 | # | ||
659 | CONFIG_PARTITION_ADVANCED=y | ||
660 | # CONFIG_ACORN_PARTITION is not set | ||
661 | # CONFIG_OSF_PARTITION is not set | ||
662 | # CONFIG_AMIGA_PARTITION is not set | ||
663 | # CONFIG_ATARI_PARTITION is not set | ||
664 | # CONFIG_MAC_PARTITION is not set | ||
665 | CONFIG_MSDOS_PARTITION=y | ||
666 | # CONFIG_BSD_DISKLABEL is not set | ||
667 | # CONFIG_MINIX_SUBPARTITION is not set | ||
668 | # CONFIG_SOLARIS_X86_PARTITION is not set | ||
669 | # CONFIG_UNIXWARE_DISKLABEL is not set | ||
670 | # CONFIG_LDM_PARTITION is not set | ||
671 | # CONFIG_SGI_PARTITION is not set | ||
672 | # CONFIG_ULTRIX_PARTITION is not set | ||
673 | # CONFIG_SUN_PARTITION is not set | ||
674 | # CONFIG_KARMA_PARTITION is not set | ||
675 | # CONFIG_EFI_PARTITION is not set | ||
676 | # CONFIG_SYSV68_PARTITION is not set | ||
677 | # CONFIG_NLS is not set | ||
678 | # CONFIG_DLM is not set | ||
679 | CONFIG_INSTRUMENTATION=y | ||
680 | # CONFIG_PROFILING is not set | ||
681 | # CONFIG_MARKERS is not set | ||
682 | |||
683 | # | ||
684 | # Kernel hacking | ||
685 | # | ||
686 | # CONFIG_PRINTK_TIME is not set | ||
687 | CONFIG_ENABLE_WARN_DEPRECATED=y | ||
688 | CONFIG_ENABLE_MUST_CHECK=y | ||
689 | CONFIG_MAGIC_SYSRQ=y | ||
690 | # CONFIG_UNUSED_SYMBOLS is not set | ||
691 | CONFIG_DEBUG_FS=y | ||
692 | # CONFIG_HEADERS_CHECK is not set | ||
693 | CONFIG_DEBUG_KERNEL=y | ||
694 | # CONFIG_DEBUG_SHIRQ is not set | ||
695 | CONFIG_DETECT_SOFTLOCKUP=y | ||
696 | CONFIG_SCHED_DEBUG=y | ||
697 | CONFIG_SCHEDSTATS=y | ||
698 | # CONFIG_TIMER_STATS is not set | ||
699 | # CONFIG_DEBUG_SLAB is not set | ||
700 | # CONFIG_DEBUG_RT_MUTEXES is not set | ||
701 | # CONFIG_RT_MUTEX_TESTER is not set | ||
702 | # CONFIG_DEBUG_SPINLOCK is not set | ||
703 | # CONFIG_DEBUG_MUTEXES is not set | ||
704 | # CONFIG_DEBUG_SPINLOCK_SLEEP is not set | ||
705 | # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set | ||
706 | # CONFIG_DEBUG_KOBJECT is not set | ||
707 | CONFIG_DEBUG_BUGVERBOSE=y | ||
708 | # CONFIG_DEBUG_INFO is not set | ||
709 | # CONFIG_DEBUG_VM is not set | ||
710 | # CONFIG_DEBUG_LIST is not set | ||
711 | # CONFIG_DEBUG_SG is not set | ||
712 | CONFIG_FRAME_POINTER=y | ||
713 | CONFIG_FORCED_INLINING=y | ||
714 | # CONFIG_BOOT_PRINTK_DELAY is not set | ||
715 | # CONFIG_FAULT_INJECTION is not set | ||
716 | # CONFIG_SAMPLES is not set | ||
717 | # CONFIG_EARLY_PRINTK is not set | ||
718 | CONFIG_SH64_PROC_TLB=y | ||
719 | CONFIG_SH64_PROC_ASIDS=y | ||
720 | CONFIG_SH64_SR_WATCH=y | ||
721 | # CONFIG_POOR_MANS_STRACE is not set | ||
722 | # CONFIG_SH_NO_BSS_INIT is not set | ||
723 | |||
724 | # | ||
725 | # Security options | ||
726 | # | ||
727 | # CONFIG_KEYS is not set | ||
728 | # CONFIG_SECURITY is not set | ||
729 | # CONFIG_SECURITY_FILE_CAPABILITIES is not set | ||
730 | # CONFIG_CRYPTO is not set | ||
731 | |||
732 | # | ||
733 | # Library routines | ||
734 | # | ||
735 | CONFIG_BITREVERSE=y | ||
736 | # CONFIG_CRC_CCITT is not set | ||
737 | # CONFIG_CRC16 is not set | ||
738 | # CONFIG_CRC_ITU_T is not set | ||
739 | CONFIG_CRC32=y | ||
740 | # CONFIG_CRC7 is not set | ||
741 | # CONFIG_LIBCRC32C is not set | ||
742 | CONFIG_PLIST=y | ||
743 | CONFIG_HAS_IOMEM=y | ||
744 | CONFIG_HAS_IOPORT=y | ||
745 | CONFIG_HAS_DMA=y | ||
diff --git a/arch/sh64/configs/sim_defconfig b/arch/sh64/configs/sim_defconfig deleted file mode 100644 index 18476cc522c3..000000000000 --- a/arch/sh64/configs/sim_defconfig +++ /dev/null | |||
@@ -1,558 +0,0 @@ | |||
1 | # | ||
2 | # Automatically generated make config: don't edit | ||
3 | # Linux kernel version: 2.6.24-rc1 | ||
4 | # Fri Nov 2 14:36:08 2007 | ||
5 | # | ||
6 | CONFIG_SUPERH=y | ||
7 | CONFIG_SUPERH64=y | ||
8 | CONFIG_MMU=y | ||
9 | CONFIG_QUICKLIST=y | ||
10 | CONFIG_RWSEM_GENERIC_SPINLOCK=y | ||
11 | CONFIG_GENERIC_FIND_NEXT_BIT=y | ||
12 | CONFIG_GENERIC_HWEIGHT=y | ||
13 | CONFIG_GENERIC_CALIBRATE_DELAY=y | ||
14 | CONFIG_GENERIC_HARDIRQS=y | ||
15 | CONFIG_GENERIC_IRQ_PROBE=y | ||
16 | # CONFIG_ARCH_HAS_ILOG2_U32 is not set | ||
17 | # CONFIG_ARCH_HAS_ILOG2_U64 is not set | ||
18 | CONFIG_ARCH_NO_VIRT_TO_BUS=y | ||
19 | CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" | ||
20 | |||
21 | # | ||
22 | # General setup | ||
23 | # | ||
24 | CONFIG_EXPERIMENTAL=y | ||
25 | CONFIG_BROKEN_ON_SMP=y | ||
26 | CONFIG_LOCK_KERNEL=y | ||
27 | CONFIG_INIT_ENV_ARG_LIMIT=32 | ||
28 | CONFIG_LOCALVERSION="" | ||
29 | CONFIG_LOCALVERSION_AUTO=y | ||
30 | CONFIG_SWAP=y | ||
31 | # CONFIG_SYSVIPC is not set | ||
32 | # CONFIG_BSD_PROCESS_ACCT is not set | ||
33 | # CONFIG_USER_NS is not set | ||
34 | # CONFIG_IKCONFIG is not set | ||
35 | CONFIG_LOG_BUF_SHIFT=14 | ||
36 | # CONFIG_CGROUPS is not set | ||
37 | CONFIG_FAIR_GROUP_SCHED=y | ||
38 | CONFIG_FAIR_USER_SCHED=y | ||
39 | # CONFIG_FAIR_CGROUP_SCHED is not set | ||
40 | CONFIG_SYSFS_DEPRECATED=y | ||
41 | # CONFIG_RELAY is not set | ||
42 | # CONFIG_BLK_DEV_INITRD is not set | ||
43 | # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set | ||
44 | CONFIG_SYSCTL=y | ||
45 | # CONFIG_EMBEDDED is not set | ||
46 | CONFIG_UID16=y | ||
47 | CONFIG_SYSCTL_SYSCALL=y | ||
48 | CONFIG_KALLSYMS=y | ||
49 | # CONFIG_KALLSYMS_ALL is not set | ||
50 | # CONFIG_KALLSYMS_EXTRA_PASS is not set | ||
51 | CONFIG_HOTPLUG=y | ||
52 | CONFIG_PRINTK=y | ||
53 | CONFIG_BUG=y | ||
54 | CONFIG_ELF_CORE=y | ||
55 | CONFIG_BASE_FULL=y | ||
56 | CONFIG_FUTEX=y | ||
57 | CONFIG_ANON_INODES=y | ||
58 | CONFIG_EPOLL=y | ||
59 | CONFIG_SIGNALFD=y | ||
60 | CONFIG_EVENTFD=y | ||
61 | CONFIG_SHMEM=y | ||
62 | CONFIG_VM_EVENT_COUNTERS=y | ||
63 | CONFIG_SLAB=y | ||
64 | # CONFIG_SLUB is not set | ||
65 | # CONFIG_SLOB is not set | ||
66 | CONFIG_RT_MUTEXES=y | ||
67 | # CONFIG_TINY_SHMEM is not set | ||
68 | CONFIG_BASE_SMALL=0 | ||
69 | # CONFIG_MODULES is not set | ||
70 | CONFIG_BLOCK=y | ||
71 | # CONFIG_LBD is not set | ||
72 | # CONFIG_BLK_DEV_IO_TRACE is not set | ||
73 | # CONFIG_LSF is not set | ||
74 | # CONFIG_BLK_DEV_BSG is not set | ||
75 | |||
76 | # | ||
77 | # IO Schedulers | ||
78 | # | ||
79 | CONFIG_IOSCHED_NOOP=y | ||
80 | CONFIG_IOSCHED_AS=y | ||
81 | CONFIG_IOSCHED_DEADLINE=y | ||
82 | CONFIG_IOSCHED_CFQ=y | ||
83 | # CONFIG_DEFAULT_AS is not set | ||
84 | # CONFIG_DEFAULT_DEADLINE is not set | ||
85 | CONFIG_DEFAULT_CFQ=y | ||
86 | # CONFIG_DEFAULT_NOOP is not set | ||
87 | CONFIG_DEFAULT_IOSCHED="cfq" | ||
88 | |||
89 | # | ||
90 | # System type | ||
91 | # | ||
92 | CONFIG_SH_SIMULATOR=y | ||
93 | # CONFIG_SH_CAYMAN is not set | ||
94 | # CONFIG_SH_HARP is not set | ||
95 | CONFIG_CPU_SH5=y | ||
96 | CONFIG_CPU_SUBTYPE_SH5_101=y | ||
97 | # CONFIG_CPU_SUBTYPE_SH5_103 is not set | ||
98 | CONFIG_LITTLE_ENDIAN=y | ||
99 | # CONFIG_BIG_ENDIAN is not set | ||
100 | CONFIG_SH_FPU=y | ||
101 | # CONFIG_SH64_FPU_DENORM_FLUSH is not set | ||
102 | CONFIG_SH64_PGTABLE_2_LEVEL=y | ||
103 | # CONFIG_SH64_PGTABLE_3_LEVEL is not set | ||
104 | CONFIG_HUGETLB_PAGE_SIZE_64K=y | ||
105 | # CONFIG_HUGETLB_PAGE_SIZE_1MB is not set | ||
106 | # CONFIG_HUGETLB_PAGE_SIZE_512MB is not set | ||
107 | CONFIG_SH64_USER_MISALIGNED_FIXUP=y | ||
108 | |||
109 | # | ||
110 | # Memory options | ||
111 | # | ||
112 | CONFIG_CACHED_MEMORY_OFFSET=0x20000000 | ||
113 | CONFIG_MEMORY_START=0x80000000 | ||
114 | CONFIG_MEMORY_SIZE_IN_MB=128 | ||
115 | |||
116 | # | ||
117 | # Cache options | ||
118 | # | ||
119 | # CONFIG_DCACHE_WRITE_BACK is not set | ||
120 | # CONFIG_DCACHE_WRITE_THROUGH is not set | ||
121 | CONFIG_DCACHE_DISABLED=y | ||
122 | # CONFIG_ICACHE_DISABLED is not set | ||
123 | CONFIG_PCIDEVICE_MEMORY_START=C0000000 | ||
124 | CONFIG_DEVICE_MEMORY_START=E0000000 | ||
125 | CONFIG_FLASH_MEMORY_START=0x00000000 | ||
126 | CONFIG_PCI_BLOCK_START=0x40000000 | ||
127 | |||
128 | # | ||
129 | # CPU Subtype specific options | ||
130 | # | ||
131 | CONFIG_SH64_ID2815_WORKAROUND=y | ||
132 | |||
133 | # | ||
134 | # Misc options | ||
135 | # | ||
136 | # CONFIG_SH_DMA is not set | ||
137 | CONFIG_PREEMPT=y | ||
138 | CONFIG_SELECT_MEMORY_MODEL=y | ||
139 | CONFIG_FLATMEM_MANUAL=y | ||
140 | # CONFIG_DISCONTIGMEM_MANUAL is not set | ||
141 | # CONFIG_SPARSEMEM_MANUAL is not set | ||
142 | CONFIG_FLATMEM=y | ||
143 | CONFIG_FLAT_NODE_MEM_MAP=y | ||
144 | # CONFIG_SPARSEMEM_STATIC is not set | ||
145 | # CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set | ||
146 | CONFIG_SPLIT_PTLOCK_CPUS=4 | ||
147 | # CONFIG_RESOURCES_64BIT is not set | ||
148 | CONFIG_ZONE_DMA_FLAG=0 | ||
149 | CONFIG_NR_QUICK=1 | ||
150 | |||
151 | # | ||
152 | # Bus options (PCI, PCMCIA, EISA, MCA, ISA) | ||
153 | # | ||
154 | # CONFIG_ARCH_SUPPORTS_MSI is not set | ||
155 | # CONFIG_PCCARD is not set | ||
156 | |||
157 | # | ||
158 | # Executable file formats | ||
159 | # | ||
160 | CONFIG_BINFMT_ELF=y | ||
161 | # CONFIG_BINFMT_MISC is not set | ||
162 | |||
163 | # | ||
164 | # Networking | ||
165 | # | ||
166 | # CONFIG_NET is not set | ||
167 | |||
168 | # | ||
169 | # Device Drivers | ||
170 | # | ||
171 | |||
172 | # | ||
173 | # Generic Driver Options | ||
174 | # | ||
175 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | ||
176 | CONFIG_STANDALONE=y | ||
177 | CONFIG_PREVENT_FIRMWARE_BUILD=y | ||
178 | # CONFIG_FW_LOADER is not set | ||
179 | # CONFIG_DEBUG_DRIVER is not set | ||
180 | # CONFIG_DEBUG_DEVRES is not set | ||
181 | # CONFIG_SYS_HYPERVISOR is not set | ||
182 | # CONFIG_MTD is not set | ||
183 | # CONFIG_PARPORT is not set | ||
184 | # CONFIG_BLK_DEV is not set | ||
185 | # CONFIG_MISC_DEVICES is not set | ||
186 | # CONFIG_IDE is not set | ||
187 | |||
188 | # | ||
189 | # SCSI device support | ||
190 | # | ||
191 | # CONFIG_RAID_ATTRS is not set | ||
192 | CONFIG_SCSI=y | ||
193 | CONFIG_SCSI_DMA=y | ||
194 | # CONFIG_SCSI_TGT is not set | ||
195 | # CONFIG_SCSI_NETLINK is not set | ||
196 | CONFIG_SCSI_PROC_FS=y | ||
197 | |||
198 | # | ||
199 | # SCSI support type (disk, tape, CD-ROM) | ||
200 | # | ||
201 | CONFIG_BLK_DEV_SD=y | ||
202 | # CONFIG_CHR_DEV_ST is not set | ||
203 | # CONFIG_CHR_DEV_OSST is not set | ||
204 | # CONFIG_BLK_DEV_SR is not set | ||
205 | # CONFIG_CHR_DEV_SG is not set | ||
206 | # CONFIG_CHR_DEV_SCH is not set | ||
207 | |||
208 | # | ||
209 | # Some SCSI devices (e.g. CD jukebox) support multiple LUNs | ||
210 | # | ||
211 | CONFIG_SCSI_MULTI_LUN=y | ||
212 | # CONFIG_SCSI_CONSTANTS is not set | ||
213 | # CONFIG_SCSI_LOGGING is not set | ||
214 | # CONFIG_SCSI_SCAN_ASYNC is not set | ||
215 | |||
216 | # | ||
217 | # SCSI Transports | ||
218 | # | ||
219 | CONFIG_SCSI_SPI_ATTRS=y | ||
220 | # CONFIG_SCSI_FC_ATTRS is not set | ||
221 | # CONFIG_SCSI_SAS_LIBSAS is not set | ||
222 | # CONFIG_SCSI_SRP_ATTRS is not set | ||
223 | CONFIG_SCSI_LOWLEVEL=y | ||
224 | # CONFIG_SCSI_DEBUG is not set | ||
225 | # CONFIG_ATA is not set | ||
226 | # CONFIG_MD is not set | ||
227 | # CONFIG_PHONE is not set | ||
228 | |||
229 | # | ||
230 | # Input device support | ||
231 | # | ||
232 | CONFIG_INPUT=y | ||
233 | # CONFIG_INPUT_FF_MEMLESS is not set | ||
234 | # CONFIG_INPUT_POLLDEV is not set | ||
235 | |||
236 | # | ||
237 | # Userland interfaces | ||
238 | # | ||
239 | CONFIG_INPUT_MOUSEDEV=y | ||
240 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set | ||
241 | CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 | ||
242 | CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 | ||
243 | # CONFIG_INPUT_JOYDEV is not set | ||
244 | # CONFIG_INPUT_EVDEV is not set | ||
245 | # CONFIG_INPUT_EVBUG is not set | ||
246 | |||
247 | # | ||
248 | # Input Device Drivers | ||
249 | # | ||
250 | # CONFIG_INPUT_KEYBOARD is not set | ||
251 | # CONFIG_INPUT_MOUSE is not set | ||
252 | # CONFIG_INPUT_JOYSTICK is not set | ||
253 | # CONFIG_INPUT_TABLET is not set | ||
254 | # CONFIG_INPUT_TOUCHSCREEN is not set | ||
255 | # CONFIG_INPUT_MISC is not set | ||
256 | |||
257 | # | ||
258 | # Hardware I/O ports | ||
259 | # | ||
260 | # CONFIG_SERIO is not set | ||
261 | # CONFIG_GAMEPORT is not set | ||
262 | |||
263 | # | ||
264 | # Character devices | ||
265 | # | ||
266 | CONFIG_VT=y | ||
267 | CONFIG_VT_CONSOLE=y | ||
268 | CONFIG_HW_CONSOLE=y | ||
269 | # CONFIG_VT_HW_CONSOLE_BINDING is not set | ||
270 | # CONFIG_SERIAL_NONSTANDARD is not set | ||
271 | |||
272 | # | ||
273 | # Serial drivers | ||
274 | # | ||
275 | # CONFIG_SERIAL_8250 is not set | ||
276 | |||
277 | # | ||
278 | # Non-8250 serial port support | ||
279 | # | ||
280 | CONFIG_SERIAL_SH_SCI=y | ||
281 | CONFIG_SERIAL_SH_SCI_NR_UARTS=2 | ||
282 | CONFIG_SERIAL_SH_SCI_CONSOLE=y | ||
283 | CONFIG_SERIAL_CORE=y | ||
284 | CONFIG_SERIAL_CORE_CONSOLE=y | ||
285 | CONFIG_UNIX98_PTYS=y | ||
286 | # CONFIG_LEGACY_PTYS is not set | ||
287 | # CONFIG_IPMI_HANDLER is not set | ||
288 | # CONFIG_HW_RANDOM is not set | ||
289 | # CONFIG_R3964 is not set | ||
290 | # CONFIG_RAW_DRIVER is not set | ||
291 | # CONFIG_TCG_TPM is not set | ||
292 | # CONFIG_I2C is not set | ||
293 | |||
294 | # | ||
295 | # SPI support | ||
296 | # | ||
297 | # CONFIG_SPI is not set | ||
298 | # CONFIG_SPI_MASTER is not set | ||
299 | # CONFIG_W1 is not set | ||
300 | # CONFIG_POWER_SUPPLY is not set | ||
301 | # CONFIG_HWMON is not set | ||
302 | # CONFIG_WATCHDOG is not set | ||
303 | |||
304 | # | ||
305 | # Sonics Silicon Backplane | ||
306 | # | ||
307 | CONFIG_SSB_POSSIBLE=y | ||
308 | # CONFIG_SSB is not set | ||
309 | |||
310 | # | ||
311 | # Multifunction device drivers | ||
312 | # | ||
313 | # CONFIG_MFD_SM501 is not set | ||
314 | |||
315 | # | ||
316 | # Multimedia devices | ||
317 | # | ||
318 | # CONFIG_VIDEO_DEV is not set | ||
319 | CONFIG_DAB=y | ||
320 | |||
321 | # | ||
322 | # Graphics support | ||
323 | # | ||
324 | # CONFIG_VGASTATE is not set | ||
325 | CONFIG_VIDEO_OUTPUT_CONTROL=y | ||
326 | CONFIG_FB=y | ||
327 | CONFIG_FIRMWARE_EDID=y | ||
328 | # CONFIG_FB_DDC is not set | ||
329 | # CONFIG_FB_CFB_FILLRECT is not set | ||
330 | # CONFIG_FB_CFB_COPYAREA is not set | ||
331 | # CONFIG_FB_CFB_IMAGEBLIT is not set | ||
332 | # CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set | ||
333 | # CONFIG_FB_SYS_FILLRECT is not set | ||
334 | # CONFIG_FB_SYS_COPYAREA is not set | ||
335 | # CONFIG_FB_SYS_IMAGEBLIT is not set | ||
336 | # CONFIG_FB_SYS_FOPS is not set | ||
337 | CONFIG_FB_DEFERRED_IO=y | ||
338 | # CONFIG_FB_SVGALIB is not set | ||
339 | # CONFIG_FB_MACMODES is not set | ||
340 | # CONFIG_FB_BACKLIGHT is not set | ||
341 | CONFIG_FB_MODE_HELPERS=y | ||
342 | # CONFIG_FB_TILEBLITTING is not set | ||
343 | |||
344 | # | ||
345 | # Frame buffer hardware drivers | ||
346 | # | ||
347 | # CONFIG_FB_S1D13XXX is not set | ||
348 | # CONFIG_FB_VIRTUAL is not set | ||
349 | # CONFIG_BACKLIGHT_LCD_SUPPORT is not set | ||
350 | |||
351 | # | ||
352 | # Display device support | ||
353 | # | ||
354 | # CONFIG_DISPLAY_SUPPORT is not set | ||
355 | |||
356 | # | ||
357 | # Console display driver support | ||
358 | # | ||
359 | CONFIG_DUMMY_CONSOLE=y | ||
360 | CONFIG_FRAMEBUFFER_CONSOLE=y | ||
361 | # CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set | ||
362 | # CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set | ||
363 | CONFIG_FONTS=y | ||
364 | # CONFIG_FONT_8x8 is not set | ||
365 | CONFIG_FONT_8x16=y | ||
366 | # CONFIG_FONT_6x11 is not set | ||
367 | # CONFIG_FONT_7x14 is not set | ||
368 | # CONFIG_FONT_PEARL_8x8 is not set | ||
369 | # CONFIG_FONT_ACORN_8x8 is not set | ||
370 | # CONFIG_FONT_MINI_4x6 is not set | ||
371 | # CONFIG_FONT_SUN8x16 is not set | ||
372 | # CONFIG_FONT_SUN12x22 is not set | ||
373 | # CONFIG_FONT_10x18 is not set | ||
374 | CONFIG_LOGO=y | ||
375 | # CONFIG_LOGO_LINUX_MONO is not set | ||
376 | # CONFIG_LOGO_LINUX_VGA16 is not set | ||
377 | # CONFIG_LOGO_LINUX_CLUT224 is not set | ||
378 | # CONFIG_LOGO_SUPERH_MONO is not set | ||
379 | # CONFIG_LOGO_SUPERH_VGA16 is not set | ||
380 | CONFIG_LOGO_SUPERH_CLUT224=y | ||
381 | |||
382 | # | ||
383 | # Sound | ||
384 | # | ||
385 | # CONFIG_SOUND is not set | ||
386 | # CONFIG_HID_SUPPORT is not set | ||
387 | # CONFIG_USB_SUPPORT is not set | ||
388 | # CONFIG_MMC is not set | ||
389 | # CONFIG_NEW_LEDS is not set | ||
390 | # CONFIG_RTC_CLASS is not set | ||
391 | |||
392 | # | ||
393 | # Userspace I/O | ||
394 | # | ||
395 | # CONFIG_UIO is not set | ||
396 | |||
397 | # | ||
398 | # File systems | ||
399 | # | ||
400 | CONFIG_EXT2_FS=y | ||
401 | # CONFIG_EXT2_FS_XATTR is not set | ||
402 | # CONFIG_EXT2_FS_XIP is not set | ||
403 | CONFIG_EXT3_FS=y | ||
404 | CONFIG_EXT3_FS_XATTR=y | ||
405 | # CONFIG_EXT3_FS_POSIX_ACL is not set | ||
406 | # CONFIG_EXT3_FS_SECURITY is not set | ||
407 | # CONFIG_EXT4DEV_FS is not set | ||
408 | CONFIG_JBD=y | ||
409 | # CONFIG_JBD_DEBUG is not set | ||
410 | CONFIG_FS_MBCACHE=y | ||
411 | # CONFIG_REISERFS_FS is not set | ||
412 | # CONFIG_JFS_FS is not set | ||
413 | # CONFIG_FS_POSIX_ACL is not set | ||
414 | # CONFIG_XFS_FS is not set | ||
415 | # CONFIG_GFS2_FS is not set | ||
416 | CONFIG_MINIX_FS=y | ||
417 | CONFIG_ROMFS_FS=y | ||
418 | CONFIG_INOTIFY=y | ||
419 | CONFIG_INOTIFY_USER=y | ||
420 | # CONFIG_QUOTA is not set | ||
421 | CONFIG_DNOTIFY=y | ||
422 | # CONFIG_AUTOFS_FS is not set | ||
423 | # CONFIG_AUTOFS4_FS is not set | ||
424 | # CONFIG_FUSE_FS is not set | ||
425 | |||
426 | # | ||
427 | # CD-ROM/DVD Filesystems | ||
428 | # | ||
429 | # CONFIG_ISO9660_FS is not set | ||
430 | # CONFIG_UDF_FS is not set | ||
431 | |||
432 | # | ||
433 | # DOS/FAT/NT Filesystems | ||
434 | # | ||
435 | # CONFIG_MSDOS_FS is not set | ||
436 | # CONFIG_VFAT_FS is not set | ||
437 | # CONFIG_NTFS_FS is not set | ||
438 | |||
439 | # | ||
440 | # Pseudo filesystems | ||
441 | # | ||
442 | CONFIG_PROC_FS=y | ||
443 | CONFIG_PROC_KCORE=y | ||
444 | CONFIG_PROC_SYSCTL=y | ||
445 | CONFIG_SYSFS=y | ||
446 | CONFIG_TMPFS=y | ||
447 | # CONFIG_TMPFS_POSIX_ACL is not set | ||
448 | CONFIG_HUGETLBFS=y | ||
449 | CONFIG_HUGETLB_PAGE=y | ||
450 | # CONFIG_CONFIGFS_FS is not set | ||
451 | |||
452 | # | ||
453 | # Miscellaneous filesystems | ||
454 | # | ||
455 | # CONFIG_ADFS_FS is not set | ||
456 | # CONFIG_AFFS_FS is not set | ||
457 | # CONFIG_HFS_FS is not set | ||
458 | # CONFIG_HFSPLUS_FS is not set | ||
459 | # CONFIG_BEFS_FS is not set | ||
460 | # CONFIG_BFS_FS is not set | ||
461 | # CONFIG_EFS_FS is not set | ||
462 | # CONFIG_CRAMFS is not set | ||
463 | # CONFIG_VXFS_FS is not set | ||
464 | # CONFIG_HPFS_FS is not set | ||
465 | # CONFIG_QNX4FS_FS is not set | ||
466 | # CONFIG_SYSV_FS is not set | ||
467 | # CONFIG_UFS_FS is not set | ||
468 | |||
469 | # | ||
470 | # Partition Types | ||
471 | # | ||
472 | CONFIG_PARTITION_ADVANCED=y | ||
473 | # CONFIG_ACORN_PARTITION is not set | ||
474 | # CONFIG_OSF_PARTITION is not set | ||
475 | # CONFIG_AMIGA_PARTITION is not set | ||
476 | # CONFIG_ATARI_PARTITION is not set | ||
477 | # CONFIG_MAC_PARTITION is not set | ||
478 | CONFIG_MSDOS_PARTITION=y | ||
479 | # CONFIG_BSD_DISKLABEL is not set | ||
480 | # CONFIG_MINIX_SUBPARTITION is not set | ||
481 | # CONFIG_SOLARIS_X86_PARTITION is not set | ||
482 | # CONFIG_UNIXWARE_DISKLABEL is not set | ||
483 | # CONFIG_LDM_PARTITION is not set | ||
484 | # CONFIG_SGI_PARTITION is not set | ||
485 | # CONFIG_ULTRIX_PARTITION is not set | ||
486 | # CONFIG_SUN_PARTITION is not set | ||
487 | # CONFIG_KARMA_PARTITION is not set | ||
488 | # CONFIG_EFI_PARTITION is not set | ||
489 | # CONFIG_SYSV68_PARTITION is not set | ||
490 | # CONFIG_NLS is not set | ||
491 | CONFIG_INSTRUMENTATION=y | ||
492 | CONFIG_PROFILING=y | ||
493 | # CONFIG_OPROFILE is not set | ||
494 | # CONFIG_MARKERS is not set | ||
495 | |||
496 | # | ||
497 | # Kernel hacking | ||
498 | # | ||
499 | # CONFIG_PRINTK_TIME is not set | ||
500 | CONFIG_ENABLE_WARN_DEPRECATED=y | ||
501 | CONFIG_ENABLE_MUST_CHECK=y | ||
502 | CONFIG_MAGIC_SYSRQ=y | ||
503 | # CONFIG_UNUSED_SYMBOLS is not set | ||
504 | CONFIG_DEBUG_FS=y | ||
505 | # CONFIG_HEADERS_CHECK is not set | ||
506 | CONFIG_DEBUG_KERNEL=y | ||
507 | # CONFIG_DEBUG_SHIRQ is not set | ||
508 | CONFIG_DETECT_SOFTLOCKUP=y | ||
509 | CONFIG_SCHED_DEBUG=y | ||
510 | CONFIG_SCHEDSTATS=y | ||
511 | # CONFIG_TIMER_STATS is not set | ||
512 | # CONFIG_DEBUG_SLAB is not set | ||
513 | # CONFIG_DEBUG_RT_MUTEXES is not set | ||
514 | # CONFIG_RT_MUTEX_TESTER is not set | ||
515 | # CONFIG_DEBUG_SPINLOCK is not set | ||
516 | # CONFIG_DEBUG_MUTEXES is not set | ||
517 | # CONFIG_DEBUG_SPINLOCK_SLEEP is not set | ||
518 | # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set | ||
519 | # CONFIG_DEBUG_KOBJECT is not set | ||
520 | CONFIG_DEBUG_BUGVERBOSE=y | ||
521 | # CONFIG_DEBUG_INFO is not set | ||
522 | # CONFIG_DEBUG_VM is not set | ||
523 | # CONFIG_DEBUG_LIST is not set | ||
524 | # CONFIG_DEBUG_SG is not set | ||
525 | CONFIG_FRAME_POINTER=y | ||
526 | CONFIG_FORCED_INLINING=y | ||
527 | # CONFIG_BOOT_PRINTK_DELAY is not set | ||
528 | # CONFIG_FAULT_INJECTION is not set | ||
529 | # CONFIG_SAMPLES is not set | ||
530 | # CONFIG_EARLY_PRINTK is not set | ||
531 | CONFIG_SH64_PROC_TLB=y | ||
532 | CONFIG_SH64_PROC_ASIDS=y | ||
533 | CONFIG_SH64_SR_WATCH=y | ||
534 | # CONFIG_POOR_MANS_STRACE is not set | ||
535 | CONFIG_SH_NO_BSS_INIT=y | ||
536 | |||
537 | # | ||
538 | # Security options | ||
539 | # | ||
540 | # CONFIG_KEYS is not set | ||
541 | # CONFIG_SECURITY is not set | ||
542 | # CONFIG_SECURITY_FILE_CAPABILITIES is not set | ||
543 | # CONFIG_CRYPTO is not set | ||
544 | |||
545 | # | ||
546 | # Library routines | ||
547 | # | ||
548 | CONFIG_BITREVERSE=y | ||
549 | # CONFIG_CRC_CCITT is not set | ||
550 | # CONFIG_CRC16 is not set | ||
551 | # CONFIG_CRC_ITU_T is not set | ||
552 | CONFIG_CRC32=y | ||
553 | # CONFIG_CRC7 is not set | ||
554 | # CONFIG_LIBCRC32C is not set | ||
555 | CONFIG_PLIST=y | ||
556 | CONFIG_HAS_IOMEM=y | ||
557 | CONFIG_HAS_IOPORT=y | ||
558 | CONFIG_HAS_DMA=y | ||
diff --git a/arch/sh64/kernel/Makefile b/arch/sh64/kernel/Makefile deleted file mode 100644 index e3467bda6167..000000000000 --- a/arch/sh64/kernel/Makefile +++ /dev/null | |||
@@ -1,36 +0,0 @@ | |||
1 | # | ||
2 | # This file is subject to the terms and conditions of the GNU General Public | ||
3 | # License. See the file "COPYING" in the main directory of this archive | ||
4 | # for more details. | ||
5 | # | ||
6 | # Copyright (C) 2000, 2001 Paolo Alberelli | ||
7 | # Copyright (C) 2003 Paul Mundt | ||
8 | # | ||
9 | # Makefile for the Linux sh64 kernel. | ||
10 | # | ||
11 | # Note! Dependencies are done automagically by 'make dep', which also | ||
12 | # removes any old dependencies. DON'T put your own dependencies here | ||
13 | # unless it's something special (ie not a .c file). | ||
14 | # | ||
15 | |||
16 | extra-y := head.o init_task.o vmlinux.lds | ||
17 | |||
18 | obj-y := process.o signal.o entry.o traps.o irq.o irq_intc.o \ | ||
19 | ptrace.o setup.o time.o sys_sh64.o semaphore.o sh_ksyms.o \ | ||
20 | switchto.o syscalls.o | ||
21 | |||
22 | obj-$(CONFIG_HEARTBEAT) += led.o | ||
23 | obj-$(CONFIG_SH_ALPHANUMERIC) += alphanum.o | ||
24 | obj-$(CONFIG_SH_DMA) += dma.o | ||
25 | obj-$(CONFIG_SH_FPU) += fpu.o | ||
26 | obj-$(CONFIG_EARLY_PRINTK) += early_printk.o | ||
27 | obj-$(CONFIG_KALLSYMS) += unwind.o | ||
28 | obj-$(CONFIG_PCI) += pcibios.o | ||
29 | obj-$(CONFIG_MODULES) += module.o | ||
30 | |||
31 | ifeq ($(CONFIG_PCI),y) | ||
32 | obj-$(CONFIG_CPU_SH5) += pci_sh5.o | ||
33 | endif | ||
34 | |||
35 | USE_STANDARD_AS_RULE := true | ||
36 | |||
diff --git a/arch/sh64/kernel/alphanum.c b/arch/sh64/kernel/alphanum.c deleted file mode 100644 index d1619d95fbaa..000000000000 --- a/arch/sh64/kernel/alphanum.c +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | /* | ||
2 | * arch/sh64/kernel/alphanum.c | ||
3 | * | ||
4 | * Copyright (C) 2002 Stuart Menefy <stuart.menefy@st.com> | ||
5 | * | ||
6 | * May be copied or modified under the terms of the GNU General Public | ||
7 | * License. See linux/COPYING for more information. | ||
8 | * | ||
9 | * Machine-independent functions for handling 8-digit alphanumeric display | ||
10 | * (e.g. Agilent HDSP-253x) | ||
11 | */ | ||
12 | #include <linux/stddef.h> | ||
13 | #include <linux/sched.h> | ||
14 | |||
15 | void mach_alphanum(int pos, unsigned char val); | ||
16 | |||
17 | void print_seg(char *file, int line) | ||
18 | { | ||
19 | int i; | ||
20 | unsigned int nibble; | ||
21 | |||
22 | for (i = 0; i < 5; i++) { | ||
23 | mach_alphanum(i, file[i]); | ||
24 | } | ||
25 | |||
26 | for (i = 0; i < 3; i++) { | ||
27 | nibble = ((line >> (i * 4)) & 0xf); | ||
28 | mach_alphanum(7 - i, nibble + ((nibble > 9) ? 55 : 48)); | ||
29 | } | ||
30 | } | ||
31 | |||
32 | void print_seg_num(unsigned num) | ||
33 | { | ||
34 | int i; | ||
35 | unsigned int nibble; | ||
36 | |||
37 | for (i = 0; i < 8; i++) { | ||
38 | nibble = ((num >> (i * 4)) & 0xf); | ||
39 | |||
40 | mach_alphanum(7 - i, nibble + ((nibble > 9) ? 55 : 48)); | ||
41 | } | ||
42 | } | ||
43 | |||
diff --git a/arch/sh64/kernel/asm-offsets.c b/arch/sh64/kernel/asm-offsets.c deleted file mode 100644 index ca76537c16c0..000000000000 --- a/arch/sh64/kernel/asm-offsets.c +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | /* | ||
2 | * This program is used to generate definitions needed by | ||
3 | * assembly language modules. | ||
4 | * | ||
5 | * We use the technique used in the OSF Mach kernel code: | ||
6 | * generate asm statements containing #defines, | ||
7 | * compile this file to assembler, and then extract the | ||
8 | * #defines from the assembly-language output. | ||
9 | */ | ||
10 | |||
11 | #include <linux/stddef.h> | ||
12 | #include <linux/types.h> | ||
13 | #include <linux/mm.h> | ||
14 | #include <asm/thread_info.h> | ||
15 | |||
16 | #define DEFINE(sym, val) \ | ||
17 | asm volatile("\n->" #sym " %0 " #val : : "i" (val)) | ||
18 | |||
19 | #define BLANK() asm volatile("\n->" : : ) | ||
20 | |||
21 | int main(void) | ||
22 | { | ||
23 | /* offsets into the thread_info struct */ | ||
24 | DEFINE(TI_TASK, offsetof(struct thread_info, task)); | ||
25 | DEFINE(TI_EXEC_DOMAIN, offsetof(struct thread_info, exec_domain)); | ||
26 | DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); | ||
27 | DEFINE(TI_PRE_COUNT, offsetof(struct thread_info, preempt_count)); | ||
28 | DEFINE(TI_CPU, offsetof(struct thread_info, cpu)); | ||
29 | DEFINE(TI_ADDR_LIMIT, offsetof(struct thread_info, addr_limit)); | ||
30 | DEFINE(TI_RESTART_BLOCK,offsetof(struct thread_info, restart_block)); | ||
31 | |||
32 | return 0; | ||
33 | } | ||
diff --git a/arch/sh64/kernel/dma.c b/arch/sh64/kernel/dma.c deleted file mode 100644 index 32c6f0549bf1..000000000000 --- a/arch/sh64/kernel/dma.c +++ /dev/null | |||
@@ -1,297 +0,0 @@ | |||
1 | /* | ||
2 | * arch/sh64/kernel/dma.c | ||
3 | * | ||
4 | * DMA routines for the SH-5 DMAC. | ||
5 | * | ||
6 | * Copyright (C) 2003 Paul Mundt | ||
7 | * | ||
8 | * This file is subject to the terms and conditions of the GNU General Public | ||
9 | * License. See the file "COPYING" in the main directory of this archive | ||
10 | * for more details. | ||
11 | */ | ||
12 | #include <linux/init.h> | ||
13 | #include <linux/module.h> | ||
14 | #include <linux/interrupt.h> | ||
15 | #include <linux/types.h> | ||
16 | #include <linux/irq.h> | ||
17 | #include <linux/spinlock.h> | ||
18 | #include <linux/mm.h> | ||
19 | #include <asm/hardware.h> | ||
20 | #include <asm/dma.h> | ||
21 | #include <asm/signal.h> | ||
22 | #include <asm/errno.h> | ||
23 | #include <asm/io.h> | ||
24 | |||
25 | typedef struct { | ||
26 | unsigned long dev_addr; | ||
27 | unsigned long mem_addr; | ||
28 | |||
29 | unsigned int mode; | ||
30 | unsigned int count; | ||
31 | } dma_info_t; | ||
32 | |||
33 | static dma_info_t dma_info[MAX_DMA_CHANNELS]; | ||
34 | static DEFINE_SPINLOCK(dma_spin_lock); | ||
35 | |||
36 | /* arch/sh64/kernel/irq_intc.c */ | ||
37 | extern void make_intc_irq(unsigned int irq); | ||
38 | |||
39 | /* DMAC Interrupts */ | ||
40 | #define DMA_IRQ_DMTE0 18 | ||
41 | #define DMA_IRQ_DERR 22 | ||
42 | |||
43 | #define DMAC_COMMON_BASE (dmac_base + 0x08) | ||
44 | #define DMAC_SAR_BASE (dmac_base + 0x10) | ||
45 | #define DMAC_DAR_BASE (dmac_base + 0x18) | ||
46 | #define DMAC_COUNT_BASE (dmac_base + 0x20) | ||
47 | #define DMAC_CTRL_BASE (dmac_base + 0x28) | ||
48 | #define DMAC_STATUS_BASE (dmac_base + 0x30) | ||
49 | |||
50 | #define DMAC_SAR(n) (DMAC_SAR_BASE + ((n) * 0x28)) | ||
51 | #define DMAC_DAR(n) (DMAC_DAR_BASE + ((n) * 0x28)) | ||
52 | #define DMAC_COUNT(n) (DMAC_COUNT_BASE + ((n) * 0x28)) | ||
53 | #define DMAC_CTRL(n) (DMAC_CTRL_BASE + ((n) * 0x28)) | ||
54 | #define DMAC_STATUS(n) (DMAC_STATUS_BASE + ((n) * 0x28)) | ||
55 | |||
56 | /* DMAC.COMMON Bit Definitions */ | ||
57 | #define DMAC_COMMON_PR 0x00000001 /* Priority */ | ||
58 | /* Bits 1-2 Reserved */ | ||
59 | #define DMAC_COMMON_ME 0x00000008 /* Master Enable */ | ||
60 | #define DMAC_COMMON_NMI 0x00000010 /* NMI Flag */ | ||
61 | /* Bits 5-6 Reserved */ | ||
62 | #define DMAC_COMMON_ER 0x00000780 /* Error Response */ | ||
63 | #define DMAC_COMMON_AAE 0x00007800 /* Address Alignment Error */ | ||
64 | /* Bits 15-63 Reserved */ | ||
65 | |||
66 | /* DMAC.SAR Bit Definitions */ | ||
67 | #define DMAC_SAR_ADDR 0xffffffff /* Source Address */ | ||
68 | |||
69 | /* DMAC.DAR Bit Definitions */ | ||
70 | #define DMAC_DAR_ADDR 0xffffffff /* Destination Address */ | ||
71 | |||
72 | /* DMAC.COUNT Bit Definitions */ | ||
73 | #define DMAC_COUNT_CNT 0xffffffff /* Transfer Count */ | ||
74 | |||
75 | /* DMAC.CTRL Bit Definitions */ | ||
76 | #define DMAC_CTRL_TS 0x00000007 /* Transfer Size */ | ||
77 | #define DMAC_CTRL_SI 0x00000018 /* Source Increment */ | ||
78 | #define DMAC_CTRL_DI 0x00000060 /* Destination Increment */ | ||
79 | #define DMAC_CTRL_RS 0x00000780 /* Resource Select */ | ||
80 | #define DMAC_CTRL_IE 0x00000800 /* Interrupt Enable */ | ||
81 | #define DMAC_CTRL_TE 0x00001000 /* Transfer Enable */ | ||
82 | /* Bits 15-63 Reserved */ | ||
83 | |||
84 | /* DMAC.STATUS Bit Definitions */ | ||
85 | #define DMAC_STATUS_TE 0x00000001 /* Transfer End */ | ||
86 | #define DMAC_STATUS_AAE 0x00000002 /* Address Alignment Error */ | ||
87 | /* Bits 2-63 Reserved */ | ||
88 | |||
89 | static unsigned long dmac_base; | ||
90 | |||
91 | void set_dma_count(unsigned int chan, unsigned int count); | ||
92 | void set_dma_addr(unsigned int chan, unsigned int addr); | ||
93 | |||
94 | static irqreturn_t dma_mte(int irq, void *dev_id, struct pt_regs *regs) | ||
95 | { | ||
96 | unsigned int chan = irq - DMA_IRQ_DMTE0; | ||
97 | dma_info_t *info = dma_info + chan; | ||
98 | u64 status; | ||
99 | |||
100 | if (info->mode & DMA_MODE_WRITE) { | ||
101 | sh64_out64(info->mem_addr & DMAC_SAR_ADDR, DMAC_SAR(chan)); | ||
102 | } else { | ||
103 | sh64_out64(info->mem_addr & DMAC_DAR_ADDR, DMAC_DAR(chan)); | ||
104 | } | ||
105 | |||
106 | set_dma_count(chan, info->count); | ||
107 | |||
108 | /* Clear the TE bit */ | ||
109 | status = sh64_in64(DMAC_STATUS(chan)); | ||
110 | status &= ~DMAC_STATUS_TE; | ||
111 | sh64_out64(status, DMAC_STATUS(chan)); | ||
112 | |||
113 | return IRQ_HANDLED; | ||
114 | } | ||
115 | |||
116 | static struct irqaction irq_dmte = { | ||
117 | .handler = dma_mte, | ||
118 | .flags = IRQF_DISABLED, | ||
119 | .name = "DMA MTE", | ||
120 | }; | ||
121 | |||
122 | static irqreturn_t dma_err(int irq, void *dev_id, struct pt_regs *regs) | ||
123 | { | ||
124 | u64 tmp; | ||
125 | u8 chan; | ||
126 | |||
127 | printk(KERN_NOTICE "DMAC: Got a DMA Error!\n"); | ||
128 | |||
129 | tmp = sh64_in64(DMAC_COMMON_BASE); | ||
130 | |||
131 | /* Check for the type of error */ | ||
132 | if ((chan = tmp & DMAC_COMMON_AAE)) { | ||
133 | /* It's an address alignment error.. */ | ||
134 | printk(KERN_NOTICE "DMAC: Alignment error on channel %d, ", chan); | ||
135 | |||
136 | printk(KERN_NOTICE "SAR: 0x%08llx, DAR: 0x%08llx, COUNT: %lld\n", | ||
137 | (sh64_in64(DMAC_SAR(chan)) & DMAC_SAR_ADDR), | ||
138 | (sh64_in64(DMAC_DAR(chan)) & DMAC_DAR_ADDR), | ||
139 | (sh64_in64(DMAC_COUNT(chan)) & DMAC_COUNT_CNT)); | ||
140 | |||
141 | } else if ((chan = tmp & DMAC_COMMON_ER)) { | ||
142 | /* Something else went wrong.. */ | ||
143 | printk(KERN_NOTICE "DMAC: Error on channel %d\n", chan); | ||
144 | } | ||
145 | |||
146 | /* Reset the ME bit to clear the interrupt */ | ||
147 | tmp |= DMAC_COMMON_ME; | ||
148 | sh64_out64(tmp, DMAC_COMMON_BASE); | ||
149 | |||
150 | return IRQ_HANDLED; | ||
151 | } | ||
152 | |||
153 | static struct irqaction irq_derr = { | ||
154 | .handler = dma_err, | ||
155 | .flags = IRQF_DISABLED, | ||
156 | .name = "DMA Error", | ||
157 | }; | ||
158 | |||
159 | static inline unsigned long calc_xmit_shift(unsigned int chan) | ||
160 | { | ||
161 | return sh64_in64(DMAC_CTRL(chan)) & 0x03; | ||
162 | } | ||
163 | |||
164 | void setup_dma(unsigned int chan, dma_info_t *info) | ||
165 | { | ||
166 | unsigned int irq = DMA_IRQ_DMTE0 + chan; | ||
167 | dma_info_t *dma = dma_info + chan; | ||
168 | |||
169 | make_intc_irq(irq); | ||
170 | setup_irq(irq, &irq_dmte); | ||
171 | dma = info; | ||
172 | } | ||
173 | |||
174 | void enable_dma(unsigned int chan) | ||
175 | { | ||
176 | u64 ctrl; | ||
177 | |||
178 | ctrl = sh64_in64(DMAC_CTRL(chan)); | ||
179 | ctrl |= DMAC_CTRL_TE; | ||
180 | sh64_out64(ctrl, DMAC_CTRL(chan)); | ||
181 | } | ||
182 | |||
183 | void disable_dma(unsigned int chan) | ||
184 | { | ||
185 | u64 ctrl; | ||
186 | |||
187 | ctrl = sh64_in64(DMAC_CTRL(chan)); | ||
188 | ctrl &= ~DMAC_CTRL_TE; | ||
189 | sh64_out64(ctrl, DMAC_CTRL(chan)); | ||
190 | } | ||
191 | |||
192 | void set_dma_mode(unsigned int chan, char mode) | ||
193 | { | ||
194 | dma_info_t *info = dma_info + chan; | ||
195 | |||
196 | info->mode = mode; | ||
197 | |||
198 | set_dma_addr(chan, info->mem_addr); | ||
199 | set_dma_count(chan, info->count); | ||
200 | } | ||
201 | |||
202 | void set_dma_addr(unsigned int chan, unsigned int addr) | ||
203 | { | ||
204 | dma_info_t *info = dma_info + chan; | ||
205 | unsigned long sar, dar; | ||
206 | |||
207 | info->mem_addr = addr; | ||
208 | sar = (info->mode & DMA_MODE_WRITE) ? info->mem_addr : info->dev_addr; | ||
209 | dar = (info->mode & DMA_MODE_WRITE) ? info->dev_addr : info->mem_addr; | ||
210 | |||
211 | sh64_out64(sar & DMAC_SAR_ADDR, DMAC_SAR(chan)); | ||
212 | sh64_out64(dar & DMAC_SAR_ADDR, DMAC_DAR(chan)); | ||
213 | } | ||
214 | |||
215 | void set_dma_count(unsigned int chan, unsigned int count) | ||
216 | { | ||
217 | dma_info_t *info = dma_info + chan; | ||
218 | u64 tmp; | ||
219 | |||
220 | info->count = count; | ||
221 | |||
222 | tmp = (info->count >> calc_xmit_shift(chan)) & DMAC_COUNT_CNT; | ||
223 | |||
224 | sh64_out64(tmp, DMAC_COUNT(chan)); | ||
225 | } | ||
226 | |||
227 | unsigned long claim_dma_lock(void) | ||
228 | { | ||
229 | unsigned long flags; | ||
230 | |||
231 | spin_lock_irqsave(&dma_spin_lock, flags); | ||
232 | |||
233 | return flags; | ||
234 | } | ||
235 | |||
236 | void release_dma_lock(unsigned long flags) | ||
237 | { | ||
238 | spin_unlock_irqrestore(&dma_spin_lock, flags); | ||
239 | } | ||
240 | |||
241 | int get_dma_residue(unsigned int chan) | ||
242 | { | ||
243 | return sh64_in64(DMAC_COUNT(chan) << calc_xmit_shift(chan)); | ||
244 | } | ||
245 | |||
246 | int __init init_dma(void) | ||
247 | { | ||
248 | struct vcr_info vcr; | ||
249 | u64 tmp; | ||
250 | |||
251 | /* Remap the DMAC */ | ||
252 | dmac_base = onchip_remap(PHYS_DMAC_BLOCK, 1024, "DMAC"); | ||
253 | if (!dmac_base) { | ||
254 | printk(KERN_ERR "Unable to remap DMAC\n"); | ||
255 | return -ENOMEM; | ||
256 | } | ||
257 | |||
258 | /* Report DMAC.VCR Info */ | ||
259 | vcr = sh64_get_vcr_info(dmac_base); | ||
260 | printk("DMAC: Module ID: 0x%04x, Module version: 0x%04x\n", | ||
261 | vcr.mod_id, vcr.mod_vers); | ||
262 | |||
263 | /* Set the ME bit */ | ||
264 | tmp = sh64_in64(DMAC_COMMON_BASE); | ||
265 | tmp |= DMAC_COMMON_ME; | ||
266 | sh64_out64(tmp, DMAC_COMMON_BASE); | ||
267 | |||
268 | /* Enable the DMAC Error Interrupt */ | ||
269 | make_intc_irq(DMA_IRQ_DERR); | ||
270 | setup_irq(DMA_IRQ_DERR, &irq_derr); | ||
271 | |||
272 | return 0; | ||
273 | } | ||
274 | |||
275 | static void __exit exit_dma(void) | ||
276 | { | ||
277 | onchip_unmap(dmac_base); | ||
278 | free_irq(DMA_IRQ_DERR, 0); | ||
279 | } | ||
280 | |||
281 | module_init(init_dma); | ||
282 | module_exit(exit_dma); | ||
283 | |||
284 | MODULE_AUTHOR("Paul Mundt"); | ||
285 | MODULE_DESCRIPTION("DMA API for SH-5 DMAC"); | ||
286 | MODULE_LICENSE("GPL"); | ||
287 | |||
288 | EXPORT_SYMBOL(setup_dma); | ||
289 | EXPORT_SYMBOL(claim_dma_lock); | ||
290 | EXPORT_SYMBOL(release_dma_lock); | ||
291 | EXPORT_SYMBOL(enable_dma); | ||
292 | EXPORT_SYMBOL(disable_dma); | ||
293 | EXPORT_SYMBOL(set_dma_mode); | ||
294 | EXPORT_SYMBOL(set_dma_addr); | ||
295 | EXPORT_SYMBOL(set_dma_count); | ||
296 | EXPORT_SYMBOL(get_dma_residue); | ||
297 | |||
diff --git a/arch/sh64/kernel/early_printk.c b/arch/sh64/kernel/early_printk.c deleted file mode 100644 index 4f9131123672..000000000000 --- a/arch/sh64/kernel/early_printk.c +++ /dev/null | |||
@@ -1,99 +0,0 @@ | |||
1 | /* | ||
2 | * arch/sh64/kernel/early_printk.c | ||
3 | * | ||
4 | * SH-5 Early SCIF console (cloned and hacked from sh implementation) | ||
5 | * | ||
6 | * Copyright (C) 2003, 2004 Paul Mundt <lethal@linux-sh.org> | ||
7 | * Copyright (C) 2002 M. R. Brown <mrbrown@0xd6.org> | ||
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 | #include <linux/console.h> | ||
14 | #include <linux/tty.h> | ||
15 | #include <linux/init.h> | ||
16 | #include <asm/io.h> | ||
17 | #include <asm/hardware.h> | ||
18 | |||
19 | #define SCIF_BASE_ADDR 0x01030000 | ||
20 | #define SCIF_ADDR_SH5 PHYS_PERIPHERAL_BLOCK+SCIF_BASE_ADDR | ||
21 | |||
22 | /* | ||
23 | * Fixed virtual address where SCIF is mapped (should already be done | ||
24 | * in arch/sh64/kernel/head.S!). | ||
25 | */ | ||
26 | #define SCIF_REG 0xfa030000 | ||
27 | |||
28 | enum { | ||
29 | SCIF_SCSMR2 = SCIF_REG + 0x00, | ||
30 | SCIF_SCBRR2 = SCIF_REG + 0x04, | ||
31 | SCIF_SCSCR2 = SCIF_REG + 0x08, | ||
32 | SCIF_SCFTDR2 = SCIF_REG + 0x0c, | ||
33 | SCIF_SCFSR2 = SCIF_REG + 0x10, | ||
34 | SCIF_SCFRDR2 = SCIF_REG + 0x14, | ||
35 | SCIF_SCFCR2 = SCIF_REG + 0x18, | ||
36 | SCIF_SCFDR2 = SCIF_REG + 0x1c, | ||
37 | SCIF_SCSPTR2 = SCIF_REG + 0x20, | ||
38 | SCIF_SCLSR2 = SCIF_REG + 0x24, | ||
39 | }; | ||
40 | |||
41 | static void sh_console_putc(int c) | ||
42 | { | ||
43 | while (!(ctrl_inw(SCIF_SCFSR2) & 0x20)) | ||
44 | cpu_relax(); | ||
45 | |||
46 | ctrl_outb(c, SCIF_SCFTDR2); | ||
47 | ctrl_outw((ctrl_inw(SCIF_SCFSR2) & 0x9f), SCIF_SCFSR2); | ||
48 | |||
49 | if (c == '\n') | ||
50 | sh_console_putc('\r'); | ||
51 | } | ||
52 | |||
53 | static void sh_console_flush(void) | ||
54 | { | ||
55 | ctrl_outw((ctrl_inw(SCIF_SCFSR2) & 0xbf), SCIF_SCFSR2); | ||
56 | |||
57 | while (!(ctrl_inw(SCIF_SCFSR2) & 0x40)) | ||
58 | cpu_relax(); | ||
59 | |||
60 | ctrl_outw((ctrl_inw(SCIF_SCFSR2) & 0xbf), SCIF_SCFSR2); | ||
61 | } | ||
62 | |||
63 | static void sh_console_write(struct console *con, const char *s, unsigned count) | ||
64 | { | ||
65 | while (count-- > 0) | ||
66 | sh_console_putc(*s++); | ||
67 | |||
68 | sh_console_flush(); | ||
69 | } | ||
70 | |||
71 | static int __init sh_console_setup(struct console *con, char *options) | ||
72 | { | ||
73 | con->cflag = CREAD | HUPCL | CLOCAL | B19200 | CS8; | ||
74 | |||
75 | return 0; | ||
76 | } | ||
77 | |||
78 | static struct console sh_console = { | ||
79 | .name = "scifcon", | ||
80 | .write = sh_console_write, | ||
81 | .setup = sh_console_setup, | ||
82 | .flags = CON_PRINTBUFFER | CON_BOOT, | ||
83 | .index = -1, | ||
84 | }; | ||
85 | |||
86 | void __init enable_early_printk(void) | ||
87 | { | ||
88 | ctrl_outb(0x2a, SCIF_SCBRR2); /* 19200bps */ | ||
89 | |||
90 | ctrl_outw(0x04, SCIF_SCFCR2); /* Reset TFRST */ | ||
91 | ctrl_outw(0x10, SCIF_SCFCR2); /* TTRG0=1 */ | ||
92 | |||
93 | ctrl_outw(0, SCIF_SCSPTR2); | ||
94 | ctrl_outw(0x60, SCIF_SCFSR2); | ||
95 | ctrl_outw(0, SCIF_SCLSR2); | ||
96 | ctrl_outw(0x30, SCIF_SCSCR2); | ||
97 | |||
98 | register_console(&sh_console); | ||
99 | } | ||
diff --git a/arch/sh64/kernel/init_task.c b/arch/sh64/kernel/init_task.c deleted file mode 100644 index deee8bfd3270..000000000000 --- a/arch/sh64/kernel/init_task.c +++ /dev/null | |||
@@ -1,46 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * arch/sh64/kernel/init_task.c | ||
7 | * | ||
8 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
9 | * Copyright (C) 2003 Paul Mundt | ||
10 | * | ||
11 | */ | ||
12 | #include <linux/rwsem.h> | ||
13 | #include <linux/mm.h> | ||
14 | #include <linux/sched.h> | ||
15 | #include <linux/init_task.h> | ||
16 | #include <linux/mqueue.h> | ||
17 | #include <linux/fs.h> | ||
18 | #include <asm/uaccess.h> | ||
19 | #include <asm/pgtable.h> | ||
20 | |||
21 | static struct fs_struct init_fs = INIT_FS; | ||
22 | static struct files_struct init_files = INIT_FILES; | ||
23 | static struct signal_struct init_signals = INIT_SIGNALS(init_signals); | ||
24 | static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); | ||
25 | struct mm_struct init_mm = INIT_MM(init_mm); | ||
26 | |||
27 | struct pt_regs fake_swapper_regs; | ||
28 | |||
29 | /* | ||
30 | * Initial thread structure. | ||
31 | * | ||
32 | * We need to make sure that this is THREAD_SIZE-byte aligned due | ||
33 | * to the way process stacks are handled. This is done by having a | ||
34 | * special "init_task" linker map entry.. | ||
35 | */ | ||
36 | union thread_union init_thread_union | ||
37 | __attribute__((__section__(".data.init_task"))) = | ||
38 | { INIT_THREAD_INFO(init_task) }; | ||
39 | |||
40 | /* | ||
41 | * Initial task structure. | ||
42 | * | ||
43 | * All other task structs will be allocated on slabs in fork.c | ||
44 | */ | ||
45 | struct task_struct init_task = INIT_TASK(init_task); | ||
46 | |||
diff --git a/arch/sh64/kernel/irq.c b/arch/sh64/kernel/irq.c deleted file mode 100644 index 9412b7166700..000000000000 --- a/arch/sh64/kernel/irq.c +++ /dev/null | |||
@@ -1,115 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * arch/sh64/kernel/irq.c | ||
7 | * | ||
8 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
9 | * Copyright (C) 2003 Paul Mundt | ||
10 | * | ||
11 | */ | ||
12 | |||
13 | /* | ||
14 | * IRQs are in fact implemented a bit like signal handlers for the kernel. | ||
15 | * Naturally it's not a 1:1 relation, but there are similarities. | ||
16 | */ | ||
17 | |||
18 | #include <linux/errno.h> | ||
19 | #include <linux/kernel_stat.h> | ||
20 | #include <linux/signal.h> | ||
21 | #include <linux/rwsem.h> | ||
22 | #include <linux/sched.h> | ||
23 | #include <linux/ioport.h> | ||
24 | #include <linux/interrupt.h> | ||
25 | #include <linux/timex.h> | ||
26 | #include <linux/slab.h> | ||
27 | #include <linux/random.h> | ||
28 | #include <linux/smp.h> | ||
29 | #include <linux/init.h> | ||
30 | #include <linux/seq_file.h> | ||
31 | #include <linux/bitops.h> | ||
32 | #include <asm/system.h> | ||
33 | #include <asm/io.h> | ||
34 | #include <asm/smp.h> | ||
35 | #include <asm/pgalloc.h> | ||
36 | #include <asm/delay.h> | ||
37 | #include <asm/irq.h> | ||
38 | #include <linux/irq.h> | ||
39 | |||
40 | void ack_bad_irq(unsigned int irq) | ||
41 | { | ||
42 | printk("unexpected IRQ trap at irq %02x\n", irq); | ||
43 | } | ||
44 | |||
45 | #if defined(CONFIG_PROC_FS) | ||
46 | int show_interrupts(struct seq_file *p, void *v) | ||
47 | { | ||
48 | int i = *(loff_t *) v, j; | ||
49 | struct irqaction * action; | ||
50 | unsigned long flags; | ||
51 | |||
52 | if (i == 0) { | ||
53 | seq_puts(p, " "); | ||
54 | for_each_online_cpu(j) | ||
55 | seq_printf(p, "CPU%d ",j); | ||
56 | seq_putc(p, '\n'); | ||
57 | } | ||
58 | |||
59 | if (i < NR_IRQS) { | ||
60 | spin_lock_irqsave(&irq_desc[i].lock, flags); | ||
61 | action = irq_desc[i].action; | ||
62 | if (!action) | ||
63 | goto unlock; | ||
64 | seq_printf(p, "%3d: ",i); | ||
65 | seq_printf(p, "%10u ", kstat_irqs(i)); | ||
66 | seq_printf(p, " %14s", irq_desc[i].chip->typename); | ||
67 | seq_printf(p, " %s", action->name); | ||
68 | |||
69 | for (action=action->next; action; action = action->next) | ||
70 | seq_printf(p, ", %s", action->name); | ||
71 | seq_putc(p, '\n'); | ||
72 | unlock: | ||
73 | spin_unlock_irqrestore(&irq_desc[i].lock, flags); | ||
74 | } | ||
75 | return 0; | ||
76 | } | ||
77 | #endif | ||
78 | |||
79 | /* | ||
80 | * do_NMI handles all Non-Maskable Interrupts. | ||
81 | */ | ||
82 | asmlinkage void do_NMI(unsigned long vector_num, struct pt_regs * regs) | ||
83 | { | ||
84 | if (regs->sr & 0x40000000) | ||
85 | printk("unexpected NMI trap in system mode\n"); | ||
86 | else | ||
87 | printk("unexpected NMI trap in user mode\n"); | ||
88 | |||
89 | /* No statistics */ | ||
90 | } | ||
91 | |||
92 | /* | ||
93 | * do_IRQ handles all normal device IRQ's. | ||
94 | */ | ||
95 | asmlinkage int do_IRQ(unsigned long vector_num, struct pt_regs * regs) | ||
96 | { | ||
97 | struct pt_regs *old_regs = set_irq_regs(regs); | ||
98 | int irq; | ||
99 | |||
100 | irq_enter(); | ||
101 | |||
102 | irq = irq_demux(vector_num); | ||
103 | |||
104 | if (irq >= 0) { | ||
105 | __do_IRQ(irq); | ||
106 | } else { | ||
107 | printk("unexpected IRQ trap at vector %03lx\n", vector_num); | ||
108 | } | ||
109 | |||
110 | irq_exit(); | ||
111 | |||
112 | set_irq_regs(old_regs); | ||
113 | return 1; | ||
114 | } | ||
115 | |||
diff --git a/arch/sh64/kernel/led.c b/arch/sh64/kernel/led.c deleted file mode 100644 index e35d3f667fb4..000000000000 --- a/arch/sh64/kernel/led.c +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | /* | ||
2 | * arch/sh64/kernel/led.c | ||
3 | * | ||
4 | * Copyright (C) 2002 Stuart Menefy <stuart.menefy@st.com> | ||
5 | * | ||
6 | * May be copied or modified under the terms of the GNU General Public | ||
7 | * License. See linux/COPYING for more information. | ||
8 | * | ||
9 | * Flash the LEDs | ||
10 | */ | ||
11 | #include <linux/stddef.h> | ||
12 | #include <linux/sched.h> | ||
13 | |||
14 | void mach_led(int pos, int val); | ||
15 | |||
16 | /* acts like an actual heart beat -- ie thump-thump-pause... */ | ||
17 | void heartbeat(void) | ||
18 | { | ||
19 | static unsigned int cnt = 0, period = 0, dist = 0; | ||
20 | |||
21 | if (cnt == 0 || cnt == dist) { | ||
22 | mach_led(-1, 1); | ||
23 | } else if (cnt == 7 || cnt == dist + 7) { | ||
24 | mach_led(-1, 0); | ||
25 | } | ||
26 | |||
27 | if (++cnt > period) { | ||
28 | cnt = 0; | ||
29 | |||
30 | /* | ||
31 | * The hyperbolic function below modifies the heartbeat period | ||
32 | * length in dependency of the current (5min) load. It goes | ||
33 | * through the points f(0)=126, f(1)=86, f(5)=51, f(inf)->30. | ||
34 | */ | ||
35 | period = ((672 << FSHIFT) / (5 * avenrun[0] + | ||
36 | (7 << FSHIFT))) + 30; | ||
37 | dist = period / 4; | ||
38 | } | ||
39 | } | ||
40 | |||
diff --git a/arch/sh64/kernel/module.c b/arch/sh64/kernel/module.c deleted file mode 100644 index 2598f6b88b44..000000000000 --- a/arch/sh64/kernel/module.c +++ /dev/null | |||
@@ -1,161 +0,0 @@ | |||
1 | /* Kernel module help for sh64. | ||
2 | |||
3 | This program is free software; you can redistribute it and/or modify | ||
4 | it under the terms of the GNU General Public License as published by | ||
5 | the Free Software Foundation; either version 2 of the License, or | ||
6 | (at your option) any later version. | ||
7 | |||
8 | This program is distributed in the hope that it will be useful, | ||
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | GNU General Public License for more details. | ||
12 | |||
13 | You should have received a copy of the GNU General Public License | ||
14 | along with this program; if not, write to the Free Software | ||
15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
16 | |||
17 | Copyright 2004 SuperH (UK) Ltd | ||
18 | Author: Richard Curnow | ||
19 | |||
20 | Based on the sh version, and on code from the sh64-specific parts of | ||
21 | modutils, originally written by Richard Curnow and Ben Gaster. | ||
22 | |||
23 | */ | ||
24 | #include <linux/moduleloader.h> | ||
25 | #include <linux/elf.h> | ||
26 | #include <linux/vmalloc.h> | ||
27 | #include <linux/fs.h> | ||
28 | #include <linux/string.h> | ||
29 | #include <linux/kernel.h> | ||
30 | |||
31 | #if 0 | ||
32 | #define DEBUGP printk | ||
33 | #else | ||
34 | #define DEBUGP(fmt...) | ||
35 | #endif | ||
36 | |||
37 | void *module_alloc(unsigned long size) | ||
38 | { | ||
39 | if (size == 0) | ||
40 | return NULL; | ||
41 | return vmalloc(size); | ||
42 | } | ||
43 | |||
44 | |||
45 | /* Free memory returned from module_alloc */ | ||
46 | void module_free(struct module *mod, void *module_region) | ||
47 | { | ||
48 | vfree(module_region); | ||
49 | /* FIXME: If module_region == mod->init_region, trim exception | ||
50 | table entries. */ | ||
51 | } | ||
52 | |||
53 | /* We don't need anything special. */ | ||
54 | int module_frob_arch_sections(Elf_Ehdr *hdr, | ||
55 | Elf_Shdr *sechdrs, | ||
56 | char *secstrings, | ||
57 | struct module *mod) | ||
58 | { | ||
59 | return 0; | ||
60 | } | ||
61 | |||
62 | int apply_relocate_add(Elf32_Shdr *sechdrs, | ||
63 | const char *strtab, | ||
64 | unsigned int symindex, | ||
65 | unsigned int relsec, | ||
66 | struct module *me) | ||
67 | { | ||
68 | unsigned int i; | ||
69 | Elf32_Rela *rel = (void *)sechdrs[relsec].sh_addr; | ||
70 | Elf32_Sym *sym; | ||
71 | Elf32_Addr relocation; | ||
72 | uint32_t *location; | ||
73 | int align; | ||
74 | int is_shmedia; | ||
75 | |||
76 | DEBUGP("Applying relocate section %u to %u\n", relsec, | ||
77 | sechdrs[relsec].sh_info); | ||
78 | for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) { | ||
79 | /* This is where to make the change */ | ||
80 | location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr | ||
81 | + rel[i].r_offset; | ||
82 | /* This is the symbol it is referring to. Note that all | ||
83 | undefined symbols have been resolved. */ | ||
84 | sym = (Elf32_Sym *)sechdrs[symindex].sh_addr | ||
85 | + ELF32_R_SYM(rel[i].r_info); | ||
86 | relocation = sym->st_value + rel[i].r_addend; | ||
87 | align = (int)location & 3; | ||
88 | |||
89 | /* For text addresses, bit2 of the st_other field indicates | ||
90 | * whether the symbol is SHmedia (1) or SHcompact (0). If | ||
91 | * SHmedia, the LSB of the symbol needs to be asserted | ||
92 | * for the CPU to be in SHmedia mode when it starts executing | ||
93 | * the branch target. */ | ||
94 | is_shmedia = (sym->st_other & 4) ? 1 : 0; | ||
95 | if (is_shmedia) { | ||
96 | relocation |= 1; | ||
97 | } | ||
98 | |||
99 | switch (ELF32_R_TYPE(rel[i].r_info)) { | ||
100 | case R_SH_DIR32: | ||
101 | DEBUGP("R_SH_DIR32 @%08lx = %08lx\n", (unsigned long) location, (unsigned long) relocation); | ||
102 | *location += relocation; | ||
103 | break; | ||
104 | case R_SH_REL32: | ||
105 | DEBUGP("R_SH_REL32 @%08lx = %08lx\n", (unsigned long) location, (unsigned long) relocation); | ||
106 | relocation -= (Elf32_Addr) location; | ||
107 | *location += relocation; | ||
108 | break; | ||
109 | case R_SH_IMM_LOW16: | ||
110 | DEBUGP("R_SH_IMM_LOW16 @%08lx = %08lx\n", (unsigned long) location, (unsigned long) relocation); | ||
111 | *location = (*location & ~0x3fffc00) | | ||
112 | ((relocation & 0xffff) << 10); | ||
113 | break; | ||
114 | case R_SH_IMM_MEDLOW16: | ||
115 | DEBUGP("R_SH_IMM_MEDLOW16 @%08lx = %08lx\n", (unsigned long) location, (unsigned long) relocation); | ||
116 | *location = (*location & ~0x3fffc00) | | ||
117 | (((relocation >> 16) & 0xffff) << 10); | ||
118 | break; | ||
119 | case R_SH_IMM_LOW16_PCREL: | ||
120 | DEBUGP("R_SH_IMM_LOW16_PCREL @%08lx = %08lx\n", (unsigned long) location, (unsigned long) relocation); | ||
121 | relocation -= (Elf32_Addr) location; | ||
122 | *location = (*location & ~0x3fffc00) | | ||
123 | ((relocation & 0xffff) << 10); | ||
124 | break; | ||
125 | case R_SH_IMM_MEDLOW16_PCREL: | ||
126 | DEBUGP("R_SH_IMM_MEDLOW16_PCREL @%08lx = %08lx\n", (unsigned long) location, (unsigned long) relocation); | ||
127 | relocation -= (Elf32_Addr) location; | ||
128 | *location = (*location & ~0x3fffc00) | | ||
129 | (((relocation >> 16) & 0xffff) << 10); | ||
130 | break; | ||
131 | default: | ||
132 | printk(KERN_ERR "module %s: Unknown relocation: %u\n", | ||
133 | me->name, ELF32_R_TYPE(rel[i].r_info)); | ||
134 | return -ENOEXEC; | ||
135 | } | ||
136 | } | ||
137 | return 0; | ||
138 | } | ||
139 | |||
140 | int apply_relocate(Elf32_Shdr *sechdrs, | ||
141 | const char *strtab, | ||
142 | unsigned int symindex, | ||
143 | unsigned int relsec, | ||
144 | struct module *me) | ||
145 | { | ||
146 | printk(KERN_ERR "module %s: REL RELOCATION unsupported\n", | ||
147 | me->name); | ||
148 | return -ENOEXEC; | ||
149 | } | ||
150 | |||
151 | int module_finalize(const Elf_Ehdr *hdr, | ||
152 | const Elf_Shdr *sechdrs, | ||
153 | struct module *me) | ||
154 | { | ||
155 | return 0; | ||
156 | } | ||
157 | |||
158 | void module_arch_cleanup(struct module *mod) | ||
159 | { | ||
160 | } | ||
161 | |||
diff --git a/arch/sh64/kernel/pci_sh5.c b/arch/sh64/kernel/pci_sh5.c deleted file mode 100644 index b4d9534d2b0e..000000000000 --- a/arch/sh64/kernel/pci_sh5.c +++ /dev/null | |||
@@ -1,536 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2001 David J. Mckay (david.mckay@st.com) | ||
3 | * Copyright (C) 2003, 2004 Paul Mundt | ||
4 | * Copyright (C) 2004 Richard Curnow | ||
5 | * | ||
6 | * May be copied or modified under the terms of the GNU General Public | ||
7 | * License. See linux/COPYING for more information. | ||
8 | * | ||
9 | * Support functions for the SH5 PCI hardware. | ||
10 | */ | ||
11 | |||
12 | #include <linux/kernel.h> | ||
13 | #include <linux/rwsem.h> | ||
14 | #include <linux/smp.h> | ||
15 | #include <linux/interrupt.h> | ||
16 | #include <linux/init.h> | ||
17 | #include <linux/errno.h> | ||
18 | #include <linux/pci.h> | ||
19 | #include <linux/delay.h> | ||
20 | #include <linux/types.h> | ||
21 | #include <asm/pci.h> | ||
22 | #include <linux/irq.h> | ||
23 | |||
24 | #include <asm/io.h> | ||
25 | #include <asm/hardware.h> | ||
26 | #include "pci_sh5.h" | ||
27 | |||
28 | static unsigned long pcicr_virt; | ||
29 | unsigned long pciio_virt; | ||
30 | |||
31 | static void __init pci_fixup_ide_bases(struct pci_dev *d) | ||
32 | { | ||
33 | int i; | ||
34 | |||
35 | /* | ||
36 | * PCI IDE controllers use non-standard I/O port decoding, respect it. | ||
37 | */ | ||
38 | if ((d->class >> 8) != PCI_CLASS_STORAGE_IDE) | ||
39 | return; | ||
40 | printk("PCI: IDE base address fixup for %s\n", pci_name(d)); | ||
41 | for(i=0; i<4; i++) { | ||
42 | struct resource *r = &d->resource[i]; | ||
43 | if ((r->start & ~0x80) == 0x374) { | ||
44 | r->start |= 2; | ||
45 | r->end = r->start; | ||
46 | } | ||
47 | } | ||
48 | } | ||
49 | DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pci_fixup_ide_bases); | ||
50 | |||
51 | char * __devinit pcibios_setup(char *str) | ||
52 | { | ||
53 | return str; | ||
54 | } | ||
55 | |||
56 | /* Rounds a number UP to the nearest power of two. Used for | ||
57 | * sizing the PCI window. | ||
58 | */ | ||
59 | static u32 __init r2p2(u32 num) | ||
60 | { | ||
61 | int i = 31; | ||
62 | u32 tmp = num; | ||
63 | |||
64 | if (num == 0) | ||
65 | return 0; | ||
66 | |||
67 | do { | ||
68 | if (tmp & (1 << 31)) | ||
69 | break; | ||
70 | i--; | ||
71 | tmp <<= 1; | ||
72 | } while (i >= 0); | ||
73 | |||
74 | tmp = 1 << i; | ||
75 | /* If the original number isn't a power of 2, round it up */ | ||
76 | if (tmp != num) | ||
77 | tmp <<= 1; | ||
78 | |||
79 | return tmp; | ||
80 | } | ||
81 | |||
82 | extern unsigned long long memory_start, memory_end; | ||
83 | |||
84 | int __init sh5pci_init(unsigned memStart, unsigned memSize) | ||
85 | { | ||
86 | u32 lsr0; | ||
87 | u32 uval; | ||
88 | |||
89 | pcicr_virt = onchip_remap(SH5PCI_ICR_BASE, 1024, "PCICR"); | ||
90 | if (!pcicr_virt) { | ||
91 | panic("Unable to remap PCICR\n"); | ||
92 | } | ||
93 | |||
94 | pciio_virt = onchip_remap(SH5PCI_IO_BASE, 0x10000, "PCIIO"); | ||
95 | if (!pciio_virt) { | ||
96 | panic("Unable to remap PCIIO\n"); | ||
97 | } | ||
98 | |||
99 | pr_debug("Register base addres is 0x%08lx\n", pcicr_virt); | ||
100 | |||
101 | /* Clear snoop registers */ | ||
102 | SH5PCI_WRITE(CSCR0, 0); | ||
103 | SH5PCI_WRITE(CSCR1, 0); | ||
104 | |||
105 | pr_debug("Wrote to reg\n"); | ||
106 | |||
107 | /* Switch off interrupts */ | ||
108 | SH5PCI_WRITE(INTM, 0); | ||
109 | SH5PCI_WRITE(AINTM, 0); | ||
110 | SH5PCI_WRITE(PINTM, 0); | ||
111 | |||
112 | /* Set bus active, take it out of reset */ | ||
113 | uval = SH5PCI_READ(CR); | ||
114 | |||
115 | /* Set command Register */ | ||
116 | SH5PCI_WRITE(CR, uval | CR_LOCK_MASK | CR_CFINT| CR_FTO | CR_PFE | CR_PFCS | CR_BMAM); | ||
117 | |||
118 | uval=SH5PCI_READ(CR); | ||
119 | pr_debug("CR is actually 0x%08x\n",uval); | ||
120 | |||
121 | /* Allow it to be a master */ | ||
122 | /* NB - WE DISABLE I/O ACCESS to stop overlap */ | ||
123 | /* set WAIT bit to enable stepping, an attempt to improve stability */ | ||
124 | SH5PCI_WRITE_SHORT(CSR_CMD, | ||
125 | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER | PCI_COMMAND_WAIT); | ||
126 | |||
127 | /* | ||
128 | ** Set translation mapping memory in order to convert the address | ||
129 | ** used for the main bus, to the PCI internal address. | ||
130 | */ | ||
131 | SH5PCI_WRITE(MBR,0x40000000); | ||
132 | |||
133 | /* Always set the max size 512M */ | ||
134 | SH5PCI_WRITE(MBMR, PCISH5_MEM_SIZCONV(512*1024*1024)); | ||
135 | |||
136 | /* | ||
137 | ** I/O addresses are mapped at internal PCI specific address | ||
138 | ** as is described into the configuration bridge table. | ||
139 | ** These are changed to 0, to allow cards that have legacy | ||
140 | ** io such as vga to function correctly. We set the SH5 IOBAR to | ||
141 | ** 256K, which is a bit big as we can only have 64K of address space | ||
142 | */ | ||
143 | |||
144 | SH5PCI_WRITE(IOBR,0x0); | ||
145 | |||
146 | pr_debug("PCI:Writing 0x%08x to IOBR\n",0); | ||
147 | |||
148 | /* Set up a 256K window. Totally pointless waste of address space */ | ||
149 | SH5PCI_WRITE(IOBMR,0); | ||
150 | pr_debug("PCI:Writing 0x%08x to IOBMR\n",0); | ||
151 | |||
152 | /* The SH5 has a HUGE 256K I/O region, which breaks the PCI spec. Ideally, | ||
153 | * we would want to map the I/O region somewhere, but it is so big this is not | ||
154 | * that easy! | ||
155 | */ | ||
156 | SH5PCI_WRITE(CSR_IBAR0,~0); | ||
157 | /* Set memory size value */ | ||
158 | memSize = memory_end - memory_start; | ||
159 | |||
160 | /* Now we set up the mbars so the PCI bus can see the memory of the machine */ | ||
161 | if (memSize < (1024 * 1024)) { | ||
162 | printk(KERN_ERR "PCISH5: Ridiculous memory size of 0x%x?\n", memSize); | ||
163 | return -EINVAL; | ||
164 | } | ||
165 | |||
166 | /* Set LSR 0 */ | ||
167 | lsr0 = (memSize > (512 * 1024 * 1024)) ? 0x1ff00001 : ((r2p2(memSize) - 0x100000) | 0x1); | ||
168 | SH5PCI_WRITE(LSR0, lsr0); | ||
169 | |||
170 | pr_debug("PCI:Writing 0x%08x to LSR0\n",lsr0); | ||
171 | |||
172 | /* Set MBAR 0 */ | ||
173 | SH5PCI_WRITE(CSR_MBAR0, memory_start); | ||
174 | SH5PCI_WRITE(LAR0, memory_start); | ||
175 | |||
176 | SH5PCI_WRITE(CSR_MBAR1,0); | ||
177 | SH5PCI_WRITE(LAR1,0); | ||
178 | SH5PCI_WRITE(LSR1,0); | ||
179 | |||
180 | pr_debug("PCI:Writing 0x%08llx to CSR_MBAR0\n",memory_start); | ||
181 | pr_debug("PCI:Writing 0x%08llx to LAR0\n",memory_start); | ||
182 | |||
183 | /* Enable the PCI interrupts on the device */ | ||
184 | SH5PCI_WRITE(INTM, ~0); | ||
185 | SH5PCI_WRITE(AINTM, ~0); | ||
186 | SH5PCI_WRITE(PINTM, ~0); | ||
187 | |||
188 | pr_debug("Switching on all error interrupts\n"); | ||
189 | |||
190 | return(0); | ||
191 | } | ||
192 | |||
193 | static int sh5pci_read(struct pci_bus *bus, unsigned int devfn, int where, | ||
194 | int size, u32 *val) | ||
195 | { | ||
196 | SH5PCI_WRITE(PAR, CONFIG_CMD(bus, devfn, where)); | ||
197 | |||
198 | switch (size) { | ||
199 | case 1: | ||
200 | *val = (u8)SH5PCI_READ_BYTE(PDR + (where & 3)); | ||
201 | break; | ||
202 | case 2: | ||
203 | *val = (u16)SH5PCI_READ_SHORT(PDR + (where & 2)); | ||
204 | break; | ||
205 | case 4: | ||
206 | *val = SH5PCI_READ(PDR); | ||
207 | break; | ||
208 | } | ||
209 | |||
210 | return PCIBIOS_SUCCESSFUL; | ||
211 | } | ||
212 | |||
213 | static int sh5pci_write(struct pci_bus *bus, unsigned int devfn, int where, | ||
214 | int size, u32 val) | ||
215 | { | ||
216 | SH5PCI_WRITE(PAR, CONFIG_CMD(bus, devfn, where)); | ||
217 | |||
218 | switch (size) { | ||
219 | case 1: | ||
220 | SH5PCI_WRITE_BYTE(PDR + (where & 3), (u8)val); | ||
221 | break; | ||
222 | case 2: | ||
223 | SH5PCI_WRITE_SHORT(PDR + (where & 2), (u16)val); | ||
224 | break; | ||
225 | case 4: | ||
226 | SH5PCI_WRITE(PDR, val); | ||
227 | break; | ||
228 | } | ||
229 | |||
230 | return PCIBIOS_SUCCESSFUL; | ||
231 | } | ||
232 | |||
233 | static struct pci_ops pci_config_ops = { | ||
234 | .read = sh5pci_read, | ||
235 | .write = sh5pci_write, | ||
236 | }; | ||
237 | |||
238 | /* Everything hangs off this */ | ||
239 | static struct pci_bus *pci_root_bus; | ||
240 | |||
241 | |||
242 | static u8 __init no_swizzle(struct pci_dev *dev, u8 * pin) | ||
243 | { | ||
244 | pr_debug("swizzle for dev %d on bus %d slot %d pin is %d\n", | ||
245 | dev->devfn,dev->bus->number, PCI_SLOT(dev->devfn),*pin); | ||
246 | return PCI_SLOT(dev->devfn); | ||
247 | } | ||
248 | |||
249 | static inline u8 bridge_swizzle(u8 pin, u8 slot) | ||
250 | { | ||
251 | return (((pin-1) + slot) % 4) + 1; | ||
252 | } | ||
253 | |||
254 | u8 __init common_swizzle(struct pci_dev *dev, u8 *pinp) | ||
255 | { | ||
256 | if (dev->bus->number != 0) { | ||
257 | u8 pin = *pinp; | ||
258 | do { | ||
259 | pin = bridge_swizzle(pin, PCI_SLOT(dev->devfn)); | ||
260 | /* Move up the chain of bridges. */ | ||
261 | dev = dev->bus->self; | ||
262 | } while (dev->bus->self); | ||
263 | *pinp = pin; | ||
264 | |||
265 | /* The slot is the slot of the last bridge. */ | ||
266 | } | ||
267 | |||
268 | return PCI_SLOT(dev->devfn); | ||
269 | } | ||
270 | |||
271 | /* This needs to be shunted out of here into the board specific bit */ | ||
272 | |||
273 | static int __init map_cayman_irq(struct pci_dev *dev, u8 slot, u8 pin) | ||
274 | { | ||
275 | int result = -1; | ||
276 | |||
277 | /* The complication here is that the PCI IRQ lines from the Cayman's 2 | ||
278 | 5V slots get into the CPU via a different path from the IRQ lines | ||
279 | from the 3 3.3V slots. Thus, we have to detect whether the card's | ||
280 | interrupts go via the 5V or 3.3V path, i.e. the 'bridge swizzling' | ||
281 | at the point where we cross from 5V to 3.3V is not the normal case. | ||
282 | |||
283 | The added complication is that we don't know that the 5V slots are | ||
284 | always bus 2, because a card containing a PCI-PCI bridge may be | ||
285 | plugged into a 3.3V slot, and this changes the bus numbering. | ||
286 | |||
287 | Also, the Cayman has an intermediate PCI bus that goes a custom | ||
288 | expansion board header (and to the secondary bridge). This bus has | ||
289 | never been used in practice. | ||
290 | |||
291 | The 1ary onboard PCI-PCI bridge is device 3 on bus 0 | ||
292 | The 2ary onboard PCI-PCI bridge is device 0 on the 2ary bus of the 1ary bridge. | ||
293 | */ | ||
294 | |||
295 | struct slot_pin { | ||
296 | int slot; | ||
297 | int pin; | ||
298 | } path[4]; | ||
299 | int i=0; | ||
300 | |||
301 | while (dev->bus->number > 0) { | ||
302 | |||
303 | slot = path[i].slot = PCI_SLOT(dev->devfn); | ||
304 | pin = path[i].pin = bridge_swizzle(pin, slot); | ||
305 | dev = dev->bus->self; | ||
306 | i++; | ||
307 | if (i > 3) panic("PCI path to root bus too long!\n"); | ||
308 | } | ||
309 | |||
310 | slot = PCI_SLOT(dev->devfn); | ||
311 | /* This is the slot on bus 0 through which the device is eventually | ||
312 | reachable. */ | ||
313 | |||
314 | /* Now work back up. */ | ||
315 | if ((slot < 3) || (i == 0)) { | ||
316 | /* Bus 0 (incl. PCI-PCI bridge itself) : perform the final | ||
317 | swizzle now. */ | ||
318 | result = IRQ_INTA + bridge_swizzle(pin, slot) - 1; | ||
319 | } else { | ||
320 | i--; | ||
321 | slot = path[i].slot; | ||
322 | pin = path[i].pin; | ||
323 | if (slot > 0) { | ||
324 | panic("PCI expansion bus device found - not handled!\n"); | ||
325 | } else { | ||
326 | if (i > 0) { | ||
327 | /* 5V slots */ | ||
328 | i--; | ||
329 | slot = path[i].slot; | ||
330 | pin = path[i].pin; | ||
331 | /* 'pin' was swizzled earlier wrt slot, don't do it again. */ | ||
332 | result = IRQ_P2INTA + (pin - 1); | ||
333 | } else { | ||
334 | /* IRQ for 2ary PCI-PCI bridge : unused */ | ||
335 | result = -1; | ||
336 | } | ||
337 | } | ||
338 | } | ||
339 | |||
340 | return result; | ||
341 | } | ||
342 | |||
343 | static irqreturn_t pcish5_err_irq(int irq, void *dev_id) | ||
344 | { | ||
345 | struct pt_regs *regs = get_irq_regs(); | ||
346 | unsigned pci_int, pci_air, pci_cir, pci_aint; | ||
347 | |||
348 | pci_int = SH5PCI_READ(INT); | ||
349 | pci_cir = SH5PCI_READ(CIR); | ||
350 | pci_air = SH5PCI_READ(AIR); | ||
351 | |||
352 | if (pci_int) { | ||
353 | printk("PCI INTERRUPT (at %08llx)!\n", regs->pc); | ||
354 | printk("PCI INT -> 0x%x\n", pci_int & 0xffff); | ||
355 | printk("PCI AIR -> 0x%x\n", pci_air); | ||
356 | printk("PCI CIR -> 0x%x\n", pci_cir); | ||
357 | SH5PCI_WRITE(INT, ~0); | ||
358 | } | ||
359 | |||
360 | pci_aint = SH5PCI_READ(AINT); | ||
361 | if (pci_aint) { | ||
362 | printk("PCI ARB INTERRUPT!\n"); | ||
363 | printk("PCI AINT -> 0x%x\n", pci_aint); | ||
364 | printk("PCI AIR -> 0x%x\n", pci_air); | ||
365 | printk("PCI CIR -> 0x%x\n", pci_cir); | ||
366 | SH5PCI_WRITE(AINT, ~0); | ||
367 | } | ||
368 | |||
369 | return IRQ_HANDLED; | ||
370 | } | ||
371 | |||
372 | static irqreturn_t pcish5_serr_irq(int irq, void *dev_id) | ||
373 | { | ||
374 | printk("SERR IRQ\n"); | ||
375 | |||
376 | return IRQ_NONE; | ||
377 | } | ||
378 | |||
379 | static void __init | ||
380 | pcibios_size_bridge(struct pci_bus *bus, struct resource *ior, | ||
381 | struct resource *memr) | ||
382 | { | ||
383 | struct resource io_res, mem_res; | ||
384 | struct pci_dev *dev; | ||
385 | struct pci_dev *bridge = bus->self; | ||
386 | struct list_head *ln; | ||
387 | |||
388 | if (!bridge) | ||
389 | return; /* host bridge, nothing to do */ | ||
390 | |||
391 | /* set reasonable default locations for pcibios_align_resource */ | ||
392 | io_res.start = PCIBIOS_MIN_IO; | ||
393 | mem_res.start = PCIBIOS_MIN_MEM; | ||
394 | |||
395 | io_res.end = io_res.start; | ||
396 | mem_res.end = mem_res.start; | ||
397 | |||
398 | /* Collect information about how our direct children are layed out. */ | ||
399 | for (ln=bus->devices.next; ln != &bus->devices; ln=ln->next) { | ||
400 | int i; | ||
401 | dev = pci_dev_b(ln); | ||
402 | |||
403 | /* Skip bridges for now */ | ||
404 | if (dev->class >> 8 == PCI_CLASS_BRIDGE_PCI) | ||
405 | continue; | ||
406 | |||
407 | for (i = 0; i < PCI_NUM_RESOURCES; i++) { | ||
408 | struct resource res; | ||
409 | unsigned long size; | ||
410 | |||
411 | memcpy(&res, &dev->resource[i], sizeof(res)); | ||
412 | size = res.end - res.start + 1; | ||
413 | |||
414 | if (res.flags & IORESOURCE_IO) { | ||
415 | res.start = io_res.end; | ||
416 | pcibios_align_resource(dev, &res, size, 0); | ||
417 | io_res.end = res.start + size; | ||
418 | } else if (res.flags & IORESOURCE_MEM) { | ||
419 | res.start = mem_res.end; | ||
420 | pcibios_align_resource(dev, &res, size, 0); | ||
421 | mem_res.end = res.start + size; | ||
422 | } | ||
423 | } | ||
424 | } | ||
425 | |||
426 | /* And for all of the subordinate busses. */ | ||
427 | for (ln=bus->children.next; ln != &bus->children; ln=ln->next) | ||
428 | pcibios_size_bridge(pci_bus_b(ln), &io_res, &mem_res); | ||
429 | |||
430 | /* turn the ending locations into sizes (subtract start) */ | ||
431 | io_res.end -= io_res.start; | ||
432 | mem_res.end -= mem_res.start; | ||
433 | |||
434 | /* Align the sizes up by bridge rules */ | ||
435 | io_res.end = ALIGN(io_res.end, 4*1024) - 1; | ||
436 | mem_res.end = ALIGN(mem_res.end, 1*1024*1024) - 1; | ||
437 | |||
438 | /* Adjust the bridge's allocation requirements */ | ||
439 | bridge->resource[0].end = bridge->resource[0].start + io_res.end; | ||
440 | bridge->resource[1].end = bridge->resource[1].start + mem_res.end; | ||
441 | |||
442 | bridge->resource[PCI_BRIDGE_RESOURCES].end = | ||
443 | bridge->resource[PCI_BRIDGE_RESOURCES].start + io_res.end; | ||
444 | bridge->resource[PCI_BRIDGE_RESOURCES+1].end = | ||
445 | bridge->resource[PCI_BRIDGE_RESOURCES+1].start + mem_res.end; | ||
446 | |||
447 | /* adjust parent's resource requirements */ | ||
448 | if (ior) { | ||
449 | ior->end = ALIGN(ior->end, 4*1024); | ||
450 | ior->end += io_res.end; | ||
451 | } | ||
452 | |||
453 | if (memr) { | ||
454 | memr->end = ALIGN(memr->end, 1*1024*1024); | ||
455 | memr->end += mem_res.end; | ||
456 | } | ||
457 | } | ||
458 | |||
459 | static void __init pcibios_size_bridges(void) | ||
460 | { | ||
461 | struct resource io_res, mem_res; | ||
462 | |||
463 | memset(&io_res, 0, sizeof(io_res)); | ||
464 | memset(&mem_res, 0, sizeof(mem_res)); | ||
465 | |||
466 | pcibios_size_bridge(pci_root_bus, &io_res, &mem_res); | ||
467 | } | ||
468 | |||
469 | static int __init pcibios_init(void) | ||
470 | { | ||
471 | if (request_irq(IRQ_ERR, pcish5_err_irq, | ||
472 | IRQF_DISABLED, "PCI Error",NULL) < 0) { | ||
473 | printk(KERN_ERR "PCISH5: Cannot hook PCI_PERR interrupt\n"); | ||
474 | return -EINVAL; | ||
475 | } | ||
476 | |||
477 | if (request_irq(IRQ_SERR, pcish5_serr_irq, | ||
478 | IRQF_DISABLED, "PCI SERR interrupt", NULL) < 0) { | ||
479 | printk(KERN_ERR "PCISH5: Cannot hook PCI_SERR interrupt\n"); | ||
480 | return -EINVAL; | ||
481 | } | ||
482 | |||
483 | /* The pci subsystem needs to know where memory is and how much | ||
484 | * of it there is. I've simply made these globals. A better mechanism | ||
485 | * is probably needed. | ||
486 | */ | ||
487 | sh5pci_init(__pa(memory_start), | ||
488 | __pa(memory_end) - __pa(memory_start)); | ||
489 | |||
490 | pci_root_bus = pci_scan_bus(0, &pci_config_ops, NULL); | ||
491 | pcibios_size_bridges(); | ||
492 | pci_assign_unassigned_resources(); | ||
493 | pci_fixup_irqs(no_swizzle, map_cayman_irq); | ||
494 | |||
495 | return 0; | ||
496 | } | ||
497 | |||
498 | subsys_initcall(pcibios_init); | ||
499 | |||
500 | void __devinit pcibios_fixup_bus(struct pci_bus *bus) | ||
501 | { | ||
502 | struct pci_dev *dev = bus->self; | ||
503 | int i; | ||
504 | |||
505 | #if 1 | ||
506 | if(dev) { | ||
507 | for(i=0; i<3; i++) { | ||
508 | bus->resource[i] = | ||
509 | &dev->resource[PCI_BRIDGE_RESOURCES+i]; | ||
510 | bus->resource[i]->name = bus->name; | ||
511 | } | ||
512 | bus->resource[0]->flags |= IORESOURCE_IO; | ||
513 | bus->resource[1]->flags |= IORESOURCE_MEM; | ||
514 | |||
515 | /* For now, propagate host limits to the bus; | ||
516 | * we'll adjust them later. */ | ||
517 | |||
518 | #if 1 | ||
519 | bus->resource[0]->end = 64*1024 - 1 ; | ||
520 | bus->resource[1]->end = PCIBIOS_MIN_MEM+(256*1024*1024)-1; | ||
521 | bus->resource[0]->start = PCIBIOS_MIN_IO; | ||
522 | bus->resource[1]->start = PCIBIOS_MIN_MEM; | ||
523 | #else | ||
524 | bus->resource[0]->end = 0; | ||
525 | bus->resource[1]->end = 0; | ||
526 | bus->resource[0]->start =0; | ||
527 | bus->resource[1]->start = 0; | ||
528 | #endif | ||
529 | /* Turn off downstream PF memory address range by default */ | ||
530 | bus->resource[2]->start = 1024*1024; | ||
531 | bus->resource[2]->end = bus->resource[2]->start - 1; | ||
532 | } | ||
533 | #endif | ||
534 | |||
535 | } | ||
536 | |||
diff --git a/arch/sh64/kernel/pcibios.c b/arch/sh64/kernel/pcibios.c deleted file mode 100644 index 945920bc24db..000000000000 --- a/arch/sh64/kernel/pcibios.c +++ /dev/null | |||
@@ -1,168 +0,0 @@ | |||
1 | /* | ||
2 | * $Id: pcibios.c,v 1.1 2001/08/24 12:38:19 dwmw2 Exp $ | ||
3 | * | ||
4 | * arch/sh/kernel/pcibios.c | ||
5 | * | ||
6 | * Copyright (C) 2002 STMicroelectronics Limited | ||
7 | * Author : David J. McKay | ||
8 | * | ||
9 | * Copyright (C) 2004 Richard Curnow, SuperH UK Limited | ||
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 | * This is GPL'd. | ||
15 | * | ||
16 | * Provided here are generic versions of: | ||
17 | * pcibios_update_resource() | ||
18 | * pcibios_align_resource() | ||
19 | * pcibios_enable_device() | ||
20 | * pcibios_set_master() | ||
21 | * pcibios_update_irq() | ||
22 | * | ||
23 | * These functions are collected here to reduce duplication of common | ||
24 | * code amongst the many platform-specific PCI support code files. | ||
25 | * | ||
26 | * Platform-specific files are expected to provide: | ||
27 | * pcibios_fixup_bus() | ||
28 | * pcibios_init() | ||
29 | * pcibios_setup() | ||
30 | * pcibios_fixup_pbus_ranges() | ||
31 | */ | ||
32 | |||
33 | #include <linux/kernel.h> | ||
34 | #include <linux/pci.h> | ||
35 | #include <linux/init.h> | ||
36 | |||
37 | void | ||
38 | pcibios_update_resource(struct pci_dev *dev, struct resource *root, | ||
39 | struct resource *res, int resource) | ||
40 | { | ||
41 | u32 new, check; | ||
42 | int reg; | ||
43 | |||
44 | new = res->start | (res->flags & PCI_REGION_FLAG_MASK); | ||
45 | if (resource < 6) { | ||
46 | reg = PCI_BASE_ADDRESS_0 + 4*resource; | ||
47 | } else if (resource == PCI_ROM_RESOURCE) { | ||
48 | res->flags |= IORESOURCE_ROM_ENABLE; | ||
49 | new |= PCI_ROM_ADDRESS_ENABLE; | ||
50 | reg = dev->rom_base_reg; | ||
51 | } else { | ||
52 | /* Somebody might have asked allocation of a non-standard resource */ | ||
53 | return; | ||
54 | } | ||
55 | |||
56 | pci_write_config_dword(dev, reg, new); | ||
57 | pci_read_config_dword(dev, reg, &check); | ||
58 | if ((new ^ check) & ((new & PCI_BASE_ADDRESS_SPACE_IO) ? PCI_BASE_ADDRESS_IO_MASK : PCI_BASE_ADDRESS_MEM_MASK)) { | ||
59 | printk(KERN_ERR "PCI: Error while updating region " | ||
60 | "%s/%d (%08x != %08x)\n", pci_name(dev), resource, | ||
61 | new, check); | ||
62 | } | ||
63 | } | ||
64 | |||
65 | /* | ||
66 | * We need to avoid collisions with `mirrored' VGA ports | ||
67 | * and other strange ISA hardware, so we always want the | ||
68 | * addresses to be allocated in the 0x000-0x0ff region | ||
69 | * modulo 0x400. | ||
70 | */ | ||
71 | void pcibios_align_resource(void *data, struct resource *res, | ||
72 | resource_size_t size, resource_size_t align) | ||
73 | { | ||
74 | if (res->flags & IORESOURCE_IO) { | ||
75 | resource_size_t start = res->start; | ||
76 | |||
77 | if (start & 0x300) { | ||
78 | start = (start + 0x3ff) & ~0x3ff; | ||
79 | res->start = start; | ||
80 | } | ||
81 | } | ||
82 | } | ||
83 | |||
84 | static void pcibios_enable_bridge(struct pci_dev *dev) | ||
85 | { | ||
86 | struct pci_bus *bus = dev->subordinate; | ||
87 | u16 cmd, old_cmd; | ||
88 | |||
89 | pci_read_config_word(dev, PCI_COMMAND, &cmd); | ||
90 | old_cmd = cmd; | ||
91 | |||
92 | if (bus->resource[0]->flags & IORESOURCE_IO) { | ||
93 | cmd |= PCI_COMMAND_IO; | ||
94 | } | ||
95 | if ((bus->resource[1]->flags & IORESOURCE_MEM) || | ||
96 | (bus->resource[2]->flags & IORESOURCE_PREFETCH)) { | ||
97 | cmd |= PCI_COMMAND_MEMORY; | ||
98 | } | ||
99 | |||
100 | if (cmd != old_cmd) { | ||
101 | pci_write_config_word(dev, PCI_COMMAND, cmd); | ||
102 | } | ||
103 | |||
104 | printk("PCI bridge %s, command register -> %04x\n", | ||
105 | pci_name(dev), cmd); | ||
106 | |||
107 | } | ||
108 | |||
109 | |||
110 | |||
111 | int pcibios_enable_device(struct pci_dev *dev, int mask) | ||
112 | { | ||
113 | u16 cmd, old_cmd; | ||
114 | int idx; | ||
115 | struct resource *r; | ||
116 | |||
117 | if ((dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) { | ||
118 | pcibios_enable_bridge(dev); | ||
119 | } | ||
120 | |||
121 | pci_read_config_word(dev, PCI_COMMAND, &cmd); | ||
122 | old_cmd = cmd; | ||
123 | for(idx=0; idx<6; idx++) { | ||
124 | if (!(mask & (1 << idx))) | ||
125 | continue; | ||
126 | r = &dev->resource[idx]; | ||
127 | if (!r->start && r->end) { | ||
128 | printk(KERN_ERR "PCI: Device %s not available because of resource collisions\n", pci_name(dev)); | ||
129 | return -EINVAL; | ||
130 | } | ||
131 | if (r->flags & IORESOURCE_IO) | ||
132 | cmd |= PCI_COMMAND_IO; | ||
133 | if (r->flags & IORESOURCE_MEM) | ||
134 | cmd |= PCI_COMMAND_MEMORY; | ||
135 | } | ||
136 | if (dev->resource[PCI_ROM_RESOURCE].start) | ||
137 | cmd |= PCI_COMMAND_MEMORY; | ||
138 | if (cmd != old_cmd) { | ||
139 | printk(KERN_INFO "PCI: Enabling device %s (%04x -> %04x)\n", pci_name(dev), old_cmd, cmd); | ||
140 | pci_write_config_word(dev, PCI_COMMAND, cmd); | ||
141 | } | ||
142 | return 0; | ||
143 | } | ||
144 | |||
145 | /* | ||
146 | * If we set up a device for bus mastering, we need to check and set | ||
147 | * the latency timer as it may not be properly set. | ||
148 | */ | ||
149 | unsigned int pcibios_max_latency = 255; | ||
150 | |||
151 | void pcibios_set_master(struct pci_dev *dev) | ||
152 | { | ||
153 | u8 lat; | ||
154 | pci_read_config_byte(dev, PCI_LATENCY_TIMER, &lat); | ||
155 | if (lat < 16) | ||
156 | lat = (64 <= pcibios_max_latency) ? 64 : pcibios_max_latency; | ||
157 | else if (lat > pcibios_max_latency) | ||
158 | lat = pcibios_max_latency; | ||
159 | else | ||
160 | return; | ||
161 | printk(KERN_INFO "PCI: Setting latency timer of device %s to %d\n", pci_name(dev), lat); | ||
162 | pci_write_config_byte(dev, PCI_LATENCY_TIMER, lat); | ||
163 | } | ||
164 | |||
165 | void __init pcibios_update_irq(struct pci_dev *dev, int irq) | ||
166 | { | ||
167 | pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq); | ||
168 | } | ||
diff --git a/arch/sh64/kernel/semaphore.c b/arch/sh64/kernel/semaphore.c deleted file mode 100644 index 72c16533436e..000000000000 --- a/arch/sh64/kernel/semaphore.c +++ /dev/null | |||
@@ -1,140 +0,0 @@ | |||
1 | /* | ||
2 | * Just taken from alpha implementation. | ||
3 | * This can't work well, perhaps. | ||
4 | */ | ||
5 | /* | ||
6 | * Generic semaphore code. Buyer beware. Do your own | ||
7 | * specific changes in <asm/semaphore-helper.h> | ||
8 | */ | ||
9 | |||
10 | #include <linux/errno.h> | ||
11 | #include <linux/rwsem.h> | ||
12 | #include <linux/sched.h> | ||
13 | #include <linux/wait.h> | ||
14 | #include <linux/init.h> | ||
15 | #include <asm/semaphore.h> | ||
16 | #include <asm/semaphore-helper.h> | ||
17 | |||
18 | spinlock_t semaphore_wake_lock; | ||
19 | |||
20 | /* | ||
21 | * Semaphores are implemented using a two-way counter: | ||
22 | * The "count" variable is decremented for each process | ||
23 | * that tries to sleep, while the "waking" variable is | ||
24 | * incremented when the "up()" code goes to wake up waiting | ||
25 | * processes. | ||
26 | * | ||
27 | * Notably, the inline "up()" and "down()" functions can | ||
28 | * efficiently test if they need to do any extra work (up | ||
29 | * needs to do something only if count was negative before | ||
30 | * the increment operation. | ||
31 | * | ||
32 | * waking_non_zero() (from asm/semaphore.h) must execute | ||
33 | * atomically. | ||
34 | * | ||
35 | * When __up() is called, the count was negative before | ||
36 | * incrementing it, and we need to wake up somebody. | ||
37 | * | ||
38 | * This routine adds one to the count of processes that need to | ||
39 | * wake up and exit. ALL waiting processes actually wake up but | ||
40 | * only the one that gets to the "waking" field first will gate | ||
41 | * through and acquire the semaphore. The others will go back | ||
42 | * to sleep. | ||
43 | * | ||
44 | * Note that these functions are only called when there is | ||
45 | * contention on the lock, and as such all this is the | ||
46 | * "non-critical" part of the whole semaphore business. The | ||
47 | * critical part is the inline stuff in <asm/semaphore.h> | ||
48 | * where we want to avoid any extra jumps and calls. | ||
49 | */ | ||
50 | void __up(struct semaphore *sem) | ||
51 | { | ||
52 | wake_one_more(sem); | ||
53 | wake_up(&sem->wait); | ||
54 | } | ||
55 | |||
56 | /* | ||
57 | * Perform the "down" function. Return zero for semaphore acquired, | ||
58 | * return negative for signalled out of the function. | ||
59 | * | ||
60 | * If called from __down, the return is ignored and the wait loop is | ||
61 | * not interruptible. This means that a task waiting on a semaphore | ||
62 | * using "down()" cannot be killed until someone does an "up()" on | ||
63 | * the semaphore. | ||
64 | * | ||
65 | * If called from __down_interruptible, the return value gets checked | ||
66 | * upon return. If the return value is negative then the task continues | ||
67 | * with the negative value in the return register (it can be tested by | ||
68 | * the caller). | ||
69 | * | ||
70 | * Either form may be used in conjunction with "up()". | ||
71 | * | ||
72 | */ | ||
73 | |||
74 | #define DOWN_VAR \ | ||
75 | struct task_struct *tsk = current; \ | ||
76 | wait_queue_t wait; \ | ||
77 | init_waitqueue_entry(&wait, tsk); | ||
78 | |||
79 | #define DOWN_HEAD(task_state) \ | ||
80 | \ | ||
81 | \ | ||
82 | tsk->state = (task_state); \ | ||
83 | add_wait_queue(&sem->wait, &wait); \ | ||
84 | \ | ||
85 | /* \ | ||
86 | * Ok, we're set up. sem->count is known to be less than zero \ | ||
87 | * so we must wait. \ | ||
88 | * \ | ||
89 | * We can let go the lock for purposes of waiting. \ | ||
90 | * We re-acquire it after awaking so as to protect \ | ||
91 | * all semaphore operations. \ | ||
92 | * \ | ||
93 | * If "up()" is called before we call waking_non_zero() then \ | ||
94 | * we will catch it right away. If it is called later then \ | ||
95 | * we will have to go through a wakeup cycle to catch it. \ | ||
96 | * \ | ||
97 | * Multiple waiters contend for the semaphore lock to see \ | ||
98 | * who gets to gate through and who has to wait some more. \ | ||
99 | */ \ | ||
100 | for (;;) { | ||
101 | |||
102 | #define DOWN_TAIL(task_state) \ | ||
103 | tsk->state = (task_state); \ | ||
104 | } \ | ||
105 | tsk->state = TASK_RUNNING; \ | ||
106 | remove_wait_queue(&sem->wait, &wait); | ||
107 | |||
108 | void __sched __down(struct semaphore * sem) | ||
109 | { | ||
110 | DOWN_VAR | ||
111 | DOWN_HEAD(TASK_UNINTERRUPTIBLE) | ||
112 | if (waking_non_zero(sem)) | ||
113 | break; | ||
114 | schedule(); | ||
115 | DOWN_TAIL(TASK_UNINTERRUPTIBLE) | ||
116 | } | ||
117 | |||
118 | int __sched __down_interruptible(struct semaphore * sem) | ||
119 | { | ||
120 | int ret = 0; | ||
121 | DOWN_VAR | ||
122 | DOWN_HEAD(TASK_INTERRUPTIBLE) | ||
123 | |||
124 | ret = waking_non_zero_interruptible(sem, tsk); | ||
125 | if (ret) | ||
126 | { | ||
127 | if (ret == 1) | ||
128 | /* ret != 0 only if we get interrupted -arca */ | ||
129 | ret = 0; | ||
130 | break; | ||
131 | } | ||
132 | schedule(); | ||
133 | DOWN_TAIL(TASK_INTERRUPTIBLE) | ||
134 | return ret; | ||
135 | } | ||
136 | |||
137 | int __down_trylock(struct semaphore * sem) | ||
138 | { | ||
139 | return waking_non_zero_trylock(sem); | ||
140 | } | ||
diff --git a/arch/sh64/kernel/setup.c b/arch/sh64/kernel/setup.c deleted file mode 100644 index 2b7264c0c6f7..000000000000 --- a/arch/sh64/kernel/setup.c +++ /dev/null | |||
@@ -1,379 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * arch/sh64/kernel/setup.c | ||
7 | * | ||
8 | * sh64 Arch Support | ||
9 | * | ||
10 | * This file handles the architecture-dependent parts of initialization | ||
11 | * | ||
12 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
13 | * Copyright (C) 2003, 2004 Paul Mundt | ||
14 | * | ||
15 | * benedict.gaster@superh.com: 2nd May 2002 | ||
16 | * Modified to use the empty_zero_page to pass command line arguments. | ||
17 | * | ||
18 | * benedict.gaster@superh.com: 3rd May 2002 | ||
19 | * Added support for ramdisk, removing statically linked romfs at the same time. | ||
20 | * | ||
21 | * lethal@linux-sh.org: 15th May 2003 | ||
22 | * Added generic procfs cpuinfo reporting. Make boards just export their name. | ||
23 | * | ||
24 | * lethal@linux-sh.org: 25th May 2003 | ||
25 | * Added generic get_cpu_subtype() for subtype reporting from cpu_data->type. | ||
26 | * | ||
27 | */ | ||
28 | #include <linux/errno.h> | ||
29 | #include <linux/rwsem.h> | ||
30 | #include <linux/sched.h> | ||
31 | #include <linux/kernel.h> | ||
32 | #include <linux/mm.h> | ||
33 | #include <linux/stddef.h> | ||
34 | #include <linux/unistd.h> | ||
35 | #include <linux/ptrace.h> | ||
36 | #include <linux/slab.h> | ||
37 | #include <linux/user.h> | ||
38 | #include <linux/a.out.h> | ||
39 | #include <linux/screen_info.h> | ||
40 | #include <linux/ioport.h> | ||
41 | #include <linux/delay.h> | ||
42 | #include <linux/init.h> | ||
43 | #include <linux/seq_file.h> | ||
44 | #include <linux/blkdev.h> | ||
45 | #include <linux/bootmem.h> | ||
46 | #include <linux/console.h> | ||
47 | #include <linux/root_dev.h> | ||
48 | #include <linux/cpu.h> | ||
49 | #include <linux/initrd.h> | ||
50 | #include <linux/pfn.h> | ||
51 | #include <asm/processor.h> | ||
52 | #include <asm/page.h> | ||
53 | #include <asm/pgtable.h> | ||
54 | #include <asm/platform.h> | ||
55 | #include <asm/uaccess.h> | ||
56 | #include <asm/system.h> | ||
57 | #include <asm/io.h> | ||
58 | #include <asm/sections.h> | ||
59 | #include <asm/setup.h> | ||
60 | #include <asm/smp.h> | ||
61 | |||
62 | struct screen_info screen_info; | ||
63 | |||
64 | #ifdef CONFIG_BLK_DEV_RAM | ||
65 | extern int rd_doload; /* 1 = load ramdisk, 0 = don't load */ | ||
66 | extern int rd_prompt; /* 1 = prompt for ramdisk, 0 = don't prompt */ | ||
67 | extern int rd_image_start; /* starting block # of image */ | ||
68 | #endif | ||
69 | |||
70 | extern int root_mountflags; | ||
71 | extern char *get_system_type(void); | ||
72 | extern void platform_setup(void); | ||
73 | extern void platform_monitor(void); | ||
74 | extern void platform_reserve(void); | ||
75 | extern int sh64_cache_init(void); | ||
76 | extern int sh64_tlb_init(void); | ||
77 | |||
78 | #define RAMDISK_IMAGE_START_MASK 0x07FF | ||
79 | #define RAMDISK_PROMPT_FLAG 0x8000 | ||
80 | #define RAMDISK_LOAD_FLAG 0x4000 | ||
81 | |||
82 | static char __initdata command_line[COMMAND_LINE_SIZE] = { 0, }; | ||
83 | unsigned long long memory_start = CONFIG_MEMORY_START; | ||
84 | unsigned long long memory_end = CONFIG_MEMORY_START + (CONFIG_MEMORY_SIZE_IN_MB * 1024 * 1024); | ||
85 | |||
86 | struct sh_cpuinfo boot_cpu_data; | ||
87 | |||
88 | static inline void parse_mem_cmdline (char ** cmdline_p) | ||
89 | { | ||
90 | char c = ' ', *to = command_line, *from = COMMAND_LINE; | ||
91 | int len = 0; | ||
92 | |||
93 | /* Save unparsed command line copy for /proc/cmdline */ | ||
94 | memcpy(boot_command_line, COMMAND_LINE, COMMAND_LINE_SIZE); | ||
95 | boot_command_line[COMMAND_LINE_SIZE-1] = '\0'; | ||
96 | |||
97 | for (;;) { | ||
98 | /* | ||
99 | * "mem=XXX[kKmM]" defines a size of memory. | ||
100 | */ | ||
101 | if (c == ' ' && !memcmp(from, "mem=", 4)) { | ||
102 | if (to != command_line) | ||
103 | to--; | ||
104 | { | ||
105 | unsigned long mem_size; | ||
106 | |||
107 | mem_size = memparse(from+4, &from); | ||
108 | memory_end = memory_start + mem_size; | ||
109 | } | ||
110 | } | ||
111 | c = *(from++); | ||
112 | if (!c) | ||
113 | break; | ||
114 | if (COMMAND_LINE_SIZE <= ++len) | ||
115 | break; | ||
116 | *(to++) = c; | ||
117 | } | ||
118 | *to = '\0'; | ||
119 | |||
120 | *cmdline_p = command_line; | ||
121 | } | ||
122 | |||
123 | static void __init sh64_cpu_type_detect(void) | ||
124 | { | ||
125 | extern unsigned long long peek_real_address_q(unsigned long long addr); | ||
126 | unsigned long long cir; | ||
127 | /* Do peeks in real mode to avoid having to set up a mapping for the | ||
128 | WPC registers. On SH5-101 cut2, such a mapping would be exposed to | ||
129 | an address translation erratum which would make it hard to set up | ||
130 | correctly. */ | ||
131 | cir = peek_real_address_q(0x0d000008); | ||
132 | |||
133 | if ((cir & 0xffff) == 0x5103) { | ||
134 | boot_cpu_data.type = CPU_SH5_103; | ||
135 | } else if (((cir >> 32) & 0xffff) == 0x51e2) { | ||
136 | /* CPU.VCR aliased at CIR address on SH5-101 */ | ||
137 | boot_cpu_data.type = CPU_SH5_101; | ||
138 | } else { | ||
139 | boot_cpu_data.type = CPU_SH_NONE; | ||
140 | } | ||
141 | } | ||
142 | |||
143 | void __init setup_arch(char **cmdline_p) | ||
144 | { | ||
145 | unsigned long bootmap_size, i; | ||
146 | unsigned long first_pfn, start_pfn, last_pfn, pages; | ||
147 | |||
148 | #ifdef CONFIG_EARLY_PRINTK | ||
149 | extern void enable_early_printk(void); | ||
150 | |||
151 | /* | ||
152 | * Setup Early SCIF console | ||
153 | */ | ||
154 | enable_early_printk(); | ||
155 | #endif | ||
156 | |||
157 | /* | ||
158 | * Setup TLB mappings | ||
159 | */ | ||
160 | sh64_tlb_init(); | ||
161 | |||
162 | /* | ||
163 | * Caches are already initialized by the time we get here, so we just | ||
164 | * fill in cpu_data info for the caches. | ||
165 | */ | ||
166 | sh64_cache_init(); | ||
167 | |||
168 | platform_setup(); | ||
169 | platform_monitor(); | ||
170 | |||
171 | sh64_cpu_type_detect(); | ||
172 | |||
173 | ROOT_DEV = old_decode_dev(ORIG_ROOT_DEV); | ||
174 | |||
175 | #ifdef CONFIG_BLK_DEV_RAM | ||
176 | rd_image_start = RAMDISK_FLAGS & RAMDISK_IMAGE_START_MASK; | ||
177 | rd_prompt = ((RAMDISK_FLAGS & RAMDISK_PROMPT_FLAG) != 0); | ||
178 | rd_doload = ((RAMDISK_FLAGS & RAMDISK_LOAD_FLAG) != 0); | ||
179 | #endif | ||
180 | |||
181 | if (!MOUNT_ROOT_RDONLY) | ||
182 | root_mountflags &= ~MS_RDONLY; | ||
183 | init_mm.start_code = (unsigned long) _text; | ||
184 | init_mm.end_code = (unsigned long) _etext; | ||
185 | init_mm.end_data = (unsigned long) _edata; | ||
186 | init_mm.brk = (unsigned long) _end; | ||
187 | |||
188 | code_resource.start = __pa(_text); | ||
189 | code_resource.end = __pa(_etext)-1; | ||
190 | data_resource.start = __pa(_etext); | ||
191 | data_resource.end = __pa(_edata)-1; | ||
192 | |||
193 | parse_mem_cmdline(cmdline_p); | ||
194 | |||
195 | /* | ||
196 | * Find the lowest and highest page frame numbers we have available | ||
197 | */ | ||
198 | first_pfn = PFN_DOWN(memory_start); | ||
199 | last_pfn = PFN_DOWN(memory_end); | ||
200 | pages = last_pfn - first_pfn; | ||
201 | |||
202 | /* | ||
203 | * Partially used pages are not usable - thus | ||
204 | * we are rounding upwards: | ||
205 | */ | ||
206 | start_pfn = PFN_UP(__pa(_end)); | ||
207 | |||
208 | /* | ||
209 | * Find a proper area for the bootmem bitmap. After this | ||
210 | * bootstrap step all allocations (until the page allocator | ||
211 | * is intact) must be done via bootmem_alloc(). | ||
212 | */ | ||
213 | bootmap_size = init_bootmem_node(NODE_DATA(0), start_pfn, | ||
214 | first_pfn, | ||
215 | last_pfn); | ||
216 | /* | ||
217 | * Round it up. | ||
218 | */ | ||
219 | bootmap_size = PFN_PHYS(PFN_UP(bootmap_size)); | ||
220 | |||
221 | /* | ||
222 | * Register fully available RAM pages with the bootmem allocator. | ||
223 | */ | ||
224 | free_bootmem_node(NODE_DATA(0), PFN_PHYS(first_pfn), PFN_PHYS(pages)); | ||
225 | |||
226 | /* | ||
227 | * Reserve all kernel sections + bootmem bitmap + a guard page. | ||
228 | */ | ||
229 | reserve_bootmem_node(NODE_DATA(0), PFN_PHYS(first_pfn), | ||
230 | (PFN_PHYS(start_pfn) + bootmap_size + PAGE_SIZE) - PFN_PHYS(first_pfn)); | ||
231 | |||
232 | /* | ||
233 | * Reserve platform dependent sections | ||
234 | */ | ||
235 | platform_reserve(); | ||
236 | |||
237 | #ifdef CONFIG_BLK_DEV_INITRD | ||
238 | if (LOADER_TYPE && INITRD_START) { | ||
239 | if (INITRD_START + INITRD_SIZE <= (PFN_PHYS(last_pfn))) { | ||
240 | reserve_bootmem_node(NODE_DATA(0), INITRD_START + __MEMORY_START, INITRD_SIZE); | ||
241 | |||
242 | initrd_start = (long) INITRD_START + PAGE_OFFSET + __MEMORY_START; | ||
243 | initrd_end = initrd_start + INITRD_SIZE; | ||
244 | } else { | ||
245 | printk("initrd extends beyond end of memory " | ||
246 | "(0x%08lx > 0x%08lx)\ndisabling initrd\n", | ||
247 | (long) INITRD_START + INITRD_SIZE, | ||
248 | PFN_PHYS(last_pfn)); | ||
249 | initrd_start = 0; | ||
250 | } | ||
251 | } | ||
252 | #endif | ||
253 | |||
254 | /* | ||
255 | * Claim all RAM, ROM, and I/O resources. | ||
256 | */ | ||
257 | |||
258 | /* Kernel RAM */ | ||
259 | request_resource(&iomem_resource, &code_resource); | ||
260 | request_resource(&iomem_resource, &data_resource); | ||
261 | |||
262 | /* Other KRAM space */ | ||
263 | for (i = 0; i < STANDARD_KRAM_RESOURCES - 2; i++) | ||
264 | request_resource(&iomem_resource, | ||
265 | &platform_parms.kram_res_p[i]); | ||
266 | |||
267 | /* XRAM space */ | ||
268 | for (i = 0; i < STANDARD_XRAM_RESOURCES; i++) | ||
269 | request_resource(&iomem_resource, | ||
270 | &platform_parms.xram_res_p[i]); | ||
271 | |||
272 | /* ROM space */ | ||
273 | for (i = 0; i < STANDARD_ROM_RESOURCES; i++) | ||
274 | request_resource(&iomem_resource, | ||
275 | &platform_parms.rom_res_p[i]); | ||
276 | |||
277 | /* I/O space */ | ||
278 | for (i = 0; i < STANDARD_IO_RESOURCES; i++) | ||
279 | request_resource(&ioport_resource, | ||
280 | &platform_parms.io_res_p[i]); | ||
281 | |||
282 | |||
283 | #ifdef CONFIG_VT | ||
284 | #if defined(CONFIG_VGA_CONSOLE) | ||
285 | conswitchp = &vga_con; | ||
286 | #elif defined(CONFIG_DUMMY_CONSOLE) | ||
287 | conswitchp = &dummy_con; | ||
288 | #endif | ||
289 | #endif | ||
290 | |||
291 | printk("Hardware FPU: %s\n", fpu_in_use ? "enabled" : "disabled"); | ||
292 | |||
293 | paging_init(); | ||
294 | } | ||
295 | |||
296 | void __xchg_called_with_bad_pointer(void) | ||
297 | { | ||
298 | printk(KERN_EMERG "xchg() called with bad pointer !\n"); | ||
299 | } | ||
300 | |||
301 | static struct cpu cpu[1]; | ||
302 | |||
303 | static int __init topology_init(void) | ||
304 | { | ||
305 | return register_cpu(cpu, 0); | ||
306 | } | ||
307 | |||
308 | subsys_initcall(topology_init); | ||
309 | |||
310 | /* | ||
311 | * Get CPU information | ||
312 | */ | ||
313 | static const char *cpu_name[] = { | ||
314 | [CPU_SH5_101] = "SH5-101", | ||
315 | [CPU_SH5_103] = "SH5-103", | ||
316 | [CPU_SH_NONE] = "Unknown", | ||
317 | }; | ||
318 | |||
319 | const char *get_cpu_subtype(void) | ||
320 | { | ||
321 | return cpu_name[boot_cpu_data.type]; | ||
322 | } | ||
323 | |||
324 | #ifdef CONFIG_PROC_FS | ||
325 | static int show_cpuinfo(struct seq_file *m,void *v) | ||
326 | { | ||
327 | unsigned int cpu = smp_processor_id(); | ||
328 | |||
329 | if (!cpu) | ||
330 | seq_printf(m, "machine\t\t: %s\n", get_system_type()); | ||
331 | |||
332 | seq_printf(m, "processor\t: %d\n", cpu); | ||
333 | seq_printf(m, "cpu family\t: SH-5\n"); | ||
334 | seq_printf(m, "cpu type\t: %s\n", get_cpu_subtype()); | ||
335 | |||
336 | seq_printf(m, "icache size\t: %dK-bytes\n", | ||
337 | (boot_cpu_data.icache.ways * | ||
338 | boot_cpu_data.icache.sets * | ||
339 | boot_cpu_data.icache.linesz) >> 10); | ||
340 | seq_printf(m, "dcache size\t: %dK-bytes\n", | ||
341 | (boot_cpu_data.dcache.ways * | ||
342 | boot_cpu_data.dcache.sets * | ||
343 | boot_cpu_data.dcache.linesz) >> 10); | ||
344 | seq_printf(m, "itlb entries\t: %d\n", boot_cpu_data.itlb.entries); | ||
345 | seq_printf(m, "dtlb entries\t: %d\n", boot_cpu_data.dtlb.entries); | ||
346 | |||
347 | #define PRINT_CLOCK(name, value) \ | ||
348 | seq_printf(m, name " clock\t: %d.%02dMHz\n", \ | ||
349 | ((value) / 1000000), ((value) % 1000000)/10000) | ||
350 | |||
351 | PRINT_CLOCK("cpu", boot_cpu_data.cpu_clock); | ||
352 | PRINT_CLOCK("bus", boot_cpu_data.bus_clock); | ||
353 | PRINT_CLOCK("module", boot_cpu_data.module_clock); | ||
354 | |||
355 | seq_printf(m, "bogomips\t: %lu.%02lu\n\n", | ||
356 | (loops_per_jiffy*HZ+2500)/500000, | ||
357 | ((loops_per_jiffy*HZ+2500)/5000) % 100); | ||
358 | |||
359 | return 0; | ||
360 | } | ||
361 | |||
362 | static void *c_start(struct seq_file *m, loff_t *pos) | ||
363 | { | ||
364 | return (void*)(*pos == 0); | ||
365 | } | ||
366 | static void *c_next(struct seq_file *m, void *v, loff_t *pos) | ||
367 | { | ||
368 | return NULL; | ||
369 | } | ||
370 | static void c_stop(struct seq_file *m, void *v) | ||
371 | { | ||
372 | } | ||
373 | struct seq_operations cpuinfo_op = { | ||
374 | .start = c_start, | ||
375 | .next = c_next, | ||
376 | .stop = c_stop, | ||
377 | .show = show_cpuinfo, | ||
378 | }; | ||
379 | #endif /* CONFIG_PROC_FS */ | ||
diff --git a/arch/sh64/kernel/sys_sh64.c b/arch/sh64/kernel/sys_sh64.c deleted file mode 100644 index de0a303ba26f..000000000000 --- a/arch/sh64/kernel/sys_sh64.c +++ /dev/null | |||
@@ -1,304 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * arch/sh64/kernel/sys_sh64.c | ||
7 | * | ||
8 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
9 | * | ||
10 | * This file contains various random system calls that | ||
11 | * have a non-standard calling sequence on the Linux/SH5 | ||
12 | * platform. | ||
13 | * | ||
14 | * Mostly taken from i386 version. | ||
15 | * | ||
16 | */ | ||
17 | |||
18 | #include <linux/errno.h> | ||
19 | #include <linux/rwsem.h> | ||
20 | #include <linux/sched.h> | ||
21 | #include <linux/mm.h> | ||
22 | #include <linux/fs.h> | ||
23 | #include <linux/smp.h> | ||
24 | #include <linux/sem.h> | ||
25 | #include <linux/msg.h> | ||
26 | #include <linux/shm.h> | ||
27 | #include <linux/stat.h> | ||
28 | #include <linux/mman.h> | ||
29 | #include <linux/file.h> | ||
30 | #include <linux/utsname.h> | ||
31 | #include <linux/syscalls.h> | ||
32 | #include <linux/ipc.h> | ||
33 | #include <asm/uaccess.h> | ||
34 | #include <asm/ptrace.h> | ||
35 | #include <asm/unistd.h> | ||
36 | |||
37 | #define REG_3 3 | ||
38 | |||
39 | /* | ||
40 | * sys_pipe() is the normal C calling standard for creating | ||
41 | * a pipe. It's not the way Unix traditionally does this, though. | ||
42 | */ | ||
43 | #ifdef NEW_PIPE_IMPLEMENTATION | ||
44 | asmlinkage int sys_pipe(unsigned long * fildes, | ||
45 | unsigned long dummy_r3, | ||
46 | unsigned long dummy_r4, | ||
47 | unsigned long dummy_r5, | ||
48 | unsigned long dummy_r6, | ||
49 | unsigned long dummy_r7, | ||
50 | struct pt_regs * regs) /* r8 = pt_regs forced by entry.S */ | ||
51 | { | ||
52 | int fd[2]; | ||
53 | int ret; | ||
54 | |||
55 | ret = do_pipe(fd); | ||
56 | if (ret == 0) | ||
57 | /* | ||
58 | *********************************************************************** | ||
59 | * To avoid the copy_to_user we prefer to break the ABIs convention, * | ||
60 | * packing the valid pair of file IDs into a single register (r3); * | ||
61 | * while r2 is the return code as defined by the sh5-ABIs. * | ||
62 | * BE CAREFUL: pipe stub, into glibc, must be aware of this solution * | ||
63 | *********************************************************************** | ||
64 | |||
65 | #ifdef __LITTLE_ENDIAN__ | ||
66 | regs->regs[REG_3] = (((unsigned long long) fd[1]) << 32) | ((unsigned long long) fd[0]); | ||
67 | #else | ||
68 | regs->regs[REG_3] = (((unsigned long long) fd[0]) << 32) | ((unsigned long long) fd[1]); | ||
69 | #endif | ||
70 | |||
71 | */ | ||
72 | /* although not very clever this is endianess independent */ | ||
73 | regs->regs[REG_3] = (unsigned long long) *((unsigned long long *) fd); | ||
74 | |||
75 | return ret; | ||
76 | } | ||
77 | |||
78 | #else | ||
79 | asmlinkage int sys_pipe(unsigned long * fildes) | ||
80 | { | ||
81 | int fd[2]; | ||
82 | int error; | ||
83 | |||
84 | error = do_pipe(fd); | ||
85 | if (!error) { | ||
86 | if (copy_to_user(fildes, fd, 2*sizeof(int))) | ||
87 | error = -EFAULT; | ||
88 | } | ||
89 | return error; | ||
90 | } | ||
91 | |||
92 | #endif | ||
93 | |||
94 | /* | ||
95 | * To avoid cache alias, we map the shard page with same color. | ||
96 | */ | ||
97 | #define COLOUR_ALIGN(addr) (((addr)+SHMLBA-1)&~(SHMLBA-1)) | ||
98 | |||
99 | unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, | ||
100 | unsigned long len, unsigned long pgoff, unsigned long flags) | ||
101 | { | ||
102 | struct vm_area_struct *vma; | ||
103 | |||
104 | if (flags & MAP_FIXED) { | ||
105 | /* We do not accept a shared mapping if it would violate | ||
106 | * cache aliasing constraints. | ||
107 | */ | ||
108 | if ((flags & MAP_SHARED) && (addr & (SHMLBA - 1))) | ||
109 | return -EINVAL; | ||
110 | return addr; | ||
111 | } | ||
112 | |||
113 | if (len > TASK_SIZE) | ||
114 | return -ENOMEM; | ||
115 | if (!addr) | ||
116 | addr = TASK_UNMAPPED_BASE; | ||
117 | |||
118 | if (flags & MAP_PRIVATE) | ||
119 | addr = PAGE_ALIGN(addr); | ||
120 | else | ||
121 | addr = COLOUR_ALIGN(addr); | ||
122 | |||
123 | for (vma = find_vma(current->mm, addr); ; vma = vma->vm_next) { | ||
124 | /* At this point: (!vma || addr < vma->vm_end). */ | ||
125 | if (TASK_SIZE - len < addr) | ||
126 | return -ENOMEM; | ||
127 | if (!vma || addr + len <= vma->vm_start) | ||
128 | return addr; | ||
129 | addr = vma->vm_end; | ||
130 | if (!(flags & MAP_PRIVATE)) | ||
131 | addr = COLOUR_ALIGN(addr); | ||
132 | } | ||
133 | } | ||
134 | |||
135 | /* common code for old and new mmaps */ | ||
136 | static inline long do_mmap2( | ||
137 | unsigned long addr, unsigned long len, | ||
138 | unsigned long prot, unsigned long flags, | ||
139 | unsigned long fd, unsigned long pgoff) | ||
140 | { | ||
141 | int error = -EBADF; | ||
142 | struct file * file = NULL; | ||
143 | |||
144 | flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE); | ||
145 | if (!(flags & MAP_ANONYMOUS)) { | ||
146 | file = fget(fd); | ||
147 | if (!file) | ||
148 | goto out; | ||
149 | } | ||
150 | |||
151 | down_write(¤t->mm->mmap_sem); | ||
152 | error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff); | ||
153 | up_write(¤t->mm->mmap_sem); | ||
154 | |||
155 | if (file) | ||
156 | fput(file); | ||
157 | out: | ||
158 | return error; | ||
159 | } | ||
160 | |||
161 | asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, | ||
162 | unsigned long prot, unsigned long flags, | ||
163 | unsigned long fd, unsigned long pgoff) | ||
164 | { | ||
165 | return do_mmap2(addr, len, prot, flags, fd, pgoff); | ||
166 | } | ||
167 | |||
168 | asmlinkage int old_mmap(unsigned long addr, unsigned long len, | ||
169 | unsigned long prot, unsigned long flags, | ||
170 | int fd, unsigned long off) | ||
171 | { | ||
172 | if (off & ~PAGE_MASK) | ||
173 | return -EINVAL; | ||
174 | return do_mmap2(addr, len, prot, flags, fd, off>>PAGE_SHIFT); | ||
175 | } | ||
176 | |||
177 | /* | ||
178 | * sys_ipc() is the de-multiplexer for the SysV IPC calls.. | ||
179 | * | ||
180 | * This is really horribly ugly. | ||
181 | */ | ||
182 | asmlinkage int sys_ipc(uint call, int first, int second, | ||
183 | int third, void __user *ptr, long fifth) | ||
184 | { | ||
185 | int version, ret; | ||
186 | |||
187 | version = call >> 16; /* hack for backward compatibility */ | ||
188 | call &= 0xffff; | ||
189 | |||
190 | if (call <= SEMCTL) | ||
191 | switch (call) { | ||
192 | case SEMOP: | ||
193 | return sys_semtimedop(first, (struct sembuf __user *)ptr, | ||
194 | second, NULL); | ||
195 | case SEMTIMEDOP: | ||
196 | return sys_semtimedop(first, (struct sembuf __user *)ptr, | ||
197 | second, | ||
198 | (const struct timespec __user *)fifth); | ||
199 | case SEMGET: | ||
200 | return sys_semget (first, second, third); | ||
201 | case SEMCTL: { | ||
202 | union semun fourth; | ||
203 | if (!ptr) | ||
204 | return -EINVAL; | ||
205 | if (get_user(fourth.__pad, (void * __user *) ptr)) | ||
206 | return -EFAULT; | ||
207 | return sys_semctl (first, second, third, fourth); | ||
208 | } | ||
209 | default: | ||
210 | return -EINVAL; | ||
211 | } | ||
212 | |||
213 | if (call <= MSGCTL) | ||
214 | switch (call) { | ||
215 | case MSGSND: | ||
216 | return sys_msgsnd (first, (struct msgbuf __user *) ptr, | ||
217 | second, third); | ||
218 | case MSGRCV: | ||
219 | switch (version) { | ||
220 | case 0: { | ||
221 | struct ipc_kludge tmp; | ||
222 | if (!ptr) | ||
223 | return -EINVAL; | ||
224 | |||
225 | if (copy_from_user(&tmp, | ||
226 | (struct ipc_kludge __user *) ptr, | ||
227 | sizeof (tmp))) | ||
228 | return -EFAULT; | ||
229 | return sys_msgrcv (first, tmp.msgp, second, | ||
230 | tmp.msgtyp, third); | ||
231 | } | ||
232 | default: | ||
233 | return sys_msgrcv (first, | ||
234 | (struct msgbuf __user *) ptr, | ||
235 | second, fifth, third); | ||
236 | } | ||
237 | case MSGGET: | ||
238 | return sys_msgget ((key_t) first, second); | ||
239 | case MSGCTL: | ||
240 | return sys_msgctl (first, second, | ||
241 | (struct msqid_ds __user *) ptr); | ||
242 | default: | ||
243 | return -EINVAL; | ||
244 | } | ||
245 | if (call <= SHMCTL) | ||
246 | switch (call) { | ||
247 | case SHMAT: | ||
248 | switch (version) { | ||
249 | default: { | ||
250 | ulong raddr; | ||
251 | ret = do_shmat (first, (char __user *) ptr, | ||
252 | second, &raddr); | ||
253 | if (ret) | ||
254 | return ret; | ||
255 | return put_user (raddr, (ulong __user *) third); | ||
256 | } | ||
257 | case 1: /* iBCS2 emulator entry point */ | ||
258 | if (!segment_eq(get_fs(), get_ds())) | ||
259 | return -EINVAL; | ||
260 | return do_shmat (first, (char __user *) ptr, | ||
261 | second, (ulong *) third); | ||
262 | } | ||
263 | case SHMDT: | ||
264 | return sys_shmdt ((char __user *)ptr); | ||
265 | case SHMGET: | ||
266 | return sys_shmget (first, second, third); | ||
267 | case SHMCTL: | ||
268 | return sys_shmctl (first, second, | ||
269 | (struct shmid_ds __user *) ptr); | ||
270 | default: | ||
271 | return -EINVAL; | ||
272 | } | ||
273 | |||
274 | return -EINVAL; | ||
275 | } | ||
276 | |||
277 | asmlinkage int sys_uname(struct old_utsname * name) | ||
278 | { | ||
279 | int err; | ||
280 | if (!name) | ||
281 | return -EFAULT; | ||
282 | down_read(&uts_sem); | ||
283 | err = copy_to_user(name, utsname(), sizeof (*name)); | ||
284 | up_read(&uts_sem); | ||
285 | return err?-EFAULT:0; | ||
286 | } | ||
287 | |||
288 | /* | ||
289 | * Do a system call from kernel instead of calling sys_execve so we | ||
290 | * end up with proper pt_regs. | ||
291 | */ | ||
292 | int kernel_execve(const char *filename, char *const argv[], char *const envp[]) | ||
293 | { | ||
294 | register unsigned long __sc0 __asm__ ("r9") = ((0x13 << 16) | __NR_execve); | ||
295 | register unsigned long __sc2 __asm__ ("r2") = (unsigned long) filename; | ||
296 | register unsigned long __sc3 __asm__ ("r3") = (unsigned long) argv; | ||
297 | register unsigned long __sc4 __asm__ ("r4") = (unsigned long) envp; | ||
298 | __asm__ __volatile__ ("trapa %1 !\t\t\t execve(%2,%3,%4)" | ||
299 | : "=r" (__sc0) | ||
300 | : "r" (__sc0), "r" (__sc2), "r" (__sc3), "r" (__sc4) ); | ||
301 | __asm__ __volatile__ ("!dummy %0 %1 %2 %3" | ||
302 | : : "r" (__sc0), "r" (__sc2), "r" (__sc3), "r" (__sc4) : "memory"); | ||
303 | return __sc0; | ||
304 | } | ||
diff --git a/arch/sh64/kernel/vmlinux.lds.S b/arch/sh64/kernel/vmlinux.lds.S deleted file mode 100644 index f533a064da5f..000000000000 --- a/arch/sh64/kernel/vmlinux.lds.S +++ /dev/null | |||
@@ -1,140 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * arch/sh5/vmlinux.lds.S | ||
7 | * | ||
8 | * ld script to make ST50 Linux kernel | ||
9 | * | ||
10 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
11 | * | ||
12 | * benedict.gaster@superh.com: 2nd May 2002 | ||
13 | * Add definition of empty_zero_page to be the first page of kernel image. | ||
14 | * | ||
15 | * benedict.gaster@superh.com: 3rd May 2002 | ||
16 | * Added support for ramdisk, removing statically linked romfs at the same time. | ||
17 | * | ||
18 | * lethal@linux-sh.org: 9th May 2003 | ||
19 | * Kill off GLOBAL_NAME() usage and other CDC-isms. | ||
20 | * | ||
21 | * lethal@linux-sh.org: 19th May 2003 | ||
22 | * Remove support for ancient toolchains. | ||
23 | */ | ||
24 | |||
25 | #include <asm/page.h> | ||
26 | #include <asm/cache.h> | ||
27 | #include <asm/processor.h> | ||
28 | #include <asm/thread_info.h> | ||
29 | |||
30 | #define LOAD_OFFSET CONFIG_CACHED_MEMORY_OFFSET | ||
31 | #include <asm-generic/vmlinux.lds.h> | ||
32 | |||
33 | OUTPUT_ARCH(sh:sh5) | ||
34 | |||
35 | #define C_PHYS(x) AT (ADDR(x) - LOAD_OFFSET) | ||
36 | |||
37 | ENTRY(__start) | ||
38 | SECTIONS | ||
39 | { | ||
40 | . = CONFIG_CACHED_MEMORY_OFFSET + CONFIG_MEMORY_START + PAGE_SIZE; | ||
41 | _text = .; /* Text and read-only data */ | ||
42 | text = .; /* Text and read-only data */ | ||
43 | |||
44 | .empty_zero_page : C_PHYS(.empty_zero_page) { | ||
45 | *(.empty_zero_page) | ||
46 | } = 0 | ||
47 | |||
48 | .text : C_PHYS(.text) { | ||
49 | *(.text.head) | ||
50 | TEXT_TEXT | ||
51 | *(.text64) | ||
52 | *(.text..SHmedia32) | ||
53 | SCHED_TEXT | ||
54 | LOCK_TEXT | ||
55 | *(.fixup) | ||
56 | *(.gnu.warning) | ||
57 | #ifdef CONFIG_LITTLE_ENDIAN | ||
58 | } = 0x6ff0fff0 | ||
59 | #else | ||
60 | } = 0xf0fff06f | ||
61 | #endif | ||
62 | |||
63 | /* We likely want __ex_table to be Cache Line aligned */ | ||
64 | . = ALIGN(L1_CACHE_BYTES); /* Exception table */ | ||
65 | __start___ex_table = .; | ||
66 | __ex_table : C_PHYS(__ex_table) { *(__ex_table) } | ||
67 | __stop___ex_table = .; | ||
68 | |||
69 | _etext = .; /* End of text section */ | ||
70 | |||
71 | NOTES | ||
72 | |||
73 | RODATA | ||
74 | |||
75 | .data : C_PHYS(.data) { /* Data */ | ||
76 | DATA_DATA | ||
77 | CONSTRUCTORS | ||
78 | } | ||
79 | |||
80 | . = ALIGN(PAGE_SIZE); | ||
81 | .data.page_aligned : C_PHYS(.data.page_aligned) { *(.data.page_aligned) } | ||
82 | |||
83 | PERCPU(PAGE_SIZE) | ||
84 | |||
85 | . = ALIGN(L1_CACHE_BYTES); | ||
86 | .data.cacheline_aligned : C_PHYS(.data.cacheline_aligned) { *(.data.cacheline_aligned) } | ||
87 | |||
88 | _edata = .; /* End of data section */ | ||
89 | |||
90 | . = ALIGN(THREAD_SIZE); /* init_task: structure size aligned */ | ||
91 | .data.init_task : C_PHYS(.data.init_task) { *(.data.init_task) } | ||
92 | |||
93 | . = ALIGN(PAGE_SIZE); /* Init code and data */ | ||
94 | __init_begin = .; | ||
95 | _sinittext = .; | ||
96 | .init.text : C_PHYS(.init.text) { *(.init.text) } | ||
97 | _einittext = .; | ||
98 | .init.data : C_PHYS(.init.data) { *(.init.data) } | ||
99 | . = ALIGN(L1_CACHE_BYTES); /* Better if Cache Line aligned */ | ||
100 | __setup_start = .; | ||
101 | .init.setup : C_PHYS(.init.setup) { *(.init.setup) } | ||
102 | __setup_end = .; | ||
103 | __initcall_start = .; | ||
104 | .initcall.init : C_PHYS(.initcall.init) { | ||
105 | INITCALLS | ||
106 | } | ||
107 | __initcall_end = .; | ||
108 | __con_initcall_start = .; | ||
109 | .con_initcall.init : C_PHYS(.con_initcall.init) { *(.con_initcall.init) } | ||
110 | __con_initcall_end = .; | ||
111 | SECURITY_INIT | ||
112 | |||
113 | #ifdef CONFIG_BLK_DEV_INITRD | ||
114 | __initramfs_start = .; | ||
115 | .init.ramfs : C_PHYS(.init.ramfs) { *(.init.ramfs) } | ||
116 | __initramfs_end = .; | ||
117 | #endif | ||
118 | |||
119 | . = ALIGN(PAGE_SIZE); | ||
120 | __init_end = .; | ||
121 | |||
122 | /* Align to the biggest single data representation, head and tail */ | ||
123 | . = ALIGN(8); | ||
124 | __bss_start = .; /* BSS */ | ||
125 | .bss : C_PHYS(.bss) { | ||
126 | *(.bss) | ||
127 | } | ||
128 | . = ALIGN(8); | ||
129 | _end = . ; | ||
130 | |||
131 | /* Sections to be discarded */ | ||
132 | /DISCARD/ : { | ||
133 | *(.exit.text) | ||
134 | *(.exit.data) | ||
135 | *(.exitcall.exit) | ||
136 | } | ||
137 | |||
138 | STABS_DEBUG | ||
139 | DWARF_DEBUG | ||
140 | } | ||
diff --git a/arch/sh64/lib/Makefile b/arch/sh64/lib/Makefile deleted file mode 100644 index 6a4cc3f9c0b1..000000000000 --- a/arch/sh64/lib/Makefile +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | # | ||
2 | # This file is subject to the terms and conditions of the GNU General Public | ||
3 | # License. See the file "COPYING" in the main directory of this archive | ||
4 | # for more details. | ||
5 | # | ||
6 | # Copyright (C) 2000, 2001 Paolo Alberelli | ||
7 | # Coprygith (C) 2003 Paul Mundt | ||
8 | # | ||
9 | # Makefile for the SH-5 specific library files.. | ||
10 | # | ||
11 | # Note! Dependencies are done automagically by 'make dep', which also | ||
12 | # removes any old dependencies. DON'T put your own dependencies here | ||
13 | # unless it's something special (ie not a .c file). | ||
14 | # | ||
15 | |||
16 | # Panic should really be compiled as PIC | ||
17 | lib-y := udelay.o c-checksum.o dbg.o io.o panic.o memcpy.o copy_user_memcpy.o \ | ||
18 | page_copy.o page_clear.o iomap.o | ||
19 | |||
diff --git a/arch/sh64/lib/io.c b/arch/sh64/lib/io.c deleted file mode 100644 index a3f3a2b8e25b..000000000000 --- a/arch/sh64/lib/io.c +++ /dev/null | |||
@@ -1,128 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2000 David J. Mckay (david.mckay@st.com) | ||
3 | * | ||
4 | * May be copied or modified under the terms of the GNU General Public | ||
5 | * License. See linux/COPYING for more information. | ||
6 | * | ||
7 | * This file contains the I/O routines for use on the overdrive board | ||
8 | * | ||
9 | */ | ||
10 | |||
11 | #include <linux/kernel.h> | ||
12 | #include <linux/types.h> | ||
13 | #include <linux/delay.h> | ||
14 | #include <linux/module.h> | ||
15 | #include <asm/system.h> | ||
16 | #include <asm/processor.h> | ||
17 | #include <asm/io.h> | ||
18 | |||
19 | /* Now for the string version of these functions */ | ||
20 | void outsb(unsigned long port, const void *addr, unsigned long count) | ||
21 | { | ||
22 | int i; | ||
23 | unsigned char *p = (unsigned char *) addr; | ||
24 | |||
25 | for (i = 0; i < count; i++, p++) { | ||
26 | outb(*p, port); | ||
27 | } | ||
28 | } | ||
29 | EXPORT_SYMBOL(outsb); | ||
30 | |||
31 | void insb(unsigned long port, void *addr, unsigned long count) | ||
32 | { | ||
33 | int i; | ||
34 | unsigned char *p = (unsigned char *) addr; | ||
35 | |||
36 | for (i = 0; i < count; i++, p++) { | ||
37 | *p = inb(port); | ||
38 | } | ||
39 | } | ||
40 | EXPORT_SYMBOL(insb); | ||
41 | |||
42 | /* For the 16 and 32 bit string functions, we have to worry about alignment. | ||
43 | * The SH does not do unaligned accesses, so we have to read as bytes and | ||
44 | * then write as a word or dword. | ||
45 | * This can be optimised a lot more, especially in the case where the data | ||
46 | * is aligned | ||
47 | */ | ||
48 | |||
49 | void outsw(unsigned long port, const void *addr, unsigned long count) | ||
50 | { | ||
51 | int i; | ||
52 | unsigned short tmp; | ||
53 | unsigned char *p = (unsigned char *) addr; | ||
54 | |||
55 | for (i = 0; i < count; i++, p += 2) { | ||
56 | tmp = (*p) | ((*(p + 1)) << 8); | ||
57 | outw(tmp, port); | ||
58 | } | ||
59 | } | ||
60 | EXPORT_SYMBOL(outsw); | ||
61 | |||
62 | void insw(unsigned long port, void *addr, unsigned long count) | ||
63 | { | ||
64 | int i; | ||
65 | unsigned short tmp; | ||
66 | unsigned char *p = (unsigned char *) addr; | ||
67 | |||
68 | for (i = 0; i < count; i++, p += 2) { | ||
69 | tmp = inw(port); | ||
70 | p[0] = tmp & 0xff; | ||
71 | p[1] = (tmp >> 8) & 0xff; | ||
72 | } | ||
73 | } | ||
74 | EXPORT_SYMBOL(insw); | ||
75 | |||
76 | void outsl(unsigned long port, const void *addr, unsigned long count) | ||
77 | { | ||
78 | int i; | ||
79 | unsigned tmp; | ||
80 | unsigned char *p = (unsigned char *) addr; | ||
81 | |||
82 | for (i = 0; i < count; i++, p += 4) { | ||
83 | tmp = (*p) | ((*(p + 1)) << 8) | ((*(p + 2)) << 16) | | ||
84 | ((*(p + 3)) << 24); | ||
85 | outl(tmp, port); | ||
86 | } | ||
87 | } | ||
88 | EXPORT_SYMBOL(outsl); | ||
89 | |||
90 | void insl(unsigned long port, void *addr, unsigned long count) | ||
91 | { | ||
92 | int i; | ||
93 | unsigned tmp; | ||
94 | unsigned char *p = (unsigned char *) addr; | ||
95 | |||
96 | for (i = 0; i < count; i++, p += 4) { | ||
97 | tmp = inl(port); | ||
98 | p[0] = tmp & 0xff; | ||
99 | p[1] = (tmp >> 8) & 0xff; | ||
100 | p[2] = (tmp >> 16) & 0xff; | ||
101 | p[3] = (tmp >> 24) & 0xff; | ||
102 | |||
103 | } | ||
104 | } | ||
105 | EXPORT_SYMBOL(insl); | ||
106 | |||
107 | void memcpy_toio(void __iomem *to, const void *from, long count) | ||
108 | { | ||
109 | unsigned char *p = (unsigned char *) from; | ||
110 | |||
111 | while (count) { | ||
112 | count--; | ||
113 | writeb(*p++, to++); | ||
114 | } | ||
115 | } | ||
116 | EXPORT_SYMBOL(memcpy_toio); | ||
117 | |||
118 | void memcpy_fromio(void *to, void __iomem *from, long count) | ||
119 | { | ||
120 | int i; | ||
121 | unsigned char *p = (unsigned char *) to; | ||
122 | |||
123 | for (i = 0; i < count; i++) { | ||
124 | p[i] = readb(from); | ||
125 | from++; | ||
126 | } | ||
127 | } | ||
128 | EXPORT_SYMBOL(memcpy_fromio); | ||
diff --git a/arch/sh64/lib/iomap.c b/arch/sh64/lib/iomap.c deleted file mode 100644 index 253d1e351d49..000000000000 --- a/arch/sh64/lib/iomap.c +++ /dev/null | |||
@@ -1,54 +0,0 @@ | |||
1 | /* | ||
2 | * arch/sh64/lib/iomap.c | ||
3 | * | ||
4 | * Generic sh64 iomap interface | ||
5 | * | ||
6 | * Copyright (C) 2004 Paul Mundt | ||
7 | * | ||
8 | * This file is subject to the terms and conditions of the GNU General Public | ||
9 | * License. See the file "COPYING" in the main directory of this archive | ||
10 | * for more details. | ||
11 | */ | ||
12 | #include <linux/pci.h> | ||
13 | #include <asm/io.h> | ||
14 | |||
15 | void __iomem *__attribute__ ((weak)) | ||
16 | ioport_map(unsigned long port, unsigned int len) | ||
17 | { | ||
18 | return (void __iomem *)port; | ||
19 | } | ||
20 | EXPORT_SYMBOL(ioport_map); | ||
21 | |||
22 | void ioport_unmap(void __iomem *addr) | ||
23 | { | ||
24 | /* Nothing .. */ | ||
25 | } | ||
26 | EXPORT_SYMBOL(ioport_unmap); | ||
27 | |||
28 | #ifdef CONFIG_PCI | ||
29 | void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) | ||
30 | { | ||
31 | unsigned long start = pci_resource_start(dev, bar); | ||
32 | unsigned long len = pci_resource_len(dev, bar); | ||
33 | unsigned long flags = pci_resource_flags(dev, bar); | ||
34 | |||
35 | if (!len) | ||
36 | return NULL; | ||
37 | if (max && len > max) | ||
38 | len = max; | ||
39 | if (flags & IORESOURCE_IO) | ||
40 | return ioport_map(start + pciio_virt, len); | ||
41 | if (flags & IORESOURCE_MEM) | ||
42 | return (void __iomem *)start; | ||
43 | |||
44 | /* What? */ | ||
45 | return NULL; | ||
46 | } | ||
47 | EXPORT_SYMBOL(pci_iomap); | ||
48 | |||
49 | void pci_iounmap(struct pci_dev *dev, void __iomem *addr) | ||
50 | { | ||
51 | /* Nothing .. */ | ||
52 | } | ||
53 | EXPORT_SYMBOL(pci_iounmap); | ||
54 | #endif | ||
diff --git a/arch/sh64/mach-cayman/Makefile b/arch/sh64/mach-cayman/Makefile deleted file mode 100644 index 67a2258bf8c4..000000000000 --- a/arch/sh64/mach-cayman/Makefile +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | # | ||
2 | # Makefile for the Hitachi Cayman specific parts of the kernel | ||
3 | # | ||
4 | # Note! Dependencies are done automagically by 'make dep', which also | ||
5 | # removes any old dependencies. DON'T put your own dependencies here | ||
6 | # unless it's something special (ie not a .c file). | ||
7 | # | ||
8 | |||
9 | obj-y := setup.o irq.o iomap.o | ||
10 | obj-$(CONFIG_HEARTBEAT) += led.o | ||
11 | |||
diff --git a/arch/sh64/mach-cayman/iomap.c b/arch/sh64/mach-cayman/iomap.c deleted file mode 100644 index a5c645f02d57..000000000000 --- a/arch/sh64/mach-cayman/iomap.c +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | /* | ||
2 | * arch/sh64/mach-cayman/iomap.c | ||
3 | * | ||
4 | * Cayman iomap interface | ||
5 | * | ||
6 | * Copyright (C) 2004 Paul Mundt | ||
7 | * | ||
8 | * This file is subject to the terms and conditions of the GNU General Public | ||
9 | * License. See the file "COPYING" in the main directory of this archive | ||
10 | * for more details. | ||
11 | */ | ||
12 | #include <asm/io.h> | ||
13 | #include <asm/cayman.h> | ||
14 | |||
15 | void __iomem *ioport_map(unsigned long port, unsigned int len) | ||
16 | { | ||
17 | if (port < 0x400) | ||
18 | return (void __iomem *)((port << 2) | smsc_superio_virt); | ||
19 | |||
20 | return (void __iomem *)port; | ||
21 | } | ||
22 | |||
diff --git a/arch/sh64/mach-harp/Makefile b/arch/sh64/mach-harp/Makefile deleted file mode 100644 index 2f2963fa2131..000000000000 --- a/arch/sh64/mach-harp/Makefile +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | obj-y := setup.o | ||
diff --git a/arch/sh64/mach-harp/setup.c b/arch/sh64/mach-harp/setup.c deleted file mode 100644 index 05011cb369bb..000000000000 --- a/arch/sh64/mach-harp/setup.c +++ /dev/null | |||
@@ -1,129 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * arch/sh64/mach-harp/setup.c | ||
7 | * | ||
8 | * SH-5 Simulator Platform Support | ||
9 | * | ||
10 | * This file handles the architecture-dependent parts of initialization | ||
11 | * | ||
12 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
13 | * | ||
14 | * benedict.gaster@superh.com: 3rd May 2002 | ||
15 | * Added support for ramdisk, removing statically linked romfs at the same time. * | ||
16 | * | ||
17 | * lethal@linux-sh.org: 15th May 2003 | ||
18 | * Use the generic procfs cpuinfo interface, just return a valid board name. | ||
19 | */ | ||
20 | #include <linux/init.h> | ||
21 | #include <linux/kernel.h> | ||
22 | #include <asm/platform.h> | ||
23 | #include <asm/irq.h> | ||
24 | |||
25 | /* | ||
26 | * Platform Dependent Interrupt Priorities. | ||
27 | */ | ||
28 | |||
29 | /* Using defaults defined in irq.h */ | ||
30 | #define RES NO_PRIORITY /* Disabled */ | ||
31 | #define IR0 IRL0_PRIORITY /* IRLs */ | ||
32 | #define IR1 IRL1_PRIORITY | ||
33 | #define IR2 IRL2_PRIORITY | ||
34 | #define IR3 IRL3_PRIORITY | ||
35 | #define PCA INTA_PRIORITY /* PCI Ints */ | ||
36 | #define PCB INTB_PRIORITY | ||
37 | #define PCC INTC_PRIORITY | ||
38 | #define PCD INTD_PRIORITY | ||
39 | #define SER TOP_PRIORITY | ||
40 | #define ERR TOP_PRIORITY | ||
41 | #define PW0 TOP_PRIORITY | ||
42 | #define PW1 TOP_PRIORITY | ||
43 | #define PW2 TOP_PRIORITY | ||
44 | #define PW3 TOP_PRIORITY | ||
45 | #define DM0 NO_PRIORITY /* DMA Ints */ | ||
46 | #define DM1 NO_PRIORITY | ||
47 | #define DM2 NO_PRIORITY | ||
48 | #define DM3 NO_PRIORITY | ||
49 | #define DAE NO_PRIORITY | ||
50 | #define TU0 TIMER_PRIORITY /* TMU Ints */ | ||
51 | #define TU1 NO_PRIORITY | ||
52 | #define TU2 NO_PRIORITY | ||
53 | #define TI2 NO_PRIORITY | ||
54 | #define ATI NO_PRIORITY /* RTC Ints */ | ||
55 | #define PRI NO_PRIORITY | ||
56 | #define CUI RTC_PRIORITY | ||
57 | #define ERI SCIF_PRIORITY /* SCIF Ints */ | ||
58 | #define RXI SCIF_PRIORITY | ||
59 | #define BRI SCIF_PRIORITY | ||
60 | #define TXI SCIF_PRIORITY | ||
61 | #define ITI TOP_PRIORITY /* WDT Ints */ | ||
62 | |||
63 | /* | ||
64 | * Platform dependent structures: maps and parms block. | ||
65 | */ | ||
66 | struct resource io_resources[] = { | ||
67 | /* To be updated with external devices */ | ||
68 | }; | ||
69 | |||
70 | struct resource kram_resources[] = { | ||
71 | /* These must be last in the array */ | ||
72 | { .name = "Kernel code", .start = 0, .end = 0 }, | ||
73 | /* These must be last in the array */ | ||
74 | { .name = "Kernel data", .start = 0, .end = 0 } | ||
75 | }; | ||
76 | |||
77 | struct resource xram_resources[] = { | ||
78 | /* To be updated with external devices */ | ||
79 | }; | ||
80 | |||
81 | struct resource rom_resources[] = { | ||
82 | /* To be updated with external devices */ | ||
83 | }; | ||
84 | |||
85 | struct sh64_platform platform_parms = { | ||
86 | .readonly_rootfs = 1, | ||
87 | .initial_root_dev = 0x0100, | ||
88 | .loader_type = 1, | ||
89 | .io_res_p = io_resources, | ||
90 | .io_res_count = ARRAY_SIZE(io_resources), | ||
91 | .kram_res_p = kram_resources, | ||
92 | .kram_res_count = ARRAY_SIZE(kram_resources), | ||
93 | .xram_res_p = xram_resources, | ||
94 | .xram_res_count = ARRAY_SIZE(xram_resources), | ||
95 | .rom_res_p = rom_resources, | ||
96 | .rom_res_count = ARRAY_SIZE(rom_resources), | ||
97 | }; | ||
98 | |||
99 | int platform_int_priority[NR_INTC_IRQS] = { | ||
100 | IR0, IR1, IR2, IR3, PCA, PCB, PCC, PCD, /* IRQ 0- 7 */ | ||
101 | RES, RES, RES, RES, SER, ERR, PW3, PW2, /* IRQ 8-15 */ | ||
102 | PW1, PW0, DM0, DM1, DM2, DM3, DAE, RES, /* IRQ 16-23 */ | ||
103 | RES, RES, RES, RES, RES, RES, RES, RES, /* IRQ 24-31 */ | ||
104 | TU0, TU1, TU2, TI2, ATI, PRI, CUI, ERI, /* IRQ 32-39 */ | ||
105 | RXI, BRI, TXI, RES, RES, RES, RES, RES, /* IRQ 40-47 */ | ||
106 | RES, RES, RES, RES, RES, RES, RES, RES, /* IRQ 48-55 */ | ||
107 | RES, RES, RES, RES, RES, RES, RES, ITI, /* IRQ 56-63 */ | ||
108 | }; | ||
109 | |||
110 | void __init platform_setup(void) | ||
111 | { | ||
112 | /* Harp platform leaves the decision to head.S, for now */ | ||
113 | platform_parms.fpu_flags = fpu_in_use; | ||
114 | } | ||
115 | |||
116 | void __init platform_monitor(void) | ||
117 | { | ||
118 | /* Nothing yet .. */ | ||
119 | } | ||
120 | |||
121 | void __init platform_reserve(void) | ||
122 | { | ||
123 | /* Nothing yet .. */ | ||
124 | } | ||
125 | |||
126 | const char *get_system_type(void) | ||
127 | { | ||
128 | return "ST50 Harp"; | ||
129 | } | ||
diff --git a/arch/sh64/mach-sim/Makefile b/arch/sh64/mach-sim/Makefile deleted file mode 100644 index 2f2963fa2131..000000000000 --- a/arch/sh64/mach-sim/Makefile +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | obj-y := setup.o | ||
diff --git a/arch/sh64/mach-sim/setup.c b/arch/sh64/mach-sim/setup.c deleted file mode 100644 index e3386ec1ce1f..000000000000 --- a/arch/sh64/mach-sim/setup.c +++ /dev/null | |||
@@ -1,126 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * arch/sh64/mach-sim/setup.c | ||
7 | * | ||
8 | * ST50 Simulator Platform Support | ||
9 | * | ||
10 | * This file handles the architecture-dependent parts of initialization | ||
11 | * | ||
12 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
13 | * | ||
14 | * lethal@linux-sh.org: 15th May 2003 | ||
15 | * Use the generic procfs cpuinfo interface, just return a valid board name. | ||
16 | */ | ||
17 | #include <linux/init.h> | ||
18 | #include <linux/kernel.h> | ||
19 | #include <asm/platform.h> | ||
20 | #include <asm/irq.h> | ||
21 | |||
22 | /* | ||
23 | * Platform Dependent Interrupt Priorities. | ||
24 | */ | ||
25 | |||
26 | /* Using defaults defined in irq.h */ | ||
27 | #define RES NO_PRIORITY /* Disabled */ | ||
28 | #define IR0 IRL0_PRIORITY /* IRLs */ | ||
29 | #define IR1 IRL1_PRIORITY | ||
30 | #define IR2 IRL2_PRIORITY | ||
31 | #define IR3 IRL3_PRIORITY | ||
32 | #define PCA INTA_PRIORITY /* PCI Ints */ | ||
33 | #define PCB INTB_PRIORITY | ||
34 | #define PCC INTC_PRIORITY | ||
35 | #define PCD INTD_PRIORITY | ||
36 | #define SER TOP_PRIORITY | ||
37 | #define ERR TOP_PRIORITY | ||
38 | #define PW0 TOP_PRIORITY | ||
39 | #define PW1 TOP_PRIORITY | ||
40 | #define PW2 TOP_PRIORITY | ||
41 | #define PW3 TOP_PRIORITY | ||
42 | #define DM0 NO_PRIORITY /* DMA Ints */ | ||
43 | #define DM1 NO_PRIORITY | ||
44 | #define DM2 NO_PRIORITY | ||
45 | #define DM3 NO_PRIORITY | ||
46 | #define DAE NO_PRIORITY | ||
47 | #define TU0 TIMER_PRIORITY /* TMU Ints */ | ||
48 | #define TU1 NO_PRIORITY | ||
49 | #define TU2 NO_PRIORITY | ||
50 | #define TI2 NO_PRIORITY | ||
51 | #define ATI NO_PRIORITY /* RTC Ints */ | ||
52 | #define PRI NO_PRIORITY | ||
53 | #define CUI RTC_PRIORITY | ||
54 | #define ERI SCIF_PRIORITY /* SCIF Ints */ | ||
55 | #define RXI SCIF_PRIORITY | ||
56 | #define BRI SCIF_PRIORITY | ||
57 | #define TXI SCIF_PRIORITY | ||
58 | #define ITI TOP_PRIORITY /* WDT Ints */ | ||
59 | |||
60 | /* | ||
61 | * Platform dependent structures: maps and parms block. | ||
62 | */ | ||
63 | struct resource io_resources[] = { | ||
64 | /* Nothing yet .. */ | ||
65 | }; | ||
66 | |||
67 | struct resource kram_resources[] = { | ||
68 | /* These must be last in the array */ | ||
69 | { .name = "Kernel code", .start = 0, .end = 0 }, | ||
70 | /* These must be last in the array */ | ||
71 | { .name = "Kernel data", .start = 0, .end = 0 } | ||
72 | }; | ||
73 | |||
74 | struct resource xram_resources[] = { | ||
75 | /* Nothing yet .. */ | ||
76 | }; | ||
77 | |||
78 | struct resource rom_resources[] = { | ||
79 | /* Nothing yet .. */ | ||
80 | }; | ||
81 | |||
82 | struct sh64_platform platform_parms = { | ||
83 | .readonly_rootfs = 1, | ||
84 | .initial_root_dev = 0x0100, | ||
85 | .loader_type = 1, | ||
86 | .io_res_p = io_resources, | ||
87 | .io_res_count = ARRAY_SIZE(io_resources), | ||
88 | .kram_res_p = kram_resources, | ||
89 | .kram_res_count = ARRAY_SIZE(kram_resources), | ||
90 | .xram_res_p = xram_resources, | ||
91 | .xram_res_count = ARRAY_SIZE(xram_resources), | ||
92 | .rom_res_p = rom_resources, | ||
93 | .rom_res_count = ARRAY_SIZE(rom_resources), | ||
94 | }; | ||
95 | |||
96 | int platform_int_priority[NR_IRQS] = { | ||
97 | IR0, IR1, IR2, IR3, PCA, PCB, PCC, PCD, /* IRQ 0- 7 */ | ||
98 | RES, RES, RES, RES, SER, ERR, PW3, PW2, /* IRQ 8-15 */ | ||
99 | PW1, PW0, DM0, DM1, DM2, DM3, DAE, RES, /* IRQ 16-23 */ | ||
100 | RES, RES, RES, RES, RES, RES, RES, RES, /* IRQ 24-31 */ | ||
101 | TU0, TU1, TU2, TI2, ATI, PRI, CUI, ERI, /* IRQ 32-39 */ | ||
102 | RXI, BRI, TXI, RES, RES, RES, RES, RES, /* IRQ 40-47 */ | ||
103 | RES, RES, RES, RES, RES, RES, RES, RES, /* IRQ 48-55 */ | ||
104 | RES, RES, RES, RES, RES, RES, RES, ITI, /* IRQ 56-63 */ | ||
105 | }; | ||
106 | |||
107 | void __init platform_setup(void) | ||
108 | { | ||
109 | /* Simulator platform leaves the decision to head.S */ | ||
110 | platform_parms.fpu_flags = fpu_in_use; | ||
111 | } | ||
112 | |||
113 | void __init platform_monitor(void) | ||
114 | { | ||
115 | /* Nothing yet .. */ | ||
116 | } | ||
117 | |||
118 | void __init platform_reserve(void) | ||
119 | { | ||
120 | /* Nothing yet .. */ | ||
121 | } | ||
122 | |||
123 | const char *get_system_type(void) | ||
124 | { | ||
125 | return "SH-5 Simulator"; | ||
126 | } | ||
diff --git a/arch/sh64/mm/consistent.c b/arch/sh64/mm/consistent.c deleted file mode 100644 index c439620402cb..000000000000 --- a/arch/sh64/mm/consistent.c +++ /dev/null | |||
@@ -1,53 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2001 David J. Mckay (david.mckay@st.com) | ||
3 | * Copyright (C) 2003 Paul Mundt (lethal@linux-sh.org) | ||
4 | * | ||
5 | * May be copied or modified under the terms of the GNU General Public | ||
6 | * License. See linux/COPYING for more information. | ||
7 | * | ||
8 | * Dynamic DMA mapping support. | ||
9 | */ | ||
10 | #include <linux/types.h> | ||
11 | #include <linux/mm.h> | ||
12 | #include <linux/string.h> | ||
13 | #include <linux/pci.h> | ||
14 | #include <linux/dma-mapping.h> | ||
15 | #include <linux/module.h> | ||
16 | #include <asm/io.h> | ||
17 | |||
18 | void *consistent_alloc(struct pci_dev *hwdev, size_t size, | ||
19 | dma_addr_t *dma_handle) | ||
20 | { | ||
21 | void *ret; | ||
22 | int gfp = GFP_ATOMIC; | ||
23 | void *vp; | ||
24 | |||
25 | if (hwdev == NULL || hwdev->dma_mask != 0xffffffff) | ||
26 | gfp |= GFP_DMA; | ||
27 | |||
28 | ret = (void *)__get_free_pages(gfp, get_order(size)); | ||
29 | |||
30 | /* now call our friend ioremap_nocache to give us an uncached area */ | ||
31 | vp = ioremap_nocache(virt_to_phys(ret), size); | ||
32 | |||
33 | if (vp != NULL) { | ||
34 | memset(vp, 0, size); | ||
35 | *dma_handle = virt_to_phys(ret); | ||
36 | dma_cache_sync(NULL, ret, size, DMA_BIDIRECTIONAL); | ||
37 | } | ||
38 | |||
39 | return vp; | ||
40 | } | ||
41 | EXPORT_SYMBOL(consistent_alloc); | ||
42 | |||
43 | void consistent_free(struct pci_dev *hwdev, size_t size, | ||
44 | void *vaddr, dma_addr_t dma_handle) | ||
45 | { | ||
46 | void *alloc; | ||
47 | |||
48 | alloc = phys_to_virt((unsigned long)dma_handle); | ||
49 | free_pages((unsigned long)alloc, get_order(size)); | ||
50 | |||
51 | iounmap(vaddr); | ||
52 | } | ||
53 | EXPORT_SYMBOL(consistent_free); | ||
diff --git a/arch/sh64/mm/hugetlbpage.c b/arch/sh64/mm/hugetlbpage.c deleted file mode 100644 index fa66daa2dfa9..000000000000 --- a/arch/sh64/mm/hugetlbpage.c +++ /dev/null | |||
@@ -1,105 +0,0 @@ | |||
1 | /* | ||
2 | * arch/sh64/mm/hugetlbpage.c | ||
3 | * | ||
4 | * SuperH HugeTLB page support. | ||
5 | * | ||
6 | * Cloned from sparc64 by Paul Mundt. | ||
7 | * | ||
8 | * Copyright (C) 2002, 2003 David S. Miller (davem@redhat.com) | ||
9 | */ | ||
10 | |||
11 | #include <linux/init.h> | ||
12 | #include <linux/fs.h> | ||
13 | #include <linux/mm.h> | ||
14 | #include <linux/hugetlb.h> | ||
15 | #include <linux/pagemap.h> | ||
16 | #include <linux/slab.h> | ||
17 | #include <linux/sysctl.h> | ||
18 | |||
19 | #include <asm/mman.h> | ||
20 | #include <asm/pgalloc.h> | ||
21 | #include <asm/tlb.h> | ||
22 | #include <asm/tlbflush.h> | ||
23 | #include <asm/cacheflush.h> | ||
24 | |||
25 | pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr) | ||
26 | { | ||
27 | pgd_t *pgd; | ||
28 | pmd_t *pmd; | ||
29 | pte_t *pte = NULL; | ||
30 | |||
31 | pgd = pgd_offset(mm, addr); | ||
32 | if (pgd) { | ||
33 | pmd = pmd_alloc(mm, pgd, addr); | ||
34 | if (pmd) | ||
35 | pte = pte_alloc_map(mm, pmd, addr); | ||
36 | } | ||
37 | return pte; | ||
38 | } | ||
39 | |||
40 | pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr) | ||
41 | { | ||
42 | pgd_t *pgd; | ||
43 | pmd_t *pmd; | ||
44 | pte_t *pte = NULL; | ||
45 | |||
46 | pgd = pgd_offset(mm, addr); | ||
47 | if (pgd) { | ||
48 | pmd = pmd_offset(pgd, addr); | ||
49 | if (pmd) | ||
50 | pte = pte_offset_map(pmd, addr); | ||
51 | } | ||
52 | return pte; | ||
53 | } | ||
54 | |||
55 | int huge_pmd_unshare(struct mm_struct *mm, unsigned long *addr, pte_t *ptep) | ||
56 | { | ||
57 | return 0; | ||
58 | } | ||
59 | |||
60 | void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, | ||
61 | pte_t *ptep, pte_t entry) | ||
62 | { | ||
63 | int i; | ||
64 | |||
65 | for (i = 0; i < (1 << HUGETLB_PAGE_ORDER); i++) { | ||
66 | set_pte_at(mm, addr, ptep, entry); | ||
67 | ptep++; | ||
68 | addr += PAGE_SIZE; | ||
69 | pte_val(entry) += PAGE_SIZE; | ||
70 | } | ||
71 | } | ||
72 | |||
73 | pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, | ||
74 | pte_t *ptep) | ||
75 | { | ||
76 | pte_t entry; | ||
77 | int i; | ||
78 | |||
79 | entry = *ptep; | ||
80 | |||
81 | for (i = 0; i < (1 << HUGETLB_PAGE_ORDER); i++) { | ||
82 | pte_clear(mm, addr, ptep); | ||
83 | addr += PAGE_SIZE; | ||
84 | ptep++; | ||
85 | } | ||
86 | |||
87 | return entry; | ||
88 | } | ||
89 | |||
90 | struct page *follow_huge_addr(struct mm_struct *mm, | ||
91 | unsigned long address, int write) | ||
92 | { | ||
93 | return ERR_PTR(-EINVAL); | ||
94 | } | ||
95 | |||
96 | int pmd_huge(pmd_t pmd) | ||
97 | { | ||
98 | return 0; | ||
99 | } | ||
100 | |||
101 | struct page *follow_huge_pmd(struct mm_struct *mm, unsigned long address, | ||
102 | pmd_t *pmd, int write) | ||
103 | { | ||
104 | return NULL; | ||
105 | } | ||
diff --git a/arch/sh64/mm/init.c b/arch/sh64/mm/init.c deleted file mode 100644 index 21cf42de23e2..000000000000 --- a/arch/sh64/mm/init.c +++ /dev/null | |||
@@ -1,189 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * arch/sh64/mm/init.c | ||
7 | * | ||
8 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
9 | * Copyright (C) 2003, 2004 Paul Mundt | ||
10 | * | ||
11 | */ | ||
12 | |||
13 | #include <linux/init.h> | ||
14 | #include <linux/rwsem.h> | ||
15 | #include <linux/mm.h> | ||
16 | #include <linux/swap.h> | ||
17 | #include <linux/bootmem.h> | ||
18 | |||
19 | #include <asm/mmu_context.h> | ||
20 | #include <asm/page.h> | ||
21 | #include <asm/pgalloc.h> | ||
22 | #include <asm/pgtable.h> | ||
23 | #include <asm/tlb.h> | ||
24 | |||
25 | DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); | ||
26 | |||
27 | /* | ||
28 | * Cache of MMU context last used. | ||
29 | */ | ||
30 | unsigned long mmu_context_cache; | ||
31 | pgd_t * mmu_pdtp_cache; | ||
32 | int after_bootmem = 0; | ||
33 | |||
34 | /* | ||
35 | * BAD_PAGE is the page that is used for page faults when linux | ||
36 | * is out-of-memory. Older versions of linux just did a | ||
37 | * do_exit(), but using this instead means there is less risk | ||
38 | * for a process dying in kernel mode, possibly leaving an inode | ||
39 | * unused etc.. | ||
40 | * | ||
41 | * BAD_PAGETABLE is the accompanying page-table: it is initialized | ||
42 | * to point to BAD_PAGE entries. | ||
43 | * | ||
44 | * ZERO_PAGE is a special page that is used for zero-initialized | ||
45 | * data and COW. | ||
46 | */ | ||
47 | |||
48 | extern unsigned char empty_zero_page[PAGE_SIZE]; | ||
49 | extern unsigned char empty_bad_page[PAGE_SIZE]; | ||
50 | extern pte_t empty_bad_pte_table[PTRS_PER_PTE]; | ||
51 | extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; | ||
52 | |||
53 | extern char _text, _etext, _edata, __bss_start, _end; | ||
54 | extern char __init_begin, __init_end; | ||
55 | |||
56 | /* It'd be good if these lines were in the standard header file. */ | ||
57 | #define START_PFN (NODE_DATA(0)->bdata->node_boot_start >> PAGE_SHIFT) | ||
58 | #define MAX_LOW_PFN (NODE_DATA(0)->bdata->node_low_pfn) | ||
59 | |||
60 | |||
61 | void show_mem(void) | ||
62 | { | ||
63 | int i, total = 0, reserved = 0; | ||
64 | int shared = 0, cached = 0; | ||
65 | |||
66 | printk("Mem-info:\n"); | ||
67 | show_free_areas(); | ||
68 | printk("Free swap: %6ldkB\n",nr_swap_pages<<(PAGE_SHIFT-10)); | ||
69 | i = max_mapnr; | ||
70 | while (i-- > 0) { | ||
71 | total++; | ||
72 | if (PageReserved(mem_map+i)) | ||
73 | reserved++; | ||
74 | else if (PageSwapCache(mem_map+i)) | ||
75 | cached++; | ||
76 | else if (page_count(mem_map+i)) | ||
77 | shared += page_count(mem_map+i) - 1; | ||
78 | } | ||
79 | printk("%d pages of RAM\n",total); | ||
80 | printk("%d reserved pages\n",reserved); | ||
81 | printk("%d pages shared\n",shared); | ||
82 | printk("%d pages swap cached\n",cached); | ||
83 | printk("%ld pages in page table cache\n", quicklist_total_size()); | ||
84 | } | ||
85 | |||
86 | /* | ||
87 | * paging_init() sets up the page tables. | ||
88 | * | ||
89 | * head.S already did a lot to set up address translation for the kernel. | ||
90 | * Here we comes with: | ||
91 | * . MMU enabled | ||
92 | * . ASID set (SR) | ||
93 | * . some 512MB regions being mapped of which the most relevant here is: | ||
94 | * . CACHED segment (ASID 0 [irrelevant], shared AND NOT user) | ||
95 | * . possible variable length regions being mapped as: | ||
96 | * . UNCACHED segment (ASID 0 [irrelevant], shared AND NOT user) | ||
97 | * . All of the memory regions are placed, independently from the platform | ||
98 | * on high addresses, above 0x80000000. | ||
99 | * . swapper_pg_dir is already cleared out by the .space directive | ||
100 | * in any case swapper does not require a real page directory since | ||
101 | * it's all kernel contained. | ||
102 | * | ||
103 | * Those pesky NULL-reference errors in the kernel are then | ||
104 | * dealt with by not mapping address 0x00000000 at all. | ||
105 | * | ||
106 | */ | ||
107 | void __init paging_init(void) | ||
108 | { | ||
109 | unsigned long zones_size[MAX_NR_ZONES] = {0, }; | ||
110 | |||
111 | pgd_init((unsigned long)swapper_pg_dir); | ||
112 | pgd_init((unsigned long)swapper_pg_dir + | ||
113 | sizeof(pgd_t) * USER_PTRS_PER_PGD); | ||
114 | |||
115 | mmu_context_cache = MMU_CONTEXT_FIRST_VERSION; | ||
116 | |||
117 | zones_size[ZONE_NORMAL] = MAX_LOW_PFN - START_PFN; | ||
118 | NODE_DATA(0)->node_mem_map = NULL; | ||
119 | free_area_init_node(0, NODE_DATA(0), zones_size, __MEMORY_START >> PAGE_SHIFT, 0); | ||
120 | } | ||
121 | |||
122 | void __init mem_init(void) | ||
123 | { | ||
124 | int codesize, reservedpages, datasize, initsize; | ||
125 | int tmp; | ||
126 | |||
127 | max_mapnr = num_physpages = MAX_LOW_PFN - START_PFN; | ||
128 | high_memory = (void *)__va(MAX_LOW_PFN * PAGE_SIZE); | ||
129 | |||
130 | /* | ||
131 | * Clear the zero-page. | ||
132 | * This is not required but we might want to re-use | ||
133 | * this very page to pass boot parameters, one day. | ||
134 | */ | ||
135 | memset(empty_zero_page, 0, PAGE_SIZE); | ||
136 | |||
137 | /* this will put all low memory onto the freelists */ | ||
138 | totalram_pages += free_all_bootmem_node(NODE_DATA(0)); | ||
139 | reservedpages = 0; | ||
140 | for (tmp = 0; tmp < num_physpages; tmp++) | ||
141 | /* | ||
142 | * Only count reserved RAM pages | ||
143 | */ | ||
144 | if (PageReserved(mem_map+tmp)) | ||
145 | reservedpages++; | ||
146 | |||
147 | after_bootmem = 1; | ||
148 | |||
149 | codesize = (unsigned long) &_etext - (unsigned long) &_text; | ||
150 | datasize = (unsigned long) &_edata - (unsigned long) &_etext; | ||
151 | initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin; | ||
152 | |||
153 | printk("Memory: %luk/%luk available (%dk kernel code, %dk reserved, %dk data, %dk init)\n", | ||
154 | (unsigned long) nr_free_pages() << (PAGE_SHIFT-10), | ||
155 | max_mapnr << (PAGE_SHIFT-10), | ||
156 | codesize >> 10, | ||
157 | reservedpages << (PAGE_SHIFT-10), | ||
158 | datasize >> 10, | ||
159 | initsize >> 10); | ||
160 | } | ||
161 | |||
162 | void free_initmem(void) | ||
163 | { | ||
164 | unsigned long addr; | ||
165 | |||
166 | addr = (unsigned long)(&__init_begin); | ||
167 | for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) { | ||
168 | ClearPageReserved(virt_to_page(addr)); | ||
169 | init_page_count(virt_to_page(addr)); | ||
170 | free_page(addr); | ||
171 | totalram_pages++; | ||
172 | } | ||
173 | printk ("Freeing unused kernel memory: %ldk freed\n", (&__init_end - &__init_begin) >> 10); | ||
174 | } | ||
175 | |||
176 | #ifdef CONFIG_BLK_DEV_INITRD | ||
177 | void free_initrd_mem(unsigned long start, unsigned long end) | ||
178 | { | ||
179 | unsigned long p; | ||
180 | for (p = start; p < end; p += PAGE_SIZE) { | ||
181 | ClearPageReserved(virt_to_page(p)); | ||
182 | init_page_count(virt_to_page(p)); | ||
183 | free_page(p); | ||
184 | totalram_pages++; | ||
185 | } | ||
186 | printk ("Freeing initrd memory: %ldk freed\n", (end - start) >> 10); | ||
187 | } | ||
188 | #endif | ||
189 | |||
diff --git a/arch/sh64/oprofile/Makefile b/arch/sh64/oprofile/Makefile deleted file mode 100644 index 11a451f6a9c3..000000000000 --- a/arch/sh64/oprofile/Makefile +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | obj-$(CONFIG_OPROFILE) += oprofile.o | ||
2 | |||
3 | DRIVER_OBJS = $(addprefix ../../../drivers/oprofile/, \ | ||
4 | oprof.o cpu_buffer.o buffer_sync.o \ | ||
5 | event_buffer.o oprofile_files.o \ | ||
6 | oprofilefs.o oprofile_stats.o \ | ||
7 | timer_int.o ) | ||
8 | |||
9 | profdrvr-y := op_model_null.o | ||
10 | |||
11 | oprofile-y := $(DRIVER_OBJS) $(profdrvr-y) | ||
12 | |||
diff --git a/arch/sh64/oprofile/op_model_null.c b/arch/sh64/oprofile/op_model_null.c deleted file mode 100644 index a750ea1fee98..000000000000 --- a/arch/sh64/oprofile/op_model_null.c +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | /* | ||
2 | * arch/sh64/oprofile/op_model_null.c | ||
3 | * | ||
4 | * Copyright (C) 2003 Paul Mundt | ||
5 | * | ||
6 | * This file is subject to the terms and conditions of the GNU General Public | ||
7 | * License. See the file "COPYING" in the main directory of this archive | ||
8 | * for more details. | ||
9 | */ | ||
10 | #include <linux/kernel.h> | ||
11 | #include <linux/oprofile.h> | ||
12 | #include <linux/init.h> | ||
13 | #include <linux/errno.h> | ||
14 | |||
15 | int __init oprofile_arch_init(struct oprofile_operations *ops) | ||
16 | { | ||
17 | return -ENODEV; | ||
18 | } | ||
19 | |||
20 | void oprofile_arch_exit(void) | ||
21 | { | ||
22 | } | ||
23 | |||