diff options
Diffstat (limited to 'arch/mips/loongson/fuloong-2e/irq.c')
-rw-r--r-- | arch/mips/loongson/fuloong-2e/irq.c | 52 |
1 files changed, 6 insertions, 46 deletions
diff --git a/arch/mips/loongson/fuloong-2e/irq.c b/arch/mips/loongson/fuloong-2e/irq.c index 9585f5aa7cce..7888cf69424a 100644 --- a/arch/mips/loongson/fuloong-2e/irq.c +++ b/arch/mips/loongson/fuloong-2e/irq.c | |||
@@ -7,39 +7,12 @@ | |||
7 | * Free Software Foundation; either version 2 of the License, or (at your | 7 | * Free Software Foundation; either version 2 of the License, or (at your |
8 | * option) any later version. | 8 | * option) any later version. |
9 | */ | 9 | */ |
10 | #include <linux/delay.h> | ||
11 | #include <linux/interrupt.h> | 10 | #include <linux/interrupt.h> |
12 | 11 | ||
13 | #include <asm/irq_cpu.h> | 12 | #include <asm/irq_cpu.h> |
14 | #include <asm/i8259.h> | 13 | #include <asm/i8259.h> |
15 | 14 | ||
16 | #include <loongson.h> | 15 | #include <loongson.h> |
17 | /* | ||
18 | * the first level int-handler will jump here if it is a bonito irq | ||
19 | */ | ||
20 | static void bonito_irqdispatch(void) | ||
21 | { | ||
22 | u32 int_status; | ||
23 | int i; | ||
24 | |||
25 | /* workaround the IO dma problem: let cpu looping to allow DMA finish */ | ||
26 | int_status = BONITO_INTISR; | ||
27 | if (int_status & (1 << 10)) { | ||
28 | while (int_status & (1 << 10)) { | ||
29 | udelay(1); | ||
30 | int_status = BONITO_INTISR; | ||
31 | } | ||
32 | } | ||
33 | |||
34 | /* Get pending sources, masked by current enables */ | ||
35 | int_status = BONITO_INTISR & BONITO_INTEN; | ||
36 | |||
37 | if (int_status != 0) { | ||
38 | i = __ffs(int_status); | ||
39 | int_status &= ~(1 << i); | ||
40 | do_IRQ(BONITO_IRQ_BASE + i); | ||
41 | } | ||
42 | } | ||
43 | 16 | ||
44 | static void i8259_irqdispatch(void) | 17 | static void i8259_irqdispatch(void) |
45 | { | 18 | { |
@@ -52,10 +25,8 @@ static void i8259_irqdispatch(void) | |||
52 | spurious_interrupt(); | 25 | spurious_interrupt(); |
53 | } | 26 | } |
54 | 27 | ||
55 | asmlinkage void plat_irq_dispatch(void) | 28 | asmlinkage void mach_irq_dispatch(unsigned int pending) |
56 | { | 29 | { |
57 | unsigned int pending = read_c0_cause() & read_c0_status() & ST0_IM; | ||
58 | |||
59 | if (pending & CAUSEF_IP7) | 30 | if (pending & CAUSEF_IP7) |
60 | do_IRQ(MIPS_CPU_IRQ_BASE + 7); | 31 | do_IRQ(MIPS_CPU_IRQ_BASE + 7); |
61 | else if (pending & CAUSEF_IP6) /* perf counter loverflow */ | 32 | else if (pending & CAUSEF_IP6) /* perf counter loverflow */ |
@@ -73,26 +44,15 @@ static struct irqaction cascade_irqaction = { | |||
73 | .name = "cascade", | 44 | .name = "cascade", |
74 | }; | 45 | }; |
75 | 46 | ||
76 | void __init arch_init_irq(void) | 47 | void __init set_irq_trigger_mode(void) |
77 | { | 48 | { |
78 | /* | ||
79 | * Clear all of the interrupts while we change the able around a bit. | ||
80 | * int-handler is not on bootstrap | ||
81 | */ | ||
82 | clear_c0_status(ST0_IM | ST0_BEV); | ||
83 | local_irq_disable(); | ||
84 | |||
85 | /* most bonito irq should be level triggered */ | 49 | /* most bonito irq should be level triggered */ |
86 | BONITO_INTEDGE = BONITO_ICU_SYSTEMERR | BONITO_ICU_MASTERERR | | 50 | BONITO_INTEDGE = BONITO_ICU_SYSTEMERR | BONITO_ICU_MASTERERR | |
87 | BONITO_ICU_RETRYERR | BONITO_ICU_MBOXES; | 51 | BONITO_ICU_RETRYERR | BONITO_ICU_MBOXES; |
88 | BONITO_INTSTEER = 0; | 52 | } |
89 | |||
90 | /* | ||
91 | * Mask out all interrupt by writing "1" to all bit position in | ||
92 | * the interrupt reset reg. | ||
93 | */ | ||
94 | BONITO_INTENCLR = ~0; | ||
95 | 53 | ||
54 | void __init mach_init_irq(void) | ||
55 | { | ||
96 | /* init all controller | 56 | /* init all controller |
97 | * 0-15 ------> i8259 interrupt | 57 | * 0-15 ------> i8259 interrupt |
98 | * 16-23 ------> mips cpu interrupt | 58 | * 16-23 ------> mips cpu interrupt |