2 * File: arch/blackfin/mach-common/interrupt.S
4 * Author: D. Jeff Dionne <jeff@ryeham.ee.ryerson.ca>
5 * Kenneth Albanowski <kjahds@kjahds.com>
8 * Description: Interrupt Entries
11 * Copyright 2004-2006 Analog Devices Inc.
13 * Bugs: Enter bugs at http://blackfin.uclinux.org/
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.
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.
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
31 #include <asm/blackfin.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/traps.h>
38 #include <asm/thread_info.h>
40 #include <asm/context.S>
42 .extern _ret_from_exception
44 #ifdef CONFIG_I_ENTRY_L1
50 .align 4 /* just in case */
52 /* Common interrupt entry code. First we do CLI, then push
53 * RETI, to keep interrupts disabled, but to allow this state to be changed
55 * R0 contains the interrupt number, while R1 may contain the value of IPEND,
56 * or garbage if IPEND won't be needed by the ISR. */
94 [--sp] = r0; /* Skip reserved */
102 [--sp] = r1; /* IPEND - R1 may or may not be set up before jumping here. */
104 /* Switch to other method of keeping interrupts disabled. */
105 #ifdef CONFIG_DEBUG_HWERR
111 [--sp] = RETI; /* orig_pc */
112 /* Clear all L registers. */
118 #ifdef CONFIG_FRAME_POINTER
122 #if ANOMALY_05000283 || ANOMALY_05000315
133 call ___ipipe_grab_irq
136 if cc jump .Lcommon_restore_context;
137 #else /* CONFIG_IPIPE */
140 #endif /* CONFIG_IPIPE */
141 call _return_from_int;
142 .Lcommon_restore_context:
146 /* interrupt routine for ivhw - 5 */
148 /* In case a single action kicks off multiple memory transactions, (like
149 * a cache line fetch, - this can cause multiple hardware errors, let's
150 * catch them all. First - make sure all the actions are complete, and
151 * the core sees the hardware errors.
157 #ifdef CONFIG_FRAME_POINTER
161 #if ANOMALY_05000283 || ANOMALY_05000315
170 /* Handle all stacked hardware errors
171 * To make sure we don't hang forever, only do it 10 times
179 CC = BITTST(R1, EVT_IVHW_P);
181 /* OK a hardware error is pending - clear it */
189 # We are going to dump something out, so make sure we print IPEND properly
193 [sp + PT_IPEND] = r0;
195 /* set the EXCAUSE to HWERR for trap_c */
196 r0 = [sp + PT_SEQSTAT];
197 R1.L = LO(VEC_HWERR);
198 R1.H = HI(VEC_HWERR);
200 [sp + PT_SEQSTAT] = R0;
202 r0 = sp; /* stack frame pt_regs pointer argument ==> r0 */
208 /* make sure EBIU_ERRMST is clear */
209 p0.l = LO(EBIU_ERRMST);
210 p0.h = HI(EBIU_ERRMST);
211 r0.l = (CORE_ERROR | CORE_MERROR);
215 call _ret_from_exception;
217 .Lcommon_restore_all_sys:
222 /* Interrupt routine for evt2 (NMI).
223 * We don't actually use this, so just return.
224 * For inner circle type details, please see:
225 * http://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:nmi
232 /* interrupt routine for core timer - 6 */
234 TIMER_INTERRUPT_ENTRY(EVT_IVTMR_P)
236 /* interrupt routine for evt7 - 7 */
238 INTERRUPT_ENTRY(EVT_IVG7_P)
240 INTERRUPT_ENTRY(EVT_IVG8_P)
242 INTERRUPT_ENTRY(EVT_IVG9_P)
244 INTERRUPT_ENTRY(EVT_IVG10_P)
246 INTERRUPT_ENTRY(EVT_IVG11_P)
248 INTERRUPT_ENTRY(EVT_IVG12_P)
250 INTERRUPT_ENTRY(EVT_IVG13_P)
253 /* interrupt routine for system_call - 15 */
254 ENTRY(_evt_system_call)
256 #ifdef CONFIG_FRAME_POINTER
260 jump .Lcommon_restore_context;
261 ENDPROC(_evt_system_call)
264 ENTRY(___ipipe_call_irqtail)
272 [--sp] = ( r7:4, p5:3 );
276 ( r7:4, p5:3 ) = [sp++];
280 reti = [sp++]; /* IRQs are off. */
290 [--sp] = reti; /* IRQs on. */
292 jump 2b; /* Likely paranoid. */
294 sp += 4; /* Discard saved RETI */
295 r0.h = _evt14_softirq;
296 r0.l = _evt14_softirq;
301 p0.l = _bfin_irq_flags;
302 p0.h = _bfin_irq_flags;
306 ENDPROC(___ipipe_call_irqtail)
308 #endif /* CONFIG_IPIPE */