diff options
author | David S. Miller <davem@davemloft.net> | 2008-12-05 21:16:48 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-12-05 21:16:48 -0500 |
commit | 23dc758e47aeb3cc2414c2ec69b7b3e95f447071 (patch) | |
tree | 70ba39d6f4ed24b67ef987b6fb528abcfbac28a7 /arch/sparc/kernel/prom_64.c | |
parent | 6524036a1e5736a07466208362d83ddf31aae3ac (diff) |
sparc: Move prom_build_devicetree() into prom_common.c
To make this work we provide a dummy nop implementation
of of_fill_in_cpu_data() for sparc32.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/kernel/prom_64.c')
-rw-r--r-- | arch/sparc/kernel/prom_64.c | 33 |
1 files changed, 7 insertions, 26 deletions
diff --git a/arch/sparc/kernel/prom_64.c b/arch/sparc/kernel/prom_64.c index 0279811d17bc..3afb838a6e61 100644 --- a/arch/sparc/kernel/prom_64.c +++ b/arch/sparc/kernel/prom_64.c | |||
@@ -32,8 +32,6 @@ | |||
32 | 32 | ||
33 | #include "prom.h" | 33 | #include "prom.h" |
34 | 34 | ||
35 | static unsigned int prom_early_allocated __initdata; | ||
36 | |||
37 | void * __init prom_early_alloc(unsigned long size) | 35 | void * __init prom_early_alloc(unsigned long size) |
38 | { | 36 | { |
39 | unsigned long paddr = lmb_alloc(size, SMP_CACHE_BYTES); | 37 | unsigned long paddr = lmb_alloc(size, SMP_CACHE_BYTES); |
@@ -401,11 +399,15 @@ struct device_node *of_find_node_by_cpuid(int cpuid) | |||
401 | return NULL; | 399 | return NULL; |
402 | } | 400 | } |
403 | 401 | ||
404 | static void __init of_fill_in_cpu_data(void) | 402 | void __init of_fill_in_cpu_data(void) |
405 | { | 403 | { |
406 | struct device_node *dp; | 404 | struct device_node *dp; |
407 | const char *mid_prop = get_mid_prop(); | 405 | const char *mid_prop; |
406 | |||
407 | if (tlb_type == hypervisor) | ||
408 | return; | ||
408 | 409 | ||
410 | mid_prop = get_mid_prop(); | ||
409 | ncpus_probed = 0; | 411 | ncpus_probed = 0; |
410 | for_each_node_by_type(dp, "cpu") { | 412 | for_each_node_by_type(dp, "cpu") { |
411 | int cpuid = of_getintprop_default(dp, mid_prop, -1); | 413 | int cpuid = of_getintprop_default(dp, mid_prop, -1); |
@@ -533,7 +535,7 @@ EXPORT_SYMBOL(of_console_path); | |||
533 | char *of_console_options; | 535 | char *of_console_options; |
534 | EXPORT_SYMBOL(of_console_options); | 536 | EXPORT_SYMBOL(of_console_options); |
535 | 537 | ||
536 | static void __init of_console_init(void) | 538 | void __init of_console_init(void) |
537 | { | 539 | { |
538 | char *msg = "OF stdout device is: %s\n"; | 540 | char *msg = "OF stdout device is: %s\n"; |
539 | struct device_node *dp; | 541 | struct device_node *dp; |
@@ -576,24 +578,3 @@ static void __init of_console_init(void) | |||
576 | 578 | ||
577 | printk(msg, of_console_path); | 579 | printk(msg, of_console_path); |
578 | } | 580 | } |
579 | |||
580 | void __init prom_build_devicetree(void) | ||
581 | { | ||
582 | struct device_node **nextp; | ||
583 | |||
584 | allnodes = prom_create_node(prom_root_node, NULL); | ||
585 | allnodes->path_component_name = ""; | ||
586 | allnodes->full_name = "/"; | ||
587 | |||
588 | nextp = &allnodes->allnext; | ||
589 | allnodes->child = prom_build_tree(allnodes, | ||
590 | prom_getchild(allnodes->node), | ||
591 | &nextp); | ||
592 | of_console_init(); | ||
593 | |||
594 | printk("PROM: Built device tree with %u bytes of memory.\n", | ||
595 | prom_early_allocated); | ||
596 | |||
597 | if (tlb_type != hypervisor) | ||
598 | of_fill_in_cpu_data(); | ||
599 | } | ||