11da177e4SLinus Torvalds /* 21da177e4SLinus Torvalds * This file is subject to the terms and conditions of the GNU General Public 31da177e4SLinus Torvalds * License. See the file "COPYING" in the main directory of this archive 41da177e4SLinus Torvalds * for more details. 51da177e4SLinus Torvalds * 61da177e4SLinus Torvalds * Copyright (C) 1992 Linus Torvalds 71da177e4SLinus Torvalds * Copyright (C) 1994 - 2000 Ralf Baechle 8c066a32aSThomas Bogendoerfer * Copyright (C) 2006 Thomas Bogendoerfer 91da177e4SLinus Torvalds */ 101da177e4SLinus Torvalds #include <linux/delay.h> 111da177e4SLinus Torvalds #include <linux/init.h> 121da177e4SLinus Torvalds #include <linux/interrupt.h> 131da177e4SLinus Torvalds #include <linux/irq.h> 141da177e4SLinus Torvalds #include <linux/kernel.h> 151da177e4SLinus Torvalds 161da177e4SLinus Torvalds #include <asm/i8259.h> 171da177e4SLinus Torvalds #include <asm/io.h> 181da177e4SLinus Torvalds #include <asm/sni.h> 19c066a32aSThomas Bogendoerfer #include <asm/irq.h> 20c066a32aSThomas Bogendoerfer #include <asm/irq_cpu.h> 211da177e4SLinus Torvalds 22c066a32aSThomas Bogendoerfer void (*sni_hwint)(void); 231da177e4SLinus Torvalds plat_irq_dispatch(void)24937a8015SRalf Baechleasmlinkage void plat_irq_dispatch(void) 25e4ac58afSRalf Baechle { 26c066a32aSThomas Bogendoerfer sni_hwint(); 27e4ac58afSRalf Baechle } 28e4ac58afSRalf Baechle 29c066a32aSThomas Bogendoerfer /* ISA irq handler */ sni_isa_irq_handler(int dummy,void * p)30*ac8fd122Safzal mohammedirqreturn_t sni_isa_irq_handler(int dummy, void *p) 311da177e4SLinus Torvalds { 32c066a32aSThomas Bogendoerfer int irq; 33c066a32aSThomas Bogendoerfer 34c066a32aSThomas Bogendoerfer irq = i8259_irq(); 35c066a32aSThomas Bogendoerfer if (unlikely(irq < 0)) 36c066a32aSThomas Bogendoerfer return IRQ_NONE; 37c066a32aSThomas Bogendoerfer 38231a35d3SThomas Bogendoerfer generic_handle_irq(irq); 39c066a32aSThomas Bogendoerfer return IRQ_HANDLED; 401da177e4SLinus Torvalds } 411da177e4SLinus Torvalds 421da177e4SLinus Torvalds /* 431da177e4SLinus Torvalds * On systems with i8259-style interrupt controllers we assume for 441da177e4SLinus Torvalds * driver compatibility reasons interrupts 0 - 15 to be the i8295 451da177e4SLinus Torvalds * interrupts even if the hardware uses a different interrupt numbering. 461da177e4SLinus Torvalds */ arch_init_irq(void)471da177e4SLinus Torvaldsvoid __init arch_init_irq(void) 481da177e4SLinus Torvalds { 491da177e4SLinus Torvalds init_i8259_irqs(); /* Integrated i8259 */ 50c066a32aSThomas Bogendoerfer switch (sni_brd_type) { 51c066a32aSThomas Bogendoerfer case SNI_BRD_10: 52c066a32aSThomas Bogendoerfer case SNI_BRD_10NEW: 53c066a32aSThomas Bogendoerfer case SNI_BRD_TOWER_OASIC: 54c066a32aSThomas Bogendoerfer case SNI_BRD_MINITOWER: 55c066a32aSThomas Bogendoerfer sni_a20r_irq_init(); 56c066a32aSThomas Bogendoerfer break; 571da177e4SLinus Torvalds 58c066a32aSThomas Bogendoerfer case SNI_BRD_PCI_TOWER: 59c066a32aSThomas Bogendoerfer sni_pcit_irq_init(); 60c066a32aSThomas Bogendoerfer break; 611da177e4SLinus Torvalds 62c066a32aSThomas Bogendoerfer case SNI_BRD_PCI_TOWER_CPLUS: 63c066a32aSThomas Bogendoerfer sni_pcit_cplus_irq_init(); 64c066a32aSThomas Bogendoerfer break; 65c066a32aSThomas Bogendoerfer 66c066a32aSThomas Bogendoerfer case SNI_BRD_RM200: 67c066a32aSThomas Bogendoerfer sni_rm200_irq_init(); 68c066a32aSThomas Bogendoerfer break; 69c066a32aSThomas Bogendoerfer 70c066a32aSThomas Bogendoerfer case SNI_BRD_PCI_MTOWER: 71c066a32aSThomas Bogendoerfer case SNI_BRD_PCI_DESKTOP: 72c066a32aSThomas Bogendoerfer case SNI_BRD_PCI_MTOWER_CPLUS: 73c066a32aSThomas Bogendoerfer sni_pcimt_irq_init(); 74c066a32aSThomas Bogendoerfer break; 75c066a32aSThomas Bogendoerfer } 761da177e4SLinus Torvalds } 77