aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/sunsab.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2007-07-20 19:59:26 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-07-20 19:59:26 -0400
commitc73fcc846c91f53fd2c67fd9c6c04888a9e5892e (patch)
tree31faa68b4176636756926535a0f50ff780973275 /drivers/serial/sunsab.c
parentede13d81b4dda409a6d271b34b8e2ec9383e255d (diff)
[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.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/drivers/serial/sunsab.c b/drivers/serial/sunsab.c
index 8a0f9e4408d4..bca57bb94939 100644
--- a/drivers/serial/sunsab.c
+++ b/drivers/serial/sunsab.c
@@ -968,22 +968,6 @@ static struct console sunsab_console = {
968 968
969static inline struct console *SUNSAB_CONSOLE(void) 969static inline struct console *SUNSAB_CONSOLE(void)
970{ 970{
971 int i;
972
973 if (con_is_present())
974 return NULL;
975
976 for (i = 0; i < num_channels; i++) {
977 int this_minor = sunsab_reg.minor + i;
978
979 if ((this_minor - 64) == (serial_console - 1))
980 break;
981 }
982 if (i == num_channels)
983 return NULL;
984
985 sunsab_console.index = i;
986
987 return &sunsab_console; 971 return &sunsab_console;
988} 972}
989#else 973#else
@@ -1080,7 +1064,12 @@ static int __devinit sab_probe(struct of_device *op, const struct of_device_id *
1080 return err; 1064 return err;
1081 } 1065 }
1082 1066
1067 sunserial_console_match(SUNSAB_CONSOLE(), op->node,
1068 &sunsab_reg, up[0].port.line);
1083 uart_add_one_port(&sunsab_reg, &up[0].port); 1069 uart_add_one_port(&sunsab_reg, &up[0].port);
1070
1071 sunserial_console_match(SUNSAB_CONSOLE(), op->node,
1072 &sunsab_reg, up[1].port.line);
1084 uart_add_one_port(&sunsab_reg, &up[1].port); 1073 uart_add_one_port(&sunsab_reg, &up[1].port);
1085 1074
1086 dev_set_drvdata(&op->dev, &up[0]); 1075 dev_set_drvdata(&op->dev, &up[0]);
@@ -1164,7 +1153,6 @@ static int __init sunsab_init(void)
1164 } 1153 }
1165 1154
1166 sunsab_reg.tty_driver->name_base = sunsab_reg.minor - 64; 1155 sunsab_reg.tty_driver->name_base = sunsab_reg.minor - 64;
1167 sunsab_reg.cons = SUNSAB_CONSOLE();
1168 sunserial_current_minor += num_channels; 1156 sunserial_current_minor += num_channels;
1169 } 1157 }
1170 1158