aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mm')
-rw-r--r--arch/arm/mm/init.c58
1 files changed, 2 insertions, 56 deletions
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index ea66341779d4..6dd66a999d9f 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -145,58 +145,6 @@ static void __init find_limits(unsigned long *min, unsigned long *max_low,
145 *max_high = bank_pfn_end(&mi->bank[mi->nr_banks - 1]); 145 *max_high = bank_pfn_end(&mi->bank[mi->nr_banks - 1]);
146} 146}
147 147
148static void __init arm_bootmem_init(unsigned long start_pfn,
149 unsigned long end_pfn)
150{
151 struct memblock_region *reg;
152 unsigned int boot_pages;
153 phys_addr_t bitmap;
154 pg_data_t *pgdat;
155
156 /*
157 * Allocate the bootmem bitmap page. This must be in a region
158 * of memory which has already been mapped.
159 */
160 boot_pages = bootmem_bootmap_pages(end_pfn - start_pfn);
161 bitmap = memblock_alloc_base(boot_pages << PAGE_SHIFT, L1_CACHE_BYTES,
162 __pfn_to_phys(end_pfn));
163
164 /*
165 * Initialise the bootmem allocator, handing the
166 * memory banks over to bootmem.
167 */
168 node_set_online(0);
169 pgdat = NODE_DATA(0);
170 init_bootmem_node(pgdat, __phys_to_pfn(bitmap), start_pfn, end_pfn);
171
172 /* Free the lowmem regions from memblock into bootmem. */
173 for_each_memblock(memory, reg) {
174 unsigned long start = memblock_region_memory_base_pfn(reg);
175 unsigned long end = memblock_region_memory_end_pfn(reg);
176
177 if (end >= end_pfn)
178 end = end_pfn;
179 if (start >= end)
180 break;
181
182 free_bootmem(__pfn_to_phys(start), (end - start) << PAGE_SHIFT);
183 }
184
185 /* Reserve the lowmem memblock reserved regions in bootmem. */
186 for_each_memblock(reserved, reg) {
187 unsigned long start = memblock_region_reserved_base_pfn(reg);
188 unsigned long end = memblock_region_reserved_end_pfn(reg);
189
190 if (end >= end_pfn)
191 end = end_pfn;
192 if (start >= end)
193 break;
194
195 reserve_bootmem(__pfn_to_phys(start),
196 (end - start) << PAGE_SHIFT, BOOTMEM_DEFAULT);
197 }
198}
199
200#ifdef CONFIG_ZONE_DMA 148#ifdef CONFIG_ZONE_DMA
201 149
202phys_addr_t arm_dma_zone_size __read_mostly; 150phys_addr_t arm_dma_zone_size __read_mostly;
@@ -236,7 +184,7 @@ void __init setup_dma_zone(const struct machine_desc *mdesc)
236#endif 184#endif
237} 185}
238 186
239static void __init arm_bootmem_free(unsigned long min, unsigned long max_low, 187static void __init zone_sizes_init(unsigned long min, unsigned long max_low,
240 unsigned long max_high) 188 unsigned long max_high)
241{ 189{
242 unsigned long zone_size[MAX_NR_ZONES], zhole_size[MAX_NR_ZONES]; 190 unsigned long zone_size[MAX_NR_ZONES], zhole_size[MAX_NR_ZONES];
@@ -396,8 +344,6 @@ void __init bootmem_init(void)
396 344
397 find_limits(&min, &max_low, &max_high); 345 find_limits(&min, &max_low, &max_high);
398 346
399 arm_bootmem_init(min, max_low);
400
401 /* 347 /*
402 * Sparsemem tries to allocate bootmem in memory_present(), 348 * Sparsemem tries to allocate bootmem in memory_present(),
403 * so must be done after the fixed reservations 349 * so must be done after the fixed reservations
@@ -414,7 +360,7 @@ void __init bootmem_init(void)
414 * the sparse mem_map arrays initialized by sparse_init() 360 * the sparse mem_map arrays initialized by sparse_init()
415 * for memmap_init_zone(), otherwise all PFNs are invalid. 361 * for memmap_init_zone(), otherwise all PFNs are invalid.
416 */ 362 */
417 arm_bootmem_free(min, max_low, max_high); 363 zone_sizes_init(min, max_low, max_high);
418 364
419 /* 365 /*
420 * This doesn't seem to be used by the Linux memory manager any 366 * This doesn't seem to be used by the Linux memory manager any