aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc/kernel/setup.c')
-rw-r--r--arch/sparc/kernel/setup.c65
1 files changed, 1 insertions, 64 deletions
diff --git a/arch/sparc/kernel/setup.c b/arch/sparc/kernel/setup.c
index 64c0ed98820a..f8228383895a 100644
--- a/arch/sparc/kernel/setup.c
+++ b/arch/sparc/kernel/setup.c
@@ -146,31 +146,6 @@ static void __init process_switch(char c)
146 } 146 }
147} 147}
148 148
149static void __init process_console(char *commands)
150{
151 serial_console = 0;
152 commands += 8;
153 /* Linux-style serial */
154 if (!strncmp(commands, "ttyS", 4))
155 serial_console = simple_strtoul(commands + 4, NULL, 10) + 1;
156 else if (!strncmp(commands, "tty", 3)) {
157 char c = *(commands + 3);
158 /* Solaris-style serial */
159 if (c == 'a' || c == 'b')
160 serial_console = c - 'a' + 1;
161 /* else Linux-style fbcon, not serial */
162 }
163#if defined(CONFIG_PROM_CONSOLE)
164 if (!strncmp(commands, "prom", 4)) {
165 char *p;
166
167 for (p = commands - 8; *p && *p != ' '; p++)
168 *p = ' ';
169 conswitchp = &prom_con;
170 }
171#endif
172}
173
174static void __init boot_flags_init(char *commands) 149static void __init boot_flags_init(char *commands)
175{ 150{
176 while (*commands) { 151 while (*commands) {
@@ -187,9 +162,7 @@ static void __init boot_flags_init(char *commands)
187 process_switch(*commands++); 162 process_switch(*commands++);
188 continue; 163 continue;
189 } 164 }
190 if (!strncmp(commands, "console=", 8)) { 165 if (!strncmp(commands, "mem=", 4)) {
191 process_console(commands);
192 } else if (!strncmp(commands, "mem=", 4)) {
193 /* 166 /*
194 * "mem=XXX[kKmM] overrides the PROM-reported 167 * "mem=XXX[kKmM] overrides the PROM-reported
195 * memory size. 168 * memory size.
@@ -341,41 +314,6 @@ void __init setup_arch(char **cmdline_p)
341 smp_setup_cpu_possible_map(); 314 smp_setup_cpu_possible_map();
342} 315}
343 316
344static int __init set_preferred_console(void)
345{
346 int idev, odev;
347
348 /* The user has requested a console so this is already set up. */
349 if (serial_console >= 0)
350 return -EBUSY;
351
352 idev = prom_query_input_device();
353 odev = prom_query_output_device();
354 if (idev == PROMDEV_IKBD && odev == PROMDEV_OSCREEN) {
355 serial_console = 0;
356 } else if (idev == PROMDEV_ITTYA && odev == PROMDEV_OTTYA) {
357 serial_console = 1;
358 } else if (idev == PROMDEV_ITTYB && odev == PROMDEV_OTTYB) {
359 serial_console = 2;
360 } else if (idev == PROMDEV_I_UNK && odev == PROMDEV_OTTYA) {
361 prom_printf("MrCoffee ttya\n");
362 serial_console = 1;
363 } else if (idev == PROMDEV_I_UNK && odev == PROMDEV_OSCREEN) {
364 serial_console = 0;
365 prom_printf("MrCoffee keyboard\n");
366 } else {
367 prom_printf("Confusing console (idev %d, odev %d)\n",
368 idev, odev);
369 serial_console = 1;
370 }
371
372 if (serial_console)
373 return add_preferred_console("ttyS", serial_console - 1, NULL);
374
375 return -ENODEV;
376}
377console_initcall(set_preferred_console);
378
379extern char *sparc_cpu_type; 317extern char *sparc_cpu_type;
380extern char *sparc_fpu_type; 318extern char *sparc_fpu_type;
381 319
@@ -461,7 +399,6 @@ void sun_do_break(void)
461 prom_cmdline(); 399 prom_cmdline();
462} 400}
463 401
464int serial_console = -1;
465int stop_a_enabled = 1; 402int stop_a_enabled = 1;
466 403
467static int __init topology_init(void) 404static int __init topology_init(void)