diff options
Diffstat (limited to 'arch/blackfin/mm')
-rw-r--r-- | arch/blackfin/mm/sram-alloc.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/arch/blackfin/mm/sram-alloc.c b/arch/blackfin/mm/sram-alloc.c index 29d98faa1efd..342e378da1ec 100644 --- a/arch/blackfin/mm/sram-alloc.c +++ b/arch/blackfin/mm/sram-alloc.c | |||
@@ -186,9 +186,45 @@ static void __init l1_inst_sram_init(void) | |||
186 | #endif | 186 | #endif |
187 | } | 187 | } |
188 | 188 | ||
189 | #ifdef __ADSPBF60x__ | ||
190 | static irqreturn_t l2_ecc_err(int irq, void *dev_id) | ||
191 | { | ||
192 | int status; | ||
193 | |||
194 | printk(KERN_ERR "L2 ecc error happend\n"); | ||
195 | status = bfin_read32(L2CTL0_STAT); | ||
196 | if (status & 0x1) | ||
197 | printk(KERN_ERR "Core channel error type:0x%x, addr:0x%x\n", | ||
198 | bfin_read32(L2CTL0_ET0), bfin_read32(L2CTL0_EADDR0)); | ||
199 | if (status & 0x2) | ||
200 | printk(KERN_ERR "System channel error type:0x%x, addr:0x%x\n", | ||
201 | bfin_read32(L2CTL0_ET1), bfin_read32(L2CTL0_EADDR1)); | ||
202 | |||
203 | status = status >> 8; | ||
204 | if (status) | ||
205 | printk(KERN_ERR "L2 Bank%d error, addr:0x%x\n", | ||
206 | status, bfin_read32(L2CTL0_ERRADDR0 + status)); | ||
207 | |||
208 | panic("L2 Ecc error"); | ||
209 | return IRQ_HANDLED; | ||
210 | } | ||
211 | #endif | ||
212 | |||
189 | static void __init l2_sram_init(void) | 213 | static void __init l2_sram_init(void) |
190 | { | 214 | { |
191 | #if L2_LENGTH != 0 | 215 | #if L2_LENGTH != 0 |
216 | |||
217 | #ifdef __ADSPBF60x__ | ||
218 | int ret; | ||
219 | |||
220 | ret = request_irq(IRQ_L2CTL0_ECC_ERR, l2_ecc_err, 0, "l2-ecc-err", | ||
221 | NULL); | ||
222 | if (unlikely(ret < 0)) { | ||
223 | printk(KERN_INFO "Fail to request l2 ecc error interrupt"); | ||
224 | return; | ||
225 | } | ||
226 | #endif | ||
227 | |||
192 | free_l2_sram_head.next = | 228 | free_l2_sram_head.next = |
193 | kmem_cache_alloc(sram_piece_cache, GFP_KERNEL); | 229 | kmem_cache_alloc(sram_piece_cache, GFP_KERNEL); |
194 | if (!free_l2_sram_head.next) { | 230 | if (!free_l2_sram_head.next) { |