1 /* Copyright (C) 2003 Analog Devices, Inc. All Rights Reserved.
3 * This file is subject to the terms and conditions of the GNU General Public
6 * Blackfin BF533/2.6 support : LG Soft India
10 /* Include an exception handler to invoke the CPLB manager
13 #include <asm-blackfin/linkage.h>
15 #include <asm/entry.h>
21 .type _cplb_hdr, STT_FUNC;
23 .type _cplb_mgr, STT_FUNC;
24 .extern __unknown_exception_occurred;
25 .type __unknown_exception_occurred, STT_FUNC;
26 .extern __cplb_miss_all_locked;
27 .type __cplb_miss_all_locked, STT_FUNC;
28 .extern __cplb_miss_without_replacement;
29 .type __cplb_miss_without_replacement, STT_FUNC;
30 .extern __cplb_protection_violation;
31 .type __cplb_protection_violation, STT_FUNC;
38 [--SP] = ( R7:0, P5:0 );
53 /*Mask the contents of SEQSTAT and leave only EXCAUSE in R2*/
57 R1 = 0x23; /* Data access CPLB protection violation */
59 IF !CC JUMP not_data_write;
60 R0 = 2; /* is a write to data space*/
64 R1 = 0x2C; /* CPLB miss on an instruction fetch */
66 R0 = 0; /* is_data_miss == False*/
67 IF CC JUMP is_icplb_miss;
73 R0 = 1; /* is_data_miss == True*/
77 #if ( defined (CONFIG_BLKFIN_CACHE) || defined (CONFIG_BLKFIN_DCACHE))
78 #if ( defined (CONFIG_BLKFIN_CACHE) && !defined (CONFIG_BLKFIN_DCACHE))
79 R1 = CPLB_ENABLE_ICACHE;
81 #if ( !defined (CONFIG_BLKFIN_CACHE) && defined (CONFIG_BLKFIN_DCACHE))
82 R1 = CPLB_ENABLE_DCACHE;
84 #if ( defined (CONFIG_BLKFIN_CACHE) && defined (CONFIG_BLKFIN_DCACHE))
85 R1 = CPLB_ENABLE_DCACHE | CPLB_ENABLE_ICACHE;
95 IF !CC JUMP not_replaced;
108 ( R7:0, P5:0 ) = [SP++];
113 CALL __unknown_exception_occurred;
117 CC = R0 == CPLB_NO_UNLOCKED;
118 IF !CC JUMP next_check;
120 CALL __cplb_miss_all_locked;
123 CC = R0 == CPLB_NO_ADDR_MATCH;
124 IF !CC JUMP next_check2;
126 CALL __cplb_miss_without_replacement;
130 CC = R0 == CPLB_PROT_VIOL;
131 IF !CC JUMP strange_return_from_cplb_mgr;
133 CALL __cplb_protection_violation;
136 strange_return_from_cplb_mgr:
139 JUMP strange_return_from_cplb_mgr;
141 /************************************
142 * Diagnostic exception handlers
145 __cplb_miss_all_locked:
147 R0 = CPLB_NO_UNLOCKED;
152 __cplb_miss_without_replacement:
154 R0 = CPLB_NO_ADDR_MATCH;
159 __cplb_protection_violation:
166 __unknown_exception_occurred:
168 /* This function is invoked by the default exception
169 * handler, if it does not recognise the kind of
170 * exception that has occurred. In other words, the
171 * default handler only handles some of the system's
172 * exception types, and it does not expect any others
173 * to occur. If your application is going to be using
174 * other kinds of exceptions, you must replace the
175 * default handler with your own, that handles all the
176 * exceptions you will use.
178 * Since there's nothing we can do, we just loop here
179 * at what we hope is a suitably informative label.
183 do_not_know_what_to_do:
185 JUMP __unknown_exception_occurred;
188 .__unknown_exception_occurred.end:
189 .global __unknown_exception_occurred;
190 .type __unknown_exception_occurred, STT_FUNC;