mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] ARM: Fix cpu_info for armv8
@ 2019-03-04 11:33 Sascha Hauer
  0 siblings, 0 replies; only message in thread
From: Sascha Hauer @ 2019-03-04 11:33 UTC (permalink / raw)
  To: Barebox List

We have get_cr() to get the control register for the different exception
levels. Use it rather than the variant hardcoded for EL1.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/cpu/cpuinfo.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/arch/arm/cpu/cpuinfo.c b/arch/arm/cpu/cpuinfo.c
index 175475b038..1ba3b4379c 100644
--- a/arch/arm/cpu/cpuinfo.c
+++ b/arch/arm/cpu/cpuinfo.c
@@ -19,6 +19,7 @@
 #include <common.h>
 #include <command.h>
 #include <complete.h>
+#include <asm/system.h>
 
 #define CPU_ARCH_UNKNOWN	0
 #define CPU_ARCH_ARMv3		1
@@ -76,11 +77,7 @@ static int do_cpuinfo(int argc, char *argv[])
 		:
 		: "memory");
 
-	__asm__ __volatile__(
-		"mrs	%0, sctlr_el1\n"
-		: "=r" (cr)
-		:
-		: "memory");
+	cr = get_cr();
 #else
 	__asm__ __volatile__(
 		"mrc    p15, 0, %0, c0, c0, 0   @ read control reg\n"
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-03-04 11:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-04 11:33 [PATCH] ARM: Fix cpu_info for armv8 Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox