ARM: 7275/1: LPAE: Check the CPU support for the long descriptor format
authorCatalin Marinas <catalin.marinas@arm.com>
Mon, 9 Jan 2012 11:24:47 +0000 (12:24 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Fri, 13 Jan 2012 08:56:41 +0000 (08:56 +0000)
This patch adds a check for the presence of the LPAE feature during the
CPU initialisation. If not present, it reports an error when
CONFIG_DEBUG_LL is enabled.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/kernel/head.S

index 14e277d2ff911ec7690c4223c5acea4b602e3450..6d579114406673fd1b97c09f0cdcbb7263b044da 100644 (file)
@@ -99,6 +99,14 @@ ENTRY(stext)
  THUMB( it     eq )            @ force fixup-able long branch encoding
        beq     __error_p                       @ yes, error 'p'
 
+#ifdef CONFIG_ARM_LPAE
+       mrc     p15, 0, r3, c0, c1, 4           @ read ID_MMFR0
+       and     r3, r3, #0xf                    @ extract VMSA support
+       cmp     r3, #5                          @ long-descriptor translation table format?
+ THUMB( it     lo )                            @ force fixup-able long branch encoding
+       blo     __error_p                       @ only classic page table format
+#endif
+
 #ifndef CONFIG_XIP_KERNEL
        adr     r3, 2f
        ldmia   r3, {r4, r8}