2 * File: arch/blackfin/mach-common/cplbhdlr.S
4 * Author: LG Soft India
7 * Description: CPLB exception handler
10 * Copyright 2004-2006 Analog Devices Inc.
12 * Bugs: Enter bugs at http://blackfin.uclinux.org/
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see the file COPYING, or write
26 * to the Free Software Foundation, Inc.,
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
30 #include <linux/linkage.h>
32 #include <asm/entry.h>
34 #ifdef CONFIG_EXCPT_IRQ_SYSC_L1
40 .type _cplb_mgr, STT_FUNC;
41 .type _panic_cplb_error, STT_FUNC;
48 /* Mask the contents of SEQSTAT and leave only EXCAUSE in R2 */
52 R1 = 0x23; /* Data access CPLB protection violation */
54 IF !CC JUMP .Lnot_data_write;
55 R0 = 2; /* is a write to data space*/
59 R1 = 0x2C; /* CPLB miss on an instruction fetch */
61 R0 = 0; /* is_data_miss == False*/
62 IF CC JUMP .Lis_icplb_miss;
66 IF !CC JUMP .Lunknown;
68 R0 = 1; /* is_data_miss == True*/
72 #if defined(CONFIG_BLKFIN_CACHE) || defined(CONFIG_BLKFIN_DCACHE)
73 # if defined(CONFIG_BLKFIN_CACHE) && !defined(CONFIG_BLKFIN_DCACHE)
74 R1 = CPLB_ENABLE_ICACHE;
76 # if !defined(CONFIG_BLKFIN_CACHE) && defined(CONFIG_BLKFIN_DCACHE)
77 R1 = CPLB_ENABLE_DCACHE;
79 # if defined(CONFIG_BLKFIN_CACHE) && defined(CONFIG_BLKFIN_DCACHE)
80 R1 = CPLB_ENABLE_DCACHE | CPLB_ENABLE_ICACHE;
90 IF !CC JUMP .Lnot_replaced;
94 * Diagnostic exception handlers
97 R0 = CPLB_UNKNOWN_ERR;
101 CC = R0 == CPLB_NO_UNLOCKED;
102 IF !CC JUMP .Lnext_check;
103 R0 = CPLB_NO_UNLOCKED;
107 CC = R0 == CPLB_NO_ADDR_MATCH;
108 IF !CC JUMP .Lnext_check2;
109 R0 = CPLB_NO_ADDR_MATCH;
113 CC = R0 == CPLB_PROT_VIOL;
114 IF !CC JUMP .Lstrange_return_from_cplb_mgr;
118 .Lstrange_return_from_cplb_mgr:
121 JUMP .Lstrange_return_from_cplb_mgr;
126 call _panic_cplb_error;
128 JUMP _handle_bad_cplb;