int-handler.S 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. /*
  2. * Copyright 2001 MontaVista Software Inc.
  3. * Author: jsun@mvista.com or jsun@junsun.net
  4. *
  5. * First-level interrupt dispatcher for ocelot board.
  6. *
  7. * This program is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU General Public License as published by the
  9. * Free Software Foundation; either version 2 of the License, or (at your
  10. * option) any later version.
  11. */
  12. #include <asm/asm.h>
  13. #include <asm/mipsregs.h>
  14. #include <asm/addrspace.h>
  15. #include <asm/regdef.h>
  16. #include <asm/stackframe.h>
  17. /*
  18. * first level interrupt dispatcher for ocelot board -
  19. * We check for the timer first, then check PCI ints A and D.
  20. * Then check for serial IRQ and fall through.
  21. */
  22. .align 5
  23. NESTED(ocelot_handle_int, PT_SIZE, sp)
  24. SAVE_ALL
  25. CLI
  26. .set at
  27. mfc0 t0, CP0_CAUSE
  28. mfc0 t2, CP0_STATUS
  29. and t0, t2
  30. andi t1, t0, STATUSF_IP2 /* int0 hardware line */
  31. bnez t1, ll_pri_enet_irq
  32. andi t1, t0, STATUSF_IP3 /* int1 hardware line */
  33. bnez t1, ll_sec_enet_irq
  34. andi t1, t0, STATUSF_IP4 /* int2 hardware line */
  35. bnez t1, ll_uart_irq
  36. andi t1, t0, STATUSF_IP5 /* int3 hardware line */
  37. bnez t1, ll_cpci_irq
  38. andi t1, t0, STATUSF_IP6 /* int4 hardware line */
  39. bnez t1, ll_galileo_p0_irq
  40. andi t1, t0, STATUSF_IP7 /* cpu timer */
  41. bnez t1, ll_cputimer_irq
  42. /* now look at the extended interrupts */
  43. mfc0 t0, CP0_CAUSE
  44. cfc0 t1, CP0_S1_INTCONTROL
  45. /* shift the mask 8 bits left to line up the bits */
  46. sll t2, t1, 8
  47. and t0, t2
  48. srl t0, t0, 16
  49. andi t1, t0, STATUSF_IP8 /* int6 hardware line */
  50. bnez t1, ll_galileo_p1_irq
  51. andi t1, t0, STATUSF_IP9 /* int7 hardware line */
  52. bnez t1, ll_pmc_irq
  53. andi t1, t0, STATUSF_IP10 /* int8 hardware line */
  54. bnez t1, ll_cpci_abcd_irq
  55. andi t1, t0, STATUSF_IP11 /* int9 hardware line */
  56. bnez t1, ll_testpoint_irq
  57. .set reorder
  58. /* wrong alarm or masked ... */
  59. j spurious_interrupt
  60. nop
  61. END(ocelot_handle_int)
  62. .align 5
  63. ll_pri_enet_irq:
  64. li a0, 2
  65. move a1, sp
  66. jal do_IRQ
  67. j ret_from_irq
  68. ll_sec_enet_irq:
  69. li a0, 3
  70. move a1, sp
  71. jal do_IRQ
  72. j ret_from_irq
  73. ll_uart_irq:
  74. li a0, 4
  75. move a1, sp
  76. jal do_IRQ
  77. j ret_from_irq
  78. ll_cpci_irq:
  79. li a0, 5
  80. move a1, sp
  81. jal do_IRQ
  82. j ret_from_irq
  83. ll_galileo_p0_irq:
  84. li a0, 6
  85. move a1, sp
  86. jal do_IRQ
  87. j ret_from_irq
  88. ll_cputimer_irq:
  89. li a0, 7
  90. move a1, sp
  91. jal do_IRQ
  92. j ret_from_irq
  93. ll_galileo_p1_irq:
  94. li a0, 8
  95. move a1, sp
  96. jal do_IRQ
  97. j ret_from_irq
  98. ll_pmc_irq:
  99. li a0, 9
  100. move a1, sp
  101. jal do_IRQ
  102. j ret_from_irq
  103. ll_cpci_abcd_irq:
  104. li a0, 10
  105. move a1, sp
  106. jal do_IRQ
  107. j ret_from_irq
  108. ll_testpoint_irq:
  109. li a0, 11
  110. move a1, sp
  111. jal do_IRQ
  112. j ret_from_irq