diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2005-08-03 00:32:30 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-08-28 20:53:34 -0400 |
commit | 7a6af5e38054d8e658a4b1b703902331a845de1a (patch) | |
tree | 8388d65aec62a65d10bd18306a7e84e7c5e7b18c /arch/ppc64 | |
parent | 6fbb49d56d228b666cb4534bbc3c2dfe833c8053 (diff) |
[PATCH] ppc64: remove firmware features from cpu_spec
The firmware_features field of struct cpu_spec should really be a separate
variable as the firmware features do not depend on the chip and the
bitmask is constructed independently. By removing it, we save 112 bytes
from the cpu_specs array and we access the bitmask directly instead of via
the cur_cpu_spec pointer.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/ppc64')
-rw-r--r-- | arch/ppc64/kernel/cputable.c | 16 | ||||
-rw-r--r-- | arch/ppc64/kernel/lparcfg.c | 4 | ||||
-rw-r--r-- | arch/ppc64/kernel/pSeries_iommu.c | 2 | ||||
-rw-r--r-- | arch/ppc64/kernel/pSeries_setup.c | 12 | ||||
-rw-r--r-- | arch/ppc64/kernel/pSeries_smp.c | 2 | ||||
-rw-r--r-- | arch/ppc64/kernel/process.c | 2 | ||||
-rw-r--r-- | arch/ppc64/kernel/sysfs.c | 2 | ||||
-rw-r--r-- | arch/ppc64/kernel/time.c | 2 |
8 files changed, 14 insertions, 28 deletions
diff --git a/arch/ppc64/kernel/cputable.c b/arch/ppc64/kernel/cputable.c index 77cec42f9525..84fdd27498a5 100644 --- a/arch/ppc64/kernel/cputable.c +++ b/arch/ppc64/kernel/cputable.c | |||
@@ -23,6 +23,7 @@ | |||
23 | 23 | ||
24 | struct cpu_spec* cur_cpu_spec = NULL; | 24 | struct cpu_spec* cur_cpu_spec = NULL; |
25 | EXPORT_SYMBOL(cur_cpu_spec); | 25 | EXPORT_SYMBOL(cur_cpu_spec); |
26 | unsigned long ppc64_firmware_features; | ||
26 | 27 | ||
27 | /* NOTE: | 28 | /* NOTE: |
28 | * Unlike ppc32, ppc64 will only call this once for the boot CPU, it's | 29 | * Unlike ppc32, ppc64 will only call this once for the boot CPU, it's |
@@ -60,7 +61,6 @@ struct cpu_spec cpu_specs[] = { | |||
60 | .icache_bsize = 128, | 61 | .icache_bsize = 128, |
61 | .dcache_bsize = 128, | 62 | .dcache_bsize = 128, |
62 | .cpu_setup = __setup_cpu_power3, | 63 | .cpu_setup = __setup_cpu_power3, |
63 | .firmware_features = COMMON_PPC64_FW, | ||
64 | }, | 64 | }, |
65 | { /* Power3+ */ | 65 | { /* Power3+ */ |
66 | .pvr_mask = 0xffff0000, | 66 | .pvr_mask = 0xffff0000, |
@@ -73,7 +73,6 @@ struct cpu_spec cpu_specs[] = { | |||
73 | .icache_bsize = 128, | 73 | .icache_bsize = 128, |
74 | .dcache_bsize = 128, | 74 | .dcache_bsize = 128, |
75 | .cpu_setup = __setup_cpu_power3, | 75 | .cpu_setup = __setup_cpu_power3, |
76 | .firmware_features = COMMON_PPC64_FW, | ||
77 | }, | 76 | }, |
78 | { /* Northstar */ | 77 | { /* Northstar */ |
79 | .pvr_mask = 0xffff0000, | 78 | .pvr_mask = 0xffff0000, |
@@ -86,7 +85,6 @@ struct cpu_spec cpu_specs[] = { | |||
86 | .icache_bsize = 128, | 85 | .icache_bsize = 128, |
87 | .dcache_bsize = 128, | 86 | .dcache_bsize = 128, |
88 | .cpu_setup = __setup_cpu_power3, | 87 | .cpu_setup = __setup_cpu_power3, |
89 | .firmware_features = COMMON_PPC64_FW, | ||
90 | }, | 88 | }, |
91 | { /* Pulsar */ | 89 | { /* Pulsar */ |
92 | .pvr_mask = 0xffff0000, | 90 | .pvr_mask = 0xffff0000, |
@@ -99,7 +97,6 @@ struct cpu_spec cpu_specs[] = { | |||
99 | .icache_bsize = 128, | 97 | .icache_bsize = 128, |
100 | .dcache_bsize = 128, | 98 | .dcache_bsize = 128, |
101 | .cpu_setup = __setup_cpu_power3, | 99 | .cpu_setup = __setup_cpu_power3, |
102 | .firmware_features = COMMON_PPC64_FW, | ||
103 | }, | 100 | }, |
104 | { /* I-star */ | 101 | { /* I-star */ |
105 | .pvr_mask = 0xffff0000, | 102 | .pvr_mask = 0xffff0000, |
@@ -112,7 +109,6 @@ struct cpu_spec cpu_specs[] = { | |||
112 | .icache_bsize = 128, | 109 | .icache_bsize = 128, |
113 | .dcache_bsize = 128, | 110 | .dcache_bsize = 128, |
114 | .cpu_setup = __setup_cpu_power3, | 111 | .cpu_setup = __setup_cpu_power3, |
115 | .firmware_features = COMMON_PPC64_FW, | ||
116 | }, | 112 | }, |
117 | { /* S-star */ | 113 | { /* S-star */ |
118 | .pvr_mask = 0xffff0000, | 114 | .pvr_mask = 0xffff0000, |
@@ -125,7 +121,6 @@ struct cpu_spec cpu_specs[] = { | |||
125 | .icache_bsize = 128, | 121 | .icache_bsize = 128, |
126 | .dcache_bsize = 128, | 122 | .dcache_bsize = 128, |
127 | .cpu_setup = __setup_cpu_power3, | 123 | .cpu_setup = __setup_cpu_power3, |
128 | .firmware_features = COMMON_PPC64_FW, | ||
129 | }, | 124 | }, |
130 | { /* Power4 */ | 125 | { /* Power4 */ |
131 | .pvr_mask = 0xffff0000, | 126 | .pvr_mask = 0xffff0000, |
@@ -138,7 +133,6 @@ struct cpu_spec cpu_specs[] = { | |||
138 | .icache_bsize = 128, | 133 | .icache_bsize = 128, |
139 | .dcache_bsize = 128, | 134 | .dcache_bsize = 128, |
140 | .cpu_setup = __setup_cpu_power4, | 135 | .cpu_setup = __setup_cpu_power4, |
141 | .firmware_features = COMMON_PPC64_FW, | ||
142 | }, | 136 | }, |
143 | { /* Power4+ */ | 137 | { /* Power4+ */ |
144 | .pvr_mask = 0xffff0000, | 138 | .pvr_mask = 0xffff0000, |
@@ -151,7 +145,6 @@ struct cpu_spec cpu_specs[] = { | |||
151 | .icache_bsize = 128, | 145 | .icache_bsize = 128, |
152 | .dcache_bsize = 128, | 146 | .dcache_bsize = 128, |
153 | .cpu_setup = __setup_cpu_power4, | 147 | .cpu_setup = __setup_cpu_power4, |
154 | .firmware_features = COMMON_PPC64_FW, | ||
155 | }, | 148 | }, |
156 | { /* PPC970 */ | 149 | { /* PPC970 */ |
157 | .pvr_mask = 0xffff0000, | 150 | .pvr_mask = 0xffff0000, |
@@ -166,7 +159,6 @@ struct cpu_spec cpu_specs[] = { | |||
166 | .icache_bsize = 128, | 159 | .icache_bsize = 128, |
167 | .dcache_bsize = 128, | 160 | .dcache_bsize = 128, |
168 | .cpu_setup = __setup_cpu_ppc970, | 161 | .cpu_setup = __setup_cpu_ppc970, |
169 | .firmware_features = COMMON_PPC64_FW, | ||
170 | }, | 162 | }, |
171 | { /* PPC970FX */ | 163 | { /* PPC970FX */ |
172 | .pvr_mask = 0xffff0000, | 164 | .pvr_mask = 0xffff0000, |
@@ -181,7 +173,6 @@ struct cpu_spec cpu_specs[] = { | |||
181 | .icache_bsize = 128, | 173 | .icache_bsize = 128, |
182 | .dcache_bsize = 128, | 174 | .dcache_bsize = 128, |
183 | .cpu_setup = __setup_cpu_ppc970, | 175 | .cpu_setup = __setup_cpu_ppc970, |
184 | .firmware_features = COMMON_PPC64_FW, | ||
185 | }, | 176 | }, |
186 | { /* PPC970MP */ | 177 | { /* PPC970MP */ |
187 | .pvr_mask = 0xffff0000, | 178 | .pvr_mask = 0xffff0000, |
@@ -196,7 +187,6 @@ struct cpu_spec cpu_specs[] = { | |||
196 | .icache_bsize = 128, | 187 | .icache_bsize = 128, |
197 | .dcache_bsize = 128, | 188 | .dcache_bsize = 128, |
198 | .cpu_setup = __setup_cpu_ppc970, | 189 | .cpu_setup = __setup_cpu_ppc970, |
199 | .firmware_features = COMMON_PPC64_FW, | ||
200 | }, | 190 | }, |
201 | { /* Power5 */ | 191 | { /* Power5 */ |
202 | .pvr_mask = 0xffff0000, | 192 | .pvr_mask = 0xffff0000, |
@@ -211,7 +201,6 @@ struct cpu_spec cpu_specs[] = { | |||
211 | .icache_bsize = 128, | 201 | .icache_bsize = 128, |
212 | .dcache_bsize = 128, | 202 | .dcache_bsize = 128, |
213 | .cpu_setup = __setup_cpu_power4, | 203 | .cpu_setup = __setup_cpu_power4, |
214 | .firmware_features = COMMON_PPC64_FW, | ||
215 | }, | 204 | }, |
216 | { /* Power5 */ | 205 | { /* Power5 */ |
217 | .pvr_mask = 0xffff0000, | 206 | .pvr_mask = 0xffff0000, |
@@ -226,7 +215,6 @@ struct cpu_spec cpu_specs[] = { | |||
226 | .icache_bsize = 128, | 215 | .icache_bsize = 128, |
227 | .dcache_bsize = 128, | 216 | .dcache_bsize = 128, |
228 | .cpu_setup = __setup_cpu_power4, | 217 | .cpu_setup = __setup_cpu_power4, |
229 | .firmware_features = COMMON_PPC64_FW, | ||
230 | }, | 218 | }, |
231 | { /* BE DD1.x */ | 219 | { /* BE DD1.x */ |
232 | .pvr_mask = 0xffff0000, | 220 | .pvr_mask = 0xffff0000, |
@@ -241,7 +229,6 @@ struct cpu_spec cpu_specs[] = { | |||
241 | .icache_bsize = 128, | 229 | .icache_bsize = 128, |
242 | .dcache_bsize = 128, | 230 | .dcache_bsize = 128, |
243 | .cpu_setup = __setup_cpu_be, | 231 | .cpu_setup = __setup_cpu_be, |
244 | .firmware_features = COMMON_PPC64_FW, | ||
245 | }, | 232 | }, |
246 | { /* default match */ | 233 | { /* default match */ |
247 | .pvr_mask = 0x00000000, | 234 | .pvr_mask = 0x00000000, |
@@ -254,7 +241,6 @@ struct cpu_spec cpu_specs[] = { | |||
254 | .icache_bsize = 128, | 241 | .icache_bsize = 128, |
255 | .dcache_bsize = 128, | 242 | .dcache_bsize = 128, |
256 | .cpu_setup = __setup_cpu_power4, | 243 | .cpu_setup = __setup_cpu_power4, |
257 | .firmware_features = COMMON_PPC64_FW, | ||
258 | } | 244 | } |
259 | }; | 245 | }; |
260 | 246 | ||
diff --git a/arch/ppc64/kernel/lparcfg.c b/arch/ppc64/kernel/lparcfg.c index 02e96627fa66..938353848cd0 100644 --- a/arch/ppc64/kernel/lparcfg.c +++ b/arch/ppc64/kernel/lparcfg.c | |||
@@ -377,7 +377,7 @@ static int lparcfg_data(struct seq_file *m, void *v) | |||
377 | 377 | ||
378 | partition_active_processors = lparcfg_count_active_processors(); | 378 | partition_active_processors = lparcfg_count_active_processors(); |
379 | 379 | ||
380 | if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) { | 380 | if (ppc64_firmware_features & FW_FEATURE_SPLPAR) { |
381 | unsigned long h_entitled, h_unallocated; | 381 | unsigned long h_entitled, h_unallocated; |
382 | unsigned long h_aggregation, h_resource; | 382 | unsigned long h_aggregation, h_resource; |
383 | unsigned long pool_idle_time, pool_procs; | 383 | unsigned long pool_idle_time, pool_procs; |
@@ -571,7 +571,7 @@ int __init lparcfg_init(void) | |||
571 | mode_t mode = S_IRUSR; | 571 | mode_t mode = S_IRUSR; |
572 | 572 | ||
573 | /* Allow writing if we have FW_FEATURE_SPLPAR */ | 573 | /* Allow writing if we have FW_FEATURE_SPLPAR */ |
574 | if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) { | 574 | if (ppc64_firmware_features & FW_FEATURE_SPLPAR) { |
575 | lparcfg_fops.write = lparcfg_write; | 575 | lparcfg_fops.write = lparcfg_write; |
576 | mode |= S_IWUSR; | 576 | mode |= S_IWUSR; |
577 | } | 577 | } |
diff --git a/arch/ppc64/kernel/pSeries_iommu.c b/arch/ppc64/kernel/pSeries_iommu.c index 69130522a87e..a5786be9c654 100644 --- a/arch/ppc64/kernel/pSeries_iommu.c +++ b/arch/ppc64/kernel/pSeries_iommu.c | |||
@@ -546,7 +546,7 @@ void iommu_init_early_pSeries(void) | |||
546 | } | 546 | } |
547 | 547 | ||
548 | if (systemcfg->platform & PLATFORM_LPAR) { | 548 | if (systemcfg->platform & PLATFORM_LPAR) { |
549 | if (cur_cpu_spec->firmware_features & FW_FEATURE_MULTITCE) { | 549 | if (ppc64_firmware_features & FW_FEATURE_MULTITCE) { |
550 | ppc_md.tce_build = tce_buildmulti_pSeriesLP; | 550 | ppc_md.tce_build = tce_buildmulti_pSeriesLP; |
551 | ppc_md.tce_free = tce_freemulti_pSeriesLP; | 551 | ppc_md.tce_free = tce_freemulti_pSeriesLP; |
552 | } else { | 552 | } else { |
diff --git a/arch/ppc64/kernel/pSeries_setup.c b/arch/ppc64/kernel/pSeries_setup.c index 5bec956e44a0..d3975ac71cfb 100644 --- a/arch/ppc64/kernel/pSeries_setup.c +++ b/arch/ppc64/kernel/pSeries_setup.c | |||
@@ -231,11 +231,11 @@ static void __init pSeries_setup_arch(void) | |||
231 | 231 | ||
232 | pSeries_nvram_init(); | 232 | pSeries_nvram_init(); |
233 | 233 | ||
234 | if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) | 234 | if (ppc64_firmware_features & FW_FEATURE_SPLPAR) |
235 | vpa_init(boot_cpuid); | 235 | vpa_init(boot_cpuid); |
236 | 236 | ||
237 | /* Choose an idle loop */ | 237 | /* Choose an idle loop */ |
238 | if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) { | 238 | if (ppc64_firmware_features & FW_FEATURE_SPLPAR) { |
239 | if (get_paca()->lppaca.shared_proc) { | 239 | if (get_paca()->lppaca.shared_proc) { |
240 | printk(KERN_INFO "Using shared processor idle loop\n"); | 240 | printk(KERN_INFO "Using shared processor idle loop\n"); |
241 | ppc_md.idle_loop = pseries_shared_idle; | 241 | ppc_md.idle_loop = pseries_shared_idle; |
@@ -260,7 +260,7 @@ static int __init pSeries_init_panel(void) | |||
260 | arch_initcall(pSeries_init_panel); | 260 | arch_initcall(pSeries_init_panel); |
261 | 261 | ||
262 | 262 | ||
263 | /* Build up the firmware_features bitmask field | 263 | /* Build up the ppc64_firmware_features bitmask field |
264 | * using contents of device-tree/ibm,hypertas-functions. | 264 | * using contents of device-tree/ibm,hypertas-functions. |
265 | * Ultimately this functionality may be moved into prom.c prom_init(). | 265 | * Ultimately this functionality may be moved into prom.c prom_init(). |
266 | */ | 266 | */ |
@@ -272,7 +272,7 @@ void __init fw_feature_init(void) | |||
272 | 272 | ||
273 | DBG(" -> fw_feature_init()\n"); | 273 | DBG(" -> fw_feature_init()\n"); |
274 | 274 | ||
275 | cur_cpu_spec->firmware_features = 0; | 275 | ppc64_firmware_features = 0; |
276 | dn = of_find_node_by_path("/rtas"); | 276 | dn = of_find_node_by_path("/rtas"); |
277 | if (dn == NULL) { | 277 | if (dn == NULL) { |
278 | printk(KERN_ERR "WARNING ! Cannot find RTAS in device-tree !\n"); | 278 | printk(KERN_ERR "WARNING ! Cannot find RTAS in device-tree !\n"); |
@@ -288,7 +288,7 @@ void __init fw_feature_init(void) | |||
288 | if ((firmware_features_table[i].name) && | 288 | if ((firmware_features_table[i].name) && |
289 | (strcmp(firmware_features_table[i].name,hypertas))==0) { | 289 | (strcmp(firmware_features_table[i].name,hypertas))==0) { |
290 | /* we have a match */ | 290 | /* we have a match */ |
291 | cur_cpu_spec->firmware_features |= | 291 | ppc64_firmware_features |= |
292 | (firmware_features_table[i].val); | 292 | (firmware_features_table[i].val); |
293 | break; | 293 | break; |
294 | } | 294 | } |
@@ -302,7 +302,7 @@ void __init fw_feature_init(void) | |||
302 | of_node_put(dn); | 302 | of_node_put(dn); |
303 | no_rtas: | 303 | no_rtas: |
304 | printk(KERN_INFO "firmware_features = 0x%lx\n", | 304 | printk(KERN_INFO "firmware_features = 0x%lx\n", |
305 | cur_cpu_spec->firmware_features); | 305 | ppc64_firmware_features); |
306 | 306 | ||
307 | DBG(" <- fw_feature_init()\n"); | 307 | DBG(" <- fw_feature_init()\n"); |
308 | } | 308 | } |
diff --git a/arch/ppc64/kernel/pSeries_smp.c b/arch/ppc64/kernel/pSeries_smp.c index 62c55a123560..8312d324aaae 100644 --- a/arch/ppc64/kernel/pSeries_smp.c +++ b/arch/ppc64/kernel/pSeries_smp.c | |||
@@ -326,7 +326,7 @@ static void __devinit smp_xics_setup_cpu(int cpu) | |||
326 | if (cpu != boot_cpuid) | 326 | if (cpu != boot_cpuid) |
327 | xics_setup_cpu(); | 327 | xics_setup_cpu(); |
328 | 328 | ||
329 | if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) | 329 | if (ppc64_firmware_features & FW_FEATURE_SPLPAR) |
330 | vpa_init(cpu); | 330 | vpa_init(cpu); |
331 | 331 | ||
332 | cpu_clear(cpu, of_spin_map); | 332 | cpu_clear(cpu, of_spin_map); |
diff --git a/arch/ppc64/kernel/process.c b/arch/ppc64/kernel/process.c index f7cae05e40fb..390f434283af 100644 --- a/arch/ppc64/kernel/process.c +++ b/arch/ppc64/kernel/process.c | |||
@@ -206,7 +206,7 @@ struct task_struct *__switch_to(struct task_struct *prev, | |||
206 | /* purr is nothing but processor time base */ | 206 | /* purr is nothing but processor time base */ |
207 | 207 | ||
208 | #if defined(CONFIG_PPC_PSERIES) | 208 | #if defined(CONFIG_PPC_PSERIES) |
209 | if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) { | 209 | if (ppc64_firmware_features & FW_FEATURE_SPLPAR) { |
210 | struct cpu_usage *cu = &__get_cpu_var(cpu_usage_array); | 210 | struct cpu_usage *cu = &__get_cpu_var(cpu_usage_array); |
211 | long unsigned start_tb, current_tb; | 211 | long unsigned start_tb, current_tb; |
212 | start_tb = old_thread->start_tb; | 212 | start_tb = old_thread->start_tb; |
diff --git a/arch/ppc64/kernel/sysfs.c b/arch/ppc64/kernel/sysfs.c index 02b8ac4e0168..90b653c724fa 100644 --- a/arch/ppc64/kernel/sysfs.c +++ b/arch/ppc64/kernel/sysfs.c | |||
@@ -154,7 +154,7 @@ void ppc64_enable_pmcs(void) | |||
154 | 154 | ||
155 | #ifdef CONFIG_PPC_PSERIES | 155 | #ifdef CONFIG_PPC_PSERIES |
156 | /* instruct hypervisor to maintain PMCs */ | 156 | /* instruct hypervisor to maintain PMCs */ |
157 | if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) | 157 | if (ppc64_firmware_features & FW_FEATURE_SPLPAR) |
158 | get_paca()->lppaca.pmcregs_in_use = 1; | 158 | get_paca()->lppaca.pmcregs_in_use = 1; |
159 | #endif /* CONFIG_PPC_PSERIES */ | 159 | #endif /* CONFIG_PPC_PSERIES */ |
160 | } | 160 | } |
diff --git a/arch/ppc64/kernel/time.c b/arch/ppc64/kernel/time.c index 909462e1adea..1c05cee05315 100644 --- a/arch/ppc64/kernel/time.c +++ b/arch/ppc64/kernel/time.c | |||
@@ -372,7 +372,7 @@ int timer_interrupt(struct pt_regs * regs) | |||
372 | 372 | ||
373 | /* collect purr register values often, for accurate calculations */ | 373 | /* collect purr register values often, for accurate calculations */ |
374 | #if defined(CONFIG_PPC_PSERIES) | 374 | #if defined(CONFIG_PPC_PSERIES) |
375 | if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) { | 375 | if (ppc64_firmware_features & FW_FEATURE_SPLPAR) { |
376 | struct cpu_usage *cu = &__get_cpu_var(cpu_usage_array); | 376 | struct cpu_usage *cu = &__get_cpu_var(cpu_usage_array); |
377 | cu->current_tb = mfspr(SPRN_PURR); | 377 | cu->current_tb = mfspr(SPRN_PURR); |
378 | } | 378 | } |