forked from luck/tmp_suning_uos_patched
[MIPS] IP22: Fix serial console detection
From: Kaj-Michael Lang <milang@tal.org> In ip22-setup.c the checks for serial/graphics console logic does not check if ARCS console=g but the machine is using serial console, as it does if no keyboard is attached. This patch adds a check if ConsoleOut is serial. There might also be support for other graphics than Newport soon... Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
This commit is contained in:
parent
c5033d7803
commit
e9feeb207e
@ -56,6 +56,7 @@ extern void ip22_time_init(void) __init;
|
|||||||
void __init plat_setup(void)
|
void __init plat_setup(void)
|
||||||
{
|
{
|
||||||
char *ctype;
|
char *ctype;
|
||||||
|
char *cserial;
|
||||||
|
|
||||||
board_be_init = ip22_be_init;
|
board_be_init = ip22_be_init;
|
||||||
ip22_time_init();
|
ip22_time_init();
|
||||||
@ -81,9 +82,14 @@ void __init plat_setup(void)
|
|||||||
/* ARCS console environment variable is set to "g?" for
|
/* ARCS console environment variable is set to "g?" for
|
||||||
* graphics console, it is set to "d" for the first serial
|
* graphics console, it is set to "d" for the first serial
|
||||||
* line and "d2" for the second serial line.
|
* line and "d2" for the second serial line.
|
||||||
|
*
|
||||||
|
* Need to check if the case is 'g' but no keyboard:
|
||||||
|
* (ConsoleIn/Out = serial)
|
||||||
*/
|
*/
|
||||||
ctype = ArcGetEnvironmentVariable("console");
|
ctype = ArcGetEnvironmentVariable("console");
|
||||||
if (ctype && *ctype == 'd') {
|
cserial = ArcGetEnvironmentVariable("ConsoleOut");
|
||||||
|
|
||||||
|
if ((ctype && *ctype == 'd') || (cserial && *cserial == 's')) {
|
||||||
static char options[8];
|
static char options[8];
|
||||||
char *baud = ArcGetEnvironmentVariable("dbaud");
|
char *baud = ArcGetEnvironmentVariable("dbaud");
|
||||||
if (baud)
|
if (baud)
|
||||||
@ -91,7 +97,7 @@ void __init plat_setup(void)
|
|||||||
add_preferred_console("ttyS", *(ctype + 1) == '2' ? 1 : 0,
|
add_preferred_console("ttyS", *(ctype + 1) == '2' ? 1 : 0,
|
||||||
baud ? options : NULL);
|
baud ? options : NULL);
|
||||||
} else if (!ctype || *ctype != 'g') {
|
} else if (!ctype || *ctype != 'g') {
|
||||||
/* Use ARC if we don't want serial ('d') or Newport ('g'). */
|
/* Use ARC if we don't want serial ('d') or graphics ('g'). */
|
||||||
prom_flags |= PROM_FLAG_USE_AS_CONSOLE;
|
prom_flags |= PROM_FLAG_USE_AS_CONSOLE;
|
||||||
add_preferred_console("arc", 0, NULL);
|
add_preferred_console("arc", 0, NULL);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user