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
6 * Copyright (C) 1995, 1996, 1997, 1998 by Ralf Baechle and Andreas Busse
8 * Jazz family specific interrupt stuff
10 * To do: On Jazz machines we remap some non-ISA interrupts to ISA
11 * interrupts. These interrupts should use their own vectors.
12 * Squeeze the last cycles out of the handlers. Only a dead
13 * cycle is a good cycle.
16 #include <asm/mipsregs.h>
18 #include <asm/regdef.h>
19 #include <asm/stackframe.h>
22 * jazz_handle_int: Interrupt handler for the ACER Pica-61 boards
26 NESTED(jazz_handle_int, PT_SIZE, ra)
33 * Get pending interrupts
35 mfc0 t0,CP0_CAUSE # get pending interrupts
36 mfc0 t1,CP0_STATUS # get enabled interrupts
37 and t0,t1 # isolate allowed ones
38 andi t0,0xff00 # isolate pending bits
40 sll t0,16 # delay slot
43 * Find irq with highest priority
44 * FIXME: This is slow - use binary search
47 1: bltz t0,2f # found pending irq
50 subu t1,PTRSIZE # delay slot
53 * Do the low-level stuff
64 PANIC("Unimplemented sw0 handler")
70 PANIC("Unimplemented sw1 handler")
72 ll_local_dma: li s1,~IE_IRQ0
73 PANIC("Unimplemented local_dma handler")
75 ll_local_dev: lbu t0,JAZZ_IO_IRQ_SOURCE
76 #if PTRSIZE == 8 /* True 64 bit kernel */
80 LONG_L t0,local_vector(t0)
85 * The braindead PICA hardware gives us no way to distinguish if we really
86 * received interrupt 7 from the (E)ISA bus or if we just received an
87 * interrupt with no findable cause. This sometimes happens with braindead
88 * cards. Oh well - for all the Jazz boxes slots are more or less just
89 * whistles and bells and we're aware of the problem.
91 ll_isa_irq: lw a0, JAZZ_EISA_IRQ_ACK
100 * Hmm... This is not just a plain PC clone so the question is
101 * which devices on Jazz machines can generate an (E)ISA NMI?
102 * (Writing to nonexistent memory?)
104 ll_isa_nmi: li s1,~IE_IRQ3
105 PANIC("Unimplemented isa_nmi handler")
108 * Timer IRQ - remapped to be more similar to an IBM compatible.
110 * The timer interrupt is handled specially to ensure that the jiffies
111 * variable is updated at all times. Specifically, the timer interrupt is
112 * just like the complete handlers except that it is invoked with interrupts
113 * disabled and should never re-enable them. If other interrupts were
114 * allowed to be processed while the timer interrupt is active, then the
115 * other interrupts would have to avoid using the jiffies variable for delay
116 * and interval timing operations to avoid hanging the system.
118 ll_timer: lw zero,JAZZ_TIMER_REGISTER # timer irq cleared on read
121 li a0, JAZZ_TIMER_IRQ
125 mfc0 t0,CP0_STATUS # disable interrupts again
134 * CPU count/compare IRQ (unused)
136 ll_count: j ret_from_irq
137 mtc0 zero,CP0_COMPARE
141 * Call the handler for the interrupt
145 * temporarily disable interrupt
165 PTR ll_local_dma # Local DMA
166 PTR ll_local_dev # Local devices
167 PTR ll_isa_irq # ISA IRQ
168 PTR ll_isa_nmi # ISA NMI
170 ll_vectors: PTR ll_count # Count/Compare IRQ
173 * Interrupt handlers for local devices.
177 loc_no_irq: PANIC("Unimplemented loc_no_irq handler")
181 loc_parallel: li s1,~JAZZ_IE_PARALLEL
182 li a0,JAZZ_PARALLEL_IRQ
188 loc_floppy: li s1,~JAZZ_IE_FLOPPY
189 li a0,JAZZ_FLOPPY_IRQ
195 loc_sound: PANIC("Unimplemented loc_sound handler")
196 loc_video: PANIC("Unimplemented loc_video handler")
199 * Ethernet interrupt handler
201 loc_ethernet: li s1,~JAZZ_IE_ETHERNET
202 li a0,JAZZ_ETHERNET_IRQ
206 * SCSI interrupt handler
208 loc_scsi: li s1,~JAZZ_IE_SCSI
213 * Keyboard interrupt handler
215 loc_keyboard: li s1,~JAZZ_IE_KEYBOARD
216 li a0,JAZZ_KEYBOARD_IRQ
220 * Mouse interrupt handler
222 loc_mouse: li s1,~JAZZ_IE_MOUSE
229 loc_serial1: li s1,~JAZZ_IE_SERIAL1
230 li a0,JAZZ_SERIAL1_IRQ
236 loc_serial2: li s1,~JAZZ_IE_SERIAL2
237 li a0,JAZZ_SERIAL2_IRQ
241 * Call the interrupt handler for an interrupt generated by a
245 * Temporarily disable interrupt source
247 lhu t2,JAZZ_IO_IRQ_ENABLE
249 sh t2,JAZZ_IO_IRQ_ENABLE
257 lhu t2,JAZZ_IO_IRQ_ENABLE
259 sh t2,JAZZ_IO_IRQ_ENABLE
264 * "Jump extender" to reach spurious_interrupt
266 3: j spurious_interrupt
269 * Vectors for interrupts generated by local devices
272 local_vector: PTR loc_no_irq