blob: ac61b90bcc66f2cf26b9792444598835cecfdc85 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
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
Thomas Bogendoerferc066a322006-12-28 18:22:32 +01008 * Copyright (C) 2006 Thomas Bogendoerfer
Linus Torvalds1da177e2005-04-16 15:20:36 -07009 */
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>
Linus Torvalds1da177e2005-04-16 15:20:36 -070015
16#include <asm/i8259.h>
17#include <asm/io.h>
18#include <asm/sni.h>
Thomas Bogendoerferc066a322006-12-28 18:22:32 +010019#include <asm/irq.h>
20#include <asm/irq_cpu.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070021
Thomas Bogendoerferc066a322006-12-28 18:22:32 +010022void (*sni_hwint)(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070023
Ralf Baechle937a8012006-10-07 19:44:33 +010024asmlinkage void plat_irq_dispatch(void)
Ralf Baechlee4ac58a2006-04-03 17:56:36 +010025{
Thomas Bogendoerferc066a322006-12-28 18:22:32 +010026 sni_hwint();
Ralf Baechlee4ac58a2006-04-03 17:56:36 +010027}
28
Thomas Bogendoerferc066a322006-12-28 18:22:32 +010029/* ISA irq handler */
30static irqreturn_t sni_isa_irq_handler(int dummy, void *p)
Linus Torvalds1da177e2005-04-16 15:20:36 -070031{
Thomas Bogendoerferc066a322006-12-28 18:22:32 +010032 int irq;
33
34 irq = i8259_irq();
35 if (unlikely(irq < 0))
36 return IRQ_NONE;
37
Thomas Bogendoerfer231a35d2008-01-04 23:31:07 +010038 generic_handle_irq(irq);
Thomas Bogendoerferc066a322006-12-28 18:22:32 +010039 return IRQ_HANDLED;
Linus Torvalds1da177e2005-04-16 15:20:36 -070040}
41
Thomas Bogendoerferc066a322006-12-28 18:22:32 +010042struct irqaction sni_isa_irq = {
43 .handler = sni_isa_irq_handler,
44 .name = "ISA",
Yong Zhang8b5690f2011-11-22 14:38:03 +000045 .flags = IRQF_SHARED
Thomas Bogendoerferc066a322006-12-28 18:22:32 +010046};
47
Linus Torvalds1da177e2005-04-16 15:20:36 -070048/*
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 */
53void __init arch_init_irq(void)
54{
Linus Torvalds1da177e2005-04-16 15:20:36 -070055 init_i8259_irqs(); /* Integrated i8259 */
Thomas Bogendoerferc066a322006-12-28 18:22:32 +010056 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:
Ralf Baechle70342282013-01-22 12:59:30 +010061 sni_a20r_irq_init();
62 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -070063
Thomas Bogendoerferc066a322006-12-28 18:22:32 +010064 case SNI_BRD_PCI_TOWER:
Ralf Baechle70342282013-01-22 12:59:30 +010065 sni_pcit_irq_init();
66 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -070067
Thomas Bogendoerferc066a322006-12-28 18:22:32 +010068 case SNI_BRD_PCI_TOWER_CPLUS:
Ralf Baechle70342282013-01-22 12:59:30 +010069 sni_pcit_cplus_irq_init();
70 break;
Thomas Bogendoerferc066a322006-12-28 18:22:32 +010071
72 case SNI_BRD_RM200:
Ralf Baechle70342282013-01-22 12:59:30 +010073 sni_rm200_irq_init();
74 break;
Thomas Bogendoerferc066a322006-12-28 18:22:32 +010075
76 case SNI_BRD_PCI_MTOWER:
77 case SNI_BRD_PCI_DESKTOP:
78 case SNI_BRD_PCI_MTOWER_CPLUS:
Ralf Baechle70342282013-01-22 12:59:30 +010079 sni_pcimt_irq_init();
80 break;
Thomas Bogendoerferc066a322006-12-28 18:22:32 +010081 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070082}