aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-11-24 17:09:56 -0500
committerDavid S. Miller <davem@davemloft.net>2009-11-24 17:09:56 -0500
commit457931de3b0925dc2eb941bc7d611a509be36dff (patch)
tree64e30c8b02e02b2004dcc9757545db437b2eff71
parent4e3533d05b6e5e66d1cda27f6671251c99c62894 (diff)
serial: suncore: Fix RSC/LOM handling in sunserial_console_termios().
RSC and LOM devices have fixed speed settings. We already had some code to match and handle "rsc" named devices on E250 systems, but we also have to handle 'rsc-console', 'rsc-control', and 'lom-console'. Also, in order to get this right regardless of what 'output-device' happens to be, explicitly pass the UART device node pointer to this routine. Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/serial/suncore.c18
-rw-r--r--drivers/serial/suncore.h3
-rw-r--r--drivers/serial/sunhv.c2
-rw-r--r--drivers/serial/sunsab.c2
-rw-r--r--drivers/serial/sunzilog.c2
5 files changed, 15 insertions, 12 deletions
diff --git a/drivers/serial/suncore.c b/drivers/serial/suncore.c
index 50d3b5e4ec73..ed7d958b0a01 100644
--- a/drivers/serial/suncore.c
+++ b/drivers/serial/suncore.c
@@ -77,23 +77,24 @@ int sunserial_console_match(struct console *con, struct device_node *dp,
77} 77}
78EXPORT_SYMBOL(sunserial_console_match); 78EXPORT_SYMBOL(sunserial_console_match);
79 79
80void 80void sunserial_console_termios(struct console *con, struct device_node *uart_dp)
81sunserial_console_termios(struct console *con)
82{ 81{
83 struct device_node *dp; 82 const char *mode, *s;
84 const char *od, *mode, *s;
85 char mode_prop[] = "ttyX-mode"; 83 char mode_prop[] = "ttyX-mode";
86 int baud, bits, stop, cflag; 84 int baud, bits, stop, cflag;
87 char parity; 85 char parity;
88 86
89 dp = of_find_node_by_path("/options"); 87 if (!strcmp(uart_dp->name, "rsc") ||
90 od = of_get_property(dp, "output-device", NULL); 88 !strcmp(uart_dp->name, "rsc-console") ||
91 if (!strcmp(od, "rsc")) { 89 !strcmp(uart_dp->name, "rsc-control")) {
92 mode = of_get_property(of_console_device, 90 mode = of_get_property(uart_dp,
93 "ssp-console-modes", NULL); 91 "ssp-console-modes", NULL);
94 if (!mode) 92 if (!mode)
95 mode = "115200,8,n,1,-"; 93 mode = "115200,8,n,1,-";
94 } else if (!strcmp(uart_dp->name, "lom-console")) {
95 mode = "9600,8,n,1,-";
96 } else { 96 } else {
97 struct device_node *dp;
97 char c; 98 char c;
98 99
99 c = 'a'; 100 c = 'a';
@@ -102,6 +103,7 @@ sunserial_console_termios(struct console *con)
102 103
103 mode_prop[3] = c; 104 mode_prop[3] = c;
104 105
106 dp = of_find_node_by_path("/options");
105 mode = of_get_property(dp, mode_prop, NULL); 107 mode = of_get_property(dp, mode_prop, NULL);
106 if (!mode) 108 if (!mode)
107 mode = "9600,8,n,1,-"; 109 mode = "9600,8,n,1,-";
diff --git a/drivers/serial/suncore.h b/drivers/serial/suncore.h
index cab95b3fbddc..db2057936c31 100644
--- a/drivers/serial/suncore.h
+++ b/drivers/serial/suncore.h
@@ -27,6 +27,7 @@ extern void sunserial_unregister_minors(struct uart_driver *, int);
27 27
28extern int sunserial_console_match(struct console *, struct device_node *, 28extern int sunserial_console_match(struct console *, struct device_node *,
29 struct uart_driver *, int, bool); 29 struct uart_driver *, int, bool);
30extern void sunserial_console_termios(struct console *); 30extern void sunserial_console_termios(struct console *,
31 struct device_node *);
31 32
32#endif /* !(_SERIAL_SUN_H) */ 33#endif /* !(_SERIAL_SUN_H) */
diff --git a/drivers/serial/sunhv.c b/drivers/serial/sunhv.c
index d548652dee50..d14cca7fb88d 100644
--- a/drivers/serial/sunhv.c
+++ b/drivers/serial/sunhv.c
@@ -566,7 +566,7 @@ static int __devinit hv_probe(struct of_device *op, const struct of_device_id *m
566 goto out_free_con_read_page; 566 goto out_free_con_read_page;
567 567
568 sunserial_console_match(&sunhv_console, op->node, 568 sunserial_console_match(&sunhv_console, op->node,
569 &sunhv_reg, port->line); 569 &sunhv_reg, port->line, false);
570 570
571 err = uart_add_one_port(&sunhv_reg, port); 571 err = uart_add_one_port(&sunhv_reg, port);
572 if (err) 572 if (err)
diff --git a/drivers/serial/sunsab.c b/drivers/serial/sunsab.c
index e7215c200ecd..d514e28d0755 100644
--- a/drivers/serial/sunsab.c
+++ b/drivers/serial/sunsab.c
@@ -883,7 +883,7 @@ static int sunsab_console_setup(struct console *con, char *options)
883 printk("Console: ttyS%d (SAB82532)\n", 883 printk("Console: ttyS%d (SAB82532)\n",
884 (sunsab_reg.minor - 64) + con->index); 884 (sunsab_reg.minor - 64) + con->index);
885 885
886 sunserial_console_termios(con); 886 sunserial_console_termios(con, to_of_device(up->port.dev)->node);
887 887
888 switch (con->cflag & CBAUD) { 888 switch (con->cflag & CBAUD) {
889 case B150: baud = 150; break; 889 case B150: baud = 150; break;
diff --git a/drivers/serial/sunzilog.c b/drivers/serial/sunzilog.c
index 3242688978e5..2c7a66af4f52 100644
--- a/drivers/serial/sunzilog.c
+++ b/drivers/serial/sunzilog.c
@@ -1180,7 +1180,7 @@ static int __init sunzilog_console_setup(struct console *con, char *options)
1180 (sunzilog_reg.minor - 64) + con->index, con->index); 1180 (sunzilog_reg.minor - 64) + con->index, con->index);
1181 1181
1182 /* Get firmware console settings. */ 1182 /* Get firmware console settings. */
1183 sunserial_console_termios(con); 1183 sunserial_console_termios(con, to_of_device(up->port.dev)->node);
1184 1184
1185 /* Firmware console speed is limited to 150-->38400 baud so 1185 /* Firmware console speed is limited to 150-->38400 baud so
1186 * this hackish cflag thing is OK. 1186 * this hackish cflag thing is OK.