summaryrefslogtreecommitdiff
path: root/arch/arc/cpu
diff options
context:
space:
mode:
authorAlexey Brodkin <abrodkin@synopsys.com>2014-12-24 14:00:29 (GMT)
committerAlexey Brodkin <abrodkin@synopsys.com>2015-01-15 19:38:42 (GMT)
commitdcb431e723f132d0df63fb1e711042a6bbfc3a6a (patch)
treed1d734a4f5809d232de35e3fb504b5f00af7cee1 /arch/arc/cpu
parentc0e9535e1d582ec089c743b705752392fcf3d9a2 (diff)
downloadu-boot-fsl-qoriq-dcb431e723f132d0df63fb1e711042a6bbfc3a6a.tar.xz
arc: add dependences on MMU presence
Depending on MMU presence in CPU there're differences in HW behavior. For example address of instruction that caused exception is put in ECR register if MMU exists and in ERET register otherwise. Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> Signed-off-by: Igor Guryanov <guryanov@synopsys.com>
Diffstat (limited to 'arch/arc/cpu')
-rw-r--r--arch/arc/cpu/arc700/start.S18
1 files changed, 14 insertions, 4 deletions
diff --git a/arch/arc/cpu/arc700/start.S b/arch/arc/cpu/arc700/start.S
index 4d505bf..2318282 100644
--- a/arch/arc/cpu/arc700/start.S
+++ b/arch/arc/cpu/arc700/start.S
@@ -78,6 +78,16 @@
PUSHAX %erbta
.endm
+.macro SAVE_EXCEPTION_SOURCE
+#ifdef CONFIG_MMU
+ /* If MMU exists exception faulting address is loaded in EFA reg */
+ lr %r0, [%efa]
+#else
+ /* Otherwise in ERET (exception return) reg */
+ lr %r0, [%eret]
+#endif
+.endm
+
.align 4
.globl _start
_start:
@@ -102,13 +112,13 @@ _start:
memory_error:
SAVE_ALL_SYS
- lr %r0, [%efa]
+ SAVE_EXCEPTION_SOURCE
mov %r1, %sp
j do_memory_error
instruction_error:
SAVE_ALL_SYS
- lr %r0, [%efa]
+ SAVE_EXCEPTION_SOURCE
mov %r1, %sp
j do_instruction_error
@@ -119,7 +129,7 @@ interrupt_handler:
EV_MachineCheck:
SAVE_ALL_SYS
- lr %r0, [%efa]
+ SAVE_EXCEPTION_SOURCE
mov %r1, %sp
j do_machine_check_fault
@@ -135,7 +145,7 @@ EV_TLBMissD:
EV_TLBProtV:
SAVE_ALL_SYS
- lr %r0, [%efa]
+ SAVE_EXCEPTION_SOURCE
mov %r1, %sp
j do_tlb_prot_violation