irq.c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * linux/arch/mips/tx4938/common/irq.c
  3. *
  4. * Common tx4938 irq handler
  5. * Copyright (C) 2000-2001 Toshiba Corporation
  6. *
  7. * 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the
  8. * terms of the GNU General Public License version 2. This program is
  9. * licensed "as is" without any warranty of any kind, whether express
  10. * or implied.
  11. *
  12. * Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com)
  13. */
  14. #include <linux/init.h>
  15. #include <linux/interrupt.h>
  16. #include <asm/irq_cpu.h>
  17. #include <asm/mipsregs.h>
  18. #include <asm/tx4938/rbtx4938.h>
  19. void __init
  20. tx4938_irq_init(void)
  21. {
  22. mips_cpu_irq_init();
  23. txx9_irq_init(TX4938_IRC_REG);
  24. set_irq_chained_handler(TX4938_IRQ_NEST_PIC_ON_CP0, handle_simple_irq);
  25. }
  26. int toshiba_rbtx4938_irq_nested(int irq);
  27. asmlinkage void plat_irq_dispatch(void)
  28. {
  29. unsigned int pending = read_c0_cause() & read_c0_status();
  30. if (pending & STATUSF_IP7)
  31. do_IRQ(TX4938_IRQ_CPU_TIMER);
  32. else if (pending & STATUSF_IP2) {
  33. int irq = txx9_irq();
  34. if (irq == TX4938_IRQ_PIC_BEG + TX4938_IR_INT(0))
  35. irq = toshiba_rbtx4938_irq_nested(irq);
  36. if (irq >= 0)
  37. do_IRQ(irq);
  38. else
  39. spurious_interrupt();
  40. } else if (pending & STATUSF_IP1)
  41. do_IRQ(TX4938_IRQ_USER1);
  42. else if (pending & STATUSF_IP0)
  43. do_IRQ(TX4938_IRQ_USER0);
  44. }