aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/setup_32.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc/kernel/setup_32.c')
-rw-r--r--arch/sparc/kernel/setup_32.c87
1 files changed, 12 insertions, 75 deletions
diff --git a/arch/sparc/kernel/setup_32.c b/arch/sparc/kernel/setup_32.c
index 7b8b76c9557f..3609bdee9ed2 100644
--- a/arch/sparc/kernel/setup_32.c
+++ b/arch/sparc/kernel/setup_32.c
@@ -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. */
104unsigned long cmdline_memory_size __initdata = 0; 104unsigned long cmdline_memory_size __initdata = 0;
105 105
106/* which CPU booted us (0xff = not set) */
107unsigned char boot_cpu_id = 0xff; /* 0xff will make it into DATA section... */
108unsigned char boot_cpu_id4; /* boot_cpu_id << 2 */
109
106static void 110static void
107prom_console_write(struct console *con, const char *s, unsigned n) 111prom_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
112static struct console prom_debug_console = { 116static 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);
@@ -215,6 +218,10 @@ void __init setup_arch(char **cmdline_p)
215 strcpy(boot_command_line, *cmdline_p); 218 strcpy(boot_command_line, *cmdline_p);
216 parse_early_param(); 219 parse_early_param();
217 220
221 boot_flags_init(*cmdline_p);
222
223 register_console(&prom_early_console);
224
218 /* Set sparc_cpu_model */ 225 /* Set sparc_cpu_model */
219 sparc_cpu_model = sun_unknown; 226 sparc_cpu_model = sun_unknown;
220 if (!strcmp(&cputypval[0], "sun4 ")) 227 if (!strcmp(&cputypval[0], "sun4 "))
@@ -265,7 +272,6 @@ void __init setup_arch(char **cmdline_p)
265#ifdef CONFIG_DUMMY_CONSOLE 272#ifdef CONFIG_DUMMY_CONSOLE
266 conswitchp = &dummy_con; 273 conswitchp = &dummy_con;
267#endif 274#endif
268 boot_flags_init(*cmdline_p);
269 275
270 idprom_init(); 276 idprom_init();
271 if (ARCH_SUN4C) 277 if (ARCH_SUN4C)
@@ -311,75 +317,6 @@ void __init setup_arch(char **cmdline_p)
311 smp_setup_cpu_possible_map(); 317 smp_setup_cpu_possible_map();
312} 318}
313 319
314static int ncpus_probed;
315
316static int show_cpuinfo(struct seq_file *m, void *__unused)
317{
318 seq_printf(m,
319 "cpu\t\t: %s\n"
320 "fpu\t\t: %s\n"
321 "promlib\t\t: Version %d Revision %d\n"
322 "prom\t\t: %d.%d\n"
323 "type\t\t: %s\n"
324 "ncpus probed\t: %d\n"
325 "ncpus active\t: %d\n"
326#ifndef CONFIG_SMP
327 "CPU0Bogo\t: %lu.%02lu\n"
328 "CPU0ClkTck\t: %ld\n"
329#endif
330 ,
331 sparc_cpu_type,
332 sparc_fpu_type ,
333 romvec->pv_romvers,
334 prom_rev,
335 romvec->pv_printrev >> 16,
336 romvec->pv_printrev & 0xffff,
337 &cputypval[0],
338 ncpus_probed,
339 num_online_cpus()
340#ifndef CONFIG_SMP
341 , cpu_data(0).udelay_val/(500000/HZ),
342 (cpu_data(0).udelay_val/(5000/HZ)) % 100,
343 cpu_data(0).clock_tick
344#endif
345 );
346
347#ifdef CONFIG_SMP
348 smp_bogo(m);
349#endif
350 mmu_info(m);
351#ifdef CONFIG_SMP
352 smp_info(m);
353#endif
354 return 0;
355}
356
357static void *c_start(struct seq_file *m, loff_t *pos)
358{
359 /* The pointer we are returning is arbitrary,
360 * it just has to be non-NULL and not IS_ERR
361 * in the success case.
362 */
363 return *pos == 0 ? &c_start : NULL;
364}
365
366static void *c_next(struct seq_file *m, void *v, loff_t *pos)
367{
368 ++*pos;
369 return c_start(m, pos);
370}
371
372static void c_stop(struct seq_file *m, void *v)
373{
374}
375
376const struct seq_operations cpuinfo_op = {
377 .start =c_start,
378 .next = c_next,
379 .stop = c_stop,
380 .show = show_cpuinfo,
381};
382
383extern int stop_a_enabled; 320extern int stop_a_enabled;
384 321
385void sun_do_break(void) 322void sun_do_break(void)