Skip to content

Commit

Permalink
[ARM] Add initial sparsemem support
Browse files Browse the repository at this point in the history
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Russell King authored and Russell King committed Apr 19, 2008
1 parent 05dda97 commit 05944d7
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
8 changes: 8 additions & 0 deletions arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -774,6 +776,12 @@ config ARCH_DISCONTIGMEM_ENABLE
or have huge holes in the physical address space for other reasons.
See <file:Documentation/vm/numa> for more.

config ARCH_SPARSEMEM_ENABLE
bool

config ARCH_SELECT_MEMORY_MODEL
bool

config NODES_SHIFT
int
default "4" if ARCH_LH7A40X
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-clps711x/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions include/asm-arm/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 10 additions & 0 deletions include/asm-arm/sparsemem.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ifndef ASMARM_SPARSEMEM_H
#define ASMARM_SPARSEMEM_H

#include <asm/memory.h>

#define MAX_PHYSADDR_BITS 32
#define MAX_PHYSMEM_BITS 32
#define SECTION_SIZE_BITS NODE_MEM_SIZE_BITS

#endif

0 comments on commit 05944d7

Please sign in to comment.