diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2006-02-15 03:35:50 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-03-20 04:13:01 -0500 |
commit | f03b8a546868fcf43feb455b69b152eb867606b2 (patch) | |
tree | 147f1f63d824827de1d374dcd6741a38c7132b68 /arch/sparc64 | |
parent | 329c68b21896eea371edbfdf305c459fb74cf9a8 (diff) |
[SPARC64]: Use different cache sizing defaults on SUN4V.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64')
-rw-r--r-- | arch/sparc64/kernel/devices.c | 34 | ||||
-rw-r--r-- | arch/sparc64/kernel/smp.c | 28 |
2 files changed, 48 insertions, 14 deletions
diff --git a/arch/sparc64/kernel/devices.c b/arch/sparc64/kernel/devices.c index 817132826e09..71eee392e141 100644 --- a/arch/sparc64/kernel/devices.c +++ b/arch/sparc64/kernel/devices.c | |||
@@ -200,7 +200,8 @@ void __init device_scan(void) | |||
200 | 200 | ||
201 | #ifndef CONFIG_SMP | 201 | #ifndef CONFIG_SMP |
202 | { | 202 | { |
203 | int err, cpu_node; | 203 | int err, cpu_node, def; |
204 | |||
204 | err = cpu_find_by_instance(0, &cpu_node, NULL); | 205 | err = cpu_find_by_instance(0, &cpu_node, NULL); |
205 | if (err) { | 206 | if (err) { |
206 | prom_printf("No cpu nodes, cannot continue\n"); | 207 | prom_printf("No cpu nodes, cannot continue\n"); |
@@ -209,21 +210,40 @@ void __init device_scan(void) | |||
209 | cpu_data(0).clock_tick = prom_getintdefault(cpu_node, | 210 | cpu_data(0).clock_tick = prom_getintdefault(cpu_node, |
210 | "clock-frequency", | 211 | "clock-frequency", |
211 | 0); | 212 | 0); |
213 | |||
214 | def = ((tlb_type == hypervisor) ? | ||
215 | (8 * 1024) : | ||
216 | (16 * 1024)); | ||
212 | cpu_data(0).dcache_size = prom_getintdefault(cpu_node, | 217 | cpu_data(0).dcache_size = prom_getintdefault(cpu_node, |
213 | "dcache-size", | 218 | "dcache-size", |
214 | 16 * 1024); | 219 | def); |
220 | |||
221 | def = 32; | ||
215 | cpu_data(0).dcache_line_size = | 222 | cpu_data(0).dcache_line_size = |
216 | prom_getintdefault(cpu_node, "dcache-line-size", 32); | 223 | prom_getintdefault(cpu_node, "dcache-line-size", |
224 | def); | ||
225 | |||
226 | def = 16 * 1024; | ||
217 | cpu_data(0).icache_size = prom_getintdefault(cpu_node, | 227 | cpu_data(0).icache_size = prom_getintdefault(cpu_node, |
218 | "icache-size", | 228 | "icache-size", |
219 | 16 * 1024); | 229 | def); |
230 | |||
231 | def = 32; | ||
220 | cpu_data(0).icache_line_size = | 232 | cpu_data(0).icache_line_size = |
221 | prom_getintdefault(cpu_node, "icache-line-size", 32); | 233 | prom_getintdefault(cpu_node, "icache-line-size", |
234 | def); | ||
235 | |||
236 | def = ((tlb_type == hypervisor) ? | ||
237 | (3 * 1024 * 1024) : | ||
238 | (4 * 1024 * 1024)); | ||
222 | cpu_data(0).ecache_size = prom_getintdefault(cpu_node, | 239 | cpu_data(0).ecache_size = prom_getintdefault(cpu_node, |
223 | "ecache-size", | 240 | "ecache-size", |
224 | 4 * 1024 * 1024); | 241 | def); |
242 | |||
243 | def = 64; | ||
225 | cpu_data(0).ecache_line_size = | 244 | cpu_data(0).ecache_line_size = |
226 | prom_getintdefault(cpu_node, "ecache-line-size", 64); | 245 | prom_getintdefault(cpu_node, "ecache-line-size", |
246 | def); | ||
227 | printk("CPU[0]: Caches " | 247 | printk("CPU[0]: Caches " |
228 | "D[sz(%d):line_sz(%d)] " | 248 | "D[sz(%d):line_sz(%d)] " |
229 | "I[sz(%d):line_sz(%d)] " | 249 | "I[sz(%d):line_sz(%d)] " |
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c index c280e6742b25..64046d37bbf0 100644 --- a/arch/sparc64/kernel/smp.c +++ b/arch/sparc64/kernel/smp.c | |||
@@ -78,7 +78,7 @@ void smp_bogo(struct seq_file *m) | |||
78 | 78 | ||
79 | void __init smp_store_cpu_info(int id) | 79 | void __init smp_store_cpu_info(int id) |
80 | { | 80 | { |
81 | int cpu_node; | 81 | int cpu_node, def; |
82 | 82 | ||
83 | /* multiplier and counter set by | 83 | /* multiplier and counter set by |
84 | smp_setup_percpu_timer() */ | 84 | smp_setup_percpu_timer() */ |
@@ -90,18 +90,32 @@ void __init smp_store_cpu_info(int id) | |||
90 | 90 | ||
91 | cpu_data(id).idle_volume = 1; | 91 | cpu_data(id).idle_volume = 1; |
92 | 92 | ||
93 | def = ((tlb_type == hypervisor) ? (8 * 1024) : (16 * 1024)); | ||
93 | cpu_data(id).dcache_size = prom_getintdefault(cpu_node, "dcache-size", | 94 | cpu_data(id).dcache_size = prom_getintdefault(cpu_node, "dcache-size", |
94 | 16 * 1024); | 95 | def); |
96 | |||
97 | def = 32; | ||
95 | cpu_data(id).dcache_line_size = | 98 | cpu_data(id).dcache_line_size = |
96 | prom_getintdefault(cpu_node, "dcache-line-size", 32); | 99 | prom_getintdefault(cpu_node, "dcache-line-size", def); |
100 | |||
101 | def = 16 * 1024; | ||
97 | cpu_data(id).icache_size = prom_getintdefault(cpu_node, "icache-size", | 102 | cpu_data(id).icache_size = prom_getintdefault(cpu_node, "icache-size", |
98 | 16 * 1024); | 103 | def); |
104 | |||
105 | def = 32; | ||
99 | cpu_data(id).icache_line_size = | 106 | cpu_data(id).icache_line_size = |
100 | prom_getintdefault(cpu_node, "icache-line-size", 32); | 107 | prom_getintdefault(cpu_node, "icache-line-size", def); |
108 | |||
109 | def = ((tlb_type == hypervisor) ? | ||
110 | (3 * 1024 * 1024) : | ||
111 | (4 * 1024 * 1024)); | ||
101 | cpu_data(id).ecache_size = prom_getintdefault(cpu_node, "ecache-size", | 112 | cpu_data(id).ecache_size = prom_getintdefault(cpu_node, "ecache-size", |
102 | 4 * 1024 * 1024); | 113 | def); |
114 | |||
115 | def = 64; | ||
103 | cpu_data(id).ecache_line_size = | 116 | cpu_data(id).ecache_line_size = |
104 | prom_getintdefault(cpu_node, "ecache-line-size", 64); | 117 | prom_getintdefault(cpu_node, "ecache-line-size", def); |
118 | |||
105 | printk("CPU[%d]: Caches " | 119 | printk("CPU[%d]: Caches " |
106 | "D[sz(%d):line_sz(%d)] " | 120 | "D[sz(%d):line_sz(%d)] " |
107 | "I[sz(%d):line_sz(%d)] " | 121 | "I[sz(%d):line_sz(%d)] " |