pxa2x0_intr.c revision 1.1.2.3 1 1.1.2.3 thorpej /* $NetBSD: pxa2x0_intr.c,v 1.1.2.3 2003/01/03 16:41:12 thorpej Exp $ */
2 1.1.2.2 nathanw
3 1.1.2.2 nathanw /*
4 1.1.2.2 nathanw * Copyright (c) 2002 Genetec Corporation. All rights reserved.
5 1.1.2.2 nathanw * Written by Hiroyuki Bessho for Genetec Corporation.
6 1.1.2.2 nathanw *
7 1.1.2.2 nathanw * Redistribution and use in source and binary forms, with or without
8 1.1.2.2 nathanw * modification, are permitted provided that the following conditions
9 1.1.2.2 nathanw * are met:
10 1.1.2.2 nathanw * 1. Redistributions of source code must retain the above copyright
11 1.1.2.2 nathanw * notice, this list of conditions and the following disclaimer.
12 1.1.2.2 nathanw * 2. Redistributions in binary form must reproduce the above copyright
13 1.1.2.2 nathanw * notice, this list of conditions and the following disclaimer in the
14 1.1.2.2 nathanw * documentation and/or other materials provided with the distribution.
15 1.1.2.2 nathanw * 3. All advertising materials mentioning features or use of this software
16 1.1.2.2 nathanw * must display the following acknowledgement:
17 1.1.2.2 nathanw * This product includes software developed for the NetBSD Project by
18 1.1.2.2 nathanw * Genetec Corporation.
19 1.1.2.2 nathanw * 4. The name of Genetec Corporation may not be used to endorse or
20 1.1.2.2 nathanw * promote products derived from this software without specific prior
21 1.1.2.2 nathanw * written permission.
22 1.1.2.2 nathanw *
23 1.1.2.2 nathanw * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``AS IS'' AND
24 1.1.2.2 nathanw * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
25 1.1.2.2 nathanw * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
26 1.1.2.2 nathanw * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GENETEC CORPORATION
27 1.1.2.2 nathanw * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28 1.1.2.2 nathanw * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29 1.1.2.2 nathanw * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30 1.1.2.2 nathanw * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31 1.1.2.2 nathanw * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32 1.1.2.2 nathanw * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 1.1.2.2 nathanw * POSSIBILITY OF SUCH DAMAGE.
34 1.1.2.2 nathanw */
35 1.1.2.2 nathanw
36 1.1.2.2 nathanw /*
37 1.1.2.2 nathanw * IRQ handler for the Intel PXA2X0 processor.
38 1.1.2.2 nathanw * It has integrated interrupt controller.
39 1.1.2.2 nathanw */
40 1.1.2.2 nathanw #include <sys/param.h>
41 1.1.2.2 nathanw #include <sys/systm.h>
42 1.1.2.2 nathanw #include <sys/malloc.h>
43 1.1.2.2 nathanw #include <uvm/uvm_extern.h>
44 1.1.2.2 nathanw #include <machine/bus.h>
45 1.1.2.2 nathanw #include <machine/intr.h>
46 1.1.2.2 nathanw #include <arm/cpufunc.h>
47 1.1.2.2 nathanw
48 1.1.2.2 nathanw #include <arm/xscale/pxa2x0reg.h>
49 1.1.2.2 nathanw #include <arm/xscale/pxa2x0var.h>
50 1.1.2.2 nathanw #include <arm/sa11x0/sa11x0_var.h>
51 1.1.2.2 nathanw #include <arm/xscale/pxa2x0_intr.h>
52 1.1.2.2 nathanw
53 1.1.2.2 nathanw /*
54 1.1.2.2 nathanw * interrupt dispatch table.
55 1.1.2.2 nathanw */
56 1.1.2.2 nathanw #ifdef MULTIPLE_HANDLERS_ON_ONE_IRQ
57 1.1.2.2 nathanw struct intrhand {
58 1.1.2.2 nathanw TAILQ_ENTRY(intrhand) ih_list; /* link on intrq list */
59 1.1.2.2 nathanw int (*ih_func)(void *); /* handler */
60 1.1.2.2 nathanw void *ih_arg; /* arg for handler */
61 1.1.2.2 nathanw };
62 1.1.2.2 nathanw #endif
63 1.1.2.2 nathanw
64 1.1.2.2 nathanw static struct {
65 1.1.2.2 nathanw #ifdef MULTIPLE_HANDLERS_ON_ONE_IRQ
66 1.1.2.2 nathanw TAILQ_HEAD(,intrhand) list;
67 1.1.2.2 nathanw #else
68 1.1.2.2 nathanw pxa2x0_irq_handler_t func;
69 1.1.2.2 nathanw #endif
70 1.1.2.2 nathanw void *cookie; /* NULL for stackframe */
71 1.1.2.2 nathanw /* struct evbnt ev; */
72 1.1.2.2 nathanw } handler[ICU_LEN];
73 1.1.2.2 nathanw
74 1.1.2.2 nathanw __volatile int softint_pending;
75 1.1.2.2 nathanw
76 1.1.2.2 nathanw __volatile int current_spl_level;
77 1.1.2.2 nathanw __volatile int intr_mask;
78 1.1.2.2 nathanw /* interrupt masks for each level */
79 1.1.2.2 nathanw int pxa2x0_imask[NIPL];
80 1.1.2.2 nathanw static int extirq_level[ICU_LEN];
81 1.1.2.2 nathanw
82 1.1.2.2 nathanw static __inline void
83 1.1.2.2 nathanw __raise(int ipl)
84 1.1.2.2 nathanw {
85 1.1.2.2 nathanw if( current_spl_level < ipl ){
86 1.1.2.2 nathanw pxa2x0_setipl(ipl);
87 1.1.2.2 nathanw }
88 1.1.2.2 nathanw }
89 1.1.2.2 nathanw
90 1.1.2.2 nathanw
91 1.1.2.2 nathanw /*
92 1.1.2.2 nathanw * Map a software interrupt queue to an interrupt priority level.
93 1.1.2.2 nathanw */
94 1.1.2.2 nathanw static const int si_to_ipl[SI_NQUEUES] = {
95 1.1.2.2 nathanw IPL_SOFT, /* SI_SOFT */
96 1.1.2.2 nathanw IPL_SOFTCLOCK, /* SI_SOFTCLOCK */
97 1.1.2.2 nathanw IPL_SOFTNET, /* SI_SOFTNET */
98 1.1.2.2 nathanw IPL_SOFTSERIAL, /* SI_SOFTSERIAL */
99 1.1.2.2 nathanw };
100 1.1.2.2 nathanw
101 1.1.2.2 nathanw /*
102 1.1.2.2 nathanw * called from irq_entry.
103 1.1.2.2 nathanw */
104 1.1.2.2 nathanw void
105 1.1.2.2 nathanw pxa2x0_irq_handler(struct clockframe *frame)
106 1.1.2.2 nathanw {
107 1.1.2.2 nathanw uint32_t irqbits;
108 1.1.2.2 nathanw int irqno;
109 1.1.2.2 nathanw int saved_spl_level;
110 1.1.2.2 nathanw
111 1.1.2.2 nathanw saved_spl_level = current_spl_level;
112 1.1.2.2 nathanw
113 1.1.2.2 nathanw /* get pending IRQs */
114 1.1.2.2 nathanw irqbits = read_icu(SAIPIC_IP);
115 1.1.2.2 nathanw
116 1.1.2.2 nathanw while( (irqno = find_first_bit(irqbits)) >= 0 ){
117 1.1.2.2 nathanw /* XXX: Shuould we handle IRQs in priority order? */
118 1.1.2.2 nathanw
119 1.1.2.2 nathanw /* raise spl to stop interrupts of lower priorities */
120 1.1.2.2 nathanw if( saved_spl_level < extirq_level[irqno] )
121 1.1.2.2 nathanw pxa2x0_setipl(extirq_level[irqno]);
122 1.1.2.2 nathanw
123 1.1.2.2 nathanw #ifdef notyet
124 1.1.2.2 nathanw /* Enable interrupt */
125 1.1.2.2 nathanw #endif
126 1.1.2.2 nathanw #ifndef MULTIPLE_HANDLERS_ON_ONE_IRQ
127 1.1.2.2 nathanw (* handler[irqno].func)(
128 1.1.2.2 nathanw handler[irqno].cookie == 0
129 1.1.2.2 nathanw ? frame : handler[irqno].cookie );
130 1.1.2.2 nathanw #else
131 1.1.2.2 nathanw /* process all handlers for this interrupt.
132 1.1.2.2 nathanw XXX not yet */
133 1.1.2.2 nathanw #endif
134 1.1.2.2 nathanw
135 1.1.2.2 nathanw #ifdef notyet
136 1.1.2.2 nathanw /* Disable interrupt */
137 1.1.2.2 nathanw #endif
138 1.1.2.2 nathanw
139 1.1.2.2 nathanw irqbits &= ~(1<<irqno);
140 1.1.2.2 nathanw }
141 1.1.2.2 nathanw
142 1.1.2.2 nathanw /* restore spl to that was when this interrupt happen */
143 1.1.2.2 nathanw pxa2x0_setipl(saved_spl_level);
144 1.1.2.2 nathanw
145 1.1.2.2 nathanw if( softint_pending & intr_mask )
146 1.1.2.2 nathanw pxa2x0_do_pending();
147 1.1.2.2 nathanw }
148 1.1.2.2 nathanw
149 1.1.2.2 nathanw static int
150 1.1.2.2 nathanw stray_interrupt( void *cookie )
151 1.1.2.2 nathanw {
152 1.1.2.2 nathanw int irqno = (int)cookie;
153 1.1.2.2 nathanw printf( "stray interrupt %d\n", irqno );
154 1.1.2.2 nathanw
155 1.1.2.2 nathanw if( PXA2X0_IRQ_MIN <= irqno && irqno < ICU_LEN ){
156 1.1.2.2 nathanw int save = disable_interrupts(I32_bit);
157 1.1.2.2 nathanw write_icu( SAIPIC_MR,
158 1.1.2.2 nathanw read_icu(SAIPIC_MR) & ~(1U<<irqno) );
159 1.1.2.2 nathanw restore_interrupts(save);
160 1.1.2.2 nathanw }
161 1.1.2.2 nathanw
162 1.1.2.2 nathanw return 0;
163 1.1.2.2 nathanw }
164 1.1.2.2 nathanw
165 1.1.2.2 nathanw
166 1.1.2.2 nathanw
167 1.1.2.2 nathanw /*
168 1.1.2.2 nathanw * Interrupt Mask Handling
169 1.1.2.2 nathanw */
170 1.1.2.2 nathanw
171 1.1.2.2 nathanw void
172 1.1.2.2 nathanw pxa2x0_update_intr_masks( int irqno, int level )
173 1.1.2.2 nathanw {
174 1.1.2.2 nathanw int mask = 1U<<irqno;
175 1.1.2.2 nathanw int psw = disable_interrupts(I32_bit);
176 1.1.2.2 nathanw int i;
177 1.1.2.2 nathanw
178 1.1.2.2 nathanw
179 1.1.2.2 nathanw for( i=IPL_BIO; i < level; ++i )
180 1.1.2.2 nathanw pxa2x0_imask[i] |= mask; /* Enable interrupt at lower level */
181 1.1.2.2 nathanw for( ; i < NIPL-1; ++i )
182 1.1.2.2 nathanw pxa2x0_imask[i] &= ~mask; /* Disable itnerrupt at upper level */
183 1.1.2.2 nathanw
184 1.1.2.2 nathanw /*
185 1.1.2.2 nathanw * Enforce a heirarchy that gives "slow" device (or devices with
186 1.1.2.2 nathanw * limited input buffer space/"real-time" requirements) a better
187 1.1.2.2 nathanw * chance at not dropping data.
188 1.1.2.2 nathanw */
189 1.1.2.2 nathanw pxa2x0_imask[IPL_BIO] &= pxa2x0_imask[IPL_SOFTNET];
190 1.1.2.2 nathanw pxa2x0_imask[IPL_NET] &= pxa2x0_imask[IPL_BIO];
191 1.1.2.2 nathanw pxa2x0_imask[IPL_SOFTSERIAL] &= pxa2x0_imask[IPL_NET];
192 1.1.2.2 nathanw pxa2x0_imask[IPL_TTY] &= pxa2x0_imask[IPL_SOFTSERIAL];
193 1.1.2.2 nathanw
194 1.1.2.2 nathanw /*
195 1.1.2.2 nathanw * splvm() blocks all interrupts that use the kernel memory
196 1.1.2.2 nathanw * allocation facilities.
197 1.1.2.2 nathanw */
198 1.1.2.2 nathanw pxa2x0_imask[IPL_IMP] &= pxa2x0_imask[IPL_TTY];
199 1.1.2.2 nathanw
200 1.1.2.2 nathanw /*
201 1.1.2.2 nathanw * Audio devices are not allowed to perform memory allocation
202 1.1.2.2 nathanw * in their interrupt routines, and they have fairly "real-time"
203 1.1.2.2 nathanw * requirements, so give them a high interrupt priority.
204 1.1.2.2 nathanw */
205 1.1.2.2 nathanw pxa2x0_imask[IPL_AUDIO] &= pxa2x0_imask[IPL_IMP];
206 1.1.2.2 nathanw
207 1.1.2.2 nathanw /*
208 1.1.2.2 nathanw * splclock() must block anything that uses the scheduler.
209 1.1.2.2 nathanw */
210 1.1.2.2 nathanw pxa2x0_imask[IPL_CLOCK] &= pxa2x0_imask[IPL_AUDIO];
211 1.1.2.2 nathanw
212 1.1.2.2 nathanw /*
213 1.1.2.2 nathanw * splhigh() must block "everything".
214 1.1.2.2 nathanw */
215 1.1.2.2 nathanw pxa2x0_imask[IPL_HIGH] &= pxa2x0_imask[IPL_STATCLOCK];
216 1.1.2.2 nathanw
217 1.1.2.2 nathanw /*
218 1.1.2.2 nathanw * XXX We need serial drivers to run at the absolute highest priority
219 1.1.2.2 nathanw * in order to avoid overruns, so serial > high.
220 1.1.2.2 nathanw */
221 1.1.2.2 nathanw pxa2x0_imask[IPL_SERIAL] &= pxa2x0_imask[IPL_HIGH];
222 1.1.2.2 nathanw
223 1.1.2.2 nathanw write_icu( SAIPIC_MR, pxa2x0_imask[current_spl_level] );
224 1.1.2.2 nathanw
225 1.1.2.2 nathanw restore_interrupts(psw);
226 1.1.2.2 nathanw }
227 1.1.2.2 nathanw
228 1.1.2.2 nathanw
229 1.1.2.2 nathanw static void
230 1.1.2.2 nathanw init_interrupt_masks(void)
231 1.1.2.2 nathanw {
232 1.1.2.2 nathanw int i;
233 1.1.2.2 nathanw pxa2x0_imask[IPL_NONE] = 0xffffffff;
234 1.1.2.2 nathanw
235 1.1.2.2 nathanw for( i = IPL_BIO; i < NIPL; ++i )
236 1.1.2.2 nathanw pxa2x0_imask[i] = 0;
237 1.1.2.2 nathanw
238 1.1.2.2 nathanw /*
239 1.1.2.2 nathanw * Initialize the soft interrupt masks to block themselves.
240 1.1.2.2 nathanw */
241 1.1.2.2 nathanw pxa2x0_imask[IPL_SOFT] = ~SI_TO_IRQBIT(SI_SOFT);
242 1.1.2.2 nathanw pxa2x0_imask[IPL_SOFTCLOCK] = ~SI_TO_IRQBIT(SI_SOFTCLOCK);
243 1.1.2.2 nathanw pxa2x0_imask[IPL_SOFTNET] = ~SI_TO_IRQBIT(SI_SOFTNET);
244 1.1.2.2 nathanw pxa2x0_imask[IPL_SOFTSERIAL] = ~SI_TO_IRQBIT(SI_SOFTSERIAL);
245 1.1.2.2 nathanw
246 1.1.2.2 nathanw /*
247 1.1.2.2 nathanw * splsoftclock() is the only interface that users of the
248 1.1.2.2 nathanw * generic software interrupt facility have to block their
249 1.1.2.2 nathanw * soft intrs, so splsoftclock() must also block IPL_SOFT.
250 1.1.2.2 nathanw */
251 1.1.2.2 nathanw pxa2x0_imask[IPL_SOFTCLOCK] &= pxa2x0_imask[IPL_SOFT];
252 1.1.2.2 nathanw
253 1.1.2.2 nathanw /*
254 1.1.2.2 nathanw * splsoftnet() must also block splsoftclock(), since we don't
255 1.1.2.2 nathanw * want timer-driven network events to occur while we're
256 1.1.2.2 nathanw * processing incoming packets.
257 1.1.2.2 nathanw */
258 1.1.2.2 nathanw pxa2x0_imask[IPL_SOFTNET] &= pxa2x0_imask[IPL_SOFTCLOCK];
259 1.1.2.2 nathanw
260 1.1.2.2 nathanw }
261 1.1.2.2 nathanw
262 1.1.2.2 nathanw void
263 1.1.2.2 nathanw pxa2x0_do_pending(void)
264 1.1.2.2 nathanw {
265 1.1.2.2 nathanw static __cpu_simple_lock_t processing = __SIMPLELOCK_UNLOCKED;
266 1.1.2.2 nathanw int oldirqstate, spl_save;
267 1.1.2.2 nathanw
268 1.1.2.2 nathanw if (__cpu_simple_lock_try(&processing) == 0)
269 1.1.2.2 nathanw return;
270 1.1.2.2 nathanw
271 1.1.2.2 nathanw spl_save = current_spl_level;
272 1.1.2.2 nathanw
273 1.1.2.2 nathanw oldirqstate = disable_interrupts(I32_bit);
274 1.1.2.2 nathanw
275 1.1.2.2 nathanw #if 1
276 1.1.2.2 nathanw #define DO_SOFTINT(si,ipl) \
277 1.1.2.2 nathanw if ((softint_pending & intr_mask) & SI_TO_IRQBIT(si)) { \
278 1.1.2.2 nathanw softint_pending &= ~SI_TO_IRQBIT(si); \
279 1.1.2.2 nathanw __raise(ipl); \
280 1.1.2.2 nathanw restore_interrupts(oldirqstate); \
281 1.1.2.2 nathanw softintr_dispatch(si); \
282 1.1.2.2 nathanw oldirqstate = disable_interrupts(I32_bit); \
283 1.1.2.2 nathanw pxa2x0_setipl(spl_save); \
284 1.1.2.2 nathanw }
285 1.1.2.2 nathanw
286 1.1.2.2 nathanw do {
287 1.1.2.2 nathanw DO_SOFTINT(SI_SOFTSERIAL,IPL_SOFTSERIAL);
288 1.1.2.2 nathanw DO_SOFTINT(SI_SOFTNET, IPL_SOFTNET);
289 1.1.2.2 nathanw DO_SOFTINT(SI_SOFTCLOCK, IPL_SOFTCLOCK);
290 1.1.2.2 nathanw DO_SOFTINT(SI_SOFT, IPL_SOFT);
291 1.1.2.2 nathanw } while( softint_pending & intr_mask );
292 1.1.2.2 nathanw #else
293 1.1.2.2 nathanw while( (si = find_first_bit(softint_pending & intr_mask)) >= 0 ){
294 1.1.2.2 nathanw softint_pending &= ~SI_TO_IRQBIT(si);
295 1.1.2.2 nathanw __raise(si_to_ipl(si));
296 1.1.2.2 nathanw restore_interrupts(oldirqstate);
297 1.1.2.2 nathanw softintr_dispatch(si);
298 1.1.2.2 nathanw oldirqstate = disable_interrupts(I32_bit);
299 1.1.2.2 nathanw pxa2x0_setipl(spl_save);
300 1.1.2.2 nathanw }
301 1.1.2.2 nathanw #endif
302 1.1.2.2 nathanw
303 1.1.2.2 nathanw __cpu_simple_unlock(&processing);
304 1.1.2.2 nathanw
305 1.1.2.2 nathanw restore_interrupts(oldirqstate);
306 1.1.2.2 nathanw }
307 1.1.2.2 nathanw
308 1.1.2.2 nathanw
309 1.1.2.2 nathanw #undef splx
310 1.1.2.2 nathanw void
311 1.1.2.2 nathanw splx(int ipl)
312 1.1.2.2 nathanw {
313 1.1.2.2 nathanw pxa2x0_splx(ipl);
314 1.1.2.2 nathanw }
315 1.1.2.2 nathanw
316 1.1.2.2 nathanw #undef _splraise
317 1.1.2.2 nathanw int
318 1.1.2.2 nathanw _splraise(int ipl)
319 1.1.2.2 nathanw {
320 1.1.2.2 nathanw return pxa2x0_splraise(ipl);
321 1.1.2.2 nathanw }
322 1.1.2.2 nathanw
323 1.1.2.2 nathanw #undef _spllower
324 1.1.2.2 nathanw int
325 1.1.2.2 nathanw _spllower(int ipl)
326 1.1.2.2 nathanw {
327 1.1.2.2 nathanw return pxa2x0_spllower(ipl);
328 1.1.2.2 nathanw }
329 1.1.2.2 nathanw
330 1.1.2.2 nathanw #undef _setsoftintr
331 1.1.2.2 nathanw void
332 1.1.2.2 nathanw _setsoftintr(int si)
333 1.1.2.2 nathanw {
334 1.1.2.2 nathanw return pxa2x0_setsoftintr(si);
335 1.1.2.2 nathanw }
336 1.1.2.2 nathanw
337 1.1.2.2 nathanw
338 1.1.2.2 nathanw
339 1.1.2.2 nathanw /*
340 1.1.2.2 nathanw * Initialize interrupt dispatcher.
341 1.1.2.2 nathanw */
342 1.1.2.2 nathanw void
343 1.1.2.2 nathanw pxa2x0_intr_init(void)
344 1.1.2.2 nathanw {
345 1.1.2.2 nathanw int i;
346 1.1.2.2 nathanw
347 1.1.2.2 nathanw for( i=0; i < sizeof handler / sizeof handler[0]; ++i ){
348 1.1.2.2 nathanw handler[i].func = stray_interrupt;
349 1.1.2.2 nathanw handler[i].cookie = (void *)(i);
350 1.1.2.2 nathanw extirq_level[i] = IPL_SERIAL;
351 1.1.2.2 nathanw }
352 1.1.2.2 nathanw
353 1.1.2.2 nathanw init_interrupt_masks();
354 1.1.2.2 nathanw
355 1.1.2.2 nathanw _splraise(IPL_SERIAL);
356 1.1.2.2 nathanw enable_interrupts(I32_bit);
357 1.1.2.2 nathanw }
358 1.1.2.2 nathanw
359 1.1.2.2 nathanw void
360 1.1.2.2 nathanw pxa2x0_set_intcbase( vaddr_t addr )
361 1.1.2.2 nathanw {
362 1.1.2.2 nathanw pxaic_base = addr;
363 1.1.2.2 nathanw }
364 1.1.2.2 nathanw
365 1.1.2.2 nathanw void *
366 1.1.2.2 nathanw pxa2x0_intr_establish(int irqno, int level,
367 1.1.2.2 nathanw int (*func)(void *), void *cookie)
368 1.1.2.2 nathanw {
369 1.1.2.2 nathanw int psw;
370 1.1.2.2 nathanw
371 1.1.2.2 nathanw if (irqno < PXA2X0_IRQ_MIN || irqno >= ICU_LEN )
372 1.1.2.2 nathanw panic("intr_establish: bogus irq number %d", irqno);
373 1.1.2.2 nathanw
374 1.1.2.2 nathanw psw = disable_interrupts(I32_bit);
375 1.1.2.2 nathanw
376 1.1.2.2 nathanw handler[irqno].cookie = cookie;
377 1.1.2.2 nathanw handler[irqno].func = func;
378 1.1.2.2 nathanw extirq_level[irqno] = level;
379 1.1.2.2 nathanw pxa2x0_update_intr_masks( irqno, level );
380 1.1.2.2 nathanw
381 1.1.2.2 nathanw intr_mask = pxa2x0_imask[current_spl_level];
382 1.1.2.2 nathanw
383 1.1.2.2 nathanw restore_interrupts(psw);
384 1.1.2.2 nathanw
385 1.1.2.2 nathanw return ( &handler[irqno] );
386 1.1.2.2 nathanw }
387 1.1.2.2 nathanw
388 1.1.2.2 nathanw
389 1.1.2.2 nathanw
390 1.1.2.2 nathanw /*
391 1.1.2.2 nathanw * Glue for drivers of sa11x0 compatible integrated logics.
392 1.1.2.2 nathanw */
393 1.1.2.2 nathanw void *
394 1.1.2.2 nathanw sa11x0_intr_establish(sa11x0_chipset_tag_t ic, int irq, int type, int level,
395 1.1.2.2 nathanw int (*ih_fun)(void *), void *ih_arg)
396 1.1.2.2 nathanw {
397 1.1.2.2 nathanw return pxa2x0_intr_establish(irq,level,ih_fun,ih_arg);
398 1.1.2.2 nathanw }
399 1.1.2.2 nathanw
400