blob: c356d53aa6122d37949ad2d07b842aa9fd7eb26d [file] [log] [blame]
Wolfgang Denk97caf672006-03-12 02:12:27 +01001/*
2 * U-boot - interrupt.S Processing of interrupts and exception handling
3 *
Aubrey Li314d22f2007-04-05 18:31:18 +08004 * Copyright (c) 2005-2007 Analog Devices Inc.
Wolfgang Denk97caf672006-03-12 02:12:27 +01005 *
6 * (C) Copyright 2000-2004
7 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
8 *
9 * This file is based on interrupt.S
10 *
11 * Copyright (C) 2003 Metrowerks, Inc. <mwaddel@metrowerks.com>
12 * Copyright (C) 2002 Arcturus Networks Ltd. Ted Ma <mated@sympatico.ca>
13 * Copyright (C) 1998 D. Jeff Dionne <jeff@ryeham.ee.ryerson.ca>,
14 * Kenneth Albanowski <kjahds@kjahds.com>,
15 * The Silver Hammer Group, Ltd.
16 *
17 * (c) 1995, Dionne & Associates
18 * (c) 1995, DKG Display Tech.
19 *
20 * This file is also based on exception.asm
21 * (C) Copyright 2001-2005 - Analog Devices, Inc. All rights reserved.
22 *
23 * See file CREDITS for list of people who contributed to this
24 * project.
25 *
26 * This program is free software; you can redistribute it and/or
27 * modify it under the terms of the GNU General Public License as
28 * published by the Free Software Foundation; either version 2 of
29 * the License, or (at your option) any later version.
30 *
31 * This program is distributed in the hope that it will be useful,
32 * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 * GNU General Public License for more details.
35 *
36 * You should have received a copy of the GNU General Public License
37 * along with this program; if not, write to the Free Software
Aubrey Li314d22f2007-04-05 18:31:18 +080038 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
39 * MA 02110-1301 USA
Wolfgang Denk97caf672006-03-12 02:12:27 +010040 */
41
42#define ASSEMBLY
Aubrey.Li9da597f2007-03-09 13:38:44 +080043#include <config.h>
44#include <asm/blackfin.h>
Wolfgang Denk97caf672006-03-12 02:12:27 +010045#include <asm/hw_irq.h>
46#include <asm/entry.h>
47#include <asm/blackfin_defs.h>
Wolfgang Denk97caf672006-03-12 02:12:27 +010048
Aubrey.Li9da597f2007-03-09 13:38:44 +080049.global _blackfin_irq_panic;
Wolfgang Denk97caf672006-03-12 02:12:27 +010050
51.text
52.align 2
53
54#ifndef CONFIG_KGDB
Aubrey.Li9da597f2007-03-09 13:38:44 +080055.global _evt_emulation
56_evt_emulation:
Wolfgang Denk97caf672006-03-12 02:12:27 +010057 SAVE_CONTEXT
58 r0 = IRQ_EMU;
59 r1 = seqstat;
60 sp += -12;
Aubrey.Li9da597f2007-03-09 13:38:44 +080061 call _blackfin_irq_panic;
Wolfgang Denk97caf672006-03-12 02:12:27 +010062 sp += 12;
63 rte;
64#endif
65
Aubrey.Li9da597f2007-03-09 13:38:44 +080066.global _evt_nmi
67_evt_nmi:
Wolfgang Denk97caf672006-03-12 02:12:27 +010068 SAVE_CONTEXT
69 r0 = IRQ_NMI;
70 r1 = RETN;
71 sp += -12;
Aubrey.Li9da597f2007-03-09 13:38:44 +080072 call _blackfin_irq_panic;
Wolfgang Denk97caf672006-03-12 02:12:27 +010073 sp += 12;
74
75_evt_nmi_exit:
76 rtn;
77
Aubrey.Li9da597f2007-03-09 13:38:44 +080078.global _trap
79_trap:
80 SAVE_ALL_SYS
81 r0 = sp; /* stack frame pt_regs pointer argument ==> r0 */
82 sp += -12;
83 call _trap_c
84 sp += 12;
85 RESTORE_ALL_SYS
86 rtx;
Wolfgang Denk97caf672006-03-12 02:12:27 +010087
Aubrey.Li9da597f2007-03-09 13:38:44 +080088.global _evt_rst
89_evt_rst:
Wolfgang Denk97caf672006-03-12 02:12:27 +010090 SAVE_CONTEXT
91 r0 = IRQ_RST;
92 r1 = RETN;
93 sp += -12;
Aubrey.Li9da597f2007-03-09 13:38:44 +080094 call _do_reset;
Wolfgang Denk97caf672006-03-12 02:12:27 +010095 sp += 12;
96
97_evt_rst_exit:
Aubrey Lif83a65c2007-03-10 23:49:29 +080098 rtn;
Wolfgang Denk97caf672006-03-12 02:12:27 +010099
100irq_panic:
101 r0 = IRQ_EVX;
102 r1 = sp;
103 sp += -12;
Aubrey.Li9da597f2007-03-09 13:38:44 +0800104 call _blackfin_irq_panic;
Wolfgang Denk97caf672006-03-12 02:12:27 +0100105 sp += 12;
106
Aubrey.Li9da597f2007-03-09 13:38:44 +0800107.global _evt_ivhw
108_evt_ivhw:
Wolfgang Denk97caf672006-03-12 02:12:27 +0100109 SAVE_CONTEXT
110 RAISE 14;
111
112_evt_ivhw_exit:
113 rti;
114
Aubrey.Li9da597f2007-03-09 13:38:44 +0800115.global _evt_timer
116_evt_timer:
Wolfgang Denk97caf672006-03-12 02:12:27 +0100117 SAVE_CONTEXT
118 r0 = IRQ_CORETMR;
119 sp += -12;
120 /* Polling method used now. */
121 /* call timer_int; */
122 sp += 12;
123 RESTORE_CONTEXT
124 rti;
125 nop;
126
Aubrey.Li9da597f2007-03-09 13:38:44 +0800127.global _evt_evt7
128_evt_evt7:
Wolfgang Denk97caf672006-03-12 02:12:27 +0100129 SAVE_CONTEXT
130 r0 = 7;
131 sp += -12;
Aubrey.Li9da597f2007-03-09 13:38:44 +0800132 call _process_int;
Wolfgang Denk97caf672006-03-12 02:12:27 +0100133 sp += 12;
134
135evt_evt7_exit:
136 RESTORE_CONTEXT
Aubrey Lif83a65c2007-03-10 23:49:29 +0800137 rti;
Wolfgang Denk97caf672006-03-12 02:12:27 +0100138
Aubrey.Li9da597f2007-03-09 13:38:44 +0800139.global _evt_evt8
140_evt_evt8:
Wolfgang Denk97caf672006-03-12 02:12:27 +0100141 SAVE_CONTEXT
142 r0 = 8;
143 sp += -12;
Aubrey.Li9da597f2007-03-09 13:38:44 +0800144 call _process_int;
Wolfgang Denk97caf672006-03-12 02:12:27 +0100145 sp += 12;
146
147evt_evt8_exit:
148 RESTORE_CONTEXT
149 rti;
150
Aubrey.Li9da597f2007-03-09 13:38:44 +0800151.global _evt_evt9
152_evt_evt9:
Wolfgang Denk97caf672006-03-12 02:12:27 +0100153 SAVE_CONTEXT
154 r0 = 9;
155 sp += -12;
Aubrey.Li9da597f2007-03-09 13:38:44 +0800156 call _process_int;
Wolfgang Denk97caf672006-03-12 02:12:27 +0100157 sp += 12;
158
159evt_evt9_exit:
160 RESTORE_CONTEXT
161 rti;
162
Aubrey.Li9da597f2007-03-09 13:38:44 +0800163.global _evt_evt10
164_evt_evt10:
Wolfgang Denk97caf672006-03-12 02:12:27 +0100165 SAVE_CONTEXT
166 r0 = 10;
167 sp += -12;
Aubrey.Li9da597f2007-03-09 13:38:44 +0800168 call _process_int;
Wolfgang Denk97caf672006-03-12 02:12:27 +0100169 sp += 12;
170
171evt_evt10_exit:
172 RESTORE_CONTEXT
173 rti;
174
Aubrey.Li9da597f2007-03-09 13:38:44 +0800175.global _evt_evt11
176_evt_evt11:
Wolfgang Denk97caf672006-03-12 02:12:27 +0100177 SAVE_CONTEXT
178 r0 = 11;
179 sp += -12;
Aubrey.Li9da597f2007-03-09 13:38:44 +0800180 call _process_int;
Wolfgang Denk97caf672006-03-12 02:12:27 +0100181 sp += 12;
182
183evt_evt11_exit:
184 RESTORE_CONTEXT
185 rti;
186
Aubrey.Li9da597f2007-03-09 13:38:44 +0800187.global _evt_evt12
188_evt_evt12:
Wolfgang Denk97caf672006-03-12 02:12:27 +0100189 SAVE_CONTEXT
190 r0 = 12;
191 sp += -12;
Aubrey.Li9da597f2007-03-09 13:38:44 +0800192 call _process_int;
Wolfgang Denk97caf672006-03-12 02:12:27 +0100193 sp += 12;
194evt_evt12_exit:
195 RESTORE_CONTEXT
196 rti;
197
Aubrey.Li9da597f2007-03-09 13:38:44 +0800198.global _evt_evt13
199_evt_evt13:
Wolfgang Denk97caf672006-03-12 02:12:27 +0100200 SAVE_CONTEXT
201 r0 = 13;
202 sp += -12;
Aubrey.Li9da597f2007-03-09 13:38:44 +0800203 call _process_int;
Wolfgang Denk97caf672006-03-12 02:12:27 +0100204 sp += 12;
205
206evt_evt13_exit:
207 RESTORE_CONTEXT
208 rti;
209
Aubrey.Li9da597f2007-03-09 13:38:44 +0800210.global _evt_system_call
211_evt_system_call:
Wolfgang Denk97caf672006-03-12 02:12:27 +0100212 [--sp] = r0;
213 [--SP] = RETI;
214 r0 = [sp++];
215 r0 += 2;
216 [--sp] = r0;
217 RETI = [SP++];
218 r0 = [SP++];
219 SAVE_CONTEXT
220 sp += -12;
Aubrey.Li9da597f2007-03-09 13:38:44 +0800221 call _exception_handle;
Wolfgang Denk97caf672006-03-12 02:12:27 +0100222 sp += 12;
223 RESTORE_CONTEXT
224 RTI;
225
226evt_system_call_exit:
227 rti;
228
Aubrey.Li9da597f2007-03-09 13:38:44 +0800229.global _evt_soft_int1
230_evt_soft_int1:
Wolfgang Denk97caf672006-03-12 02:12:27 +0100231 [--sp] = r0;
232 [--SP] = RETI;
233 r0 = [sp++];
234 r0 += 2;
235 [--sp] = r0;
236 RETI = [SP++];
237 r0 = [SP++];
238 SAVE_CONTEXT
239 sp += -12;
Aubrey.Li9da597f2007-03-09 13:38:44 +0800240 call _exception_handle;
Wolfgang Denk97caf672006-03-12 02:12:27 +0100241 sp += 12;
242 RESTORE_CONTEXT
243 RTI;
244
245evt_soft_int1_exit:
246 rti;