diff options
author | David S. Miller <davem@davemloft.net> | 2008-02-14 06:21:51 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-04-24 10:32:11 +0400 |
commit | ad072004ca35a9918964ca7aee2bf00d79c8657f (patch) | |
tree | dffd2075d875d0e53b638c07cff030beb8dea1dc /arch | |
parent | b97094560b991af5c62391014e72bfa4c3a3701f (diff) | |
download | linux-ad072004ca35a9918964ca7aee2bf00d79c8657f.tar.xz |
[SPARC64]: Use lmb_alloc() for PROM device tree.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/sparc64/kernel/prom.c | 14 | ||||
-rw-r--r-- | arch/sparc64/mm/init.c | 4 |
2 files changed, 11 insertions, 7 deletions
diff --git a/arch/sparc64/kernel/prom.c b/arch/sparc64/kernel/prom.c index 68964ddcde1e..ed03a18d3b36 100644 --- a/arch/sparc64/kernel/prom.c +++ b/arch/sparc64/kernel/prom.c @@ -19,8 +19,8 @@ #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> @@ -122,16 +122,20 @@ int of_find_in_proplist(const char *list, const char *match, int len) } 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; diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c index 658ec462ed45..0abefc8ca40d 100644 --- a/arch/sparc64/mm/init.c +++ b/arch/sparc64/mm/init.c @@ -1214,6 +1214,8 @@ void __init paging_init(void) */ real_setup_per_cpu_areas(); + prom_build_devicetree(); + /* Setup bootmem... */ pages_avail = 0; last_valid_pfn = end_pfn = bootmem_init(&pages_avail, phys_base); @@ -1222,8 +1224,6 @@ void __init paging_init(void) kernel_physical_mapping_init(); - prom_build_devicetree(); - if (tlb_type == hypervisor) sun4v_mdesc_init(); |