Commit 7c0e6555 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] console autodetection for pmac

From: Olaf Hering <olh@suse.de>

This one allows console autodetection for powermacs.
parent 9b19f4f0
...@@ -476,6 +476,7 @@ static int __init set_preferred_console(void) ...@@ -476,6 +476,7 @@ static int __init set_preferred_console(void)
{ {
struct device_node *prom_stdout; struct device_node *prom_stdout;
char *name; char *name;
int offset;
/* The user has requested a console so this is already set up. */ /* The user has requested a console so this is already set up. */
if (strstr(saved_command_line, "console=")) if (strstr(saved_command_line, "console="))
...@@ -493,7 +494,6 @@ static int __init set_preferred_console(void) ...@@ -493,7 +494,6 @@ static int __init set_preferred_console(void)
int i; int i;
u32 *reg = (u32 *)get_property(prom_stdout, "reg", &i); u32 *reg = (u32 *)get_property(prom_stdout, "reg", &i);
if (i > 8) { if (i > 8) {
int offset;
switch (reg[1]) { switch (reg[1]) {
case 0x3f8: case 0x3f8:
offset = 0; offset = 0;
...@@ -511,15 +511,19 @@ static int __init set_preferred_console(void) ...@@ -511,15 +511,19 @@ static int __init set_preferred_console(void)
/* We dont recognise the serial port */ /* We dont recognise the serial port */
return -ENODEV; return -ENODEV;
} }
return add_preferred_console("ttyS", offset, NULL);
} }
} else if (strcmp(name, "vty") == 0) { } else if (strcmp(name, "vty") == 0)
/* pSeries LPAR virtual console */ /* pSeries LPAR virtual console */
return add_preferred_console("hvc", 0, NULL); return add_preferred_console("hvc", 0, NULL);
} else if (strcmp(name, "ch-a") == 0)
offset = 0;
else if (strcmp(name, "ch-b") == 0)
offset = 1;
else
return -ENODEV; return -ENODEV;
return add_preferred_console("ttyS", offset, NULL);
} }
console_initcall(set_preferred_console); console_initcall(set_preferred_console);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment