interrupt.S 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. /*
  2. * File: arch/blackfin/mach-common/interrupt.S
  3. * Based on:
  4. * Author: D. Jeff Dionne <jeff@ryeham.ee.ryerson.ca>
  5. * Kenneth Albanowski <kjahds@kjahds.com>
  6. *
  7. * Created: ?
  8. * Description: Interrupt Entries
  9. *
  10. * Modified:
  11. * Copyright 2004-2006 Analog Devices Inc.
  12. *
  13. * Bugs: Enter bugs at http://blackfin.uclinux.org/
  14. *
  15. * This program is free software; you can redistribute it and/or modify
  16. * it under the terms of the GNU General Public License as published by
  17. * the Free Software Foundation; either version 2 of the License, or
  18. * (at your option) any later version.
  19. *
  20. * This program is distributed in the hope that it will be useful,
  21. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  22. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  23. * GNU General Public License for more details.
  24. *
  25. * You should have received a copy of the GNU General Public License
  26. * along with this program; if not, see the file COPYING, or write
  27. * to the Free Software Foundation, Inc.,
  28. * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  29. */
  30. #include <asm/blackfin.h>
  31. #include <asm/mach/irq.h>
  32. #include <linux/autoconf.h>
  33. #include <linux/linkage.h>
  34. #include <asm/entry.h>
  35. #include <asm/asm-offsets.h>
  36. #include <asm/trace.h>
  37. #include <asm/mach-common/context.S>
  38. #ifdef CONFIG_I_ENTRY_L1
  39. .section .l1.text
  40. #else
  41. .text
  42. #endif
  43. .align 4 /* just in case */
  44. /* Common interrupt entry code. First we do CLI, then push
  45. * RETI, to keep interrupts disabled, but to allow this state to be changed
  46. * by local_bh_enable.
  47. * R0 contains the interrupt number, while R1 may contain the value of IPEND,
  48. * or garbage if IPEND won't be needed by the ISR. */
  49. __common_int_entry:
  50. [--sp] = fp;
  51. [--sp] = usp;
  52. [--sp] = i0;
  53. [--sp] = i1;
  54. [--sp] = i2;
  55. [--sp] = i3;
  56. [--sp] = m0;
  57. [--sp] = m1;
  58. [--sp] = m2;
  59. [--sp] = m3;
  60. [--sp] = l0;
  61. [--sp] = l1;
  62. [--sp] = l2;
  63. [--sp] = l3;
  64. [--sp] = b0;
  65. [--sp] = b1;
  66. [--sp] = b2;
  67. [--sp] = b3;
  68. [--sp] = a0.x;
  69. [--sp] = a0.w;
  70. [--sp] = a1.x;
  71. [--sp] = a1.w;
  72. [--sp] = LC0;
  73. [--sp] = LC1;
  74. [--sp] = LT0;
  75. [--sp] = LT1;
  76. [--sp] = LB0;
  77. [--sp] = LB1;
  78. [--sp] = ASTAT;
  79. [--sp] = r0; /* Skip reserved */
  80. [--sp] = RETS;
  81. r2 = RETI;
  82. [--sp] = r2;
  83. [--sp] = RETX;
  84. [--sp] = RETN;
  85. [--sp] = RETE;
  86. [--sp] = SEQSTAT;
  87. [--sp] = r1; /* IPEND - R1 may or may not be set up before jumping here. */
  88. /* Switch to other method of keeping interrupts disabled. */
  89. #ifdef CONFIG_DEBUG_HWERR
  90. r1 = 0x3f;
  91. sti r1;
  92. #else
  93. cli r1;
  94. #endif
  95. [--sp] = RETI; /* orig_pc */
  96. /* Clear all L registers. */
  97. r1 = 0 (x);
  98. l0 = r1;
  99. l1 = r1;
  100. l2 = r1;
  101. l3 = r1;
  102. #ifdef CONFIG_FRAME_POINTER
  103. fp = 0;
  104. #endif
  105. #if ANOMALY_05000283 || ANOMALY_05000315
  106. cc = r7 == r7;
  107. p5.h = 0xffc0;
  108. p5.l = 0x0014;
  109. if cc jump 1f;
  110. r7.l = W[p5];
  111. 1:
  112. #endif
  113. r1 = sp;
  114. SP += -12;
  115. call _do_irq;
  116. SP += 12;
  117. call _return_from_int;
  118. .Lcommon_restore_context:
  119. RESTORE_CONTEXT
  120. rti;
  121. /* interrupt routine for ivhw - 5 */
  122. ENTRY(_evt_ivhw)
  123. SAVE_CONTEXT
  124. #ifdef CONFIG_FRAME_POINTER
  125. fp = 0;
  126. #endif
  127. #if ANOMALY_05000283
  128. cc = r7 == r7;
  129. p5.h = 0xffc0;
  130. p5.l = 0x0014;
  131. if cc jump 1f;
  132. r7.l = W[p5];
  133. 1:
  134. #endif
  135. trace_buffer_stop(p0, r0);
  136. r0 = IRQ_HWERR;
  137. r1 = sp;
  138. #ifdef CONFIG_HARDWARE_PM
  139. r7 = SEQSTAT;
  140. r7 = r7 >>> 0xe;
  141. r6 = 0x1F;
  142. r7 = r7 & r6;
  143. r5 = 0x12;
  144. cc = r7 == r5;
  145. if cc jump .Lcall_do_ovf; /* deal with performance counter overflow */
  146. #endif
  147. SP += -12;
  148. call _irq_panic;
  149. SP += 12;
  150. rti;
  151. #ifdef CONFIG_HARDWARE_PM
  152. .Lcall_do_ovf:
  153. SP += -12;
  154. call _pm_overflow;
  155. SP += 12;
  156. jump .Lcommon_restore_context;
  157. #endif
  158. /* Interrupt routine for evt2 (NMI).
  159. * We don't actually use this, so just return.
  160. * For inner circle type details, please see:
  161. * http://docs.blackfin.uclinux.org/doku.php?id=linux:nmi
  162. */
  163. ENTRY(_evt_nmi)
  164. .weak _evt_nmi
  165. rtn;
  166. ENDPROC(_evt_nmi)
  167. /* interrupt routine for core timer - 6 */
  168. ENTRY(_evt_timer)
  169. TIMER_INTERRUPT_ENTRY(EVT_IVTMR_P)
  170. /* interrupt routine for evt7 - 7 */
  171. ENTRY(_evt_evt7)
  172. INTERRUPT_ENTRY(EVT_IVG7_P)
  173. ENTRY(_evt_evt8)
  174. INTERRUPT_ENTRY(EVT_IVG8_P)
  175. ENTRY(_evt_evt9)
  176. INTERRUPT_ENTRY(EVT_IVG9_P)
  177. ENTRY(_evt_evt10)
  178. INTERRUPT_ENTRY(EVT_IVG10_P)
  179. ENTRY(_evt_evt11)
  180. INTERRUPT_ENTRY(EVT_IVG11_P)
  181. ENTRY(_evt_evt12)
  182. INTERRUPT_ENTRY(EVT_IVG12_P)
  183. ENTRY(_evt_evt13)
  184. INTERRUPT_ENTRY(EVT_IVG13_P)
  185. /* interrupt routine for system_call - 15 */
  186. ENTRY(_evt_system_call)
  187. SAVE_CONTEXT_SYSCALL
  188. #ifdef CONFIG_FRAME_POINTER
  189. fp = 0;
  190. #endif
  191. call _system_call;
  192. jump .Lcommon_restore_context;
  193. ENDPROC(_evt_system_call)