summaryrefslogtreecommitdiffstats
path: root/arch/arm/cpu/cpuinfo.c
diff options
context:
space:
mode:
authorLucas Stach <l.stach@pengutronix.de>2017-03-01 15:26:40 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2017-03-03 07:06:06 +0100
commitd92ce9b36a363ead3549343be800fe1dfac8ca2c (patch)
tree4eda80ea1cafa05fe7a9ff70e88d686b85585db9 /arch/arm/cpu/cpuinfo.c
parent0d0b426a6741306f0dab1be862a91c36fdcb87fd (diff)
downloadbarebox-d92ce9b36a363ead3549343be800fe1dfac8ca2c.tar.gz
barebox-d92ce9b36a363ead3549343be800fe1dfac8ca2c.tar.xz
ARM: correctly identify ARMv6 K/Z
The ARMv6 K/Z derivatives have a v7 compatible MMU, but all other parts (including the cache handling) is still at v6. As we don't make use of the more advanced features of the v7 MMU in Barebox, it's okay to just override this to properly identify the CPU as ARMv6. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/cpu/cpuinfo.c')
-rw-r--r--arch/arm/cpu/cpuinfo.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/arm/cpu/cpuinfo.c b/arch/arm/cpu/cpuinfo.c
index 86e19d9780..175475b038 100644
--- a/arch/arm/cpu/cpuinfo.c
+++ b/arch/arm/cpu/cpuinfo.c
@@ -165,6 +165,14 @@ static int do_cpuinfo(int argc, char *argv[])
} else
cpu_arch = CPU_ARCH_UNKNOWN;
+ /*
+ * Special case for ARMv6 (K/Z) (has v7 compatible MMU, but is v6
+ * otherwise). The below check just matches all ARMv6, as done in the
+ * Linux kernel.
+ */
+ if ((mainid & 0x7f000) == 0x7b000)
+ cpu_arch = CPU_ARCH_ARMv6;
+
switch (cpu_arch) {
case CPU_ARCH_ARMv3:
architecture = "v3";