diff options
Diffstat (limited to 'drivers/serial/sh-sci.c')
-rw-r--r-- | drivers/serial/sh-sci.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c index 557b54ab2f25..dbf5357a77b3 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 */ |
@@ -263,6 +263,7 @@ static inline void sci_init_pins(struct uart_port *port, unsigned int cflag) | |||
263 | #elif defined(CONFIG_CPU_SUBTYPE_SH7763) || \ | 263 | #elif defined(CONFIG_CPU_SUBTYPE_SH7763) || \ |
264 | defined(CONFIG_CPU_SUBTYPE_SH7780) || \ | 264 | defined(CONFIG_CPU_SUBTYPE_SH7780) || \ |
265 | defined(CONFIG_CPU_SUBTYPE_SH7785) || \ | 265 | defined(CONFIG_CPU_SUBTYPE_SH7785) || \ |
266 | defined(CONFIG_CPU_SUBTYPE_SH7786) || \ | ||
266 | defined(CONFIG_CPU_SUBTYPE_SHX3) | 267 | defined(CONFIG_CPU_SUBTYPE_SHX3) |
267 | static inline void sci_init_pins(struct uart_port *port, unsigned int cflag) | 268 | static inline void sci_init_pins(struct uart_port *port, unsigned int cflag) |
268 | { | 269 | { |
@@ -284,7 +285,8 @@ static inline void sci_init_pins(struct uart_port *port, unsigned int cflag) | |||
284 | 285 | ||
285 | #if defined(CONFIG_CPU_SUBTYPE_SH7760) || \ | 286 | #if defined(CONFIG_CPU_SUBTYPE_SH7760) || \ |
286 | defined(CONFIG_CPU_SUBTYPE_SH7780) || \ | 287 | defined(CONFIG_CPU_SUBTYPE_SH7780) || \ |
287 | defined(CONFIG_CPU_SUBTYPE_SH7785) | 288 | defined(CONFIG_CPU_SUBTYPE_SH7785) || \ |
289 | defined(CONFIG_CPU_SUBTYPE_SH7786) | ||
288 | static inline int scif_txroom(struct uart_port *port) | 290 | static inline int scif_txroom(struct uart_port *port) |
289 | { | 291 | { |
290 | return SCIF_TXROOM_MAX - (sci_in(port, SCTFDR) & 0xff); | 292 | return SCIF_TXROOM_MAX - (sci_in(port, SCTFDR) & 0xff); |
@@ -1095,6 +1097,7 @@ static void serial_console_write(struct console *co, const char *s, | |||
1095 | unsigned count) | 1097 | unsigned count) |
1096 | { | 1098 | { |
1097 | struct uart_port *port = &serial_console_port->port; | 1099 | struct uart_port *port = &serial_console_port->port; |
1100 | unsigned short bits; | ||
1098 | int i; | 1101 | int i; |
1099 | 1102 | ||
1100 | for (i = 0; i < count; i++) { | 1103 | for (i = 0; i < count; i++) { |
@@ -1103,6 +1106,11 @@ static void serial_console_write(struct console *co, const char *s, | |||
1103 | 1106 | ||
1104 | sci_poll_put_char(port, *s++); | 1107 | sci_poll_put_char(port, *s++); |
1105 | } | 1108 | } |
1109 | |||
1110 | /* wait until fifo is empty and last bit has been transmitted */ | ||
1111 | bits = SCxSR_TDxE(port) | SCxSR_TEND(port); | ||
1112 | while ((sci_in(port, SCxSR) & bits) != bits) | ||
1113 | cpu_relax(); | ||
1106 | } | 1114 | } |
1107 | 1115 | ||
1108 | static int __init serial_console_setup(struct console *co, char *options) | 1116 | static int __init serial_console_setup(struct console *co, char *options) |