Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | /* |
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 | |
4 | * for more details. | |
5 | * | |
6 | * Copyright (C) 1992 Linus Torvalds | |
7 | * Copyright (C) 1994 - 2000 Ralf Baechle | |
c066a32a | 8 | * Copyright (C) 2006 Thomas Bogendoerfer |
1da177e4 LT |
9 | */ |
10 | #include <linux/delay.h> | |
11 | #include <linux/init.h> | |
12 | #include <linux/interrupt.h> | |
13 | #include <linux/irq.h> | |
14 | #include <linux/kernel.h> | |
1da177e4 LT |
15 | |
16 | #include <asm/i8259.h> | |
17 | #include <asm/io.h> | |
18 | #include <asm/sni.h> | |
c066a32a TB |
19 | #include <asm/irq.h> |
20 | #include <asm/irq_cpu.h> | |
1da177e4 | 21 | |
c066a32a | 22 | void (*sni_hwint)(void); |
1da177e4 | 23 | |
c066a32a | 24 | asmlinkage void plat_irq_dispatch(void) |
1da177e4 | 25 | { |
c066a32a | 26 | sni_hwint(); |
1da177e4 LT |
27 | } |
28 | ||
c066a32a TB |
29 | /* ISA irq handler */ |
30 | static irqreturn_t sni_isa_irq_handler(int dummy, void *p) | |
1da177e4 | 31 | { |
1da177e4 LT |
32 | int irq; |
33 | ||
c066a32a TB |
34 | irq = i8259_irq(); |
35 | if (unlikely(irq < 0)) | |
36 | return IRQ_NONE; | |
1da177e4 | 37 | |
231a35d3 | 38 | generic_handle_irq(irq); |
c066a32a | 39 | return IRQ_HANDLED; |
e4ac58af RB |
40 | } |
41 | ||
c066a32a TB |
42 | struct irqaction sni_isa_irq = { |
43 | .handler = sni_isa_irq_handler, | |
44 | .name = "ISA", | |
231a35d3 | 45 | .flags = IRQF_SHARED | IRQF_DISABLED |
c066a32a | 46 | }; |
1da177e4 LT |
47 | |
48 | /* | |
49 | * On systems with i8259-style interrupt controllers we assume for | |
50 | * driver compatibility reasons interrupts 0 - 15 to be the i8295 | |
51 | * interrupts even if the hardware uses a different interrupt numbering. | |
52 | */ | |
53 | void __init arch_init_irq(void) | |
54 | { | |
1da177e4 | 55 | init_i8259_irqs(); /* Integrated i8259 */ |
c066a32a TB |
56 | switch (sni_brd_type) { |
57 | case SNI_BRD_10: | |
58 | case SNI_BRD_10NEW: | |
59 | case SNI_BRD_TOWER_OASIC: | |
60 | case SNI_BRD_MINITOWER: | |
61 | sni_a20r_irq_init(); | |
62 | break; | |
63 | ||
64 | case SNI_BRD_PCI_TOWER: | |
65 | sni_pcit_irq_init(); | |
66 | break; | |
67 | ||
68 | case SNI_BRD_PCI_TOWER_CPLUS: | |
69 | sni_pcit_cplus_irq_init(); | |
70 | break; | |
71 | ||
72 | case SNI_BRD_RM200: | |
73 | sni_rm200_irq_init(); | |
74 | break; | |
75 | ||
76 | case SNI_BRD_PCI_MTOWER: | |
77 | case SNI_BRD_PCI_DESKTOP: | |
78 | case SNI_BRD_PCI_MTOWER_CPLUS: | |
79 | sni_pcimt_irq_init(); | |
80 | break; | |
81 | } | |
1da177e4 | 82 | } |