diff options
author | Paul Mundt <lethal@linux-sh.org> | 2006-01-17 01:14:14 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-17 02:15:28 -0500 |
commit | bf3a00f88c926635932c91afd90b4a0907dfbe78 (patch) | |
tree | 179a56c061461a0f3d25cd0171ba8ce90e5e7ed5 /include/asm-sh/irq.h | |
parent | 9d44190eae97ad4c9ce30f1084e1b0dabd646df5 (diff) |
[PATCH] sh: IRQ handler updates
This moves the various IRQ controller drivers into a new subdirectory, and
also extends the INTC2 IRQ handler to also deal with SH7760 and SH7780
interrupts, rather than just ST-40.
The old CONFIG_SH_GENERIC has also been removed from the IRQ definitions, as
new ports are expected to be based off of CONFIG_SH_UNKNOWN. Since there are
plenty of incompatible machvecs, CONFIG_SH_GENERIC doesn't make sense anymore.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-sh/irq.h')
-rw-r--r-- | include/asm-sh/irq.h | 143 |
1 files changed, 78 insertions, 65 deletions
diff --git a/include/asm-sh/irq.h b/include/asm-sh/irq.h index 614a8c13b721..060ec3c27207 100644 --- a/include/asm-sh/irq.h +++ b/include/asm-sh/irq.h | |||
@@ -15,13 +15,20 @@ | |||
15 | #include <asm/machvec.h> | 15 | #include <asm/machvec.h> |
16 | #include <asm/ptrace.h> /* for pt_regs */ | 16 | #include <asm/ptrace.h> /* for pt_regs */ |
17 | 17 | ||
18 | #if defined(CONFIG_SH_HP600) || \ | 18 | #if defined(CONFIG_SH_HP6XX) || \ |
19 | defined(CONFIG_SH_RTS7751R2D) || \ | 19 | defined(CONFIG_SH_RTS7751R2D) || \ |
20 | defined(CONFIG_SH_HS7751RVOIP) || \ | 20 | defined(CONFIG_SH_HS7751RVOIP) || \ |
21 | defined(CONFIG_SH_SH03) | 21 | defined(CONFIG_SH_HS7751RVOIP) || \ |
22 | defined(CONFIG_SH_SH03) || \ | ||
23 | defined(CONFIG_SH_R7780RP) || \ | ||
24 | defined(CONFIG_SH_LANDISK) | ||
22 | #include <asm/mach/ide.h> | 25 | #include <asm/mach/ide.h> |
23 | #endif | 26 | #endif |
24 | 27 | ||
28 | #ifndef CONFIG_CPU_SUBTYPE_SH7780 | ||
29 | |||
30 | #define INTC_DMAC0_MSK 0 | ||
31 | |||
25 | #if defined(CONFIG_CPU_SH3) | 32 | #if defined(CONFIG_CPU_SH3) |
26 | #define INTC_IPRA 0xfffffee2UL | 33 | #define INTC_IPRA 0xfffffee2UL |
27 | #define INTC_IPRB 0xfffffee4UL | 34 | #define INTC_IPRB 0xfffffee4UL |
@@ -235,8 +242,9 @@ | |||
235 | #define SCIF1_IPR_ADDR INTC_IPRB | 242 | #define SCIF1_IPR_ADDR INTC_IPRB |
236 | #define SCIF1_IPR_POS 1 | 243 | #define SCIF1_IPR_POS 1 |
237 | #define SCIF1_PRIORITY 3 | 244 | #define SCIF1_PRIORITY 3 |
238 | #endif | 245 | #endif /* ST40STB1 */ |
239 | #endif | 246 | |
247 | #endif /* 775x / SH4-202 / ST40STB1 */ | ||
240 | 248 | ||
241 | /* NR_IRQS is made from three components: | 249 | /* NR_IRQS is made from three components: |
242 | * 1. ONCHIP_NR_IRQS - number of IRLS + on-chip peripherial modules | 250 | * 1. ONCHIP_NR_IRQS - number of IRLS + on-chip peripherial modules |
@@ -245,37 +253,35 @@ | |||
245 | */ | 253 | */ |
246 | 254 | ||
247 | /* 1. ONCHIP_NR_IRQS */ | 255 | /* 1. ONCHIP_NR_IRQS */ |
248 | #ifdef CONFIG_SH_GENERIC | 256 | #if defined(CONFIG_CPU_SUBTYPE_SH7604) |
257 | # define ONCHIP_NR_IRQS 24 // Actually 21 | ||
258 | #elif defined(CONFIG_CPU_SUBTYPE_SH7707) | ||
259 | # define ONCHIP_NR_IRQS 64 | ||
260 | # define PINT_NR_IRQS 16 | ||
261 | #elif defined(CONFIG_CPU_SUBTYPE_SH7708) | ||
262 | # define ONCHIP_NR_IRQS 32 | ||
263 | #elif defined(CONFIG_CPU_SUBTYPE_SH7709) || \ | ||
264 | defined(CONFIG_CPU_SUBTYPE_SH7705) | ||
265 | # define ONCHIP_NR_IRQS 64 // Actually 61 | ||
266 | # define PINT_NR_IRQS 16 | ||
267 | #elif defined(CONFIG_CPU_SUBTYPE_SH7750) | ||
268 | # define ONCHIP_NR_IRQS 48 // Actually 44 | ||
269 | #elif defined(CONFIG_CPU_SUBTYPE_SH7751) | ||
270 | # define ONCHIP_NR_IRQS 72 | ||
271 | #elif defined(CONFIG_CPU_SUBTYPE_SH7760) | ||
272 | # define ONCHIP_NR_IRQS 112 /* XXX */ | ||
273 | #elif defined(CONFIG_CPU_SUBTYPE_SH4_202) | ||
274 | # define ONCHIP_NR_IRQS 72 | ||
275 | #elif defined(CONFIG_CPU_SUBTYPE_ST40STB1) | ||
276 | # define ONCHIP_NR_IRQS 144 | ||
277 | #elif defined(CONFIG_CPU_SUBTYPE_SH7300) | ||
278 | # define ONCHIP_NR_IRQS 109 | ||
279 | #elif defined(CONFIG_SH_UNKNOWN) /* Most be last */ | ||
249 | # define ONCHIP_NR_IRQS 144 | 280 | # define ONCHIP_NR_IRQS 144 |
250 | #else | ||
251 | # if defined(CONFIG_CPU_SUBTYPE_SH7604) | ||
252 | # define ONCHIP_NR_IRQS 24 // Actually 21 | ||
253 | # elif defined(CONFIG_CPU_SUBTYPE_SH7707) | ||
254 | # define ONCHIP_NR_IRQS 64 | ||
255 | # define PINT_NR_IRQS 16 | ||
256 | # elif defined(CONFIG_CPU_SUBTYPE_SH7708) | ||
257 | # define ONCHIP_NR_IRQS 32 | ||
258 | # elif defined(CONFIG_CPU_SUBTYPE_SH7709) || \ | ||
259 | defined(CONFIG_CPU_SUBTYPE_SH7705) | ||
260 | # define ONCHIP_NR_IRQS 64 // Actually 61 | ||
261 | # define PINT_NR_IRQS 16 | ||
262 | # elif defined(CONFIG_CPU_SUBTYPE_SH7750) | ||
263 | # define ONCHIP_NR_IRQS 48 // Actually 44 | ||
264 | # elif defined(CONFIG_CPU_SUBTYPE_SH7751) | ||
265 | # define ONCHIP_NR_IRQS 72 | ||
266 | # elif defined(CONFIG_CPU_SUBTYPE_SH7760) | ||
267 | # define ONCHIP_NR_IRQS 110 | ||
268 | # elif defined(CONFIG_CPU_SUBTYPE_SH4_202) | ||
269 | # define ONCHIP_NR_IRQS 72 | ||
270 | # elif defined(CONFIG_CPU_SUBTYPE_ST40STB1) | ||
271 | # define ONCHIP_NR_IRQS 144 | ||
272 | # elif defined(CONFIG_CPU_SUBTYPE_SH7300) | ||
273 | # define ONCHIP_NR_IRQS 109 | ||
274 | # endif | ||
275 | #endif | 281 | #endif |
276 | 282 | ||
277 | /* 2. PINT_NR_IRQS */ | 283 | /* 2. PINT_NR_IRQS */ |
278 | #ifdef CONFIG_SH_GENERIC | 284 | #ifdef CONFIG_SH_UNKNOWN |
279 | # define PINT_NR_IRQS 16 | 285 | # define PINT_NR_IRQS 16 |
280 | #else | 286 | #else |
281 | # ifndef PINT_NR_IRQS | 287 | # ifndef PINT_NR_IRQS |
@@ -288,22 +294,22 @@ | |||
288 | #endif | 294 | #endif |
289 | 295 | ||
290 | /* 3. OFFCHIP_NR_IRQS */ | 296 | /* 3. OFFCHIP_NR_IRQS */ |
291 | #ifdef CONFIG_SH_GENERIC | 297 | #if defined(CONFIG_HD64461) |
298 | # define OFFCHIP_NR_IRQS 18 | ||
299 | #elif defined (CONFIG_SH_BIGSUR) /* must be before CONFIG_HD64465 */ | ||
300 | # define OFFCHIP_NR_IRQS 48 | ||
301 | #elif defined(CONFIG_HD64465) | ||
292 | # define OFFCHIP_NR_IRQS 16 | 302 | # define OFFCHIP_NR_IRQS 16 |
303 | #elif defined (CONFIG_SH_EC3104) | ||
304 | # define OFFCHIP_NR_IRQS 16 | ||
305 | #elif defined (CONFIG_SH_DREAMCAST) | ||
306 | # define OFFCHIP_NR_IRQS 96 | ||
307 | #elif defined (CONFIG_SH_TITAN) | ||
308 | # define OFFCHIP_NR_IRQS 4 | ||
309 | #elif defined(CONFIG_SH_UNKNOWN) | ||
310 | # define OFFCHIP_NR_IRQS 16 /* Must also be last */ | ||
293 | #else | 311 | #else |
294 | # if defined(CONFIG_HD64461) | 312 | # define OFFCHIP_NR_IRQS 0 |
295 | # define OFFCHIP_NR_IRQS 18 | ||
296 | # elif defined (CONFIG_SH_BIGSUR) /* must be before CONFIG_HD64465 */ | ||
297 | # define OFFCHIP_NR_IRQS 48 | ||
298 | # elif defined(CONFIG_HD64465) | ||
299 | # define OFFCHIP_NR_IRQS 16 | ||
300 | # elif defined (CONFIG_SH_EC3104) | ||
301 | # define OFFCHIP_NR_IRQS 16 | ||
302 | # elif defined (CONFIG_SH_DREAMCAST) | ||
303 | # define OFFCHIP_NR_IRQS 96 | ||
304 | # else | ||
305 | # define OFFCHIP_NR_IRQS 0 | ||
306 | # endif | ||
307 | #endif | 313 | #endif |
308 | 314 | ||
309 | #if OFFCHIP_NR_IRQS > 0 | 315 | #if OFFCHIP_NR_IRQS > 0 |
@@ -313,16 +319,6 @@ | |||
313 | /* NR_IRQS. 1+2+3 */ | 319 | /* NR_IRQS. 1+2+3 */ |
314 | #define NR_IRQS (ONCHIP_NR_IRQS + PINT_NR_IRQS + OFFCHIP_NR_IRQS) | 320 | #define NR_IRQS (ONCHIP_NR_IRQS + PINT_NR_IRQS + OFFCHIP_NR_IRQS) |
315 | 321 | ||
316 | /* In a generic kernel, NR_IRQS is an upper bound, and we should use | ||
317 | * ACTUAL_NR_IRQS (which uses the machine vector) to get the correct value. | ||
318 | */ | ||
319 | #ifdef CONFIG_SH_GENERIC | ||
320 | # define ACTUAL_NR_IRQS (sh_mv.mv_nr_irqs) | ||
321 | #else | ||
322 | # define ACTUAL_NR_IRQS NR_IRQS | ||
323 | #endif | ||
324 | |||
325 | |||
326 | extern void disable_irq(unsigned int); | 322 | extern void disable_irq(unsigned int); |
327 | extern void disable_irq_nosync(unsigned int); | 323 | extern void disable_irq_nosync(unsigned int); |
328 | extern void enable_irq(unsigned int); | 324 | extern void enable_irq(unsigned int); |
@@ -542,9 +538,6 @@ extern int ipr_irq_demux(int irq); | |||
542 | 538 | ||
543 | extern int ipr_irq_demux(int irq); | 539 | extern int ipr_irq_demux(int irq); |
544 | #define __irq_demux(irq) ipr_irq_demux(irq) | 540 | #define __irq_demux(irq) ipr_irq_demux(irq) |
545 | |||
546 | #else | ||
547 | #define __irq_demux(irq) irq | ||
548 | #endif /* CONFIG_CPU_SUBTYPE_SH7707 || CONFIG_CPU_SUBTYPE_SH7709 */ | 541 | #endif /* CONFIG_CPU_SUBTYPE_SH7707 || CONFIG_CPU_SUBTYPE_SH7709 */ |
549 | 542 | ||
550 | #if defined(CONFIG_CPU_SUBTYPE_SH7750) || defined(CONFIG_CPU_SUBTYPE_SH7751) || \ | 543 | #if defined(CONFIG_CPU_SUBTYPE_SH7750) || defined(CONFIG_CPU_SUBTYPE_SH7751) || \ |
@@ -557,18 +550,35 @@ extern int ipr_irq_demux(int irq); | |||
557 | #define INTC_ICR_IRLM (1<<7) | 550 | #define INTC_ICR_IRLM (1<<7) |
558 | #endif | 551 | #endif |
559 | 552 | ||
560 | #ifdef CONFIG_CPU_SUBTYPE_ST40STB1 | 553 | #else |
554 | #include <asm/irq-sh7780.h> | ||
555 | #endif | ||
561 | 556 | ||
557 | /* SH with INTC2-style interrupts */ | ||
558 | #ifdef CONFIG_CPU_HAS_INTC2_IRQ | ||
559 | #if defined(CONFIG_CPU_SUBTYPE_ST40STB1) | ||
560 | #define INTC2_BASE 0xfe080000 | ||
562 | #define INTC2_FIRST_IRQ 64 | 561 | #define INTC2_FIRST_IRQ 64 |
563 | #define NR_INTC2_IRQS 25 | 562 | #define INTC2_INTREQ_OFFSET 0x20 |
564 | 563 | #define INTC2_INTMSK_OFFSET 0x40 | |
564 | #define INTC2_INTMSKCLR_OFFSET 0x60 | ||
565 | #define NR_INTC2_IRQS 25 | ||
566 | #elif defined(CONFIG_CPU_SUBTYPE_SH7760) | ||
565 | #define INTC2_BASE 0xfe080000 | 567 | #define INTC2_BASE 0xfe080000 |
566 | #define INTC2_INTC2MODE (INTC2_BASE+0x80) | 568 | #define INTC2_FIRST_IRQ 48 /* INTEVT 0x800 */ |
567 | |||
568 | #define INTC2_INTPRI_OFFSET 0x00 | ||
569 | #define INTC2_INTREQ_OFFSET 0x20 | 569 | #define INTC2_INTREQ_OFFSET 0x20 |
570 | #define INTC2_INTMSK_OFFSET 0x40 | 570 | #define INTC2_INTMSK_OFFSET 0x40 |
571 | #define INTC2_INTMSKCLR_OFFSET 0x60 | 571 | #define INTC2_INTMSKCLR_OFFSET 0x60 |
572 | #define NR_INTC2_IRQS 64 | ||
573 | #elif defined(CONFIG_CPU_SUBTYPE_SH7780) | ||
574 | #define INTC2_BASE 0xffd40000 | ||
575 | #define INTC2_FIRST_IRQ 22 | ||
576 | #define INTC2_INTMSK_OFFSET (0x38) | ||
577 | #define INTC2_INTMSKCLR_OFFSET (0x3c) | ||
578 | #define NR_INTC2_IRQS 60 | ||
579 | #endif | ||
580 | |||
581 | #define INTC2_INTPRI_OFFSET 0x00 | ||
572 | 582 | ||
573 | void make_intc2_irq(unsigned int irq, | 583 | void make_intc2_irq(unsigned int irq, |
574 | unsigned int ipr_offset, unsigned int ipr_shift, | 584 | unsigned int ipr_offset, unsigned int ipr_shift, |
@@ -577,13 +587,16 @@ void make_intc2_irq(unsigned int irq, | |||
577 | void init_IRQ_intc2(void); | 587 | void init_IRQ_intc2(void); |
578 | void intc2_add_clear_irq(int irq, int (*fn)(int)); | 588 | void intc2_add_clear_irq(int irq, int (*fn)(int)); |
579 | 589 | ||
580 | #endif /* CONFIG_CPU_SUBTYPE_ST40STB1 */ | 590 | #endif |
581 | 591 | ||
582 | static inline int generic_irq_demux(int irq) | 592 | static inline int generic_irq_demux(int irq) |
583 | { | 593 | { |
584 | return irq; | 594 | return irq; |
585 | } | 595 | } |
586 | 596 | ||
597 | #ifndef __irq_demux | ||
598 | #define __irq_demux(irq) (irq) | ||
599 | #endif | ||
587 | #define irq_canonicalize(irq) (irq) | 600 | #define irq_canonicalize(irq) (irq) |
588 | #define irq_demux(irq) __irq_demux(sh_mv.mv_irq_demux(irq)) | 601 | #define irq_demux(irq) __irq_demux(sh_mv.mv_irq_demux(irq)) |
589 | 602 | ||