aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/kernel/setup.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 4de432ec903..efac7df72d6 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -304,10 +304,23 @@ int cpu_architecture(void)
304 cpu_arch = (processor_id >> 16) & 7; 304 cpu_arch = (processor_id >> 16) & 7;
305 if (cpu_arch) 305 if (cpu_arch)
306 cpu_arch += CPU_ARCH_ARMv3; 306 cpu_arch += CPU_ARCH_ARMv3;
307 } else { 307 } else if ((processor_id & 0x000f0000) == 0x000f0000) {
308 /* the revised CPUID */ 308 unsigned int mmfr0;
309 cpu_arch = ((processor_id >> 12) & 0xf) - 0xb + CPU_ARCH_ARMv6; 309
310 } 310 /* Revised CPUID format. Read the Memory Model Feature
311 * Register 0 and check for VMSAv7 or PMSAv7 */
312 asm("mrc p15, 0, %0, c0, c1, 4"
313 : "=r" (mmfr0));
314 if ((mmfr0 & 0x0000000f) == 0x00000003 ||
315 (mmfr0 & 0x000000f0) == 0x00000030)
316 cpu_arch = CPU_ARCH_ARMv7;
317 else if ((mmfr0 & 0x0000000f) == 0x00000002 ||
318 (mmfr0 & 0x000000f0) == 0x00000020)
319 cpu_arch = CPU_ARCH_ARMv6;
320 else
321 cpu_arch = CPU_ARCH_UNKNOWN;
322 } else
323 cpu_arch = CPU_ARCH_UNKNOWN;
311 324
312 return cpu_arch; 325 return cpu_arch;
313} 326}