int-handler.S 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * Copyright 2001 MontaVista Software Inc.
  3. * Author: jsun@mvista.com or jsun@junsun.net
  4. *
  5. * First-level interrupt dispatcher for ddb5477
  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/ddb5477.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(ddb5477_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_cputimer_irq
  34. andi t1, t0, (STATUSF_IP2 | STATUSF_IP3 | STATUSF_IP4 | STATUSF_IP5 | STATUSF_IP6 )
  35. bnez t1, ll_vrc5477_irq
  36. andi t1, t0, STATUSF_IP0 /* software int 0 */
  37. bnez t1, ll_cpu_ip0
  38. andi t1, t0, STATUSF_IP1 /* software int 1 */
  39. bnez t1, ll_cpu_ip1
  40. nop
  41. .set reorder
  42. /* wrong alarm or masked ... */
  43. j spurious_interrupt
  44. nop
  45. END(ddb5477_handle_int)
  46. .align 5
  47. ll_vrc5477_irq:
  48. move a0, sp
  49. jal vrc5477_irq_dispatch
  50. j ret_from_irq
  51. ll_cputimer_irq:
  52. li a0, CPU_IRQ_BASE + 7
  53. move a1, sp
  54. jal do_IRQ
  55. j ret_from_irq
  56. ll_cpu_ip0:
  57. li a0, CPU_IRQ_BASE + 0
  58. move a1, sp
  59. jal do_IRQ
  60. j ret_from_irq
  61. ll_cpu_ip1:
  62. li a0, CPU_IRQ_BASE + 1
  63. move a1, sp
  64. jal do_IRQ
  65. j ret_from_irq