Browse Source

ARM: mpu: Allow enabling of the MPU via kconfig

Allows the user to select MPU support when compiling for ARM processors
that support the PMSAv7.

This ensures that CONFIG_SMP depends on the MPU in the case that no MMU
is present.

CONFIG_SMP_ON_UP is not implemented for nommu, so introduce an MMU
dependency there.

Signed-off-by: Jonathan Austin <jonathan.austin@arm.com>
Reviewed-by: Will Deacon <will.deacon@arm.com>
Jonathan Austin 12 years ago
parent
commit
801bb21c60
2 changed files with 13 additions and 2 deletions
  1. 2 2
      arch/arm/Kconfig
  2. 11 0
      arch/arm/Kconfig-nommu

+ 2 - 2
arch/arm/Kconfig

@@ -1414,7 +1414,7 @@ config SMP
 	depends on CPU_V6K || CPU_V7
 	depends on CPU_V6K || CPU_V7
 	depends on GENERIC_CLOCKEVENTS
 	depends on GENERIC_CLOCKEVENTS
 	depends on HAVE_SMP
 	depends on HAVE_SMP
-	depends on MMU
+	depends on MMU || ARM_MPU
 	select USE_GENERIC_SMP_HELPERS
 	select USE_GENERIC_SMP_HELPERS
 	help
 	help
 	  This enables support for systems with more than one CPU. If you have
 	  This enables support for systems with more than one CPU. If you have
@@ -1435,7 +1435,7 @@ config SMP
 
 
 config SMP_ON_UP
 config SMP_ON_UP
 	bool "Allow booting SMP kernel on uniprocessor systems (EXPERIMENTAL)"
 	bool "Allow booting SMP kernel on uniprocessor systems (EXPERIMENTAL)"
-	depends on SMP && !XIP_KERNEL
+	depends on SMP && !XIP_KERNEL && MMU
 	default y
 	default y
 	help
 	help
 	  SMP kernels contain instructions which fail on non-SMP processors.
 	  SMP kernels contain instructions which fail on non-SMP processors.

+ 11 - 0
arch/arm/Kconfig-nommu

@@ -50,3 +50,14 @@ config REMAP_VECTORS_TO_RAM
 	  Otherwise, say 'y' here.  In this case, the kernel will require
 	  Otherwise, say 'y' here.  In this case, the kernel will require
 	  external support to redirect the hardware exception vectors to
 	  external support to redirect the hardware exception vectors to
 	  the writable versions located at DRAM_BASE.
 	  the writable versions located at DRAM_BASE.
+
+config ARM_MPU
+       bool 'Use the ARM v7 PMSA Compliant MPU'
+       default y
+       help
+         Some ARM systems without an MMU have instead a Memory Protection
+         Unit (MPU) that defines the type and permissions for regions of
+         memory.
+
+         If your CPU has an MPU then you should choose 'y' here unless you
+         know that you do not want to use the MPU.