diff options
author | Michal Simek <monstr@monstr.eu> | 2011-12-15 09:47:16 -0500 |
---|---|---|
committer | Michal Simek <monstr@monstr.eu> | 2012-03-23 04:28:13 -0400 |
commit | baab8a828d2d6b5b073c192ebe777514bbf3c831 (patch) | |
tree | da9cf80b749b1470e5b408cd0e1ae69494b9e6a1 /arch/microblaze | |
parent | 832997990ab912ab8ed4ade08cb6ac5f471efa1e (diff) |
microblaze: Use active regions
Register lowmem active regions.
Signed-off-by: Michal Simek <monstr@monstr.eu>
Diffstat (limited to 'arch/microblaze')
-rw-r--r-- | arch/microblaze/Kconfig | 4 | ||||
-rw-r--r-- | arch/microblaze/mm/init.c | 18 |
2 files changed, 20 insertions, 2 deletions
diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig index 8e9da3d42814..3267cc5065d5 100644 --- a/arch/microblaze/Kconfig +++ b/arch/microblaze/Kconfig | |||
@@ -1,6 +1,7 @@ | |||
1 | config MICROBLAZE | 1 | config MICROBLAZE |
2 | def_bool y | 2 | def_bool y |
3 | select HAVE_MEMBLOCK | 3 | select HAVE_MEMBLOCK |
4 | select HAVE_MEMBLOCK_NODE_MAP | ||
4 | select HAVE_FUNCTION_TRACER | 5 | select HAVE_FUNCTION_TRACER |
5 | select HAVE_FUNCTION_TRACE_MCOUNT_TEST | 6 | select HAVE_FUNCTION_TRACE_MCOUNT_TEST |
6 | select HAVE_FUNCTION_GRAPH_TRACER | 7 | select HAVE_FUNCTION_GRAPH_TRACER |
@@ -30,6 +31,9 @@ config RWSEM_GENERIC_SPINLOCK | |||
30 | config ZONE_DMA | 31 | config ZONE_DMA |
31 | def_bool y | 32 | def_bool y |
32 | 33 | ||
34 | config ARCH_POPULATES_NODE_MAP | ||
35 | def_bool y | ||
36 | |||
33 | config RWSEM_XCHGADD_ALGORITHM | 37 | config RWSEM_XCHGADD_ALGORITHM |
34 | bool | 38 | bool |
35 | 39 | ||
diff --git a/arch/microblaze/mm/init.c b/arch/microblaze/mm/init.c index cbcdf24b1c89..43b3f604bafe 100644 --- a/arch/microblaze/mm/init.c +++ b/arch/microblaze/mm/init.c | |||
@@ -68,7 +68,8 @@ static void __init paging_init(void) | |||
68 | 68 | ||
69 | zones_size[ZONE_DMA] = max_pfn; | 69 | zones_size[ZONE_DMA] = max_pfn; |
70 | 70 | ||
71 | free_area_init(zones_size); | 71 | /* We don't have holes in memory map */ |
72 | free_area_init_nodes(zones_size); | ||
72 | } | 73 | } |
73 | 74 | ||
74 | void __init setup_memory(void) | 75 | void __init setup_memory(void) |
@@ -142,8 +143,18 @@ void __init setup_memory(void) | |||
142 | PFN_UP(TOPHYS((u32)klimit)), min_low_pfn, max_low_pfn); | 143 | PFN_UP(TOPHYS((u32)klimit)), min_low_pfn, max_low_pfn); |
143 | memblock_reserve(PFN_UP(TOPHYS((u32)klimit)) << PAGE_SHIFT, map_size); | 144 | memblock_reserve(PFN_UP(TOPHYS((u32)klimit)) << PAGE_SHIFT, map_size); |
144 | 145 | ||
146 | /* Add active regions with valid PFNs */ | ||
147 | for_each_memblock(memory, reg) { | ||
148 | unsigned long start_pfn, end_pfn; | ||
149 | |||
150 | start_pfn = memblock_region_memory_base_pfn(reg); | ||
151 | end_pfn = memblock_region_memory_end_pfn(reg); | ||
152 | memblock_set_node(start_pfn << PAGE_SHIFT, | ||
153 | (end_pfn - start_pfn) << PAGE_SHIFT, 0); | ||
154 | } | ||
155 | |||
145 | /* free bootmem is whole main memory */ | 156 | /* free bootmem is whole main memory */ |
146 | free_bootmem(memory_start, lowmem_size); | 157 | free_bootmem_with_active_regions(0, max_low_pfn); |
147 | 158 | ||
148 | /* reserve allocate blocks */ | 159 | /* reserve allocate blocks */ |
149 | for_each_memblock(reserved, reg) { | 160 | for_each_memblock(reserved, reg) { |
@@ -162,6 +173,9 @@ void __init setup_memory(void) | |||
162 | } | 173 | } |
163 | } | 174 | } |
164 | 175 | ||
176 | /* XXX need to clip this if using highmem? */ | ||
177 | sparse_memory_present_with_active_regions(0); | ||
178 | |||
165 | #ifdef CONFIG_MMU | 179 | #ifdef CONFIG_MMU |
166 | init_bootmem_done = 1; | 180 | init_bootmem_done = 1; |
167 | #endif | 181 | #endif |