]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[ARM] 5222/1: Allow configuring user:kernel split via Kconfig
authorLennert Buytenhek <buytenh@wantstofly.org>
Mon, 25 Aug 2008 20:03:32 +0000 (21:03 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 1 Sep 2008 11:06:33 +0000 (12:06 +0100)
This patch adds a config option (CONFIG_VMSPLIT_*) to allow choosing
between 3:1, 2:2 and 1:3 user:kernel memory splits.

Tested-by: Riku Voipio <riku.voipio@iki.fi>
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/Kconfig
arch/arm/include/asm/memory.h
arch/arm/mach-footbridge/include/mach/memory.h
arch/arm/mach-iop13xx/include/mach/memory.h

index c6b248d19c79187ca9e9bf84ec1f1741405bf39a..4eb816c4df7dc1581e04c94c6e40a42ca21d5a8b 100644 (file)
@@ -311,6 +311,7 @@ config ARCH_IOP13XX
        select PLAT_IOP
        select PCI
        select ARCH_SUPPORTS_MSI
+       select VMSPLIT_1G
        help
          Support for Intel's IOP13XX (XScale) family of processors.
 
@@ -739,6 +740,29 @@ config SMP
 
          If you don't know what to do here, say N.
 
+choice
+       prompt "Memory split"
+       default VMSPLIT_3G
+       help
+         Select the desired split between kernel and user memory.
+
+         If you are not absolutely sure what you are doing, leave this
+         option alone!
+
+       config VMSPLIT_3G
+               bool "3G/1G user/kernel split"
+       config VMSPLIT_2G
+               bool "2G/2G user/kernel split"
+       config VMSPLIT_1G
+               bool "1G/3G user/kernel split"
+endchoice
+
+config PAGE_OFFSET
+       hex
+       default 0x40000000 if VMSPLIT_1G
+       default 0x80000000 if VMSPLIT_2G
+       default 0xC0000000
+
 config NR_CPUS
        int "Maximum number of CPUs (2-32)"
        range 2 32
index bf7c737c92267c7de8b38c0b6347816a0bdb3328..7e8d22fef29c2455a52f7e84e2b96269203092c8 100644 (file)
 #ifndef __ASM_ARM_MEMORY_H
 #define __ASM_ARM_MEMORY_H
 
+#include <linux/compiler.h>
+#include <linux/const.h>
+#include <mach/memory.h>
+#include <asm/sizes.h>
+
 /*
  * Allow for constants defined here to be used from assembly code
  * by prepending the UL suffix only with actual C code compilation.
  */
-#ifndef __ASSEMBLY__
-#define UL(x) (x##UL)
-#else
-#define UL(x) (x)
-#endif
-
-#include <linux/compiler.h>
-#include <mach/memory.h>
-#include <asm/sizes.h>
+#define UL(x) _AC(x, UL)
 
 #ifdef CONFIG_MMU
 
-#ifndef TASK_SIZE
 /*
+ * PAGE_OFFSET - the virtual address of the start of the kernel image
  * TASK_SIZE - the maximum size of a user space task.
  * TASK_UNMAPPED_BASE - the lower boundary of the mmap VM area
  */
-#define TASK_SIZE              UL(0xbf000000)
-#define TASK_UNMAPPED_BASE     UL(0x40000000)
-#endif
+#define PAGE_OFFSET            UL(CONFIG_PAGE_OFFSET)
+#define TASK_SIZE              (UL(CONFIG_PAGE_OFFSET) - UL(0x01000000))
+#define TASK_UNMAPPED_BASE     (UL(CONFIG_PAGE_OFFSET) / 3)
 
 /*
  * The maximum size of a 26-bit user space task.
  */
 #define TASK_SIZE_26           UL(0x04000000)
 
-/*
- * Page offset: 3GB
- */
-#ifndef PAGE_OFFSET
-#define PAGE_OFFSET            UL(0xc0000000)
-#endif
-
 /*
  * The module space lives between the addresses given by TASK_SIZE
  * and PAGE_OFFSET - it must be within 32MB of the kernel text.
index e9cae99dd1f9881e1acdc5913ed2495efb49131a..6ae2f1a07ab90b585e122ee8596cbd4f3f7b4b6a 100644 (file)
@@ -42,10 +42,6 @@ extern unsigned long __bus_to_virt(unsigned long);
 
 #endif
 
-/* Task size and page offset at 3GB */
-#define TASK_SIZE              UL(0xbf000000)
-#define PAGE_OFFSET            UL(0xc0000000)
-
 /*
  * Cache flushing area.
  */
@@ -56,12 +52,6 @@ extern unsigned long __bus_to_virt(unsigned long);
  */
 #define PHYS_OFFSET            UL(0x00000000)
 
-/*
- * This decides where the kernel will search for a free chunk of vm
- * space during mmap's.
- */
-#define TASK_UNMAPPED_BASE ((TASK_SIZE + 0x01000000) / 3)
-
 #define FLUSH_BASE_PHYS                0x50000000
 
 #endif
index e8b59d8f1bb985f1e4fde351e677f48e4688f679..a74b027432d272aafe02d0365fa6dac508c12daf 100644 (file)
@@ -7,9 +7,6 @@
  * Physical DRAM offset.
  */
 #define PHYS_OFFSET    UL(0x00000000)
-#define TASK_SIZE      UL(0x3f000000)
-#define PAGE_OFFSET    UL(0x40000000)
-#define TASK_UNMAPPED_BASE ((TASK_SIZE + 0x01000000) / 3)
 
 #ifndef __ASSEMBLY__