diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2018-03-14 10:57:45 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2018-03-29 08:16:40 +0200 |
commit | 979df618cfdda8e8a7113569b45c011de9594f2b (patch) | |
tree | e87b5ede3ced0a7a9c2e7d0013a72cbeb3fefa35 | |
parent | c42f49262e7e9293b99d1b7528027a3aa3b8767e (diff) | |
download | barebox-979df618cfdda8e8a7113569b45c011de9594f2b.tar.gz barebox-979df618cfdda8e8a7113569b45c011de9594f2b.tar.xz |
ARM: aarch64: lowlevel: Use switch_el
Use switch_el macro rather than open coded version. While at it rename the
labels so that the name matches the exception level.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | arch/arm/cpu/lowlevel_64.S | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/arch/arm/cpu/lowlevel_64.S b/arch/arm/cpu/lowlevel_64.S index a66556f1ad..af1cd8b5bc 100644 --- a/arch/arm/cpu/lowlevel_64.S +++ b/arch/arm/cpu/lowlevel_64.S @@ -1,18 +1,13 @@ #include <linux/linkage.h> #include <init.h> #include <asm/system.h> +#include <asm/assembler64.h> .section ".text_bare_init_","ax" ENTRY(arm_cpu_lowlevel_init) - mrs x1, CurrentEL - cmp x1, #0xC /* Check EL3 state */ - b.eq 1f - cmp x1, #0x8 /* Check EL2 state */ - b.eq 2f - cmp x1, #0x4 /* Check EL1 state */ - b.eq 3f + switch_el x1, 3f, 2f, 1f -1: +3: mov x0, #1 /* Non-Secure EL0/1 */ orr x0, x0, #(1 << 10) /* 64-bit EL2 */ msr scr_el3, x0 @@ -25,7 +20,7 @@ ENTRY(arm_cpu_lowlevel_init) b done -3: +1: mov x0, #(3 << 20) /* Enable FP/SIMD */ msr cpacr_el1, x0 b done |