Merge tag 'edac/v4.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab...
[linux-2.6-block.git] / arch / arm / mm / abort-ev7.S
CommitLineData
bbe88886
CM
1#include <linux/linkage.h>
2#include <asm/assembler.h>
3/*
4 * Function: v7_early_abort
5 *
da740472
RK
6 * Params : r2 = pt_regs
7 * : r4 = aborted context pc
3e287bec 8 * : r5 = aborted context psr
bbe88886 9 *
da740472 10 * Returns : r4 - r11, r13 preserved
bbe88886
CM
11 *
12 * Purpose : obtain information about current aborted instruction.
13 */
14 .align 5
15ENTRY(v7_early_abort)
bbe88886
CM
16 mrc p15, 0, r1, c5, c0, 0 @ get FSR
17 mrc p15, 0, r0, c6, c0, 0 @ get FAR
18
19 /*
20 * V6 code adjusts the returned DFSR.
21 * New designs should not need to patch up faults.
22 */
e220ba60
DE
23
24#if defined(CONFIG_VERIFY_PERMISSION_FAULT)
25 /*
26 * Detect erroneous permission failures and fix
27 */
28 ldr r3, =0x40d @ On permission fault
29 and r3, r1, r3
30 cmp r3, #0x0d
da740472 31 bne do_DataAbort
e220ba60
DE
32
33 mcr p15, 0, r0, c7, c8, 0 @ Retranslate FAR
34 isb
0d147db0
RK
35 mrc p15, 0, ip, c7, c4, 0 @ Read the PAR
36 and r3, ip, #0x7b @ On translation fault
e220ba60 37 cmp r3, #0x0b
da740472 38 bne do_DataAbort
e220ba60 39 bic r1, r1, #0xf @ Fix up FSR FS[5:0]
0d147db0
RK
40 and ip, ip, #0x7e
41 orr r1, r1, ip, LSR #1
e220ba60
DE
42#endif
43
da740472 44 b do_DataAbort
93ed3970 45ENDPROC(v7_early_abort)