diff options
Diffstat (limited to 'arch/mips/jazz/irq.c')
-rw-r--r-- | arch/mips/jazz/irq.c | 78 |
1 files changed, 74 insertions, 4 deletions
diff --git a/arch/mips/jazz/irq.c b/arch/mips/jazz/irq.c index b309b1bcf2e8..becc9accd495 100644 --- a/arch/mips/jazz/irq.c +++ b/arch/mips/jazz/irq.c | |||
@@ -15,8 +15,6 @@ | |||
15 | #include <asm/io.h> | 15 | #include <asm/io.h> |
16 | #include <asm/jazz.h> | 16 | #include <asm/jazz.h> |
17 | 17 | ||
18 | extern asmlinkage void jazz_handle_int(void); | ||
19 | |||
20 | static DEFINE_SPINLOCK(r4030_lock); | 18 | static DEFINE_SPINLOCK(r4030_lock); |
21 | 19 | ||
22 | static void enable_r4030_irq(unsigned int irq) | 20 | static void enable_r4030_irq(unsigned int irq) |
@@ -90,10 +88,82 @@ void __init init_r4030_ints(void) | |||
90 | */ | 88 | */ |
91 | void __init arch_init_irq(void) | 89 | void __init arch_init_irq(void) |
92 | { | 90 | { |
93 | set_except_vector(0, jazz_handle_int); | ||
94 | |||
95 | init_i8259_irqs(); /* Integrated i8259 */ | 91 | init_i8259_irqs(); /* Integrated i8259 */ |
96 | init_r4030_ints(); | 92 | init_r4030_ints(); |
97 | 93 | ||
98 | change_c0_status(ST0_IM, IE_IRQ4 | IE_IRQ3 | IE_IRQ2 | IE_IRQ1); | 94 | change_c0_status(ST0_IM, IE_IRQ4 | IE_IRQ3 | IE_IRQ2 | IE_IRQ1); |
99 | } | 95 | } |
96 | |||
97 | static void loc_call(unsigned int irq, struct pt_regs *regs, unsigned int mask) | ||
98 | { | ||
99 | r4030_write_reg16(JAZZ_IO_IRQ_ENABLE, | ||
100 | r4030_read_reg16(JAZZ_IO_IRQ_ENABLE) & mask); | ||
101 | do_IRQ(irq, regs); | ||
102 | r4030_write_reg16(JAZZ_IO_IRQ_ENABLE, | ||
103 | r4030_read_reg16(JAZZ_IO_IRQ_ENABLE) | mask); | ||
104 | } | ||
105 | |||
106 | static void ll_local_dev(struct pt_regs *regs) | ||
107 | { | ||
108 | switch (r4030_read_reg32(JAZZ_IO_IRQ_SOURCE)) { | ||
109 | case 0: | ||
110 | panic("Unimplemented loc_no_irq handler"); | ||
111 | break; | ||
112 | case 4: | ||
113 | loc_call(JAZZ_PARALLEL_IRQ, regs, JAZZ_IE_PARALLEL); | ||
114 | break; | ||
115 | case 8: | ||
116 | loc_call(JAZZ_PARALLEL_IRQ, regs, JAZZ_IE_FLOPPY); | ||
117 | break; | ||
118 | case 12: | ||
119 | panic("Unimplemented loc_sound handler"); | ||
120 | break; | ||
121 | case 16: | ||
122 | panic("Unimplemented loc_video handler"); | ||
123 | break; | ||
124 | case 20: | ||
125 | loc_call(JAZZ_ETHERNET_IRQ, regs, JAZZ_IE_ETHERNET); | ||
126 | break; | ||
127 | case 24: | ||
128 | loc_call(JAZZ_SCSI_IRQ, regs, JAZZ_IE_SCSI); | ||
129 | break; | ||
130 | case 28: | ||
131 | loc_call(JAZZ_KEYBOARD_IRQ, regs, JAZZ_IE_KEYBOARD); | ||
132 | break; | ||
133 | case 32: | ||
134 | loc_call(JAZZ_MOUSE_IRQ, regs, JAZZ_IE_MOUSE); | ||
135 | break; | ||
136 | case 36: | ||
137 | loc_call(JAZZ_SERIAL1_IRQ, regs, JAZZ_IE_SERIAL1); | ||
138 | break; | ||
139 | case 40: | ||
140 | loc_call(JAZZ_SERIAL2_IRQ, regs, JAZZ_IE_SERIAL2); | ||
141 | break; | ||
142 | } | ||
143 | } | ||
144 | |||
145 | asmlinkage void plat_irq_dispatch(struct pt_regs *regs) | ||
146 | { | ||
147 | unsigned int pending = read_c0_cause() & read_c0_status() & ST0_IM; | ||
148 | |||
149 | if (pending & IE_IRQ5) | ||
150 | write_c0_compare(0); | ||
151 | else if (pending & IE_IRQ4) { | ||
152 | r4030_read_reg32(JAZZ_TIMER_REGISTER); | ||
153 | do_IRQ(JAZZ_TIMER_IRQ, regs); | ||
154 | } else if (pending & IE_IRQ3) | ||
155 | panic("Unimplemented ISA NMI handler"); | ||
156 | else if (pending & IE_IRQ2) | ||
157 | do_IRQ(r4030_read_reg32(JAZZ_EISA_IRQ_ACK), regs); | ||
158 | else if (pending & IE_IRQ1) { | ||
159 | ll_local_dev(regs); | ||
160 | } else if (unlikely(pending & IE_IRQ0)) | ||
161 | panic("Unimplemented local_dma handler"); | ||
162 | else if (pending & IE_SW1) { | ||
163 | clear_c0_cause(IE_SW1); | ||
164 | panic("Unimplemented sw1 handler"); | ||
165 | } else if (pending & IE_SW0) { | ||
166 | clear_c0_cause(IE_SW0); | ||
167 | panic("Unimplemented sw0 handler"); | ||
168 | } | ||
169 | } | ||