Commit ad072004 authored by David S. Miller's avatar David S. Miller

[SPARC64]: Use lmb_alloc() for PROM device tree.

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b9709456
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/bootmem.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/lmb.h>
#include <asm/prom.h> #include <asm/prom.h>
#include <asm/of_device.h> #include <asm/of_device.h>
...@@ -122,16 +122,20 @@ int of_find_in_proplist(const char *list, const char *match, int len) ...@@ -122,16 +122,20 @@ int of_find_in_proplist(const char *list, const char *match, int len)
} }
EXPORT_SYMBOL(of_find_in_proplist); 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) static void * __init prom_early_alloc(unsigned long size)
{ {
unsigned long paddr = lmb_alloc(size, SMP_CACHE_BYTES);
void *ret; void *ret;
ret = __alloc_bootmem(size, SMP_CACHE_BYTES, 0UL); if (!paddr) {
if (ret != NULL) prom_printf("prom_early_alloc(%lu) failed\n");
memset(ret, 0, size); prom_halt();
}
ret = __va(paddr);
memset(ret, 0, size);
prom_early_allocated += size; prom_early_allocated += size;
return ret; return ret;
......
...@@ -1214,6 +1214,8 @@ void __init paging_init(void) ...@@ -1214,6 +1214,8 @@ void __init paging_init(void)
*/ */
real_setup_per_cpu_areas(); real_setup_per_cpu_areas();
prom_build_devicetree();
/* Setup bootmem... */ /* Setup bootmem... */
pages_avail = 0; pages_avail = 0;
last_valid_pfn = end_pfn = bootmem_init(&pages_avail, phys_base); last_valid_pfn = end_pfn = bootmem_init(&pages_avail, phys_base);
...@@ -1222,8 +1224,6 @@ void __init paging_init(void) ...@@ -1222,8 +1224,6 @@ void __init paging_init(void)
kernel_physical_mapping_init(); kernel_physical_mapping_init();
prom_build_devicetree();
if (tlb_type == hypervisor) if (tlb_type == hypervisor)
sun4v_mdesc_init(); sun4v_mdesc_init();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment