2 * linux/arch/arm/mach-footbridge/irq.c
4 * Copyright (C) 1996-2000 Russell King
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
11 * 22-Aug-1998 RMK Restructured IRQ routines
12 * 03-Sep-1998 PJB Merged CATS support
13 * 20-Jan-1998 RMK Started merge of EBSA286, CATS and NetWinder
14 * 26-Jan-1999 PJB Don't use IACK on CATS
15 * 16-Mar-1999 RMK Added autodetect of ISA PICs
17 #include <linux/ioport.h>
18 #include <linux/list.h>
19 #include <linux/init.h>
21 #include <asm/mach/irq.h>
23 #include <asm/hardware.h>
24 #include <asm/hardware/dec21285.h>
27 #include <asm/mach-types.h>
29 extern void __init
isa_init_irq(unsigned int irq
);
32 * Footbridge IRQ translation table
33 * Converts from our IRQ numbers into FootBridge masks
35 static const int fb_irq_mask
[] = {
36 IRQ_MASK_UART_RX
, /* 0 */
37 IRQ_MASK_UART_TX
, /* 1 */
38 IRQ_MASK_TIMER1
, /* 2 */
39 IRQ_MASK_TIMER2
, /* 3 */
40 IRQ_MASK_TIMER3
, /* 4 */
45 IRQ_MASK_DOORBELLHOST
, /* 9 */
46 IRQ_MASK_DMA1
, /* 10 */
47 IRQ_MASK_DMA2
, /* 11 */
48 IRQ_MASK_PCI
, /* 12 */
49 IRQ_MASK_SDRAMPARITY
, /* 13 */
50 IRQ_MASK_I2OINPOST
, /* 14 */
51 IRQ_MASK_PCI_ABORT
, /* 15 */
52 IRQ_MASK_PCI_SERR
, /* 16 */
53 IRQ_MASK_DISCARD_TIMER
, /* 17 */
54 IRQ_MASK_PCI_DPERR
, /* 18 */
55 IRQ_MASK_PCI_PERR
, /* 19 */
58 static void fb_mask_irq(unsigned int irq
)
60 *CSR_IRQ_DISABLE
= fb_irq_mask
[_DC21285_INR(irq
)];
63 static void fb_unmask_irq(unsigned int irq
)
65 *CSR_IRQ_ENABLE
= fb_irq_mask
[_DC21285_INR(irq
)];
68 static struct irqchip fb_chip
= {
71 .unmask
= fb_unmask_irq
,
74 static void __init
__fb_init_irq(void)
81 *CSR_IRQ_DISABLE
= -1;
82 *CSR_FIQ_DISABLE
= -1;
84 for (irq
= _DC21285_IRQ(0); irq
< _DC21285_IRQ(20); irq
++) {
85 set_irq_chip(irq
, &fb_chip
);
86 set_irq_handler(irq
, do_level_IRQ
);
87 set_irq_flags(irq
, IRQF_VALID
| IRQF_PROBE
);
91 void __init
footbridge_init_irq(void)
95 if (!footbridge_cfn_mode())
98 if (machine_is_ebsa285())
99 /* The following is dependent on which slot
100 * you plug the Southbridge card into. We
101 * currently assume that you plug it into
102 * the right-hand most slot.
104 isa_init_irq(IRQ_PCI
);
106 if (machine_is_cats())
107 isa_init_irq(IRQ_IN2
);
109 if (machine_is_netwinder())
110 isa_init_irq(IRQ_IN3
);