3 * Stefan Roese, DENX Software Engineering, sr@denx.de.
6 * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
7 * Marius Groeger <mgroeger@sysgo.de>
10 * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
11 * Alex Zuepke <azu@sysgo.de>
13 * See file CREDITS for list of people who contributed to this
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License as
18 * published by the Free Software Foundation; either version 2 of
19 * the License, or (at your option) any later version.
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
33 #include <asm/arch/ixp425.h>
34 #include <asm/proc-armv/ptrace.h>
38 void (*m_func)( void *data);
41 static struct _irq_handler IRQ_HANDLER[N_IRQS];
43 static void default_isr(void *data)
45 printf("default_isr(): called for IRQ %d, Interrupt Status=%x PR=%x\n",
46 (int)data, *IXP425_ICIP, *IXP425_ICIH);
49 static int next_irq(void)
51 return (((*IXP425_ICIH & 0x000000fc) >> 2) - 1);
54 void do_irq (struct pt_regs *pt_regs)
58 IRQ_HANDLER[irq].m_func(IRQ_HANDLER[irq].m_data);
61 void irq_install_handler (int irq, interrupt_handler_t handle_irq, void *data)
63 if (irq >= N_IRQS || !handle_irq)
66 IRQ_HANDLER[irq].m_data = data;
67 IRQ_HANDLER[irq].m_func = handle_irq;
70 int arch_interrupt_init (void)
74 /* install default interrupt handlers */
75 for (i = 0; i < N_IRQS; i++)
76 irq_install_handler(i, default_isr, (void *)i);
78 /* configure interrupts for IRQ mode */
79 *IXP425_ICLR = 0x00000000;