]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
ARM: prepare for removal of a bunch of <mach/memory.h> files
authorNicolas Pitre <nicolas.pitre@linaro.org>
Wed, 6 Jul 2011 02:52:51 +0000 (22:52 -0400)
committerNicolas Pitre <nico@fluxnic.net>
Mon, 26 Sep 2011 14:11:58 +0000 (10:11 -0400)
When the CONFIG_NO_MACH_MEMORY_H symbol is selected by a particular
machine class, the machine specific memory.h include file is no longer
used and can be removed.  In that case the equivalent information can
be obtained dynamically at runtime by enabling CONFIG_ARM_PATCH_PHYS_VIRT
or by specifying the physical memory address at kernel configuration time.

If/when all instances of mach/memory.h are removed then this symbol could
be removed.

Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
arch/arm/Kconfig
arch/arm/include/asm/memory.h
arch/arm/kernel/head.S

index 272eadc7a12cc552497dd3ad437c0ed76f7438a1..1ecb09bca27ea71ed857dd4a3a5d68f9f3096543 100644 (file)
@@ -211,6 +211,17 @@ config ARM_PATCH_PHYS_VIRT
          this feature (eg, building a kernel for a single machine) and
          you need to shrink the kernel to the minimal size.
 
+config NO_MACH_MEMORY_H
+       bool
+       help
+         Select this when mach/memory.h is removed.
+
+config PHYS_OFFSET
+       hex "Physical address of main memory"
+       depends on !ARM_PATCH_PHYS_VIRT && NO_MACH_MEMORY_H
+       help
+         Please provide the physical address corresponding to the
+         location of main memory in your system.
 
 source "init/Kconfig"
 
index 90bca427e367180c0b4db5230fafc9e8ae63314f..046c915694cdd347fca54bace4994f25a9a15d42 100644 (file)
 #include <linux/compiler.h>
 #include <linux/const.h>
 #include <linux/types.h>
-#include <mach/memory.h>
 #include <asm/sizes.h>
 
+#ifndef CONFIG_NO_MACH_MEMORY_H
+#include <mach/memory.h>
+#endif
+
 /*
  * Allow for constants defined here to be used from assembly code
  * by prepending the UL suffix only with actual C code compilation.
@@ -184,7 +187,11 @@ static inline unsigned long __phys_to_virt(unsigned long x)
 #endif
 
 #ifndef PHYS_OFFSET
+#ifdef PLAT_PHYS_OFFSET
 #define PHYS_OFFSET    PLAT_PHYS_OFFSET
+#else
+#define PHYS_OFFSET    UL(CONFIG_PHYS_OFFSET)
+#endif
 #endif
 
 /*
index 7408fd5066566a4cd0e5e2218fbb7fd8262fafe7..673c806cc1060068ba6fedf563d1e6f81d2b6f50 100644 (file)
@@ -95,7 +95,7 @@ ENTRY(stext)
        sub     r4, r3, r4                      @ (PHYS_OFFSET - PAGE_OFFSET)
        add     r8, r8, r4                      @ PHYS_OFFSET
 #else
-       ldr     r8, =PLAT_PHYS_OFFSET
+       ldr     r8, =PHYS_OFFSET                @ always constant in this case
 #endif
 
        /*