aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64/kernel/smp.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2006-06-22 02:34:02 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-06-24 02:15:17 -0400
commit07f8e5f358a0b7240f1dad6b3819f2fd1103f159 (patch)
tree5976cc05de92f27a9cc12a3db31ced5311ac3769 /arch/sparc64/kernel/smp.c
parent6d307724cb6a6b8466cad4fdf13d8a409bc2433f (diff)
[SPARC64]: Convert cpu_find_by_*() interface to in-kernel PROM device tree.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/kernel/smp.c')
-rw-r--r--arch/sparc64/kernel/smp.c41
1 files changed, 22 insertions, 19 deletions
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c
index f03d52d0b88d..f62bf3a2de1a 100644
--- a/arch/sparc64/kernel/smp.c
+++ b/arch/sparc64/kernel/smp.c
@@ -39,6 +39,7 @@
39#include <asm/starfire.h> 39#include <asm/starfire.h>
40#include <asm/tlb.h> 40#include <asm/tlb.h>
41#include <asm/sections.h> 41#include <asm/sections.h>
42#include <asm/prom.h>
42 43
43extern void calibrate_delay(void); 44extern void calibrate_delay(void);
44 45
@@ -76,41 +77,42 @@ void smp_bogo(struct seq_file *m)
76 77
77void __init smp_store_cpu_info(int id) 78void __init smp_store_cpu_info(int id)
78{ 79{
79 int cpu_node, def; 80 struct device_node *dp;
81 int def;
80 82
81 /* multiplier and counter set by 83 /* multiplier and counter set by
82 smp_setup_percpu_timer() */ 84 smp_setup_percpu_timer() */
83 cpu_data(id).udelay_val = loops_per_jiffy; 85 cpu_data(id).udelay_val = loops_per_jiffy;
84 86
85 cpu_find_by_mid(id, &cpu_node); 87 cpu_find_by_mid(id, &dp);
86 cpu_data(id).clock_tick = prom_getintdefault(cpu_node, 88 cpu_data(id).clock_tick =
87 "clock-frequency", 0); 89 of_getintprop_default(dp, "clock-frequency", 0);
88 90
89 def = ((tlb_type == hypervisor) ? (8 * 1024) : (16 * 1024)); 91 def = ((tlb_type == hypervisor) ? (8 * 1024) : (16 * 1024));
90 cpu_data(id).dcache_size = prom_getintdefault(cpu_node, "dcache-size", 92 cpu_data(id).dcache_size =
91 def); 93 of_getintprop_default(dp, "dcache-size", def);
92 94
93 def = 32; 95 def = 32;
94 cpu_data(id).dcache_line_size = 96 cpu_data(id).dcache_line_size =
95 prom_getintdefault(cpu_node, "dcache-line-size", def); 97 of_getintprop_default(dp, "dcache-line-size", def);
96 98
97 def = 16 * 1024; 99 def = 16 * 1024;
98 cpu_data(id).icache_size = prom_getintdefault(cpu_node, "icache-size", 100 cpu_data(id).icache_size =
99 def); 101 of_getintprop_default(dp, "icache-size", def);
100 102
101 def = 32; 103 def = 32;
102 cpu_data(id).icache_line_size = 104 cpu_data(id).icache_line_size =
103 prom_getintdefault(cpu_node, "icache-line-size", def); 105 of_getintprop_default(dp, "icache-line-size", def);
104 106
105 def = ((tlb_type == hypervisor) ? 107 def = ((tlb_type == hypervisor) ?
106 (3 * 1024 * 1024) : 108 (3 * 1024 * 1024) :
107 (4 * 1024 * 1024)); 109 (4 * 1024 * 1024));
108 cpu_data(id).ecache_size = prom_getintdefault(cpu_node, "ecache-size", 110 cpu_data(id).ecache_size =
109 def); 111 of_getintprop_default(dp, "ecache-size", def);
110 112
111 def = 64; 113 def = 64;
112 cpu_data(id).ecache_line_size = 114 cpu_data(id).ecache_line_size =
113 prom_getintdefault(cpu_node, "ecache-line-size", def); 115 of_getintprop_default(dp, "ecache-line-size", def);
114 116
115 printk("CPU[%d]: Caches " 117 printk("CPU[%d]: Caches "
116 "D[sz(%d):line_sz(%d)] " 118 "D[sz(%d):line_sz(%d)] "
@@ -342,10 +344,10 @@ static int __devinit smp_boot_one_cpu(unsigned int cpu)
342 344
343 prom_startcpu_cpuid(cpu, entry, cookie); 345 prom_startcpu_cpuid(cpu, entry, cookie);
344 } else { 346 } else {
345 int cpu_node; 347 struct device_node *dp;
346 348
347 cpu_find_by_mid(cpu, &cpu_node); 349 cpu_find_by_mid(cpu, &dp);
348 prom_startcpu(cpu_node, entry, cookie); 350 prom_startcpu(dp->node, entry, cookie);
349 } 351 }
350 352
351 for (timeout = 0; timeout < 5000000; timeout++) { 353 for (timeout = 0; timeout < 5000000; timeout++) {
@@ -1289,7 +1291,8 @@ int setup_profiling_timer(unsigned int multiplier)
1289 1291
1290static void __init smp_tune_scheduling(void) 1292static void __init smp_tune_scheduling(void)
1291{ 1293{
1292 int instance, node; 1294 struct device_node *dp;
1295 int instance;
1293 unsigned int def, smallest = ~0U; 1296 unsigned int def, smallest = ~0U;
1294 1297
1295 def = ((tlb_type == hypervisor) ? 1298 def = ((tlb_type == hypervisor) ?
@@ -1297,10 +1300,10 @@ static void __init smp_tune_scheduling(void)
1297 (4 * 1024 * 1024)); 1300 (4 * 1024 * 1024));
1298 1301
1299 instance = 0; 1302 instance = 0;
1300 while (!cpu_find_by_instance(instance, &node, NULL)) { 1303 while (!cpu_find_by_instance(instance, &dp, NULL)) {
1301 unsigned int val; 1304 unsigned int val;
1302 1305
1303 val = prom_getintdefault(node, "ecache-size", def); 1306 val = of_getintprop_default(dp, "ecache-size", def);
1304 if (val < smallest) 1307 if (val < smallest)
1305 smallest = val; 1308 smallest = val;
1306 1309