irq-handler.S 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /*
  2. * Copyright 2003, 04 PMC-Sierra Inc.
  3. * Author: Manish Lachwani (lachwani@pmc-sierra.com
  4. * Copyright 2004 Ralf Baechle (ralf@linux-mips.org)
  5. *
  6. * First-level interrupt router for the PMC-Sierra Titan board
  7. *
  8. * This program is free software; you can redistribute it and/or modify it
  9. * under the terms of the GNU General Public License as published by the
  10. * Free Software Foundation; either version 2 of the License, or (at your
  11. * option) any later version.
  12. *
  13. * Titan supports Hypertransport or PCI but not both. Hence, one interrupt
  14. * line is shared between the PCI slot A and Hypertransport. This is the
  15. * Processor INTB #0.
  16. */
  17. #include <linux/config.h>
  18. #include <asm/asm.h>
  19. #include <asm/mipsregs.h>
  20. #include <asm/addrspace.h>
  21. #include <asm/regdef.h>
  22. #include <asm/stackframe.h>
  23. .align 5
  24. NESTED(titan_handle_int, PT_SIZE, sp)
  25. SAVE_ALL
  26. CLI
  27. .set at
  28. .set noreorder
  29. la ra, ret_from_irq
  30. mfc0 t0, CP0_CAUSE
  31. mfc0 t2, CP0_STATUS
  32. and t0, t2
  33. andi t2, t0, STATUSF_IP7 /* INTB5 hardware line */
  34. bnez t2, ll_timer_irq /* Timer */
  35. andi t1, t0, STATUSF_IP2 /* INTB0 hardware line */
  36. bnez t1, ll_pcia_irq /* 64-bit PCI */
  37. andi t2, t0, STATUSF_IP3 /* INTB1 hardware line */
  38. bnez t2, ll_pcib_irq /* second 64-bit PCI slot */
  39. andi t1, t0, STATUSF_IP4 /* INTB2 hardware line */
  40. bnez t1, ll_duart_irq /* UART */
  41. andi t2, t0, STATUSF_IP5 /* SMP inter-core interrupts */
  42. bnez t2, ll_smp_irq
  43. andi t1, t0, STATUSF_IP6
  44. bnez t1, ll_ht_irq /* Hypertransport */
  45. move a0, sp
  46. j do_extended_irq
  47. END(titan_handle_int)
  48. .set reorder
  49. .align 5
  50. ll_pcia_irq:
  51. li a0, 2
  52. move a1, sp
  53. #ifdef CONFIG_HYPERTRANSPORT
  54. j ll_ht_smp_irq_handler
  55. #else
  56. j do_IRQ
  57. #endif
  58. ll_pcib_irq:
  59. li a0, 3
  60. move a1, sp
  61. j do_IRQ
  62. ll_duart_irq:
  63. li a0, 4
  64. move a1, sp
  65. j do_IRQ
  66. ll_smp_irq:
  67. li a0, 5
  68. move a1, sp
  69. #ifdef CONFIG_SMP
  70. j titan_mailbox_irq
  71. #else
  72. j do_IRQ
  73. #endif
  74. ll_ht_irq:
  75. li a0, 6
  76. move a1, sp
  77. j ll_ht_smp_irq_handler
  78. ll_timer_irq:
  79. li a0, 7
  80. move a1, sp
  81. j do_IRQ