Commit 457931de3b0925dc2eb941bc7d611a509be36dff

Authored by David S. Miller
1 parent 4e3533d05b

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>

Showing 5 changed files with 15 additions and 12 deletions Side-by-side Diff

drivers/serial/suncore.c
... ... @@ -77,23 +77,24 @@
77 77 }
78 78 EXPORT_SYMBOL(sunserial_console_match);
79 79  
80   -void
81   -sunserial_console_termios(struct console *con)
  80 +void sunserial_console_termios(struct console *con, struct device_node *uart_dp)
82 81 {
83   - struct device_node *dp;
84   - const char *od, *mode, *s;
  82 + const char *mode, *s;
85 83 char mode_prop[] = "ttyX-mode";
86 84 int baud, bits, stop, cflag;
87 85 char parity;
88 86  
89   - dp = of_find_node_by_path("/options");
90   - od = of_get_property(dp, "output-device", NULL);
91   - if (!strcmp(od, "rsc")) {
92   - mode = of_get_property(of_console_device,
  87 + if (!strcmp(uart_dp->name, "rsc") ||
  88 + !strcmp(uart_dp->name, "rsc-console") ||
  89 + !strcmp(uart_dp->name, "rsc-control")) {
  90 + mode = of_get_property(uart_dp,
93 91 "ssp-console-modes", NULL);
94 92 if (!mode)
95 93 mode = "115200,8,n,1,-";
  94 + } else if (!strcmp(uart_dp->name, "lom-console")) {
  95 + mode = "9600,8,n,1,-";
96 96 } else {
  97 + struct device_node *dp;
97 98 char c;
98 99  
99 100 c = 'a';
... ... @@ -102,6 +103,7 @@
102 103  
103 104 mode_prop[3] = c;
104 105  
  106 + dp = of_find_node_by_path("/options");
105 107 mode = of_get_property(dp, mode_prop, NULL);
106 108 if (!mode)
107 109 mode = "9600,8,n,1,-";
drivers/serial/suncore.h
... ... @@ -27,7 +27,8 @@
27 27  
28 28 extern int sunserial_console_match(struct console *, struct device_node *,
29 29 struct uart_driver *, int, bool);
30   -extern void sunserial_console_termios(struct console *);
  30 +extern void sunserial_console_termios(struct console *,
  31 + struct device_node *);
31 32  
32 33 #endif /* !(_SERIAL_SUN_H) */
drivers/serial/sunhv.c
... ... @@ -566,7 +566,7 @@
566 566 goto out_free_con_read_page;
567 567  
568 568 sunserial_console_match(&sunhv_console, op->node,
569   - &sunhv_reg, port->line);
  569 + &sunhv_reg, port->line, false);
570 570  
571 571 err = uart_add_one_port(&sunhv_reg, port);
572 572 if (err)
drivers/serial/sunsab.c
... ... @@ -883,7 +883,7 @@
883 883 printk("Console: ttyS%d (SAB82532)\n",
884 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 888 switch (con->cflag & CBAUD) {
889 889 case B150: baud = 150; break;
drivers/serial/sunzilog.c
... ... @@ -1180,7 +1180,7 @@
1180 1180 (sunzilog_reg.minor - 64) + con->index, con->index);
1181 1181  
1182 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 1185 /* Firmware console speed is limited to 150-->38400 baud so
1186 1186 * this hackish cflag thing is OK.