aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm/init64.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/mm/init64.c')
-rw-r--r--arch/powerpc/mm/init64.c126
1 files changed, 0 insertions, 126 deletions
diff --git a/arch/powerpc/mm/init64.c b/arch/powerpc/mm/init64.c
index 81f6745b31ef..c0ce6a7af3c7 100644
--- a/arch/powerpc/mm/init64.c
+++ b/arch/powerpc/mm/init64.c
@@ -166,77 +166,6 @@ void free_initrd_mem(unsigned long start, unsigned long end)
166} 166}
167#endif 167#endif
168 168
169/*
170 * Initialize the bootmem system and give it all the memory we
171 * have available.
172 */
173#ifndef CONFIG_NEED_MULTIPLE_NODES
174void __init do_init_bootmem(void)
175{
176 unsigned long i;
177 unsigned long start, bootmap_pages;
178 unsigned long total_pages = lmb_end_of_DRAM() >> PAGE_SHIFT;
179 int boot_mapsize;
180
181 /*
182 * Find an area to use for the bootmem bitmap. Calculate the size of
183 * bitmap required as (Total Memory) / PAGE_SIZE / BITS_PER_BYTE.
184 * Add 1 additional page in case the address isn't page-aligned.
185 */
186 bootmap_pages = bootmem_bootmap_pages(total_pages);
187
188 start = lmb_alloc(bootmap_pages<<PAGE_SHIFT, PAGE_SIZE);
189 BUG_ON(!start);
190
191 boot_mapsize = init_bootmem(start >> PAGE_SHIFT, total_pages);
192
193 max_pfn = max_low_pfn;
194
195 /* Add all physical memory to the bootmem map, mark each area
196 * present.
197 */
198 for (i=0; i < lmb.memory.cnt; i++)
199 free_bootmem(lmb.memory.region[i].base,
200 lmb_size_bytes(&lmb.memory, i));
201
202 /* reserve the sections we're already using */
203 for (i=0; i < lmb.reserved.cnt; i++)
204 reserve_bootmem(lmb.reserved.region[i].base,
205 lmb_size_bytes(&lmb.reserved, i));
206
207 for (i=0; i < lmb.memory.cnt; i++)
208 memory_present(0, lmb_start_pfn(&lmb.memory, i),
209 lmb_end_pfn(&lmb.memory, i));
210}
211
212/*
213 * paging_init() sets up the page tables - in fact we've already done this.
214 */
215void __init paging_init(void)
216{
217 unsigned long zones_size[MAX_NR_ZONES];
218 unsigned long zholes_size[MAX_NR_ZONES];
219 unsigned long total_ram = lmb_phys_mem_size();
220 unsigned long top_of_ram = lmb_end_of_DRAM();
221
222 printk(KERN_INFO "Top of RAM: 0x%lx, Total RAM: 0x%lx\n",
223 top_of_ram, total_ram);
224 printk(KERN_INFO "Memory hole size: %ldMB\n",
225 (top_of_ram - total_ram) >> 20);
226 /*
227 * All pages are DMA-able so we put them all in the DMA zone.
228 */
229 memset(zones_size, 0, sizeof(zones_size));
230 memset(zholes_size, 0, sizeof(zholes_size));
231
232 zones_size[ZONE_DMA] = top_of_ram >> PAGE_SHIFT;
233 zholes_size[ZONE_DMA] = (top_of_ram - total_ram) >> PAGE_SHIFT;
234
235 free_area_init_node(0, NODE_DATA(0), zones_size,
236 __pa(PAGE_OFFSET) >> PAGE_SHIFT, zholes_size);
237}
238#endif /* ! CONFIG_NEED_MULTIPLE_NODES */
239
240static struct kcore_list kcore_vmem; 169static struct kcore_list kcore_vmem;
241 170
242static int __init setup_kcore(void) 171static int __init setup_kcore(void)
@@ -264,61 +193,6 @@ static int __init setup_kcore(void)
264} 193}
265module_init(setup_kcore); 194module_init(setup_kcore);
266 195
267void __init mem_init(void)
268{
269#ifdef CONFIG_NEED_MULTIPLE_NODES
270 int nid;
271#endif
272 pg_data_t *pgdat;
273 unsigned long i;
274 struct page *page;
275 unsigned long reservedpages = 0, codesize, initsize, datasize, bsssize;
276
277 num_physpages = max_low_pfn; /* RAM is assumed contiguous */
278 high_memory = (void *) __va(max_low_pfn * PAGE_SIZE);
279
280#ifdef CONFIG_NEED_MULTIPLE_NODES
281 for_each_online_node(nid) {
282 if (NODE_DATA(nid)->node_spanned_pages != 0) {
283 printk("freeing bootmem node %x\n", nid);
284 totalram_pages +=
285 free_all_bootmem_node(NODE_DATA(nid));
286 }
287 }
288#else
289 max_mapnr = num_physpages;
290 totalram_pages += free_all_bootmem();
291#endif
292
293 for_each_pgdat(pgdat) {
294 for (i = 0; i < pgdat->node_spanned_pages; i++) {
295 page = pgdat_page_nr(pgdat, i);
296 if (PageReserved(page))
297 reservedpages++;
298 }
299 }
300
301 codesize = (unsigned long)&_etext - (unsigned long)&_stext;
302 initsize = (unsigned long)&__init_end - (unsigned long)&__init_begin;
303 datasize = (unsigned long)&_edata - (unsigned long)&__init_end;
304 bsssize = (unsigned long)&__bss_stop - (unsigned long)&__bss_start;
305
306 printk(KERN_INFO "Memory: %luk/%luk available (%luk kernel code, "
307 "%luk reserved, %luk data, %luk bss, %luk init)\n",
308 (unsigned long)nr_free_pages() << (PAGE_SHIFT-10),
309 num_physpages << (PAGE_SHIFT-10),
310 codesize >> 10,
311 reservedpages << (PAGE_SHIFT-10),
312 datasize >> 10,
313 bsssize >> 10,
314 initsize >> 10);
315
316 mem_init_done = 1;
317
318 /* Initialize the vDSO */
319 vdso_init();
320}
321
322void __iomem * reserve_phb_iospace(unsigned long size) 196void __iomem * reserve_phb_iospace(unsigned long size)
323{ 197{
324 void __iomem *virt_addr; 198 void __iomem *virt_addr;