blob: a10eaabe54d0d5d2e4c4f3f00719eb819dce8770 [file] [log] [blame]
Aubrey Li65458982007-03-20 18:16:24 +08001/*
2 * U-boot - interrupt.S Processing of interrupts and exception handling
3 *
Aubrey Li155fd762007-04-05 18:31:18 +08004 * Copyright (c) 2005-2007 Analog Devices Inc.
Aubrey Li65458982007-03-20 18:16:24 +08005 *
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 Li155fd762007-04-05 18:31:18 +080038 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
39 * MA 02110-1301 USA
Aubrey Li65458982007-03-20 18:16:24 +080040 */
41
42#define ASSEMBLY
43#include <config.h>
44#include <asm/blackfin.h>
Aubrey Li65458982007-03-20 18:16:24 +080045#include <asm/entry.h>
Aubrey Li65458982007-03-20 18:16:24 +080046
47.global _blackfin_irq_panic;
48
49.text
50.align 2
51
52#ifndef CONFIG_KGDB
53.global _evt_emulation
54_evt_emulation:
55 SAVE_CONTEXT
Mike Frysingerd4d77302008-02-04 19:26:55 -050056 r0 = 0;
Aubrey Li65458982007-03-20 18:16:24 +080057 r1 = seqstat;
58 sp += -12;
59 call _blackfin_irq_panic;
60 sp += 12;
61 rte;
62#endif
63
64.global _evt_nmi
65_evt_nmi:
66 SAVE_CONTEXT
Mike Frysingerd4d77302008-02-04 19:26:55 -050067 r0 = 2;
Aubrey Li65458982007-03-20 18:16:24 +080068 r1 = RETN;
69 sp += -12;
70 call _blackfin_irq_panic;
71 sp += 12;
72
73_evt_nmi_exit:
74 rtn;
75
76.global _trap
77_trap:
78 SAVE_ALL_SYS
79 r0 = sp; /* stack frame pt_regs pointer argument ==> r0 */
80 sp += -12;
81 call _trap_c
82 sp += 12;
83 RESTORE_ALL_SYS
84 rtx;
85
86.global _evt_rst
87_evt_rst:
88 SAVE_CONTEXT
Mike Frysingerd4d77302008-02-04 19:26:55 -050089 r0 = 1;
Aubrey Li65458982007-03-20 18:16:24 +080090 r1 = RETN;
91 sp += -12;
92 call _do_reset;
93 sp += 12;
94
95_evt_rst_exit:
96 rtn;
97
98irq_panic:
Mike Frysingerd4d77302008-02-04 19:26:55 -050099 r0 = 3;
Aubrey Li65458982007-03-20 18:16:24 +0800100 r1 = sp;
101 sp += -12;
102 call _blackfin_irq_panic;
103 sp += 12;
104
105.global _evt_ivhw
106_evt_ivhw:
107 SAVE_CONTEXT
108 RAISE 14;
109
110_evt_ivhw_exit:
111 rti;
112
113.global _evt_timer
114_evt_timer:
115 SAVE_CONTEXT
Mike Frysingerd4d77302008-02-04 19:26:55 -0500116 r0 = 6;
Aubrey Li65458982007-03-20 18:16:24 +0800117 sp += -12;
118 /* Polling method used now. */
119 /* call timer_int; */
120 sp += 12;
121 RESTORE_CONTEXT
122 rti;
123 nop;
124
125.global _evt_evt7
126_evt_evt7:
127 SAVE_CONTEXT
128 r0 = 7;
129 sp += -12;
130 call _process_int;
131 sp += 12;
132
133evt_evt7_exit:
134 RESTORE_CONTEXT
135 rti;
136
137.global _evt_evt8
138_evt_evt8:
139 SAVE_CONTEXT
140 r0 = 8;
141 sp += -12;
142 call _process_int;
143 sp += 12;
144
145evt_evt8_exit:
146 RESTORE_CONTEXT
147 rti;
148
149.global _evt_evt9
150_evt_evt9:
151 SAVE_CONTEXT
152 r0 = 9;
153 sp += -12;
154 call _process_int;
155 sp += 12;
156
157evt_evt9_exit:
158 RESTORE_CONTEXT
159 rti;
160
161.global _evt_evt10
162_evt_evt10:
163 SAVE_CONTEXT
164 r0 = 10;
165 sp += -12;
166 call _process_int;
167 sp += 12;
168
169evt_evt10_exit:
170 RESTORE_CONTEXT
171 rti;
172
173.global _evt_evt11
174_evt_evt11:
175 SAVE_CONTEXT
176 r0 = 11;
177 sp += -12;
178 call _process_int;
179 sp += 12;
180
181evt_evt11_exit:
182 RESTORE_CONTEXT
183 rti;
184
185.global _evt_evt12
186_evt_evt12:
187 SAVE_CONTEXT
188 r0 = 12;
189 sp += -12;
190 call _process_int;
191 sp += 12;
192evt_evt12_exit:
193 RESTORE_CONTEXT
194 rti;
195
196.global _evt_evt13
197_evt_evt13:
198 SAVE_CONTEXT
199 r0 = 13;
200 sp += -12;
201 call _process_int;
202 sp += 12;
203
204evt_evt13_exit:
205 RESTORE_CONTEXT
206 rti;
207
208.global _evt_system_call
209_evt_system_call:
210 [--sp] = r0;
211 [--SP] = RETI;
212 r0 = [sp++];
213 r0 += 2;
214 [--sp] = r0;
215 RETI = [SP++];
216 r0 = [SP++];
217 SAVE_CONTEXT
218 sp += -12;
219 call _exception_handle;
220 sp += 12;
221 RESTORE_CONTEXT
222 RTI;
223
224evt_system_call_exit:
225 rti;
226
227.global _evt_soft_int1
228_evt_soft_int1:
229 [--sp] = r0;
230 [--SP] = RETI;
231 r0 = [sp++];
232 r0 += 2;
233 [--sp] = r0;
234 RETI = [SP++];
235 r0 = [SP++];
236 SAVE_CONTEXT
237 sp += -12;
238 call _exception_handle;
239 sp += 12;
240 RESTORE_CONTEXT
241 RTI;
242
243evt_soft_int1_exit:
244 rti;