diff options
Diffstat (limited to 'include/asm-arm/arch-pxa/memory.h')
-rw-r--r-- | include/asm-arm/arch-pxa/memory.h | 36 |
1 files changed, 3 insertions, 33 deletions
diff --git a/include/asm-arm/arch-pxa/memory.h b/include/asm-arm/arch-pxa/memory.h index eaf6d43939e9..e17f9881faf0 100644 --- a/include/asm-arm/arch-pxa/memory.h +++ b/include/asm-arm/arch-pxa/memory.h | |||
@@ -27,7 +27,6 @@ | |||
27 | #define __virt_to_bus(x) __virt_to_phys(x) | 27 | #define __virt_to_bus(x) __virt_to_phys(x) |
28 | #define __bus_to_virt(x) __phys_to_virt(x) | 28 | #define __bus_to_virt(x) __phys_to_virt(x) |
29 | 29 | ||
30 | #ifdef CONFIG_DISCONTIGMEM | ||
31 | /* | 30 | /* |
32 | * The nodes are matched with the physical SDRAM banks as follows: | 31 | * The nodes are matched with the physical SDRAM banks as follows: |
33 | * | 32 | * |
@@ -35,38 +34,9 @@ | |||
35 | * node 1: 0xa4000000-0xa7ffffff --> 0xc4000000-0xc7ffffff | 34 | * node 1: 0xa4000000-0xa7ffffff --> 0xc4000000-0xc7ffffff |
36 | * node 2: 0xa8000000-0xabffffff --> 0xc8000000-0xcbffffff | 35 | * node 2: 0xa8000000-0xabffffff --> 0xc8000000-0xcbffffff |
37 | * node 3: 0xac000000-0xafffffff --> 0xcc000000-0xcfffffff | 36 | * node 3: 0xac000000-0xafffffff --> 0xcc000000-0xcfffffff |
37 | * | ||
38 | * This needs a node mem size of 26 bits. | ||
38 | */ | 39 | */ |
39 | 40 | #define NODE_MEM_SIZE_BITS 26 | |
40 | /* | ||
41 | * Given a kernel address, find the home node of the underlying memory. | ||
42 | */ | ||
43 | #define KVADDR_TO_NID(addr) (((unsigned long)(addr) - PAGE_OFFSET) >> 26) | ||
44 | |||
45 | /* | ||
46 | * Given a page frame number, convert it to a node id. | ||
47 | */ | ||
48 | #define PFN_TO_NID(pfn) (((pfn) - PHYS_PFN_OFFSET) >> (26 - PAGE_SHIFT)) | ||
49 | |||
50 | /* | ||
51 | * Given a kaddr, ADDR_TO_MAPBASE finds the owning node of the memory | ||
52 | * and returns the mem_map of that node. | ||
53 | */ | ||
54 | #define ADDR_TO_MAPBASE(kaddr) NODE_MEM_MAP(KVADDR_TO_NID(kaddr)) | ||
55 | |||
56 | /* | ||
57 | * Given a page frame number, find the owning node of the memory | ||
58 | * and returns the mem_map of that node. | ||
59 | */ | ||
60 | #define PFN_TO_MAPBASE(pfn) NODE_MEM_MAP(PFN_TO_NID(pfn)) | ||
61 | |||
62 | /* | ||
63 | * Given a kaddr, LOCAL_MEM_MAP finds the owning node of the memory | ||
64 | * and returns the index corresponding to the appropriate page in the | ||
65 | * node's mem_map. | ||
66 | */ | ||
67 | #define LOCAL_MAP_NR(addr) \ | ||
68 | (((unsigned long)(addr) & 0x03ffffff) >> PAGE_SHIFT) | ||
69 | |||
70 | #endif | ||
71 | 41 | ||
72 | #endif | 42 | #endif |