[PATCH 56/78] ARM: aarch64: lowlevel: Use switch_el

Sascha Hauer s.hauer at pengutronix.de
Fri Mar 16 05:53:32 PDT 2018


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 at pengutronix.de>
---
 arch/arm/cpu/lowlevel_64.S | 13 ++++---------
 1 file 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
-- 
2.16.1




More information about the barebox mailing list