diff options
Diffstat (limited to 'drivers/serial/sh-sci.c')
-rw-r--r-- | drivers/serial/sh-sci.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c index 557b54ab2f25..d3ccce0bfd44 100644 --- a/drivers/serial/sh-sci.c +++ b/drivers/serial/sh-sci.c | |||
@@ -139,7 +139,7 @@ static void sci_poll_put_char(struct uart_port *port, unsigned char c) | |||
139 | } while (!(status & SCxSR_TDxE(port))); | 139 | } while (!(status & SCxSR_TDxE(port))); |
140 | 140 | ||
141 | sci_in(port, SCxSR); /* Dummy read */ | 141 | sci_in(port, SCxSR); /* Dummy read */ |
142 | sci_out(port, SCxSR, SCxSR_TDxE_CLEAR(port)); | 142 | sci_out(port, SCxSR, SCxSR_TDxE_CLEAR(port) & ~SCxSR_TEND(port)); |
143 | sci_out(port, SCxTDR, c); | 143 | sci_out(port, SCxTDR, c); |
144 | } | 144 | } |
145 | #endif /* CONFIG_CONSOLE_POLL || CONFIG_SERIAL_SH_SCI_CONSOLE */ | 145 | #endif /* CONFIG_CONSOLE_POLL || CONFIG_SERIAL_SH_SCI_CONSOLE */ |
@@ -1095,6 +1095,7 @@ static void serial_console_write(struct console *co, const char *s, | |||
1095 | unsigned count) | 1095 | unsigned count) |
1096 | { | 1096 | { |
1097 | struct uart_port *port = &serial_console_port->port; | 1097 | struct uart_port *port = &serial_console_port->port; |
1098 | unsigned short bits; | ||
1098 | int i; | 1099 | int i; |
1099 | 1100 | ||
1100 | for (i = 0; i < count; i++) { | 1101 | for (i = 0; i < count; i++) { |
@@ -1103,6 +1104,11 @@ static void serial_console_write(struct console *co, const char *s, | |||
1103 | 1104 | ||
1104 | sci_poll_put_char(port, *s++); | 1105 | sci_poll_put_char(port, *s++); |
1105 | } | 1106 | } |
1107 | |||
1108 | /* wait until fifo is empty and last bit has been transmitted */ | ||
1109 | bits = SCxSR_TDxE(port) | SCxSR_TEND(port); | ||
1110 | while ((sci_in(port, SCxSR) & bits) != bits) | ||
1111 | cpu_relax(); | ||
1106 | } | 1112 | } |
1107 | 1113 | ||
1108 | static int __init serial_console_setup(struct console *co, char *options) | 1114 | static int __init serial_console_setup(struct console *co, char *options) |