int-handler.S 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /*
  2. * Copyright 2001 MontaVista Software Inc.
  3. * Author: jsun@mvista.com or jsun@junsun.net
  4. *
  5. * First-level interrupt dispatcher for ddb5476
  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. #include <asm/ddb5xxx/ddb5476.h>
  18. /*
  19. * first level interrupt dispatcher for ocelot board -
  20. * We check for the timer first, then check PCI ints A and D.
  21. * Then check for serial IRQ and fall through.
  22. */
  23. .align 5
  24. NESTED(ddb5476_handle_int, PT_SIZE, sp)
  25. SAVE_ALL
  26. CLI
  27. .set at
  28. .set noreorder
  29. mfc0 t0, CP0_CAUSE
  30. mfc0 t2, CP0_STATUS
  31. and t0, t2
  32. andi t1, t0, STATUSF_IP7 /* cpu timer */
  33. bnez t1, ll_cpu_ip7
  34. andi t1, t0, STATUSF_IP2 /* vrc5476 & i8259 */
  35. bnez t1, ll_cpu_ip2
  36. andi t1, t0, STATUSF_IP3
  37. bnez t1, ll_cpu_ip3
  38. andi t1, t0, STATUSF_IP4
  39. bnez t1, ll_cpu_ip4
  40. andi t1, t0, STATUSF_IP5
  41. bnez t1, ll_cpu_ip5
  42. andi t1, t0, STATUSF_IP6
  43. bnez t1, ll_cpu_ip6
  44. andi t1, t0, STATUSF_IP0 /* software int 0 */
  45. bnez t1, ll_cpu_ip0
  46. andi t1, t0, STATUSF_IP1 /* software int 1 */
  47. bnez t1, ll_cpu_ip1
  48. nop
  49. .set reorder
  50. /* wrong alarm or masked ... */
  51. // jal spurious_interrupt
  52. // j ret_from_irq
  53. move a0, sp
  54. jal vrc5476_irq_dispatch
  55. j ret_from_irq
  56. nop
  57. .align 5
  58. ll_cpu_ip0:
  59. li a0, CPU_IRQ_BASE + 0
  60. move a1, sp
  61. jal do_IRQ
  62. j ret_from_irq
  63. ll_cpu_ip1:
  64. li a0, CPU_IRQ_BASE + 1
  65. move a1, sp
  66. jal do_IRQ
  67. j ret_from_irq
  68. ll_cpu_ip2: /* jump to second-level dispatching */
  69. move a0, sp
  70. jal vrc5476_irq_dispatch
  71. j ret_from_irq
  72. ll_cpu_ip3:
  73. li a0, CPU_IRQ_BASE + 3
  74. move a1, sp
  75. jal do_IRQ
  76. j ret_from_irq
  77. ll_cpu_ip4:
  78. li a0, CPU_IRQ_BASE + 4
  79. move a1, sp
  80. jal do_IRQ
  81. j ret_from_irq
  82. ll_cpu_ip5:
  83. li a0, CPU_IRQ_BASE + 5
  84. move a1, sp
  85. jal do_IRQ
  86. j ret_from_irq
  87. ll_cpu_ip6:
  88. li a0, CPU_IRQ_BASE + 6
  89. move a1, sp
  90. jal do_IRQ
  91. j ret_from_irq
  92. ll_cpu_ip7:
  93. li a0, CPU_IRQ_BASE + 7
  94. move a1, sp
  95. jal do_IRQ
  96. j ret_from_irq
  97. END(ddb5476_handle_int)