diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2010-01-29 00:18:56 -0500 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2010-02-09 10:32:36 -0500 |
commit | 580537140568caddbc8a727d4c2f238d38707f68 (patch) | |
tree | a5cdd290efc0409efac396749406072ea0a360d0 /arch/microblaze/kernel | |
parent | 0ada0a73120c28cc432bcdbac061781465c2f48f (diff) |
microblaze: remove early_init_dt_scan_cpus() and phyp_dump_*()
Microblaze only has one CPU, it isn't SMP at all. early_init_dt_scan_cpus()
is effectively just a no-op, so remove it.
Microblaze doesn't support hypervisor assisted dump either, so the phyp stuff
can also go.
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Michal Simek <monstr@monstr.eu>
Diffstat (limited to 'arch/microblaze/kernel')
-rw-r--r-- | arch/microblaze/kernel/prom.c | 153 |
1 files changed, 0 insertions, 153 deletions
diff --git a/arch/microblaze/kernel/prom.c b/arch/microblaze/kernel/prom.c index 6eff83a71218..cd158ef5b583 100644 --- a/arch/microblaze/kernel/prom.c +++ b/arch/microblaze/kernel/prom.c | |||
@@ -47,67 +47,6 @@ struct device_node *of_chosen; | |||
47 | 47 | ||
48 | #define early_init_dt_scan_drconf_memory(node) 0 | 48 | #define early_init_dt_scan_drconf_memory(node) 0 |
49 | 49 | ||
50 | static int __init early_init_dt_scan_cpus(unsigned long node, | ||
51 | const char *uname, int depth, | ||
52 | void *data) | ||
53 | { | ||
54 | static int logical_cpuid; | ||
55 | char *type = of_get_flat_dt_prop(node, "device_type", NULL); | ||
56 | const u32 *intserv; | ||
57 | int i, nthreads; | ||
58 | int found = 0; | ||
59 | |||
60 | /* We are scanning "cpu" nodes only */ | ||
61 | if (type == NULL || strcmp(type, "cpu") != 0) | ||
62 | return 0; | ||
63 | |||
64 | /* Get physical cpuid */ | ||
65 | intserv = of_get_flat_dt_prop(node, "reg", NULL); | ||
66 | nthreads = 1; | ||
67 | |||
68 | /* | ||
69 | * Now see if any of these threads match our boot cpu. | ||
70 | * NOTE: This must match the parsing done in smp_setup_cpu_maps. | ||
71 | */ | ||
72 | for (i = 0; i < nthreads; i++) { | ||
73 | /* | ||
74 | * version 2 of the kexec param format adds the phys cpuid of | ||
75 | * booted proc. | ||
76 | */ | ||
77 | if (initial_boot_params && initial_boot_params->version >= 2) { | ||
78 | if (intserv[i] == | ||
79 | initial_boot_params->boot_cpuid_phys) { | ||
80 | found = 1; | ||
81 | break; | ||
82 | } | ||
83 | } else { | ||
84 | /* | ||
85 | * Check if it's the boot-cpu, set it's hw index now, | ||
86 | * unfortunately this format did not support booting | ||
87 | * off secondary threads. | ||
88 | */ | ||
89 | if (of_get_flat_dt_prop(node, | ||
90 | "linux,boot-cpu", NULL) != NULL) { | ||
91 | found = 1; | ||
92 | break; | ||
93 | } | ||
94 | } | ||
95 | |||
96 | #ifdef CONFIG_SMP | ||
97 | /* logical cpu id is always 0 on UP kernels */ | ||
98 | logical_cpuid++; | ||
99 | #endif | ||
100 | } | ||
101 | |||
102 | if (found) { | ||
103 | pr_debug("boot cpu: logical %d physical %d\n", logical_cpuid, | ||
104 | intserv[i]); | ||
105 | boot_cpuid = logical_cpuid; | ||
106 | } | ||
107 | |||
108 | return 0; | ||
109 | } | ||
110 | |||
111 | void __init early_init_dt_scan_chosen_arch(unsigned long node) | 50 | void __init early_init_dt_scan_chosen_arch(unsigned long node) |
112 | { | 51 | { |
113 | /* No Microblaze specific code here */ | 52 | /* No Microblaze specific code here */ |
@@ -163,86 +102,6 @@ static int __init early_init_dt_scan_memory(unsigned long node, | |||
163 | return 0; | 102 | return 0; |
164 | } | 103 | } |
165 | 104 | ||
166 | #ifdef CONFIG_PHYP_DUMP | ||
167 | /** | ||
168 | * phyp_dump_calculate_reserve_size() - reserve variable boot area 5% or arg | ||
169 | * | ||
170 | * Function to find the largest size we need to reserve | ||
171 | * during early boot process. | ||
172 | * | ||
173 | * It either looks for boot param and returns that OR | ||
174 | * returns larger of 256 or 5% rounded down to multiples of 256MB. | ||
175 | * | ||
176 | */ | ||
177 | static inline unsigned long phyp_dump_calculate_reserve_size(void) | ||
178 | { | ||
179 | unsigned long tmp; | ||
180 | |||
181 | if (phyp_dump_info->reserve_bootvar) | ||
182 | return phyp_dump_info->reserve_bootvar; | ||
183 | |||
184 | /* divide by 20 to get 5% of value */ | ||
185 | tmp = lmb_end_of_DRAM(); | ||
186 | do_div(tmp, 20); | ||
187 | |||
188 | /* round it down in multiples of 256 */ | ||
189 | tmp = tmp & ~0x0FFFFFFFUL; | ||
190 | |||
191 | return (tmp > PHYP_DUMP_RMR_END ? tmp : PHYP_DUMP_RMR_END); | ||
192 | } | ||
193 | |||
194 | /** | ||
195 | * phyp_dump_reserve_mem() - reserve all not-yet-dumped mmemory | ||
196 | * | ||
197 | * This routine may reserve memory regions in the kernel only | ||
198 | * if the system is supported and a dump was taken in last | ||
199 | * boot instance or if the hardware is supported and the | ||
200 | * scratch area needs to be setup. In other instances it returns | ||
201 | * without reserving anything. The memory in case of dump being | ||
202 | * active is freed when the dump is collected (by userland tools). | ||
203 | */ | ||
204 | static void __init phyp_dump_reserve_mem(void) | ||
205 | { | ||
206 | unsigned long base, size; | ||
207 | unsigned long variable_reserve_size; | ||
208 | |||
209 | if (!phyp_dump_info->phyp_dump_configured) { | ||
210 | printk(KERN_ERR "Phyp-dump not supported on this hardware\n"); | ||
211 | return; | ||
212 | } | ||
213 | |||
214 | if (!phyp_dump_info->phyp_dump_at_boot) { | ||
215 | printk(KERN_INFO "Phyp-dump disabled at boot time\n"); | ||
216 | return; | ||
217 | } | ||
218 | |||
219 | variable_reserve_size = phyp_dump_calculate_reserve_size(); | ||
220 | |||
221 | if (phyp_dump_info->phyp_dump_is_active) { | ||
222 | /* Reserve *everything* above RMR.Area freed by userland tools*/ | ||
223 | base = variable_reserve_size; | ||
224 | size = lmb_end_of_DRAM() - base; | ||
225 | |||
226 | /* XXX crashed_ram_end is wrong, since it may be beyond | ||
227 | * the memory_limit, it will need to be adjusted. */ | ||
228 | lmb_reserve(base, size); | ||
229 | |||
230 | phyp_dump_info->init_reserve_start = base; | ||
231 | phyp_dump_info->init_reserve_size = size; | ||
232 | } else { | ||
233 | size = phyp_dump_info->cpu_state_size + | ||
234 | phyp_dump_info->hpte_region_size + | ||
235 | variable_reserve_size; | ||
236 | base = lmb_end_of_DRAM() - size; | ||
237 | lmb_reserve(base, size); | ||
238 | phyp_dump_info->init_reserve_start = base; | ||
239 | phyp_dump_info->init_reserve_size = size; | ||
240 | } | ||
241 | } | ||
242 | #else | ||
243 | static inline void __init phyp_dump_reserve_mem(void) {} | ||
244 | #endif /* CONFIG_PHYP_DUMP && CONFIG_PPC_RTAS */ | ||
245 | |||
246 | #ifdef CONFIG_EARLY_PRINTK | 105 | #ifdef CONFIG_EARLY_PRINTK |
247 | /* MS this is Microblaze specifig function */ | 106 | /* MS this is Microblaze specifig function */ |
248 | static int __init early_init_dt_scan_serial(unsigned long node, | 107 | static int __init early_init_dt_scan_serial(unsigned long node, |
@@ -284,11 +143,6 @@ void __init early_init_devtree(void *params) | |||
284 | /* Setup flat device-tree pointer */ | 143 | /* Setup flat device-tree pointer */ |
285 | initial_boot_params = params; | 144 | initial_boot_params = params; |
286 | 145 | ||
287 | #ifdef CONFIG_PHYP_DUMP | ||
288 | /* scan tree to see if dump occured during last boot */ | ||
289 | of_scan_flat_dt(early_init_dt_scan_phyp_dump, NULL); | ||
290 | #endif | ||
291 | |||
292 | /* Retrieve various informations from the /chosen node of the | 146 | /* Retrieve various informations from the /chosen node of the |
293 | * device-tree, including the platform type, initrd location and | 147 | * device-tree, including the platform type, initrd location and |
294 | * size, TCE reserve, and more ... | 148 | * size, TCE reserve, and more ... |
@@ -308,13 +162,6 @@ void __init early_init_devtree(void *params) | |||
308 | 162 | ||
309 | pr_debug("Phys. mem: %lx\n", (unsigned long) lmb_phys_mem_size()); | 163 | pr_debug("Phys. mem: %lx\n", (unsigned long) lmb_phys_mem_size()); |
310 | 164 | ||
311 | pr_debug("Scanning CPUs ...\n"); | ||
312 | |||
313 | /* Retreive CPU related informations from the flat tree | ||
314 | * (altivec support, boot CPU ID, ...) | ||
315 | */ | ||
316 | of_scan_flat_dt(early_init_dt_scan_cpus, NULL); | ||
317 | |||
318 | pr_debug(" <- early_init_devtree()\n"); | 165 | pr_debug(" <- early_init_devtree()\n"); |
319 | } | 166 | } |
320 | 167 | ||