irq.c 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * IRQ vector handles
  3. *
  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
  6. * for more details.
  7. *
  8. * Copyright (C) 1995, 1996, 1997, 2003 by Ralf Baechle
  9. */
  10. #include <linux/kernel.h>
  11. #include <linux/init.h>
  12. #include <linux/irq.h>
  13. #include <linux/interrupt.h>
  14. #include <linux/pci.h>
  15. #include <asm/i8259.h>
  16. #include <asm/irq_cpu.h>
  17. #include <asm/irq_gt641xx.h>
  18. #include <asm/gt64120.h>
  19. #include <irq.h>
  20. asmlinkage void plat_irq_dispatch(void)
  21. {
  22. unsigned pending = read_c0_status() & read_c0_cause() & ST0_IM;
  23. int irq;
  24. if (pending & CAUSEF_IP2)
  25. gt641xx_irq_dispatch();
  26. else if (pending & CAUSEF_IP6) {
  27. irq = i8259_irq();
  28. if (irq < 0)
  29. spurious_interrupt();
  30. else
  31. do_IRQ(irq);
  32. } else if (pending & CAUSEF_IP3)
  33. do_IRQ(MIPS_CPU_IRQ_BASE + 3);
  34. else if (pending & CAUSEF_IP4)
  35. do_IRQ(MIPS_CPU_IRQ_BASE + 4);
  36. else if (pending & CAUSEF_IP5)
  37. do_IRQ(MIPS_CPU_IRQ_BASE + 5);
  38. else if (pending & CAUSEF_IP7)
  39. do_IRQ(MIPS_CPU_IRQ_BASE + 7);
  40. else
  41. spurious_interrupt();
  42. }
  43. void __init arch_init_irq(void)
  44. {
  45. mips_cpu_irq_init();
  46. gt641xx_irq_init();
  47. init_i8259_irqs();
  48. if (request_irq(GT641XX_CASCADE_IRQ, no_action, IRQF_NO_THREAD,
  49. "cascade", NULL)) {
  50. pr_err("Failed to request irq %d (cascade)\n",
  51. GT641XX_CASCADE_IRQ);
  52. }
  53. if (request_irq(I8259_CASCADE_IRQ, no_action, IRQF_NO_THREAD,
  54. "cascade", NULL)) {
  55. pr_err("Failed to request irq %d (cascade)\n",
  56. I8259_CASCADE_IRQ);
  57. }
  58. }