aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm/pgtable_32.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/mm/pgtable_32.c')
-rw-r--r--arch/powerpc/mm/pgtable_32.c32
1 files changed, 28 insertions, 4 deletions
diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c
index cb96cb2e17cc..b55bbe87acb8 100644
--- a/arch/powerpc/mm/pgtable_32.c
+++ b/arch/powerpc/mm/pgtable_32.c
@@ -283,18 +283,18 @@ int map_page(unsigned long va, phys_addr_t pa, int flags)
283} 283}
284 284
285/* 285/*
286 * Map in a big chunk of physical memory starting at PAGE_OFFSET. 286 * Map in a chunk of physical memory starting at start.
287 */ 287 */
288void __init mapin_ram(void) 288void __init __mapin_ram_chunk(unsigned long offset, unsigned long top)
289{ 289{
290 unsigned long v, s, f; 290 unsigned long v, s, f;
291 phys_addr_t p; 291 phys_addr_t p;
292 int ktext; 292 int ktext;
293 293
294 s = mmu_mapin_ram(); 294 s = offset;
295 v = PAGE_OFFSET + s; 295 v = PAGE_OFFSET + s;
296 p = memstart_addr + s; 296 p = memstart_addr + s;
297 for (; s < total_lowmem; s += PAGE_SIZE) { 297 for (; s < top; s += PAGE_SIZE) {
298 ktext = ((char *) v >= _stext && (char *) v < etext); 298 ktext = ((char *) v >= _stext && (char *) v < etext);
299 f = ktext ? PAGE_KERNEL_TEXT : PAGE_KERNEL; 299 f = ktext ? PAGE_KERNEL_TEXT : PAGE_KERNEL;
300 map_page(v, p, f); 300 map_page(v, p, f);
@@ -307,6 +307,30 @@ void __init mapin_ram(void)
307 } 307 }
308} 308}
309 309
310void __init mapin_ram(void)
311{
312 unsigned long s, top;
313
314#ifndef CONFIG_WII
315 top = total_lowmem;
316 s = mmu_mapin_ram(top);
317 __mapin_ram_chunk(s, top);
318#else
319 if (!wii_hole_size) {
320 s = mmu_mapin_ram(total_lowmem);
321 __mapin_ram_chunk(s, total_lowmem);
322 } else {
323 top = wii_hole_start;
324 s = mmu_mapin_ram(top);
325 __mapin_ram_chunk(s, top);
326
327 top = lmb_end_of_DRAM();
328 s = wii_mmu_mapin_mem2(top);
329 __mapin_ram_chunk(s, top);
330 }
331#endif
332}
333
310/* Scan the real Linux page tables and return a PTE pointer for 334/* Scan the real Linux page tables and return a PTE pointer for
311 * a virtual address in a context. 335 * a virtual address in a context.
312 * Returns true (1) if PTE was found, zero otherwise. The pointer to 336 * Returns true (1) if PTE was found, zero otherwise. The pointer to