diff options
Diffstat (limited to 'arch/sparc/kernel/setup_32.c')
-rw-r--r-- | arch/sparc/kernel/setup_32.c | 111 |
1 files changed, 23 insertions, 88 deletions
diff --git a/arch/sparc/kernel/setup_32.c b/arch/sparc/kernel/setup_32.c index b22ce6100403..d26e1f6c717a 100644 --- a/arch/sparc/kernel/setup_32.c +++ b/arch/sparc/kernel/setup_32.c | |||
@@ -82,7 +82,7 @@ static void prom_sync_me(void) | |||
82 | "nop\n\t" : : "r" (&trapbase)); | 82 | "nop\n\t" : : "r" (&trapbase)); |
83 | 83 | ||
84 | prom_printf("PROM SYNC COMMAND...\n"); | 84 | prom_printf("PROM SYNC COMMAND...\n"); |
85 | show_free_areas(); | 85 | show_free_areas(0); |
86 | if(current->pid != 0) { | 86 | if(current->pid != 0) { |
87 | local_irq_enable(); | 87 | local_irq_enable(); |
88 | sys_sync(); | 88 | sys_sync(); |
@@ -103,16 +103,20 @@ static unsigned int boot_flags __initdata = 0; | |||
103 | /* Exported for mm/init.c:paging_init. */ | 103 | /* Exported for mm/init.c:paging_init. */ |
104 | unsigned long cmdline_memory_size __initdata = 0; | 104 | unsigned long cmdline_memory_size __initdata = 0; |
105 | 105 | ||
106 | /* which CPU booted us (0xff = not set) */ | ||
107 | unsigned char boot_cpu_id = 0xff; /* 0xff will make it into DATA section... */ | ||
108 | unsigned char boot_cpu_id4; /* boot_cpu_id << 2 */ | ||
109 | |||
106 | static void | 110 | static void |
107 | prom_console_write(struct console *con, const char *s, unsigned n) | 111 | prom_console_write(struct console *con, const char *s, unsigned n) |
108 | { | 112 | { |
109 | prom_write(s, n); | 113 | prom_write(s, n); |
110 | } | 114 | } |
111 | 115 | ||
112 | static struct console prom_debug_console = { | 116 | static struct console prom_early_console = { |
113 | .name = "debug", | 117 | .name = "earlyprom", |
114 | .write = prom_console_write, | 118 | .write = prom_console_write, |
115 | .flags = CON_PRINTBUFFER, | 119 | .flags = CON_PRINTBUFFER | CON_BOOT, |
116 | .index = -1, | 120 | .index = -1, |
117 | }; | 121 | }; |
118 | 122 | ||
@@ -133,8 +137,7 @@ static void __init process_switch(char c) | |||
133 | prom_halt(); | 137 | prom_halt(); |
134 | break; | 138 | break; |
135 | case 'p': | 139 | case 'p': |
136 | /* Use PROM debug console. */ | 140 | /* Just ignore, this behavior is now the default. */ |
137 | register_console(&prom_debug_console); | ||
138 | break; | 141 | break; |
139 | default: | 142 | default: |
140 | printk("Unknown boot switch (-%c)\n", c); | 143 | printk("Unknown boot switch (-%c)\n", c); |
@@ -184,8 +187,6 @@ static void __init boot_flags_init(char *commands) | |||
184 | */ | 187 | */ |
185 | 188 | ||
186 | extern void sun4c_probe_vac(void); | 189 | extern void sun4c_probe_vac(void); |
187 | extern char cputypval; | ||
188 | extern unsigned long start, end; | ||
189 | 190 | ||
190 | extern unsigned short root_flags; | 191 | extern unsigned short root_flags; |
191 | extern unsigned short root_dev; | 192 | extern unsigned short root_dev; |
@@ -210,30 +211,34 @@ void __init setup_arch(char **cmdline_p) | |||
210 | int i; | 211 | int i; |
211 | unsigned long highest_paddr; | 212 | unsigned long highest_paddr; |
212 | 213 | ||
213 | sparc_ttable = (struct tt_entry *) &start; | 214 | sparc_ttable = (struct tt_entry *) &trapbase; |
214 | 215 | ||
215 | /* Initialize PROM console and command line. */ | 216 | /* Initialize PROM console and command line. */ |
216 | *cmdline_p = prom_getbootargs(); | 217 | *cmdline_p = prom_getbootargs(); |
217 | strcpy(boot_command_line, *cmdline_p); | 218 | strcpy(boot_command_line, *cmdline_p); |
218 | parse_early_param(); | 219 | parse_early_param(); |
219 | 220 | ||
221 | boot_flags_init(*cmdline_p); | ||
222 | |||
223 | register_console(&prom_early_console); | ||
224 | |||
220 | /* Set sparc_cpu_model */ | 225 | /* Set sparc_cpu_model */ |
221 | sparc_cpu_model = sun_unknown; | 226 | sparc_cpu_model = sun_unknown; |
222 | if (!strcmp(&cputypval,"sun4 ")) | 227 | if (!strcmp(&cputypval[0], "sun4 ")) |
223 | sparc_cpu_model = sun4; | 228 | sparc_cpu_model = sun4; |
224 | if (!strcmp(&cputypval,"sun4c")) | 229 | if (!strcmp(&cputypval[0], "sun4c")) |
225 | sparc_cpu_model = sun4c; | 230 | sparc_cpu_model = sun4c; |
226 | if (!strcmp(&cputypval,"sun4m")) | 231 | if (!strcmp(&cputypval[0], "sun4m")) |
227 | sparc_cpu_model = sun4m; | 232 | sparc_cpu_model = sun4m; |
228 | if (!strcmp(&cputypval,"sun4s")) | 233 | if (!strcmp(&cputypval[0], "sun4s")) |
229 | sparc_cpu_model = sun4m; /* CP-1200 with PROM 2.30 -E */ | 234 | sparc_cpu_model = sun4m; /* CP-1200 with PROM 2.30 -E */ |
230 | if (!strcmp(&cputypval,"sun4d")) | 235 | if (!strcmp(&cputypval[0], "sun4d")) |
231 | sparc_cpu_model = sun4d; | 236 | sparc_cpu_model = sun4d; |
232 | if (!strcmp(&cputypval,"sun4e")) | 237 | if (!strcmp(&cputypval[0], "sun4e")) |
233 | sparc_cpu_model = sun4e; | 238 | sparc_cpu_model = sun4e; |
234 | if (!strcmp(&cputypval,"sun4u")) | 239 | if (!strcmp(&cputypval[0], "sun4u")) |
235 | sparc_cpu_model = sun4u; | 240 | sparc_cpu_model = sun4u; |
236 | if (!strncmp(&cputypval, "leon" , 4)) | 241 | if (!strncmp(&cputypval[0], "leon" , 4)) |
237 | sparc_cpu_model = sparc_leon; | 242 | sparc_cpu_model = sparc_leon; |
238 | 243 | ||
239 | printk("ARCH: "); | 244 | printk("ARCH: "); |
@@ -262,12 +267,11 @@ void __init setup_arch(char **cmdline_p) | |||
262 | default: | 267 | default: |
263 | printk("UNKNOWN!\n"); | 268 | printk("UNKNOWN!\n"); |
264 | break; | 269 | break; |
265 | }; | 270 | } |
266 | 271 | ||
267 | #ifdef CONFIG_DUMMY_CONSOLE | 272 | #ifdef CONFIG_DUMMY_CONSOLE |
268 | conswitchp = &dummy_con; | 273 | conswitchp = &dummy_con; |
269 | #endif | 274 | #endif |
270 | boot_flags_init(*cmdline_p); | ||
271 | 275 | ||
272 | idprom_init(); | 276 | idprom_init(); |
273 | if (ARCH_SUN4C) | 277 | if (ARCH_SUN4C) |
@@ -313,75 +317,6 @@ void __init setup_arch(char **cmdline_p) | |||
313 | smp_setup_cpu_possible_map(); | 317 | smp_setup_cpu_possible_map(); |
314 | } | 318 | } |
315 | 319 | ||
316 | static int ncpus_probed; | ||
317 | |||
318 | static int show_cpuinfo(struct seq_file *m, void *__unused) | ||
319 | { | ||
320 | seq_printf(m, | ||
321 | "cpu\t\t: %s\n" | ||
322 | "fpu\t\t: %s\n" | ||
323 | "promlib\t\t: Version %d Revision %d\n" | ||
324 | "prom\t\t: %d.%d\n" | ||
325 | "type\t\t: %s\n" | ||
326 | "ncpus probed\t: %d\n" | ||
327 | "ncpus active\t: %d\n" | ||
328 | #ifndef CONFIG_SMP | ||
329 | "CPU0Bogo\t: %lu.%02lu\n" | ||
330 | "CPU0ClkTck\t: %ld\n" | ||
331 | #endif | ||
332 | , | ||
333 | sparc_cpu_type, | ||
334 | sparc_fpu_type , | ||
335 | romvec->pv_romvers, | ||
336 | prom_rev, | ||
337 | romvec->pv_printrev >> 16, | ||
338 | romvec->pv_printrev & 0xffff, | ||
339 | &cputypval, | ||
340 | ncpus_probed, | ||
341 | num_online_cpus() | ||
342 | #ifndef CONFIG_SMP | ||
343 | , cpu_data(0).udelay_val/(500000/HZ), | ||
344 | (cpu_data(0).udelay_val/(5000/HZ)) % 100, | ||
345 | cpu_data(0).clock_tick | ||
346 | #endif | ||
347 | ); | ||
348 | |||
349 | #ifdef CONFIG_SMP | ||
350 | smp_bogo(m); | ||
351 | #endif | ||
352 | mmu_info(m); | ||
353 | #ifdef CONFIG_SMP | ||
354 | smp_info(m); | ||
355 | #endif | ||
356 | return 0; | ||
357 | } | ||
358 | |||
359 | static void *c_start(struct seq_file *m, loff_t *pos) | ||
360 | { | ||
361 | /* The pointer we are returning is arbitrary, | ||
362 | * it just has to be non-NULL and not IS_ERR | ||
363 | * in the success case. | ||
364 | */ | ||
365 | return *pos == 0 ? &c_start : NULL; | ||
366 | } | ||
367 | |||
368 | static void *c_next(struct seq_file *m, void *v, loff_t *pos) | ||
369 | { | ||
370 | ++*pos; | ||
371 | return c_start(m, pos); | ||
372 | } | ||
373 | |||
374 | static void c_stop(struct seq_file *m, void *v) | ||
375 | { | ||
376 | } | ||
377 | |||
378 | const struct seq_operations cpuinfo_op = { | ||
379 | .start =c_start, | ||
380 | .next = c_next, | ||
381 | .stop = c_stop, | ||
382 | .show = show_cpuinfo, | ||
383 | }; | ||
384 | |||
385 | extern int stop_a_enabled; | 320 | extern int stop_a_enabled; |
386 | 321 | ||
387 | void sun_do_break(void) | 322 | void sun_do_break(void) |