#include <linux/types.h>
 #include <linux/string.h>
 #include <linux/mm.h>
-#include <linux/bootmem.h>
 #include <linux/module.h>
+#include <linux/lmb.h>
 
 #include <asm/prom.h>
 #include <asm/of_device.h>
 }
 EXPORT_SYMBOL(of_find_in_proplist);
 
-static unsigned int prom_early_allocated;
+static unsigned int prom_early_allocated __initdata;
 
 static void * __init prom_early_alloc(unsigned long size)
 {
+       unsigned long paddr = lmb_alloc(size, SMP_CACHE_BYTES);
        void *ret;
 
-       ret = __alloc_bootmem(size, SMP_CACHE_BYTES, 0UL);
-       if (ret != NULL)
-               memset(ret, 0, size);
+       if (!paddr) {
+               prom_printf("prom_early_alloc(%lu) failed\n");
+               prom_halt();
+       }
 
+       ret = __va(paddr);
+       memset(ret, 0, size);
        prom_early_allocated += size;
 
        return ret;
 
         */
        real_setup_per_cpu_areas();
 
+       prom_build_devicetree();
+
        /* Setup bootmem... */
        pages_avail = 0;
        last_valid_pfn = end_pfn = bootmem_init(&pages_avail, phys_base);
 
        kernel_physical_mapping_init();
 
-       prom_build_devicetree();
-
        if (tlb_type == hypervisor)
                sun4v_mdesc_init();