diff options
author | David S. Miller <davem@davemloft.net> | 2008-02-13 22:21:51 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-04-24 02:32:11 -0400 |
commit | ad072004ca35a9918964ca7aee2bf00d79c8657f (patch) | |
tree | dffd2075d875d0e53b638c07cff030beb8dea1dc /arch/sparc64 | |
parent | b97094560b991af5c62391014e72bfa4c3a3701f (diff) |
[SPARC64]: Use lmb_alloc() for PROM device tree.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64')
-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 @@ | |||
19 | #include <linux/types.h> | 19 | #include <linux/types.h> |
20 | #include <linux/string.h> | 20 | #include <linux/string.h> |
21 | #include <linux/mm.h> | 21 | #include <linux/mm.h> |
22 | #include <linux/bootmem.h> | ||
23 | #include <linux/module.h> | 22 | #include <linux/module.h> |
23 | #include <linux/lmb.h> | ||
24 | 24 | ||
25 | #include <asm/prom.h> | 25 | #include <asm/prom.h> |
26 | #include <asm/of_device.h> | 26 | #include <asm/of_device.h> |
@@ -122,16 +122,20 @@ int of_find_in_proplist(const char *list, const char *match, int len) | |||
122 | } | 122 | } |
123 | EXPORT_SYMBOL(of_find_in_proplist); | 123 | EXPORT_SYMBOL(of_find_in_proplist); |
124 | 124 | ||
125 | static unsigned int prom_early_allocated; | 125 | static unsigned int prom_early_allocated __initdata; |
126 | 126 | ||
127 | static void * __init prom_early_alloc(unsigned long size) | 127 | static void * __init prom_early_alloc(unsigned long size) |
128 | { | 128 | { |
129 | unsigned long paddr = lmb_alloc(size, SMP_CACHE_BYTES); | ||
129 | void *ret; | 130 | void *ret; |
130 | 131 | ||
131 | ret = __alloc_bootmem(size, SMP_CACHE_BYTES, 0UL); | 132 | if (!paddr) { |
132 | if (ret != NULL) | 133 | prom_printf("prom_early_alloc(%lu) failed\n"); |
133 | memset(ret, 0, size); | 134 | prom_halt(); |
135 | } | ||
134 | 136 | ||
137 | ret = __va(paddr); | ||
138 | memset(ret, 0, size); | ||
135 | prom_early_allocated += size; | 139 | prom_early_allocated += size; |
136 | 140 | ||
137 | return ret; | 141 | 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) | |||
1214 | */ | 1214 | */ |
1215 | real_setup_per_cpu_areas(); | 1215 | real_setup_per_cpu_areas(); |
1216 | 1216 | ||
1217 | prom_build_devicetree(); | ||
1218 | |||
1217 | /* Setup bootmem... */ | 1219 | /* Setup bootmem... */ |
1218 | pages_avail = 0; | 1220 | pages_avail = 0; |
1219 | last_valid_pfn = end_pfn = bootmem_init(&pages_avail, phys_base); | 1221 | last_valid_pfn = end_pfn = bootmem_init(&pages_avail, phys_base); |
@@ -1222,8 +1224,6 @@ void __init paging_init(void) | |||
1222 | 1224 | ||
1223 | kernel_physical_mapping_init(); | 1225 | kernel_physical_mapping_init(); |
1224 | 1226 | ||
1225 | prom_build_devicetree(); | ||
1226 | |||
1227 | if (tlb_type == hypervisor) | 1227 | if (tlb_type == hypervisor) |
1228 | sun4v_mdesc_init(); | 1228 | sun4v_mdesc_init(); |
1229 | 1229 | ||