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.c36
1 files changed, 31 insertions, 5 deletions
diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c
index cb96cb2e17cc..177e4038b43c 100644
--- a/arch/powerpc/mm/pgtable_32.c
+++ b/arch/powerpc/mm/pgtable_32.c
@@ -26,6 +26,7 @@
26#include <linux/vmalloc.h> 26#include <linux/vmalloc.h>
27#include <linux/init.h> 27#include <linux/init.h>
28#include <linux/highmem.h> 28#include <linux/highmem.h>
29#include <linux/lmb.h>
29 30
30#include <asm/pgtable.h> 31#include <asm/pgtable.h>
31#include <asm/pgalloc.h> 32#include <asm/pgalloc.h>
@@ -191,7 +192,8 @@ __ioremap_caller(phys_addr_t addr, unsigned long size, unsigned long flags,
191 * Don't allow anybody to remap normal RAM that we're using. 192 * Don't allow anybody to remap normal RAM that we're using.
192 * mem_init() sets high_memory so only do the check after that. 193 * mem_init() sets high_memory so only do the check after that.
193 */ 194 */
194 if (mem_init_done && (p < virt_to_phys(high_memory))) { 195 if (mem_init_done && (p < virt_to_phys(high_memory)) &&
196 !(__allow_ioremap_reserved && lmb_is_region_reserved(p, size))) {
195 printk("__ioremap(): phys addr 0x%llx is RAM lr %p\n", 197 printk("__ioremap(): phys addr 0x%llx is RAM lr %p\n",
196 (unsigned long long)p, __builtin_return_address(0)); 198 (unsigned long long)p, __builtin_return_address(0));
197 return NULL; 199 return NULL;
@@ -283,18 +285,18 @@ int map_page(unsigned long va, phys_addr_t pa, int flags)
283} 285}
284 286
285/* 287/*
286 * Map in a big chunk of physical memory starting at PAGE_OFFSET. 288 * Map in a chunk of physical memory starting at start.
287 */ 289 */
288void __init mapin_ram(void) 290void __init __mapin_ram_chunk(unsigned long offset, unsigned long top)
289{ 291{
290 unsigned long v, s, f; 292 unsigned long v, s, f;
291 phys_addr_t p; 293 phys_addr_t p;
292 int ktext; 294 int ktext;
293 295
294 s = mmu_mapin_ram(); 296 s = offset;
295 v = PAGE_OFFSET + s; 297 v = PAGE_OFFSET + s;
296 p = memstart_addr + s; 298 p = memstart_addr + s;
297 for (; s < total_lowmem; s += PAGE_SIZE) { 299 for (; s < top; s += PAGE_SIZE) {
298 ktext = ((char *) v >= _stext && (char *) v < etext); 300 ktext = ((char *) v >= _stext && (char *) v < etext);
299 f = ktext ? PAGE_KERNEL_TEXT : PAGE_KERNEL; 301 f = ktext ? PAGE_KERNEL_TEXT : PAGE_KERNEL;
300 map_page(v, p, f); 302 map_page(v, p, f);
@@ -307,6 +309,30 @@ void __init mapin_ram(void)
307 } 309 }
308} 310}
309 311
312void __init mapin_ram(void)
313{
314 unsigned long s, top;
315
316#ifndef CONFIG_WII
317 top = total_lowmem;
318 s = mmu_mapin_ram(top);
319 __mapin_ram_chunk(s, top);
320#else
321 if (!wii_hole_size) {
322 s = mmu_mapin_ram(total_lowmem);
323 __mapin_ram_chunk(s, total_lowmem);
324 } else {
325 top = wii_hole_start;
326 s = mmu_mapin_ram(top);
327 __mapin_ram_chunk(s, top);
328
329 top = lmb_end_of_DRAM();
330 s = wii_mmu_mapin_mem2(top);
331 __mapin_ram_chunk(s, top);
332 }
333#endif
334}
335
310/* Scan the real Linux page tables and return a PTE pointer for 336/* Scan the real Linux page tables and return a PTE pointer for
311 * a virtual address in a context. 337 * a virtual address in a context.
312 * Returns true (1) if PTE was found, zero otherwise. The pointer to 338 * Returns true (1) if PTE was found, zero otherwise. The pointer to