diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2007-06-20 17:27:10 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2007-06-20 17:27:10 -0400 |
commit | 3b1d4ed5353af04d6aa20be2701727b9cdb2ac61 (patch) | |
tree | e4a3335c925abd933f1650e1ee4786e6bfad8f35 /arch/mips/mips-boards | |
parent | 7c8545e98468c53809fc06788a3b9a34dff05240 (diff) |
[MIPS] Don't drag a platform specific header into generic arch code.
For some platforms it's definitions may conflict. So that's the one-liner.
The rest is 10 square kilometers of collateral damage fixup this include
used to paper over.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/mips-boards')
-rw-r--r-- | arch/mips/mips-boards/atlas/atlas_int.c | 8 | ||||
-rw-r--r-- | arch/mips/mips-boards/generic/time.c | 50 | ||||
-rw-r--r-- | arch/mips/mips-boards/malta/malta_int.c | 14 | ||||
-rw-r--r-- | arch/mips/mips-boards/sead/sead_int.c | 2 | ||||
-rw-r--r-- | arch/mips/mips-boards/sead/sead_setup.c | 2 | ||||
-rw-r--r-- | arch/mips/mips-boards/sim/sim_int.c | 2 | ||||
-rw-r--r-- | arch/mips/mips-boards/sim/sim_time.c | 8 |
7 files changed, 34 insertions, 52 deletions
diff --git a/arch/mips/mips-boards/atlas/atlas_int.c b/arch/mips/mips-boards/atlas/atlas_int.c index 9f49da95aacf..6c8f0255e85d 100644 --- a/arch/mips/mips-boards/atlas/atlas_int.c +++ b/arch/mips/mips-boards/atlas/atlas_int.c | |||
@@ -189,7 +189,7 @@ asmlinkage void plat_irq_dispatch(void) | |||
189 | if (irq == MIPSCPU_INT_ATLAS) | 189 | if (irq == MIPSCPU_INT_ATLAS) |
190 | atlas_hw0_irqdispatch(); | 190 | atlas_hw0_irqdispatch(); |
191 | else if (irq >= 0) | 191 | else if (irq >= 0) |
192 | do_IRQ(MIPSCPU_INT_BASE + irq); | 192 | do_IRQ(MIPS_CPU_IRQ_BASE + irq); |
193 | else | 193 | else |
194 | spurious_interrupt(); | 194 | spurious_interrupt(); |
195 | } | 195 | } |
@@ -261,11 +261,11 @@ void __init arch_init_irq(void) | |||
261 | } else if (cpu_has_vint) { | 261 | } else if (cpu_has_vint) { |
262 | set_vi_handler (MIPSCPU_INT_ATLAS, atlas_hw0_irqdispatch); | 262 | set_vi_handler (MIPSCPU_INT_ATLAS, atlas_hw0_irqdispatch); |
263 | #ifdef CONFIG_MIPS_MT_SMTC | 263 | #ifdef CONFIG_MIPS_MT_SMTC |
264 | setup_irq_smtc (MIPSCPU_INT_BASE + MIPSCPU_INT_ATLAS, | 264 | setup_irq_smtc (MIPS_CPU_IRQ_BASE + MIPSCPU_INT_ATLAS, |
265 | &atlasirq, (0x100 << MIPSCPU_INT_ATLAS)); | 265 | &atlasirq, (0x100 << MIPSCPU_INT_ATLAS)); |
266 | #else /* Not SMTC */ | 266 | #else /* Not SMTC */ |
267 | setup_irq(MIPSCPU_INT_BASE + MIPSCPU_INT_ATLAS, &atlasirq); | 267 | setup_irq(MIPS_CPU_IRQ_BASE + MIPSCPU_INT_ATLAS, &atlasirq); |
268 | #endif /* CONFIG_MIPS_MT_SMTC */ | 268 | #endif /* CONFIG_MIPS_MT_SMTC */ |
269 | } else | 269 | } else |
270 | setup_irq(MIPSCPU_INT_BASE + MIPSCPU_INT_ATLAS, &atlasirq); | 270 | setup_irq(MIPS_CPU_IRQ_BASE + MIPSCPU_INT_ATLAS, &atlasirq); |
271 | } | 271 | } |
diff --git a/arch/mips/mips-boards/generic/time.c b/arch/mips/mips-boards/generic/time.c index 8f1000f51b3d..c45d556aa96b 100644 --- a/arch/mips/mips-boards/generic/time.c +++ b/arch/mips/mips-boards/generic/time.c | |||
@@ -54,7 +54,7 @@ | |||
54 | unsigned long cpu_khz; | 54 | unsigned long cpu_khz; |
55 | 55 | ||
56 | static int mips_cpu_timer_irq; | 56 | static int mips_cpu_timer_irq; |
57 | extern int mipsxx_perfcount_irq; | 57 | extern int cp0_perfcount_irq; |
58 | extern void smtc_timer_broadcast(int); | 58 | extern void smtc_timer_broadcast(int); |
59 | 59 | ||
60 | static void mips_timer_dispatch(void) | 60 | static void mips_timer_dispatch(void) |
@@ -64,7 +64,7 @@ static void mips_timer_dispatch(void) | |||
64 | 64 | ||
65 | static void mips_perf_dispatch(void) | 65 | static void mips_perf_dispatch(void) |
66 | { | 66 | { |
67 | do_IRQ(mipsxx_perfcount_irq); | 67 | do_IRQ(cp0_perfcount_irq); |
68 | } | 68 | } |
69 | 69 | ||
70 | /* | 70 | /* |
@@ -82,12 +82,12 @@ static inline int handle_perf_irq (int r2) | |||
82 | { | 82 | { |
83 | /* | 83 | /* |
84 | * The performance counter overflow interrupt may be shared with the | 84 | * The performance counter overflow interrupt may be shared with the |
85 | * timer interrupt (mipsxx_perfcount_irq < 0). If it is and a | 85 | * timer interrupt (cp0_perfcount_irq < 0). If it is and a |
86 | * performance counter has overflowed (perf_irq() == IRQ_HANDLED) | 86 | * performance counter has overflowed (perf_irq() == IRQ_HANDLED) |
87 | * and we can't reliably determine if a counter interrupt has also | 87 | * and we can't reliably determine if a counter interrupt has also |
88 | * happened (!r2) then don't check for a timer interrupt. | 88 | * happened (!r2) then don't check for a timer interrupt. |
89 | */ | 89 | */ |
90 | return (mipsxx_perfcount_irq < 0) && | 90 | return (cp0_perfcount_irq < 0) && |
91 | perf_irq() == IRQ_HANDLED && | 91 | perf_irq() == IRQ_HANDLED && |
92 | !r2; | 92 | !r2; |
93 | } | 93 | } |
@@ -259,42 +259,31 @@ static struct irqaction perf_irqaction = { | |||
259 | 259 | ||
260 | void __init plat_perf_setup(struct irqaction *irq) | 260 | void __init plat_perf_setup(struct irqaction *irq) |
261 | { | 261 | { |
262 | int hwint = 0; | 262 | cp0_perfcount_irq = -1; |
263 | mipsxx_perfcount_irq = -1; | ||
264 | 263 | ||
265 | #ifdef MSC01E_INT_BASE | 264 | #ifdef MSC01E_INT_BASE |
266 | if (cpu_has_veic) { | 265 | if (cpu_has_veic) { |
267 | set_vi_handler (MSC01E_INT_PERFCTR, mips_perf_dispatch); | 266 | set_vi_handler (MSC01E_INT_PERFCTR, mips_perf_dispatch); |
268 | mipsxx_perfcount_irq = MSC01E_INT_BASE + MSC01E_INT_PERFCTR; | 267 | cp0_perfcount_irq = MSC01E_INT_BASE + MSC01E_INT_PERFCTR; |
269 | } else | 268 | } else |
270 | #endif | 269 | #endif |
271 | if (cpu_has_mips_r2) { | 270 | if (cp0_perfcount_irq >= 0) { |
272 | /* | 271 | if (cpu_has_vint) |
273 | * Read IntCtl.IPPCI to determine the performance | 272 | set_vi_handler(cp0_perfcount_irq, mips_perf_dispatch); |
274 | * counter interrupt | ||
275 | */ | ||
276 | hwint = (read_c0_intctl () >> 26) & 7; | ||
277 | if (hwint != MIPSCPU_INT_CPUCTR) { | ||
278 | if (cpu_has_vint) | ||
279 | set_vi_handler (hwint, mips_perf_dispatch); | ||
280 | mipsxx_perfcount_irq = MIPSCPU_INT_BASE + hwint; | ||
281 | } | ||
282 | } | ||
283 | if (mipsxx_perfcount_irq >= 0) { | ||
284 | #ifdef CONFIG_MIPS_MT_SMTC | 273 | #ifdef CONFIG_MIPS_MT_SMTC |
285 | setup_irq_smtc(mipsxx_perfcount_irq, irq, 0x100 << hwint); | 274 | setup_irq_smtc(cp0_perfcount_irq, irq, |
275 | 0x100 << cp0_perfcount_irq); | ||
286 | #else | 276 | #else |
287 | setup_irq(mipsxx_perfcount_irq, irq); | 277 | setup_irq(cp0_perfcount_irq, irq); |
288 | #endif /* CONFIG_MIPS_MT_SMTC */ | 278 | #endif /* CONFIG_MIPS_MT_SMTC */ |
289 | #ifdef CONFIG_SMP | 279 | #ifdef CONFIG_SMP |
290 | set_irq_handler(mipsxx_perfcount_irq, handle_percpu_irq); | 280 | set_irq_handler(cp0_perfcount_irq, handle_percpu_irq); |
291 | #endif | 281 | #endif |
292 | } | 282 | } |
293 | } | 283 | } |
294 | 284 | ||
295 | void __init plat_timer_setup(struct irqaction *irq) | 285 | void __init plat_timer_setup(struct irqaction *irq) |
296 | { | 286 | { |
297 | int hwint = 0; | ||
298 | #ifdef MSC01E_INT_BASE | 287 | #ifdef MSC01E_INT_BASE |
299 | if (cpu_has_veic) { | 288 | if (cpu_has_veic) { |
300 | set_vi_handler (MSC01E_INT_CPUCTR, mips_timer_dispatch); | 289 | set_vi_handler (MSC01E_INT_CPUCTR, mips_timer_dispatch); |
@@ -303,22 +292,15 @@ void __init plat_timer_setup(struct irqaction *irq) | |||
303 | else | 292 | else |
304 | #endif | 293 | #endif |
305 | { | 294 | { |
306 | if (cpu_has_mips_r2) | ||
307 | /* | ||
308 | * Read IntCtl.IPTI to determine the timer interrupt | ||
309 | */ | ||
310 | hwint = (read_c0_intctl () >> 29) & 7; | ||
311 | else | ||
312 | hwint = MIPSCPU_INT_CPUCTR; | ||
313 | if (cpu_has_vint) | 295 | if (cpu_has_vint) |
314 | set_vi_handler (hwint, mips_timer_dispatch); | 296 | set_vi_handler(cp0_compare_irq, mips_timer_dispatch); |
315 | mips_cpu_timer_irq = MIPSCPU_INT_BASE + hwint; | 297 | mips_cpu_timer_irq = MIPS_CPU_IRQ_BASE + cp0_compare_irq; |
316 | } | 298 | } |
317 | 299 | ||
318 | /* we are using the cpu counter for timer interrupts */ | 300 | /* we are using the cpu counter for timer interrupts */ |
319 | irq->handler = mips_timer_interrupt; /* we use our own handler */ | 301 | irq->handler = mips_timer_interrupt; /* we use our own handler */ |
320 | #ifdef CONFIG_MIPS_MT_SMTC | 302 | #ifdef CONFIG_MIPS_MT_SMTC |
321 | setup_irq_smtc(mips_cpu_timer_irq, irq, 0x100 << hwint); | 303 | setup_irq_smtc(mips_cpu_timer_irq, irq, 0x100 << cp0_compare_irq); |
322 | #else | 304 | #else |
323 | setup_irq(mips_cpu_timer_irq, irq); | 305 | setup_irq(mips_cpu_timer_irq, irq); |
324 | #endif /* CONFIG_MIPS_MT_SMTC */ | 306 | #endif /* CONFIG_MIPS_MT_SMTC */ |
diff --git a/arch/mips/mips-boards/malta/malta_int.c b/arch/mips/mips-boards/malta/malta_int.c index 1668cc21d5b5..c78d48349600 100644 --- a/arch/mips/mips-boards/malta/malta_int.c +++ b/arch/mips/mips-boards/malta/malta_int.c | |||
@@ -257,7 +257,7 @@ asmlinkage void plat_irq_dispatch(void) | |||
257 | if (irq == MIPSCPU_INT_I8259A) | 257 | if (irq == MIPSCPU_INT_I8259A) |
258 | malta_hw0_irqdispatch(); | 258 | malta_hw0_irqdispatch(); |
259 | else if (irq > 0) | 259 | else if (irq > 0) |
260 | do_IRQ(MIPSCPU_INT_BASE + irq); | 260 | do_IRQ(MIPS_CPU_IRQ_BASE + irq); |
261 | else | 261 | else |
262 | spurious_interrupt(); | 262 | spurious_interrupt(); |
263 | } | 263 | } |
@@ -326,17 +326,17 @@ void __init arch_init_irq(void) | |||
326 | set_vi_handler (MIPSCPU_INT_I8259A, malta_hw0_irqdispatch); | 326 | set_vi_handler (MIPSCPU_INT_I8259A, malta_hw0_irqdispatch); |
327 | set_vi_handler (MIPSCPU_INT_COREHI, corehi_irqdispatch); | 327 | set_vi_handler (MIPSCPU_INT_COREHI, corehi_irqdispatch); |
328 | #ifdef CONFIG_MIPS_MT_SMTC | 328 | #ifdef CONFIG_MIPS_MT_SMTC |
329 | setup_irq_smtc (MIPSCPU_INT_BASE+MIPSCPU_INT_I8259A, &i8259irq, | 329 | setup_irq_smtc (MIPS_CPU_IRQ_BASE+MIPSCPU_INT_I8259A, &i8259irq, |
330 | (0x100 << MIPSCPU_INT_I8259A)); | 330 | (0x100 << MIPSCPU_INT_I8259A)); |
331 | setup_irq_smtc (MIPSCPU_INT_BASE+MIPSCPU_INT_COREHI, | 331 | setup_irq_smtc (MIPS_CPU_IRQ_BASE+MIPSCPU_INT_COREHI, |
332 | &corehi_irqaction, (0x100 << MIPSCPU_INT_COREHI)); | 332 | &corehi_irqaction, (0x100 << MIPSCPU_INT_COREHI)); |
333 | #else /* Not SMTC */ | 333 | #else /* Not SMTC */ |
334 | setup_irq (MIPSCPU_INT_BASE+MIPSCPU_INT_I8259A, &i8259irq); | 334 | setup_irq (MIPS_CPU_IRQ_BASE+MIPSCPU_INT_I8259A, &i8259irq); |
335 | setup_irq (MIPSCPU_INT_BASE+MIPSCPU_INT_COREHI, &corehi_irqaction); | 335 | setup_irq (MIPS_CPU_IRQ_BASE+MIPSCPU_INT_COREHI, &corehi_irqaction); |
336 | #endif /* CONFIG_MIPS_MT_SMTC */ | 336 | #endif /* CONFIG_MIPS_MT_SMTC */ |
337 | } | 337 | } |
338 | else { | 338 | else { |
339 | setup_irq (MIPSCPU_INT_BASE+MIPSCPU_INT_I8259A, &i8259irq); | 339 | setup_irq (MIPS_CPU_IRQ_BASE+MIPSCPU_INT_I8259A, &i8259irq); |
340 | setup_irq (MIPSCPU_INT_BASE+MIPSCPU_INT_COREHI, &corehi_irqaction); | 340 | setup_irq (MIPS_CPU_IRQ_BASE+MIPSCPU_INT_COREHI, &corehi_irqaction); |
341 | } | 341 | } |
342 | } | 342 | } |
diff --git a/arch/mips/mips-boards/sead/sead_int.c b/arch/mips/mips-boards/sead/sead_int.c index c4b9de3a7f27..9ca0f82f1360 100644 --- a/arch/mips/mips-boards/sead/sead_int.c +++ b/arch/mips/mips-boards/sead/sead_int.c | |||
@@ -106,7 +106,7 @@ asmlinkage void plat_irq_dispatch(void) | |||
106 | irq = irq_ffs(pending); | 106 | irq = irq_ffs(pending); |
107 | 107 | ||
108 | if (irq >= 0) | 108 | if (irq >= 0) |
109 | do_IRQ(MIPSCPU_INT_BASE + irq); | 109 | do_IRQ(MIPS_CPU_IRQ_BASE + irq); |
110 | else | 110 | else |
111 | spurious_interrupt(); | 111 | spurious_interrupt(); |
112 | } | 112 | } |
diff --git a/arch/mips/mips-boards/sead/sead_setup.c b/arch/mips/mips-boards/sead/sead_setup.c index 811aba100605..bb801409d39b 100644 --- a/arch/mips/mips-boards/sead/sead_setup.c +++ b/arch/mips/mips-boards/sead/sead_setup.c | |||
@@ -68,7 +68,7 @@ static void __init serial_init(void) | |||
68 | #else | 68 | #else |
69 | s.iobase = SEAD_UART0_REGS_BASE+3; | 69 | s.iobase = SEAD_UART0_REGS_BASE+3; |
70 | #endif | 70 | #endif |
71 | s.irq = MIPSCPU_INT_BASE + MIPSCPU_INT_UART0; | 71 | s.irq = MIPS_CPU_IRQ_BASE + MIPSCPU_INT_UART0; |
72 | s.uartclk = SEAD_BASE_BAUD * 16; | 72 | s.uartclk = SEAD_BASE_BAUD * 16; |
73 | s.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_AUTO_IRQ; | 73 | s.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_AUTO_IRQ; |
74 | s.iotype = UPIO_PORT; | 74 | s.iotype = UPIO_PORT; |
diff --git a/arch/mips/mips-boards/sim/sim_int.c b/arch/mips/mips-boards/sim/sim_int.c index 15ac0655c1ff..766e0159ee5b 100644 --- a/arch/mips/mips-boards/sim/sim_int.c +++ b/arch/mips/mips-boards/sim/sim_int.c | |||
@@ -77,7 +77,7 @@ asmlinkage void plat_irq_dispatch(void) | |||
77 | irq = irq_ffs(pending); | 77 | irq = irq_ffs(pending); |
78 | 78 | ||
79 | if (irq > 0) | 79 | if (irq > 0) |
80 | do_IRQ(MIPSCPU_INT_BASE + irq); | 80 | do_IRQ(MIPS_CPU_IRQ_BASE + irq); |
81 | else | 81 | else |
82 | spurious_interrupt(); | 82 | spurious_interrupt(); |
83 | } | 83 | } |
diff --git a/arch/mips/mips-boards/sim/sim_time.c b/arch/mips/mips-boards/sim/sim_time.c index d3a21c741514..7224ffe31d36 100644 --- a/arch/mips/mips-boards/sim/sim_time.c +++ b/arch/mips/mips-boards/sim/sim_time.c | |||
@@ -71,8 +71,8 @@ irqreturn_t sim_timer_interrupt(int irq, void *dev_id) | |||
71 | 71 | ||
72 | int vpflags = dvpe(); | 72 | int vpflags = dvpe(); |
73 | write_c0_compare (read_c0_count() - 1); | 73 | write_c0_compare (read_c0_count() - 1); |
74 | clear_c0_cause(0x100 << MIPSCPU_INT_CPUCTR); | 74 | clear_c0_cause(0x100 << cp0_compare_irq); |
75 | set_c0_status(0x100 << MIPSCPU_INT_CPUCTR); | 75 | set_c0_status(0x100 << cp0_compare_irq); |
76 | irq_enable_hazard(); | 76 | irq_enable_hazard(); |
77 | evpe(vpflags); | 77 | evpe(vpflags); |
78 | 78 | ||
@@ -183,8 +183,8 @@ void __init plat_timer_setup(struct irqaction *irq) | |||
183 | } | 183 | } |
184 | else { | 184 | else { |
185 | if (cpu_has_vint) | 185 | if (cpu_has_vint) |
186 | set_vi_handler(MIPSCPU_INT_CPUCTR, mips_timer_dispatch); | 186 | set_vi_handler(cp0_compare_irq, mips_timer_dispatch); |
187 | mips_cpu_timer_irq = MIPSCPU_INT_BASE + MIPSCPU_INT_CPUCTR; | 187 | mips_cpu_timer_irq = MIPS_CPU_IRQ_BASE + cp0_compare_irq; |
188 | } | 188 | } |
189 | 189 | ||
190 | /* we are using the cpu counter for timer interrupts */ | 190 | /* we are using the cpu counter for timer interrupts */ |