2 * System-specific setup, especially interrupts.
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
8 * Copyright (C) 1998 Harald Koerfgen
9 * Copyright (C) 2000, 2001, 2002, 2003, 2005 Maciej W. Rozycki
11 #include <linux/console.h>
12 #include <linux/init.h>
13 #include <linux/interrupt.h>
14 #include <linux/ioport.h>
15 #include <linux/irq.h>
16 #include <linux/irqnr.h>
17 #include <linux/module.h>
18 #include <linux/param.h>
19 #include <linux/percpu-defs.h>
20 #include <linux/sched.h>
21 #include <linux/spinlock.h>
22 #include <linux/types.h>
25 #include <asm/bootinfo.h>
27 #include <asm/cpu-features.h>
28 #include <asm/cpu-type.h>
30 #include <asm/irq_cpu.h>
31 #include <asm/mipsregs.h>
32 #include <asm/reboot.h>
34 #include <asm/traps.h>
35 #include <asm/wbflush.h>
37 #include <asm/dec/interrupts.h>
38 #include <asm/dec/ioasic.h>
39 #include <asm/dec/ioasic_addrs.h>
40 #include <asm/dec/ioasic_ints.h>
41 #include <asm/dec/kn01.h>
42 #include <asm/dec/kn02.h>
43 #include <asm/dec/kn02ba.h>
44 #include <asm/dec/kn02ca.h>
45 #include <asm/dec/kn03.h>
46 #include <asm/dec/kn230.h>
47 #include <asm/dec/system.h>
50 extern void dec_machine_restart(char *command
);
51 extern void dec_machine_halt(void);
52 extern void dec_machine_power_off(void);
53 extern irqreturn_t
dec_intr_halt(int irq
, void *dev_id
);
55 unsigned long dec_kn_slot_base
, dec_kn_slot_size
;
57 EXPORT_SYMBOL(dec_kn_slot_base
);
58 EXPORT_SYMBOL(dec_kn_slot_size
);
62 DEFINE_SPINLOCK(ioasic_ssr_lock
);
64 volatile u32
*ioasic_base
;
66 EXPORT_SYMBOL(ioasic_base
);
69 * IRQ routing and priority tables. Priorites are set as follows:
71 * KN01 KN230 KN02 KN02-BA KN02-CA KN03
73 * MEMORY CPU CPU CPU ASIC CPU CPU
74 * RTC CPU CPU CPU ASIC CPU CPU
75 * DMA - - - ASIC ASIC ASIC
76 * SERIAL0 CPU CPU CSR ASIC ASIC ASIC
77 * SERIAL1 - - - ASIC - ASIC
78 * SCSI CPU CPU CSR ASIC ASIC ASIC
79 * ETHERNET CPU * CSR ASIC ASIC ASIC
80 * other - - - ASIC - -
81 * TC2 - - CSR CPU ASIC ASIC
82 * TC1 - - CSR CPU ASIC ASIC
83 * TC0 - - CSR CPU ASIC ASIC
84 * other - CPU - CPU ASIC ASIC
85 * other - - - - CPU CPU
87 * * -- shared with SCSI
90 int dec_interrupt
[DEC_NR_INTS
] = {
91 [0 ... DEC_NR_INTS
- 1] = -1
94 EXPORT_SYMBOL(dec_interrupt
);
96 int_ptr cpu_mask_nr_tbl
[DEC_MAX_CPU_INTS
][2] = {
97 { { .i
= ~0 }, { .p
= dec_intr_unimplemented
} },
99 int_ptr asic_mask_nr_tbl
[DEC_MAX_ASIC_INTS
][2] = {
100 { { .i
= ~0 }, { .p
= asic_intr_unimplemented
} },
102 int cpu_fpu_mask
= DEC_CPU_IRQ_MASK(DEC_CPU_INR_FPU
);
105 static struct irqaction ioirq
= {
106 .handler
= no_action
,
108 .flags
= IRQF_NO_THREAD
,
110 static struct irqaction fpuirq
= {
111 .handler
= no_action
,
113 .flags
= IRQF_NO_THREAD
,
116 static struct irqaction busirq
= {
118 .flags
= IRQF_NO_THREAD
,
121 static struct irqaction haltirq
= {
122 .handler
= dec_intr_halt
,
124 .flags
= IRQF_NO_THREAD
,
129 * Bus error (DBE/IBE exceptions and bus interrupts) handling setup.
131 static void __init
dec_be_init(void)
133 switch (mips_machtype
) {
134 case MACH_DS23100
: /* DS2100/DS3100 Pmin/Pmax */
135 board_be_handler
= dec_kn01_be_handler
;
136 busirq
.handler
= dec_kn01_be_interrupt
;
137 busirq
.flags
|= IRQF_SHARED
;
140 case MACH_DS5000_1XX
: /* DS5000/1xx 3min */
141 case MACH_DS5000_XX
: /* DS5000/xx Maxine */
142 board_be_handler
= dec_kn02xa_be_handler
;
143 busirq
.handler
= dec_kn02xa_be_interrupt
;
144 dec_kn02xa_be_init();
146 case MACH_DS5000_200
: /* DS5000/200 3max */
147 case MACH_DS5000_2X0
: /* DS5000/240 3max+ */
148 case MACH_DS5900
: /* DS5900 bigmax */
149 board_be_handler
= dec_ecc_be_handler
;
150 busirq
.handler
= dec_ecc_be_interrupt
;
156 void __init
plat_mem_setup(void)
158 board_be_init
= dec_be_init
;
162 _machine_restart
= dec_machine_restart
;
163 _machine_halt
= dec_machine_halt
;
164 pm_power_off
= dec_machine_power_off
;
166 ioport_resource
.start
= ~0UL;
167 ioport_resource
.end
= 0UL;
171 * Machine-specific initialisation for KN01, aka DS2100 (aka Pmin)
172 * or DS3100 (aka Pmax).
174 static int kn01_interrupt
[DEC_NR_INTS
] __initdata
= {
175 [DEC_IRQ_CASCADE
] = -1,
176 [DEC_IRQ_AB_RECV
] = -1,
177 [DEC_IRQ_AB_XMIT
] = -1,
178 [DEC_IRQ_DZ11
] = DEC_CPU_IRQ_NR(KN01_CPU_INR_DZ11
),
180 [DEC_IRQ_FLOPPY
] = -1,
181 [DEC_IRQ_FPU
] = DEC_CPU_IRQ_NR(DEC_CPU_INR_FPU
),
184 [DEC_IRQ_LANCE
] = DEC_CPU_IRQ_NR(KN01_CPU_INR_LANCE
),
185 [DEC_IRQ_BUS
] = DEC_CPU_IRQ_NR(KN01_CPU_INR_BUS
),
187 [DEC_IRQ_RTC
] = DEC_CPU_IRQ_NR(KN01_CPU_INR_RTC
),
190 [DEC_IRQ_SII
] = DEC_CPU_IRQ_NR(KN01_CPU_INR_SII
),
194 [DEC_IRQ_TIMER
] = -1,
195 [DEC_IRQ_VIDEO
] = DEC_CPU_IRQ_NR(KN01_CPU_INR_VIDEO
),
196 [DEC_IRQ_ASC_MERR
] = -1,
197 [DEC_IRQ_ASC_ERR
] = -1,
198 [DEC_IRQ_ASC_DMA
] = -1,
199 [DEC_IRQ_FLOPPY_ERR
] = -1,
200 [DEC_IRQ_ISDN_ERR
] = -1,
201 [DEC_IRQ_ISDN_RXDMA
] = -1,
202 [DEC_IRQ_ISDN_TXDMA
] = -1,
203 [DEC_IRQ_LANCE_MERR
] = -1,
204 [DEC_IRQ_SCC0A_RXERR
] = -1,
205 [DEC_IRQ_SCC0A_RXDMA
] = -1,
206 [DEC_IRQ_SCC0A_TXERR
] = -1,
207 [DEC_IRQ_SCC0A_TXDMA
] = -1,
208 [DEC_IRQ_AB_RXERR
] = -1,
209 [DEC_IRQ_AB_RXDMA
] = -1,
210 [DEC_IRQ_AB_TXERR
] = -1,
211 [DEC_IRQ_AB_TXDMA
] = -1,
212 [DEC_IRQ_SCC1A_RXERR
] = -1,
213 [DEC_IRQ_SCC1A_RXDMA
] = -1,
214 [DEC_IRQ_SCC1A_TXERR
] = -1,
215 [DEC_IRQ_SCC1A_TXDMA
] = -1,
218 static int_ptr kn01_cpu_mask_nr_tbl
[][2] __initdata
= {
219 { { .i
= DEC_CPU_IRQ_MASK(KN01_CPU_INR_BUS
) },
220 { .i
= DEC_CPU_IRQ_NR(KN01_CPU_INR_BUS
) } },
221 { { .i
= DEC_CPU_IRQ_MASK(KN01_CPU_INR_RTC
) },
222 { .i
= DEC_CPU_IRQ_NR(KN01_CPU_INR_RTC
) } },
223 { { .i
= DEC_CPU_IRQ_MASK(KN01_CPU_INR_DZ11
) },
224 { .i
= DEC_CPU_IRQ_NR(KN01_CPU_INR_DZ11
) } },
225 { { .i
= DEC_CPU_IRQ_MASK(KN01_CPU_INR_SII
) },
226 { .i
= DEC_CPU_IRQ_NR(KN01_CPU_INR_SII
) } },
227 { { .i
= DEC_CPU_IRQ_MASK(KN01_CPU_INR_LANCE
) },
228 { .i
= DEC_CPU_IRQ_NR(KN01_CPU_INR_LANCE
) } },
229 { { .i
= DEC_CPU_IRQ_ALL
},
230 { .p
= cpu_all_int
} },
233 static void __init
dec_init_kn01(void)
236 memcpy(&dec_interrupt
, &kn01_interrupt
,
237 sizeof(kn01_interrupt
));
239 /* CPU IRQ priorities. */
240 memcpy(&cpu_mask_nr_tbl
, &kn01_cpu_mask_nr_tbl
,
241 sizeof(kn01_cpu_mask_nr_tbl
));
245 } /* dec_init_kn01 */
249 * Machine-specific initialisation for KN230, aka DS5100, aka MIPSmate.
251 static int kn230_interrupt
[DEC_NR_INTS
] __initdata
= {
252 [DEC_IRQ_CASCADE
] = -1,
253 [DEC_IRQ_AB_RECV
] = -1,
254 [DEC_IRQ_AB_XMIT
] = -1,
255 [DEC_IRQ_DZ11
] = DEC_CPU_IRQ_NR(KN230_CPU_INR_DZ11
),
257 [DEC_IRQ_FLOPPY
] = -1,
258 [DEC_IRQ_FPU
] = DEC_CPU_IRQ_NR(DEC_CPU_INR_FPU
),
259 [DEC_IRQ_HALT
] = DEC_CPU_IRQ_NR(KN230_CPU_INR_HALT
),
261 [DEC_IRQ_LANCE
] = DEC_CPU_IRQ_NR(KN230_CPU_INR_LANCE
),
262 [DEC_IRQ_BUS
] = DEC_CPU_IRQ_NR(KN230_CPU_INR_BUS
),
264 [DEC_IRQ_RTC
] = DEC_CPU_IRQ_NR(KN230_CPU_INR_RTC
),
267 [DEC_IRQ_SII
] = DEC_CPU_IRQ_NR(KN230_CPU_INR_SII
),
271 [DEC_IRQ_TIMER
] = -1,
272 [DEC_IRQ_VIDEO
] = -1,
273 [DEC_IRQ_ASC_MERR
] = -1,
274 [DEC_IRQ_ASC_ERR
] = -1,
275 [DEC_IRQ_ASC_DMA
] = -1,
276 [DEC_IRQ_FLOPPY_ERR
] = -1,
277 [DEC_IRQ_ISDN_ERR
] = -1,
278 [DEC_IRQ_ISDN_RXDMA
] = -1,
279 [DEC_IRQ_ISDN_TXDMA
] = -1,
280 [DEC_IRQ_LANCE_MERR
] = -1,
281 [DEC_IRQ_SCC0A_RXERR
] = -1,
282 [DEC_IRQ_SCC0A_RXDMA
] = -1,
283 [DEC_IRQ_SCC0A_TXERR
] = -1,
284 [DEC_IRQ_SCC0A_TXDMA
] = -1,
285 [DEC_IRQ_AB_RXERR
] = -1,
286 [DEC_IRQ_AB_RXDMA
] = -1,
287 [DEC_IRQ_AB_TXERR
] = -1,
288 [DEC_IRQ_AB_TXDMA
] = -1,
289 [DEC_IRQ_SCC1A_RXERR
] = -1,
290 [DEC_IRQ_SCC1A_RXDMA
] = -1,
291 [DEC_IRQ_SCC1A_TXERR
] = -1,
292 [DEC_IRQ_SCC1A_TXDMA
] = -1,
295 static int_ptr kn230_cpu_mask_nr_tbl
[][2] __initdata
= {
296 { { .i
= DEC_CPU_IRQ_MASK(KN230_CPU_INR_BUS
) },
297 { .i
= DEC_CPU_IRQ_NR(KN230_CPU_INR_BUS
) } },
298 { { .i
= DEC_CPU_IRQ_MASK(KN230_CPU_INR_RTC
) },
299 { .i
= DEC_CPU_IRQ_NR(KN230_CPU_INR_RTC
) } },
300 { { .i
= DEC_CPU_IRQ_MASK(KN230_CPU_INR_DZ11
) },
301 { .i
= DEC_CPU_IRQ_NR(KN230_CPU_INR_DZ11
) } },
302 { { .i
= DEC_CPU_IRQ_MASK(KN230_CPU_INR_SII
) },
303 { .i
= DEC_CPU_IRQ_NR(KN230_CPU_INR_SII
) } },
304 { { .i
= DEC_CPU_IRQ_ALL
},
305 { .p
= cpu_all_int
} },
308 static void __init
dec_init_kn230(void)
311 memcpy(&dec_interrupt
, &kn230_interrupt
,
312 sizeof(kn230_interrupt
));
314 /* CPU IRQ priorities. */
315 memcpy(&cpu_mask_nr_tbl
, &kn230_cpu_mask_nr_tbl
,
316 sizeof(kn230_cpu_mask_nr_tbl
));
320 } /* dec_init_kn230 */
324 * Machine-specific initialisation for KN02, aka DS5000/200, aka 3max.
326 static int kn02_interrupt
[DEC_NR_INTS
] __initdata
= {
327 [DEC_IRQ_CASCADE
] = DEC_CPU_IRQ_NR(KN02_CPU_INR_CASCADE
),
328 [DEC_IRQ_AB_RECV
] = -1,
329 [DEC_IRQ_AB_XMIT
] = -1,
330 [DEC_IRQ_DZ11
] = KN02_IRQ_NR(KN02_CSR_INR_DZ11
),
331 [DEC_IRQ_ASC
] = KN02_IRQ_NR(KN02_CSR_INR_ASC
),
332 [DEC_IRQ_FLOPPY
] = -1,
333 [DEC_IRQ_FPU
] = DEC_CPU_IRQ_NR(DEC_CPU_INR_FPU
),
336 [DEC_IRQ_LANCE
] = KN02_IRQ_NR(KN02_CSR_INR_LANCE
),
337 [DEC_IRQ_BUS
] = DEC_CPU_IRQ_NR(KN02_CPU_INR_BUS
),
339 [DEC_IRQ_RTC
] = DEC_CPU_IRQ_NR(KN02_CPU_INR_RTC
),
343 [DEC_IRQ_TC0
] = KN02_IRQ_NR(KN02_CSR_INR_TC0
),
344 [DEC_IRQ_TC1
] = KN02_IRQ_NR(KN02_CSR_INR_TC1
),
345 [DEC_IRQ_TC2
] = KN02_IRQ_NR(KN02_CSR_INR_TC2
),
346 [DEC_IRQ_TIMER
] = -1,
347 [DEC_IRQ_VIDEO
] = -1,
348 [DEC_IRQ_ASC_MERR
] = -1,
349 [DEC_IRQ_ASC_ERR
] = -1,
350 [DEC_IRQ_ASC_DMA
] = -1,
351 [DEC_IRQ_FLOPPY_ERR
] = -1,
352 [DEC_IRQ_ISDN_ERR
] = -1,
353 [DEC_IRQ_ISDN_RXDMA
] = -1,
354 [DEC_IRQ_ISDN_TXDMA
] = -1,
355 [DEC_IRQ_LANCE_MERR
] = -1,
356 [DEC_IRQ_SCC0A_RXERR
] = -1,
357 [DEC_IRQ_SCC0A_RXDMA
] = -1,
358 [DEC_IRQ_SCC0A_TXERR
] = -1,
359 [DEC_IRQ_SCC0A_TXDMA
] = -1,
360 [DEC_IRQ_AB_RXERR
] = -1,
361 [DEC_IRQ_AB_RXDMA
] = -1,
362 [DEC_IRQ_AB_TXERR
] = -1,
363 [DEC_IRQ_AB_TXDMA
] = -1,
364 [DEC_IRQ_SCC1A_RXERR
] = -1,
365 [DEC_IRQ_SCC1A_RXDMA
] = -1,
366 [DEC_IRQ_SCC1A_TXERR
] = -1,
367 [DEC_IRQ_SCC1A_TXDMA
] = -1,
370 static int_ptr kn02_cpu_mask_nr_tbl
[][2] __initdata
= {
371 { { .i
= DEC_CPU_IRQ_MASK(KN02_CPU_INR_BUS
) },
372 { .i
= DEC_CPU_IRQ_NR(KN02_CPU_INR_BUS
) } },
373 { { .i
= DEC_CPU_IRQ_MASK(KN02_CPU_INR_RTC
) },
374 { .i
= DEC_CPU_IRQ_NR(KN02_CPU_INR_RTC
) } },
375 { { .i
= DEC_CPU_IRQ_MASK(KN02_CPU_INR_CASCADE
) },
376 { .p
= kn02_io_int
} },
377 { { .i
= DEC_CPU_IRQ_ALL
},
378 { .p
= cpu_all_int
} },
381 static int_ptr kn02_asic_mask_nr_tbl
[][2] __initdata
= {
382 { { .i
= KN02_IRQ_MASK(KN02_CSR_INR_DZ11
) },
383 { .i
= KN02_IRQ_NR(KN02_CSR_INR_DZ11
) } },
384 { { .i
= KN02_IRQ_MASK(KN02_CSR_INR_ASC
) },
385 { .i
= KN02_IRQ_NR(KN02_CSR_INR_ASC
) } },
386 { { .i
= KN02_IRQ_MASK(KN02_CSR_INR_LANCE
) },
387 { .i
= KN02_IRQ_NR(KN02_CSR_INR_LANCE
) } },
388 { { .i
= KN02_IRQ_MASK(KN02_CSR_INR_TC2
) },
389 { .i
= KN02_IRQ_NR(KN02_CSR_INR_TC2
) } },
390 { { .i
= KN02_IRQ_MASK(KN02_CSR_INR_TC1
) },
391 { .i
= KN02_IRQ_NR(KN02_CSR_INR_TC1
) } },
392 { { .i
= KN02_IRQ_MASK(KN02_CSR_INR_TC0
) },
393 { .i
= KN02_IRQ_NR(KN02_CSR_INR_TC0
) } },
394 { { .i
= KN02_IRQ_ALL
},
395 { .p
= kn02_all_int
} },
398 static void __init
dec_init_kn02(void)
401 memcpy(&dec_interrupt
, &kn02_interrupt
,
402 sizeof(kn02_interrupt
));
404 /* CPU IRQ priorities. */
405 memcpy(&cpu_mask_nr_tbl
, &kn02_cpu_mask_nr_tbl
,
406 sizeof(kn02_cpu_mask_nr_tbl
));
408 /* KN02 CSR IRQ priorities. */
409 memcpy(&asic_mask_nr_tbl
, &kn02_asic_mask_nr_tbl
,
410 sizeof(kn02_asic_mask_nr_tbl
));
413 init_kn02_irqs(KN02_IRQ_BASE
);
415 } /* dec_init_kn02 */
419 * Machine-specific initialisation for KN02-BA, aka DS5000/1xx
420 * (xx = 20, 25, 33), aka 3min. Also applies to KN04(-BA), aka
421 * DS5000/150, aka 4min.
423 static int kn02ba_interrupt
[DEC_NR_INTS
] __initdata
= {
424 [DEC_IRQ_CASCADE
] = DEC_CPU_IRQ_NR(KN02BA_CPU_INR_CASCADE
),
425 [DEC_IRQ_AB_RECV
] = -1,
426 [DEC_IRQ_AB_XMIT
] = -1,
428 [DEC_IRQ_ASC
] = IO_IRQ_NR(KN02BA_IO_INR_ASC
),
429 [DEC_IRQ_FLOPPY
] = -1,
430 [DEC_IRQ_FPU
] = DEC_CPU_IRQ_NR(DEC_CPU_INR_FPU
),
431 [DEC_IRQ_HALT
] = DEC_CPU_IRQ_NR(KN02BA_CPU_INR_HALT
),
433 [DEC_IRQ_LANCE
] = IO_IRQ_NR(KN02BA_IO_INR_LANCE
),
434 [DEC_IRQ_BUS
] = IO_IRQ_NR(KN02BA_IO_INR_BUS
),
435 [DEC_IRQ_PSU
] = IO_IRQ_NR(KN02BA_IO_INR_PSU
),
436 [DEC_IRQ_RTC
] = IO_IRQ_NR(KN02BA_IO_INR_RTC
),
437 [DEC_IRQ_SCC0
] = IO_IRQ_NR(KN02BA_IO_INR_SCC0
),
438 [DEC_IRQ_SCC1
] = IO_IRQ_NR(KN02BA_IO_INR_SCC1
),
440 [DEC_IRQ_TC0
] = DEC_CPU_IRQ_NR(KN02BA_CPU_INR_TC0
),
441 [DEC_IRQ_TC1
] = DEC_CPU_IRQ_NR(KN02BA_CPU_INR_TC1
),
442 [DEC_IRQ_TC2
] = DEC_CPU_IRQ_NR(KN02BA_CPU_INR_TC2
),
443 [DEC_IRQ_TIMER
] = -1,
444 [DEC_IRQ_VIDEO
] = -1,
445 [DEC_IRQ_ASC_MERR
] = IO_IRQ_NR(IO_INR_ASC_MERR
),
446 [DEC_IRQ_ASC_ERR
] = IO_IRQ_NR(IO_INR_ASC_ERR
),
447 [DEC_IRQ_ASC_DMA
] = IO_IRQ_NR(IO_INR_ASC_DMA
),
448 [DEC_IRQ_FLOPPY_ERR
] = -1,
449 [DEC_IRQ_ISDN_ERR
] = -1,
450 [DEC_IRQ_ISDN_RXDMA
] = -1,
451 [DEC_IRQ_ISDN_TXDMA
] = -1,
452 [DEC_IRQ_LANCE_MERR
] = IO_IRQ_NR(IO_INR_LANCE_MERR
),
453 [DEC_IRQ_SCC0A_RXERR
] = IO_IRQ_NR(IO_INR_SCC0A_RXERR
),
454 [DEC_IRQ_SCC0A_RXDMA
] = IO_IRQ_NR(IO_INR_SCC0A_RXDMA
),
455 [DEC_IRQ_SCC0A_TXERR
] = IO_IRQ_NR(IO_INR_SCC0A_TXERR
),
456 [DEC_IRQ_SCC0A_TXDMA
] = IO_IRQ_NR(IO_INR_SCC0A_TXDMA
),
457 [DEC_IRQ_AB_RXERR
] = -1,
458 [DEC_IRQ_AB_RXDMA
] = -1,
459 [DEC_IRQ_AB_TXERR
] = -1,
460 [DEC_IRQ_AB_TXDMA
] = -1,
461 [DEC_IRQ_SCC1A_RXERR
] = IO_IRQ_NR(IO_INR_SCC1A_RXERR
),
462 [DEC_IRQ_SCC1A_RXDMA
] = IO_IRQ_NR(IO_INR_SCC1A_RXDMA
),
463 [DEC_IRQ_SCC1A_TXERR
] = IO_IRQ_NR(IO_INR_SCC1A_TXERR
),
464 [DEC_IRQ_SCC1A_TXDMA
] = IO_IRQ_NR(IO_INR_SCC1A_TXDMA
),
467 static int_ptr kn02ba_cpu_mask_nr_tbl
[][2] __initdata
= {
468 { { .i
= DEC_CPU_IRQ_MASK(KN02BA_CPU_INR_CASCADE
) },
469 { .p
= kn02xa_io_int
} },
470 { { .i
= DEC_CPU_IRQ_MASK(KN02BA_CPU_INR_TC2
) },
471 { .i
= DEC_CPU_IRQ_NR(KN02BA_CPU_INR_TC2
) } },
472 { { .i
= DEC_CPU_IRQ_MASK(KN02BA_CPU_INR_TC1
) },
473 { .i
= DEC_CPU_IRQ_NR(KN02BA_CPU_INR_TC1
) } },
474 { { .i
= DEC_CPU_IRQ_MASK(KN02BA_CPU_INR_TC0
) },
475 { .i
= DEC_CPU_IRQ_NR(KN02BA_CPU_INR_TC0
) } },
476 { { .i
= DEC_CPU_IRQ_ALL
},
477 { .p
= cpu_all_int
} },
480 static int_ptr kn02ba_asic_mask_nr_tbl
[][2] __initdata
= {
481 { { .i
= IO_IRQ_MASK(KN02BA_IO_INR_BUS
) },
482 { .i
= IO_IRQ_NR(KN02BA_IO_INR_BUS
) } },
483 { { .i
= IO_IRQ_MASK(KN02BA_IO_INR_RTC
) },
484 { .i
= IO_IRQ_NR(KN02BA_IO_INR_RTC
) } },
485 { { .i
= IO_IRQ_DMA
},
486 { .p
= asic_dma_int
} },
487 { { .i
= IO_IRQ_MASK(KN02BA_IO_INR_SCC0
) },
488 { .i
= IO_IRQ_NR(KN02BA_IO_INR_SCC0
) } },
489 { { .i
= IO_IRQ_MASK(KN02BA_IO_INR_SCC1
) },
490 { .i
= IO_IRQ_NR(KN02BA_IO_INR_SCC1
) } },
491 { { .i
= IO_IRQ_MASK(KN02BA_IO_INR_ASC
) },
492 { .i
= IO_IRQ_NR(KN02BA_IO_INR_ASC
) } },
493 { { .i
= IO_IRQ_MASK(KN02BA_IO_INR_LANCE
) },
494 { .i
= IO_IRQ_NR(KN02BA_IO_INR_LANCE
) } },
495 { { .i
= IO_IRQ_ALL
},
496 { .p
= asic_all_int
} },
499 static void __init
dec_init_kn02ba(void)
502 memcpy(&dec_interrupt
, &kn02ba_interrupt
,
503 sizeof(kn02ba_interrupt
));
505 /* CPU IRQ priorities. */
506 memcpy(&cpu_mask_nr_tbl
, &kn02ba_cpu_mask_nr_tbl
,
507 sizeof(kn02ba_cpu_mask_nr_tbl
));
509 /* I/O ASIC IRQ priorities. */
510 memcpy(&asic_mask_nr_tbl
, &kn02ba_asic_mask_nr_tbl
,
511 sizeof(kn02ba_asic_mask_nr_tbl
));
514 init_ioasic_irqs(IO_IRQ_BASE
);
516 } /* dec_init_kn02ba */
520 * Machine-specific initialisation for KN02-CA, aka DS5000/xx,
521 * (xx = 20, 25, 33), aka MAXine. Also applies to KN04(-CA), aka
522 * DS5000/50, aka 4MAXine.
524 static int kn02ca_interrupt
[DEC_NR_INTS
] __initdata
= {
525 [DEC_IRQ_CASCADE
] = DEC_CPU_IRQ_NR(KN02CA_CPU_INR_CASCADE
),
526 [DEC_IRQ_AB_RECV
] = IO_IRQ_NR(KN02CA_IO_INR_AB_RECV
),
527 [DEC_IRQ_AB_XMIT
] = IO_IRQ_NR(KN02CA_IO_INR_AB_XMIT
),
529 [DEC_IRQ_ASC
] = IO_IRQ_NR(KN02CA_IO_INR_ASC
),
530 [DEC_IRQ_FLOPPY
] = IO_IRQ_NR(KN02CA_IO_INR_FLOPPY
),
531 [DEC_IRQ_FPU
] = DEC_CPU_IRQ_NR(DEC_CPU_INR_FPU
),
532 [DEC_IRQ_HALT
] = DEC_CPU_IRQ_NR(KN02CA_CPU_INR_HALT
),
533 [DEC_IRQ_ISDN
] = IO_IRQ_NR(KN02CA_IO_INR_ISDN
),
534 [DEC_IRQ_LANCE
] = IO_IRQ_NR(KN02CA_IO_INR_LANCE
),
535 [DEC_IRQ_BUS
] = DEC_CPU_IRQ_NR(KN02CA_CPU_INR_BUS
),
537 [DEC_IRQ_RTC
] = DEC_CPU_IRQ_NR(KN02CA_CPU_INR_RTC
),
538 [DEC_IRQ_SCC0
] = IO_IRQ_NR(KN02CA_IO_INR_SCC0
),
541 [DEC_IRQ_TC0
] = IO_IRQ_NR(KN02CA_IO_INR_TC0
),
542 [DEC_IRQ_TC1
] = IO_IRQ_NR(KN02CA_IO_INR_TC1
),
544 [DEC_IRQ_TIMER
] = DEC_CPU_IRQ_NR(KN02CA_CPU_INR_TIMER
),
545 [DEC_IRQ_VIDEO
] = IO_IRQ_NR(KN02CA_IO_INR_VIDEO
),
546 [DEC_IRQ_ASC_MERR
] = IO_IRQ_NR(IO_INR_ASC_MERR
),
547 [DEC_IRQ_ASC_ERR
] = IO_IRQ_NR(IO_INR_ASC_ERR
),
548 [DEC_IRQ_ASC_DMA
] = IO_IRQ_NR(IO_INR_ASC_DMA
),
549 [DEC_IRQ_FLOPPY_ERR
] = IO_IRQ_NR(IO_INR_FLOPPY_ERR
),
550 [DEC_IRQ_ISDN_ERR
] = IO_IRQ_NR(IO_INR_ISDN_ERR
),
551 [DEC_IRQ_ISDN_RXDMA
] = IO_IRQ_NR(IO_INR_ISDN_RXDMA
),
552 [DEC_IRQ_ISDN_TXDMA
] = IO_IRQ_NR(IO_INR_ISDN_TXDMA
),
553 [DEC_IRQ_LANCE_MERR
] = IO_IRQ_NR(IO_INR_LANCE_MERR
),
554 [DEC_IRQ_SCC0A_RXERR
] = IO_IRQ_NR(IO_INR_SCC0A_RXERR
),
555 [DEC_IRQ_SCC0A_RXDMA
] = IO_IRQ_NR(IO_INR_SCC0A_RXDMA
),
556 [DEC_IRQ_SCC0A_TXERR
] = IO_IRQ_NR(IO_INR_SCC0A_TXERR
),
557 [DEC_IRQ_SCC0A_TXDMA
] = IO_IRQ_NR(IO_INR_SCC0A_TXDMA
),
558 [DEC_IRQ_AB_RXERR
] = IO_IRQ_NR(IO_INR_AB_RXERR
),
559 [DEC_IRQ_AB_RXDMA
] = IO_IRQ_NR(IO_INR_AB_RXDMA
),
560 [DEC_IRQ_AB_TXERR
] = IO_IRQ_NR(IO_INR_AB_TXERR
),
561 [DEC_IRQ_AB_TXDMA
] = IO_IRQ_NR(IO_INR_AB_TXDMA
),
562 [DEC_IRQ_SCC1A_RXERR
] = -1,
563 [DEC_IRQ_SCC1A_RXDMA
] = -1,
564 [DEC_IRQ_SCC1A_TXERR
] = -1,
565 [DEC_IRQ_SCC1A_TXDMA
] = -1,
568 static int_ptr kn02ca_cpu_mask_nr_tbl
[][2] __initdata
= {
569 { { .i
= DEC_CPU_IRQ_MASK(KN02CA_CPU_INR_BUS
) },
570 { .i
= DEC_CPU_IRQ_NR(KN02CA_CPU_INR_BUS
) } },
571 { { .i
= DEC_CPU_IRQ_MASK(KN02CA_CPU_INR_RTC
) },
572 { .i
= DEC_CPU_IRQ_NR(KN02CA_CPU_INR_RTC
) } },
573 { { .i
= DEC_CPU_IRQ_MASK(KN02CA_CPU_INR_CASCADE
) },
574 { .p
= kn02xa_io_int
} },
575 { { .i
= DEC_CPU_IRQ_ALL
},
576 { .p
= cpu_all_int
} },
579 static int_ptr kn02ca_asic_mask_nr_tbl
[][2] __initdata
= {
580 { { .i
= IO_IRQ_DMA
},
581 { .p
= asic_dma_int
} },
582 { { .i
= IO_IRQ_MASK(KN02CA_IO_INR_SCC0
) },
583 { .i
= IO_IRQ_NR(KN02CA_IO_INR_SCC0
) } },
584 { { .i
= IO_IRQ_MASK(KN02CA_IO_INR_ASC
) },
585 { .i
= IO_IRQ_NR(KN02CA_IO_INR_ASC
) } },
586 { { .i
= IO_IRQ_MASK(KN02CA_IO_INR_LANCE
) },
587 { .i
= IO_IRQ_NR(KN02CA_IO_INR_LANCE
) } },
588 { { .i
= IO_IRQ_MASK(KN02CA_IO_INR_TC1
) },
589 { .i
= IO_IRQ_NR(KN02CA_IO_INR_TC1
) } },
590 { { .i
= IO_IRQ_MASK(KN02CA_IO_INR_TC0
) },
591 { .i
= IO_IRQ_NR(KN02CA_IO_INR_TC0
) } },
592 { { .i
= IO_IRQ_ALL
},
593 { .p
= asic_all_int
} },
596 static void __init
dec_init_kn02ca(void)
599 memcpy(&dec_interrupt
, &kn02ca_interrupt
,
600 sizeof(kn02ca_interrupt
));
602 /* CPU IRQ priorities. */
603 memcpy(&cpu_mask_nr_tbl
, &kn02ca_cpu_mask_nr_tbl
,
604 sizeof(kn02ca_cpu_mask_nr_tbl
));
606 /* I/O ASIC IRQ priorities. */
607 memcpy(&asic_mask_nr_tbl
, &kn02ca_asic_mask_nr_tbl
,
608 sizeof(kn02ca_asic_mask_nr_tbl
));
611 init_ioasic_irqs(IO_IRQ_BASE
);
613 } /* dec_init_kn02ca */
617 * Machine-specific initialisation for KN03, aka DS5000/240,
618 * aka 3max+ and DS5900, aka BIGmax. Also applies to KN05, aka
619 * DS5000/260, aka 4max+ and DS5900/260.
621 static int kn03_interrupt
[DEC_NR_INTS
] __initdata
= {
622 [DEC_IRQ_CASCADE
] = DEC_CPU_IRQ_NR(KN03_CPU_INR_CASCADE
),
623 [DEC_IRQ_AB_RECV
] = -1,
624 [DEC_IRQ_AB_XMIT
] = -1,
626 [DEC_IRQ_ASC
] = IO_IRQ_NR(KN03_IO_INR_ASC
),
627 [DEC_IRQ_FLOPPY
] = -1,
628 [DEC_IRQ_FPU
] = DEC_CPU_IRQ_NR(DEC_CPU_INR_FPU
),
629 [DEC_IRQ_HALT
] = DEC_CPU_IRQ_NR(KN03_CPU_INR_HALT
),
631 [DEC_IRQ_LANCE
] = IO_IRQ_NR(KN03_IO_INR_LANCE
),
632 [DEC_IRQ_BUS
] = DEC_CPU_IRQ_NR(KN03_CPU_INR_BUS
),
633 [DEC_IRQ_PSU
] = IO_IRQ_NR(KN03_IO_INR_PSU
),
634 [DEC_IRQ_RTC
] = DEC_CPU_IRQ_NR(KN03_CPU_INR_RTC
),
635 [DEC_IRQ_SCC0
] = IO_IRQ_NR(KN03_IO_INR_SCC0
),
636 [DEC_IRQ_SCC1
] = IO_IRQ_NR(KN03_IO_INR_SCC1
),
638 [DEC_IRQ_TC0
] = IO_IRQ_NR(KN03_IO_INR_TC0
),
639 [DEC_IRQ_TC1
] = IO_IRQ_NR(KN03_IO_INR_TC1
),
640 [DEC_IRQ_TC2
] = IO_IRQ_NR(KN03_IO_INR_TC2
),
641 [DEC_IRQ_TIMER
] = -1,
642 [DEC_IRQ_VIDEO
] = -1,
643 [DEC_IRQ_ASC_MERR
] = IO_IRQ_NR(IO_INR_ASC_MERR
),
644 [DEC_IRQ_ASC_ERR
] = IO_IRQ_NR(IO_INR_ASC_ERR
),
645 [DEC_IRQ_ASC_DMA
] = IO_IRQ_NR(IO_INR_ASC_DMA
),
646 [DEC_IRQ_FLOPPY_ERR
] = -1,
647 [DEC_IRQ_ISDN_ERR
] = -1,
648 [DEC_IRQ_ISDN_RXDMA
] = -1,
649 [DEC_IRQ_ISDN_TXDMA
] = -1,
650 [DEC_IRQ_LANCE_MERR
] = IO_IRQ_NR(IO_INR_LANCE_MERR
),
651 [DEC_IRQ_SCC0A_RXERR
] = IO_IRQ_NR(IO_INR_SCC0A_RXERR
),
652 [DEC_IRQ_SCC0A_RXDMA
] = IO_IRQ_NR(IO_INR_SCC0A_RXDMA
),
653 [DEC_IRQ_SCC0A_TXERR
] = IO_IRQ_NR(IO_INR_SCC0A_TXERR
),
654 [DEC_IRQ_SCC0A_TXDMA
] = IO_IRQ_NR(IO_INR_SCC0A_TXDMA
),
655 [DEC_IRQ_AB_RXERR
] = -1,
656 [DEC_IRQ_AB_RXDMA
] = -1,
657 [DEC_IRQ_AB_TXERR
] = -1,
658 [DEC_IRQ_AB_TXDMA
] = -1,
659 [DEC_IRQ_SCC1A_RXERR
] = IO_IRQ_NR(IO_INR_SCC1A_RXERR
),
660 [DEC_IRQ_SCC1A_RXDMA
] = IO_IRQ_NR(IO_INR_SCC1A_RXDMA
),
661 [DEC_IRQ_SCC1A_TXERR
] = IO_IRQ_NR(IO_INR_SCC1A_TXERR
),
662 [DEC_IRQ_SCC1A_TXDMA
] = IO_IRQ_NR(IO_INR_SCC1A_TXDMA
),
665 static int_ptr kn03_cpu_mask_nr_tbl
[][2] __initdata
= {
666 { { .i
= DEC_CPU_IRQ_MASK(KN03_CPU_INR_BUS
) },
667 { .i
= DEC_CPU_IRQ_NR(KN03_CPU_INR_BUS
) } },
668 { { .i
= DEC_CPU_IRQ_MASK(KN03_CPU_INR_RTC
) },
669 { .i
= DEC_CPU_IRQ_NR(KN03_CPU_INR_RTC
) } },
670 { { .i
= DEC_CPU_IRQ_MASK(KN03_CPU_INR_CASCADE
) },
671 { .p
= kn03_io_int
} },
672 { { .i
= DEC_CPU_IRQ_ALL
},
673 { .p
= cpu_all_int
} },
676 static int_ptr kn03_asic_mask_nr_tbl
[][2] __initdata
= {
677 { { .i
= IO_IRQ_DMA
},
678 { .p
= asic_dma_int
} },
679 { { .i
= IO_IRQ_MASK(KN03_IO_INR_SCC0
) },
680 { .i
= IO_IRQ_NR(KN03_IO_INR_SCC0
) } },
681 { { .i
= IO_IRQ_MASK(KN03_IO_INR_SCC1
) },
682 { .i
= IO_IRQ_NR(KN03_IO_INR_SCC1
) } },
683 { { .i
= IO_IRQ_MASK(KN03_IO_INR_ASC
) },
684 { .i
= IO_IRQ_NR(KN03_IO_INR_ASC
) } },
685 { { .i
= IO_IRQ_MASK(KN03_IO_INR_LANCE
) },
686 { .i
= IO_IRQ_NR(KN03_IO_INR_LANCE
) } },
687 { { .i
= IO_IRQ_MASK(KN03_IO_INR_TC2
) },
688 { .i
= IO_IRQ_NR(KN03_IO_INR_TC2
) } },
689 { { .i
= IO_IRQ_MASK(KN03_IO_INR_TC1
) },
690 { .i
= IO_IRQ_NR(KN03_IO_INR_TC1
) } },
691 { { .i
= IO_IRQ_MASK(KN03_IO_INR_TC0
) },
692 { .i
= IO_IRQ_NR(KN03_IO_INR_TC0
) } },
693 { { .i
= IO_IRQ_ALL
},
694 { .p
= asic_all_int
} },
697 static void __init
dec_init_kn03(void)
700 memcpy(&dec_interrupt
, &kn03_interrupt
,
701 sizeof(kn03_interrupt
));
703 /* CPU IRQ priorities. */
704 memcpy(&cpu_mask_nr_tbl
, &kn03_cpu_mask_nr_tbl
,
705 sizeof(kn03_cpu_mask_nr_tbl
));
707 /* I/O ASIC IRQ priorities. */
708 memcpy(&asic_mask_nr_tbl
, &kn03_asic_mask_nr_tbl
,
709 sizeof(kn03_asic_mask_nr_tbl
));
712 init_ioasic_irqs(IO_IRQ_BASE
);
714 } /* dec_init_kn03 */
717 void __init
arch_init_irq(void)
719 switch (mips_machtype
) {
720 case MACH_DS23100
: /* DS2100/DS3100 Pmin/Pmax */
723 case MACH_DS5100
: /* DS5100 MIPSmate */
726 case MACH_DS5000_200
: /* DS5000/200 3max */
729 case MACH_DS5000_1XX
: /* DS5000/1xx 3min */
732 case MACH_DS5000_2X0
: /* DS5000/240 3max+ */
733 case MACH_DS5900
: /* DS5900 bigmax */
736 case MACH_DS5000_XX
: /* Personal DS5000/xx */
739 case MACH_DS5800
: /* DS5800 Isis */
740 panic("Don't know how to set this up!");
742 case MACH_DS5400
: /* DS5400 MIPSfair */
743 panic("Don't know how to set this up!");
745 case MACH_DS5500
: /* DS5500 MIPSfair-2 */
746 panic("Don't know how to set this up!");
750 /* Free the FPU interrupt if the exception is present. */
751 if (!cpu_has_nofpuex
) {
753 dec_interrupt
[DEC_IRQ_FPU
] = -1;
755 /* Free the halt interrupt unused on R4k systems. */
756 if (current_cpu_type() == CPU_R4000SC
||
757 current_cpu_type() == CPU_R4400SC
)
758 dec_interrupt
[DEC_IRQ_HALT
] = -1;
760 /* Register board interrupts: FPU and cascade. */
761 if (dec_interrupt
[DEC_IRQ_FPU
] >= 0 && cpu_has_fpu
) {
762 struct irq_desc
*desc_fpu
;
765 irq_fpu
= dec_interrupt
[DEC_IRQ_FPU
];
766 setup_irq(irq_fpu
, &fpuirq
);
767 desc_fpu
= irq_to_desc(irq_fpu
);
768 fpu_kstat_irq
= this_cpu_ptr(desc_fpu
->kstat_irqs
);
770 if (dec_interrupt
[DEC_IRQ_CASCADE
] >= 0)
771 setup_irq(dec_interrupt
[DEC_IRQ_CASCADE
], &ioirq
);
773 /* Register the bus error interrupt. */
774 if (dec_interrupt
[DEC_IRQ_BUS
] >= 0 && busirq
.handler
)
775 setup_irq(dec_interrupt
[DEC_IRQ_BUS
], &busirq
);
777 /* Register the HALT interrupt. */
778 if (dec_interrupt
[DEC_IRQ_HALT
] >= 0)
779 setup_irq(dec_interrupt
[DEC_IRQ_HALT
], &haltirq
);
782 asmlinkage
unsigned int dec_irq_dispatch(unsigned int irq
)