From: Russell King Date: Thu, 30 Nov 2006 20:43:51 +0000 (+0000) Subject: [ARM] Add initial sparsemem support X-Git-Tag: v2.6.26-rc1~1131^2~2^13 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=05944d74bc28fffbcce159cb915d0acff82f30a1;p=linux-2.6 [ARM] Add initial sparsemem support Signed-off-by: Russell King --- diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 4039a13300..df051bd24b 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -422,6 +422,8 @@ config ARCH_SA1100 bool "SA1100-based" select ISA select ARCH_DISCONTIGMEM_ENABLE + select ARCH_SPARSEMEM_ENABLE + select ARCH_SELECT_MEMORY_MODEL select ARCH_MTD_XIP select GENERIC_GPIO select GENERIC_TIME @@ -774,6 +776,12 @@ config ARCH_DISCONTIGMEM_ENABLE or have huge holes in the physical address space for other reasons. See for more. +config ARCH_SPARSEMEM_ENABLE + bool + +config ARCH_SELECT_MEMORY_MODEL + bool + config NODES_SHIFT int default "4" if ARCH_LH7A40X diff --git a/arch/arm/mach-clps711x/Kconfig b/arch/arm/mach-clps711x/Kconfig index 0e2b641268..dbaae5f746 100644 --- a/arch/arm/mach-clps711x/Kconfig +++ b/arch/arm/mach-clps711x/Kconfig @@ -31,6 +31,8 @@ config ARCH_EDB7211 bool "EDB7211" select ISA select ARCH_DISCONTIGMEM_ENABLE + select ARCH_SPARSEMEM_ENABLE + select ARCH_SELECT_MEMORY_MODEL help Say Y here if you intend to run this kernel on a Cirrus Logic EDB-7211 evaluation board. diff --git a/include/asm-arm/memory.h b/include/asm-arm/memory.h index d9bfb39ada..9ba4d7136e 100644 --- a/include/asm-arm/memory.h +++ b/include/asm-arm/memory.h @@ -217,7 +217,10 @@ static inline __deprecated void *bus_to_virt(unsigned long x) #ifndef CONFIG_DISCONTIGMEM #define ARCH_PFN_OFFSET PHYS_PFN_OFFSET + +#ifndef CONFIG_SPARSEMEM #define pfn_valid(pfn) ((pfn) >= PHYS_PFN_OFFSET && (pfn) < (PHYS_PFN_OFFSET + max_mapnr)) +#endif #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) #define virt_addr_valid(kaddr) ((unsigned long)(kaddr) >= PAGE_OFFSET && (unsigned long)(kaddr) < (unsigned long)high_memory) diff --git a/include/asm-arm/sparsemem.h b/include/asm-arm/sparsemem.h new file mode 100644 index 0000000000..277158191a --- /dev/null +++ b/include/asm-arm/sparsemem.h @@ -0,0 +1,10 @@ +#ifndef ASMARM_SPARSEMEM_H +#define ASMARM_SPARSEMEM_H + +#include + +#define MAX_PHYSADDR_BITS 32 +#define MAX_PHYSMEM_BITS 32 +#define SECTION_SIZE_BITS NODE_MEM_SIZE_BITS + +#endif