memblock: Introduce default allocation limit and use it to replace explicit ones
[deliverable/linux.git] / arch / powerpc / mm / init_32.c
index 6a6975dc265427bf39c15979374c52501755aa3c..59b208b7ec6fbd0adfe11581010445071d521b5c 100644 (file)
@@ -91,12 +91,6 @@ int __allow_ioremap_reserved;
 /* max amount of low RAM to map in */
 unsigned long __max_low_memory = MAX_LOW_MEM;
 
-/*
- * address of the limit of what is accessible with initial MMU setup -
- * 256MB usually, but only 16MB on 601.
- */
-phys_addr_t __initial_memory_limit_addr = (phys_addr_t)0x10000000;
-
 /*
  * Check for command-line options that affect what MMU_init will do.
  */
@@ -126,13 +120,6 @@ void __init MMU_init(void)
        if (ppc_md.progress)
                ppc_md.progress("MMU:enter", 0x111);
 
-       /* 601 can only access 16MB at the moment */
-       if (PVR_VER(mfspr(SPRN_PVR)) == 1)
-               __initial_memory_limit_addr = 0x01000000;
-       /* 8xx can only access 8MB at the moment */
-       if (PVR_VER(mfspr(SPRN_PVR)) == 0x50)
-               __initial_memory_limit_addr = 0x00800000;
-
        /* parse args from command line */
        MMU_setup();
 
@@ -190,20 +177,18 @@ void __init MMU_init(void)
 #ifdef CONFIG_BOOTX_TEXT
        btext_unmap();
 #endif
+
+       /* Shortly after that, the entire linear mapping will be available */
+       memblock_set_current_limit(lowmem_end_addr);
 }
 
 /* This is only called until mem_init is done. */
 void __init *early_get_page(void)
 {
-       void *p;
-
-       if (init_bootmem_done) {
-               p = alloc_bootmem_pages(PAGE_SIZE);
-       } else {
-               p = __va(memblock_alloc_base(PAGE_SIZE, PAGE_SIZE,
-                                       __initial_memory_limit_addr));
-       }
-       return p;
+       if (init_bootmem_done)
+               return alloc_bootmem_pages(PAGE_SIZE);
+       else
+               return __va(memblock_alloc(PAGE_SIZE, PAGE_SIZE));
 }
 
 /* Free up now-unused memory */
This page took 0.029133 seconds and 5 git commands to generate.