2 * U-boot - ints.c Interrupt related routines
4 * Copyright (c) 2005-2007 Analog Devices Inc.
6 * This file is based on ints.c
8 * Apr18 2003, Changed by HuTao to support interrupt cascading for Blackfin
11 * Copyright 1996 Roman Zippel
12 * Copyright 1999 D. Jeff Dionne <jeff@uclinux.org>
13 * Copyright 2000-2001 Lineo, Inc. D. Jefff Dionne <jeff@lineo.ca>
14 * Copyright 2002 Arcturus Networks Inc. MaTed <mated@sympatico.ca>
15 * Copyright 2003 Metrowerks/Motorola
17 * (C) Copyright 2000-2004
18 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
20 * See file CREDITS for list of people who contributed to this
23 * This program is free software; you can redistribute it and/or
24 * modify it under the terms of the GNU General Public License as
25 * published by the Free Software Foundation; either version 2 of
26 * the License, or (at your option) any later version.
28 * This program is distributed in the hope that it will be useful,
29 * but WITHOUT ANY WARRANTY; without even the implied warranty of
30 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31 * GNU General Public License for more details.
33 * You should have received a copy of the GNU General Public License
34 * along with this program; if not, write to the Free Software
35 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
40 #include <linux/stddef.h>
41 #include <asm/system.h>
43 #include <asm/traps.h>
45 #include <asm/errno.h>
46 #include <asm/machdep.h>
47 #include <asm/setup.h>
48 #include <asm/blackfin.h>
51 void blackfin_irq_panic(int reason, struct pt_regs *regs)
53 printf("\n\nException: IRQ 0x%x entered\n", reason);
54 printf("code=[0x%x], ", (unsigned int)(regs->seqstat & 0x3f));
55 printf("stack frame=0x%x, ", (unsigned int)regs);
56 printf("bad PC=0x%04x\n", (unsigned int)regs->pc);
58 printf("Unhandled IRQ or exceptions!\n");
59 printf("Please reset the board \n");
62 void blackfin_init_IRQ(void)
64 *(unsigned volatile long *)(SIC_IMASK) = SIC_UNMASK_ALL;
67 *(unsigned volatile long *)(EVT_EMULATION_ADDR) = 0x0;
69 *(unsigned volatile long *)(EVT_NMI_ADDR) =
70 (unsigned volatile long)evt_nmi;
71 *(unsigned volatile long *)(EVT_EXCEPTION_ADDR) =
72 (unsigned volatile long)trap;
73 *(unsigned volatile long *)(EVT_HARDWARE_ERROR_ADDR) =
74 (unsigned volatile long)evt_ivhw;
75 *(unsigned volatile long *)(EVT_RESET_ADDR) =
76 (unsigned volatile long)evt_rst;
77 *(unsigned volatile long *)(EVT_TIMER_ADDR) =
78 (unsigned volatile long)evt_timer;
79 *(unsigned volatile long *)(EVT_IVG7_ADDR) =
80 (unsigned volatile long)evt_evt7;
81 *(unsigned volatile long *)(EVT_IVG8_ADDR) =
82 (unsigned volatile long)evt_evt8;
83 *(unsigned volatile long *)(EVT_IVG9_ADDR) =
84 (unsigned volatile long)evt_evt9;
85 *(unsigned volatile long *)(EVT_IVG10_ADDR) =
86 (unsigned volatile long)evt_evt10;
87 *(unsigned volatile long *)(EVT_IVG11_ADDR) =
88 (unsigned volatile long)evt_evt11;
89 *(unsigned volatile long *)(EVT_IVG12_ADDR) =
90 (unsigned volatile long)evt_evt12;
91 *(unsigned volatile long *)(EVT_IVG13_ADDR) =
92 (unsigned volatile long)evt_evt13;
93 *(unsigned volatile long *)(EVT_IVG14_ADDR) =
94 (unsigned volatile long)evt_system_call;
95 *(unsigned volatile long *)(EVT_IVG15_ADDR) =
96 (unsigned volatile long)evt_soft_int1;
97 *(volatile unsigned long *)ILAT = 0;
100 *(volatile unsigned long *)IMASK = 0xffbf;
104 void exception_handle(void)
106 #if defined (CONFIG_PANIC_HANG)
109 udelay(100000); /* allow messages to go out */
110 do_reset(NULL, 0, 0, NULL);
114 void display_excp(void)
116 printf("Exception!\n");