diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2007-07-20 16:59:26 -0700 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-07-20 16:59:26 -0700 |
commit | c73fcc846c91f53fd2c67fd9c6c04888a9e5892e (patch) | |
tree | 31faa68b4176636756926535a0f50ff780973275 /drivers/serial/sunsab.c | |
parent | ede13d81b4dda409a6d271b34b8e2ec9383e255d (diff) | |
download | op-kernel-dev-c73fcc846c91f53fd2c67fd9c6c04888a9e5892e.zip op-kernel-dev-c73fcc846c91f53fd2c67fd9c6c04888a9e5892e.tar.gz |
[SPARC]: Fix serial console device detection.
The current scheme works on static interpretation of text names, which
is wrong.
The output-device setting, for example, must be resolved via an alias
or similar to a full path name to the console device.
Paths also contain an optional set of 'options', which starts with a
colon at the end of the path. The option area is used to specify
which of two serial ports ('a' or 'b') the path refers to when a
device node drives multiple ports. 'a' is assumed if the option
specification is missing.
This was caught by the UltraSPARC-T1 simulator. The 'output-device'
property was set to 'ttya' and we didn't pick upon the fact that this
is an OBP alias set to '/virtual-devices/console'. Instead we saw it
as the first serial console device, instead of the hypervisor console.
The infrastructure is now there to take advantage of this to resolve
the console correctly even in multi-head situations in fbcon too.
Thanks to Greg Onufer for the bug report.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/serial/sunsab.c')
-rw-r--r-- | drivers/serial/sunsab.c | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/drivers/serial/sunsab.c b/drivers/serial/sunsab.c index 8a0f9e4..bca57bb 100644 --- a/drivers/serial/sunsab.c +++ b/drivers/serial/sunsab.c @@ -968,22 +968,6 @@ static struct console sunsab_console = { static inline struct console *SUNSAB_CONSOLE(void) { - int i; - - if (con_is_present()) - return NULL; - - for (i = 0; i < num_channels; i++) { - int this_minor = sunsab_reg.minor + i; - - if ((this_minor - 64) == (serial_console - 1)) - break; - } - if (i == num_channels) - return NULL; - - sunsab_console.index = i; - return &sunsab_console; } #else @@ -1080,7 +1064,12 @@ static int __devinit sab_probe(struct of_device *op, const struct of_device_id * return err; } + sunserial_console_match(SUNSAB_CONSOLE(), op->node, + &sunsab_reg, up[0].port.line); uart_add_one_port(&sunsab_reg, &up[0].port); + + sunserial_console_match(SUNSAB_CONSOLE(), op->node, + &sunsab_reg, up[1].port.line); uart_add_one_port(&sunsab_reg, &up[1].port); dev_set_drvdata(&op->dev, &up[0]); @@ -1164,7 +1153,6 @@ static int __init sunsab_init(void) } sunsab_reg.tty_driver->name_base = sunsab_reg.minor - 64; - sunsab_reg.cons = SUNSAB_CONSOLE(); sunserial_current_minor += num_channels; } |