source: rtems/c/src/lib/libbsp/arm/edb7312/irq/bsp_irq_asm.S @ c499856

4.115
Last change on this file since c499856 was c499856, checked in by Chris Johns <chrisj@…>, on Mar 20, 2014 at 9:10:47 PM

Change all references of rtems.com to rtems.org.

  • Property mode set to 100644
File size: 7.0 KB
Line 
1/*
2 * Cirrus EP7312 Intererrupt handler
3 *
4 * Copyright (c) 2002 by Jay Monkman <jtm@smoothsmoothie.com>
5 *
6 * Copyright (c) 2002 by Charlie Steader <charlies@poliac.com>
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.rtems.org/license/LICENSE.
11*/
12#define __asm__
13#include "irq.h"
14
15        .extern edb7312_interrupt_dispatch
16
17/*
18 * Function to obtain, execute an IT handler and acknowledge the IT
19 */
20
21        .globl bsp_interrupt_dispatch
22bsp_interrupt_dispatch :
23/*
24 * Look at interrupt status register to determine source.
25 * From source, determine offset into expanded vector table
26 * and load handler address into r0.
27 */
28
29  ldr   r1, =0x80000000 /* close to interrupt status/mask registers 1 */
30  ldr   r2, =0x80001000 /* close to interrupt status/mask registers 2 */
31  ldr   r3, =0x80002000 /* close to interrupt status/mask registers 3 */
32
33  stmdb   sp!,{r4, r5, r6}
34
35/*
36 * INTSR3
37 */
38check_dai:
39  ldr   r4, [r3, #0x240]
40  ldr   r5, [r3, #0x280]
41  and   r6, r4, r5 /* only look at interrupts which are enabled */
42  tst   r6, #0x0001
43  beq   check_extfiq
44  mov   r0, #BSP_DAIINT
45  b     get_handler
46
47/*
48 * INTSR1
49 */
50check_extfiq:
51  ldr   r4, [r1, #0x240]
52  ldr   r5, [r1, #0x280]
53  and   r6, r4, r5 /* only look at interrupts which are enabled */
54  tst   r6, #0x0001
55  beq   check_bl
56  mov   r0, #BSP_EXTFIQ
57  b     get_handler
58
59check_bl:
60#if 0
61MUST REMEMBER TO UNCOMMENT IF THIS HANDLER MOVES
62  ldr   r4, [r1, #0x240]
63  ldr   r5, [r1, #0x280]
64  and   r6, r4, r5 /* only look at interrupts which are enabled */
65#endif
66  tst   r6, #0x0002
67  beq   check_we
68  mov   r0, #BSP_BLINT
69  b     get_handler
70
71check_we:
72#if 0
73MUST REMEMBER TO UNCOMMENT IF THIS HANDLER MOVES
74  ldr   r4, [r1, #0x240]
75  ldr   r5, [r1, #0x280]
76  and   r6, r4, r5 /* only look at interrupts which are enabled */
77#endif
78  tst   r6, #0x0004
79  beq   check_mc
80  mov   r0, #BSP_WEINT
81  b     get_handler
82
83check_mc:
84#if 0
85MUST REMEMBER TO UNCOMMENT IF THIS HANDLER MOVES
86  ldr   r4, [r1, #0x240]
87  ldr   r5, [r1, #0x280]
88  and   r6, r4, r5 /* only look at interrupts which are enabled */
89#endif
90  tst   r6, #0x0008
91  beq   check_cs
92  mov   r0, #BSP_MCINT
93  b     get_handler
94
95check_cs:
96#if 0
97MUST REMEMBER TO UNCOMMENT IF THIS HANDLER MOVES
98  ldr   r4, [r1, #0x240]
99  ldr   r5, [r1, #0x280]
100  and   r6, r4, r5 /* only look at interrupts which are enabled */
101#endif
102  tst   r6, #0x0010
103  beq   check_e1
104  mov   r0, #BSP_CSINT
105  b     get_handler
106
107check_e1:
108#if 0
109MUST REMEMBER TO UNCOMMENT IF THIS HANDLER MOVES
110  ldr   r4, [r1, #0x240]
111  ldr   r5, [r1, #0x280]
112  and   r6, r4, r5 /* only look at interrupts which are enabled */
113#endif
114  tst   r6, #0x0020
115  beq   check_e2
116  mov   r0, #BSP_EINT1
117  b     get_handler
118
119check_e2:
120#if 0
121MUST REMEMBER TO UNCOMMENT IF THIS HANDLER MOVES
122  ldr   r4, [r1, #0x240]
123  ldr   r5, [r1, #0x280]
124  and   r6, r4, r5 /* only look at interrupts which are enabled */
125#endif
126  tst   r6, #0x0040
127  beq   check_e3
128  mov   r0, #BSP_EINT2
129  b     get_handler
130
131check_e3:
132#if 0
133MUST REMEMBER TO UNCOMMENT IF THIS HANDLER MOVES
134  ldr   r4, [r1, #0x240]
135  ldr   r5, [r1, #0x280]
136  and   r6, r4, r5 /* only look at interrupts which are enabled */
137#endif
138  tst   r6, #0x0080
139  beq   check_tc1
140  mov   r0, #BSP_EINT3
141  b     get_handler
142
143check_tc1:
144#if 0
145MUST REMEMBER TO UNCOMMENT IF THIS HANDLER MOVES
146  ldr   r4, [r1, #0x240]
147  ldr   r5, [r1, #0x280]
148  and   r6, r4, r5 /* only look at interrupts which are enabled */
149#endif
150  tst   r6, #0x0100
151  beq   check_tc2
152  mov   r0, #BSP_TC1OI
153  b     get_handler
154
155check_tc2:
156#if 0
157MUST REMEMBER TO UNCOMMENT IF THIS HANDLER MOVES
158  ldr   r4, [r1, #0x240]
159  ldr   r5, [r1, #0x280]
160  and   r6, r4, r5 /* only look at interrupts which are enabled */
161#endif
162  tst   r6, #0x0200
163  beq   check_rtc
164  mov   r0, #BSP_TC2OI
165  b     get_handler
166
167check_rtc:
168#if 0
169MUST REMEMBER TO UNCOMMENT IF THIS HANDLER MOVES
170  ldr   r4, [r1, #0x240]
171  ldr   r5, [r1, #0x280]
172  and   r6, r4, r5 /* only look at interrupts which are enabled */
173#endif
174  tst   r6, #0x0400
175  beq   check_tick
176  mov   r0, #BSP_RTCMI
177  b     get_handler
178
179check_tick:
180#if 0
181MUST REMEMBER TO UNCOMMENT IF THIS HANDLER MOVES
182  ldr   r4, [r1, #0x240]
183  ldr   r5, [r1, #0x280]
184  and   r6, r4, r5 /* only look at interrupts which are enabled */
185#endif
186  tst   r6, #0x0800
187  beq   check_utx1
188  mov   r0, #BSP_TINT
189  b     get_handler
190
191check_utx1:
192#if 0
193MUST REMEMBER TO UNCOMMENT IF THIS HANDLER MOVES
194  ldr   r4, [r1, #0x240]
195  ldr   r5, [r1, #0x280]
196  and   r6, r4, r5 /* only look at interrupts which are enabled */
197#endif
198  tst   r6, #0x1000
199  beq   check_urx1
200  mov   r0, #BSP_UTXINT1
201  b     get_handler
202
203check_urx1:
204#if 0
205MUST REMEMBER TO UNCOMMENT IF THIS HANDLER MOVES
206  ldr   r4, [r1, #0x240]
207  ldr   r5, [r1, #0x280]
208  and   r6, r4, r5 /* only look at interrupts which are enabled */
209#endif
210  tst   r6, #0x2000
211  beq   check_ums
212  mov   r0, #BSP_URXINT1
213  b     get_handler
214
215check_ums:
216#if 0
217MUST REMEMBER TO UNCOMMENT IF THIS HANDLER MOVES
218  ldr   r4, [r1, #0x240]
219  ldr   r5, [r1, #0x280]
220  and   r6, r4, r5 /* only look at interrupts which are enabled */
221#endif
222  tst   r6, #0x4000
223  beq   check_sse
224  mov   r0, #BSP_UMSINT
225  b     get_handler
226
227check_sse:
228#if 0
229MUST REMEMBER TO UNCOMMENT IF THIS HANDLER MOVES
230  ldr   r4, [r1, #0x240]
231  ldr   r5, [r1, #0x280]
232  and   r6, r4, r5 /* only look at interrupts which are enabled */
233#endif
234  tst   r6, #0x8000
235  beq   check_kbd
236  mov   r0, #BSP_SSEOTI
237  b     get_handler
238
239/*
240 * INTSR2
241 */
242check_kbd:
243  ldr   r4, [r2, #0x240]
244  ldr   r5, [r2, #0x280]
245  and   r6, r4, r5 /* only look at interrupts which are enabled */
246  tst   r6, #0x0001
247  beq   check_ss2rx
248  mov   r0, #BSP_KBDINT
249  b     get_handler
250
251check_ss2rx:
252#if 0
253MUST REMEMBER TO UNCOMMENT IF THIS HANDLER MOVES
254  ldr   r4, [r2, #0x240]
255  ldr   r5, [r2, #0x280]
256  and   r6, r4, r5 /* only look at interrupts which are enabled */
257#endif
258  tst   r6, #0x0002
259  beq   check_ss2tx
260  mov   r0, #BSP_SS2RX
261  b     get_handler
262
263check_ss2tx:
264#if 0
265MUST REMEMBER TO UNCOMMENT IF THIS HANDLER MOVES
266  ldr   r4, [r2, #0x240]
267  ldr   r5, [r2, #0x280]
268  and   r6, r4, r5 /* only look at interrupts which are enabled */
269#endif
270  tst   r6, #0x0004
271  beq   check_utx2
272  mov   r0, #BSP_SS2TX
273  b     get_handler
274
275check_utx2:
276#if 0
277MUST REMEMBER TO UNCOMMENT IF THIS HANDLER MOVES
278  ldr   r4, [r2, #0x240]
279  ldr   r5, [r2, #0x280]
280  and   r6, r4, r5 /* only look at interrupts which are enabled */
281#endif
282  tst   r6, #0x1000
283  beq   check_urx2
284  mov   r0, #BSP_UTXINT2
285  b     get_handler
286
287check_urx2:
288#if 0
289MUST REMEMBER TO UNCOMMENT IF THIS HANDLER MOVES
290  ldr   r4, [r2, #0x240]
291  ldr   r5, [r2, #0x280]
292  and   r6, r4, r5 /* only look at interrupts which are enabled */
293#endif
294  tst   r6, #0x2000
295  beq   IRQ_NoInterrupt
296  mov   r0, #BSP_URXINT2
297  b     get_handler
298
299get_handler:
300
301  ldmia   sp!,{r4, r5, r6}
302
303  /*
304   * re-enable interrupts at processor level as the current
305   * interrupt source is now masked via VEGA logic
306   */
307/*
308  mrs   r1, cpsr
309  and   r1, r1, #0xFFFFFF3F
310  msr   cpsr, r1
311*/
312
313  stmdb sp!,{lr}
314  bl    edb7312_interrupt_dispatch
315  ldmia sp!,{lr}
316
317IRQ_NoInterrupt:
318  /* return to the "main" interrupt handler */
319  mov pc, lr
Note: See TracBrowser for help on using the repository browser.