aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/sh/kernel/early_printk.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/sh/kernel/early_printk.c b/arch/sh/kernel/early_printk.c
index 18ca249e8409..11b4c85999b7 100644
--- a/arch/sh/kernel/early_printk.c
+++ b/arch/sh/kernel/early_printk.c
@@ -143,6 +143,7 @@ static void scif_sercon_init(char *s)
143{ 143{
144 struct uart_port *port = &scif_port; 144 struct uart_port *port = &scif_port;
145 unsigned baud = DEFAULT_BAUD; 145 unsigned baud = DEFAULT_BAUD;
146 unsigned int status;
146 char *e; 147 char *e;
147 148
148 if (*s == ',') 149 if (*s == ',')
@@ -161,12 +162,17 @@ static void scif_sercon_init(char *s)
161 baud = DEFAULT_BAUD; 162 baud = DEFAULT_BAUD;
162 } 163 }
163 164
165 do {
166 status = sci_in(port, SCxSR);
167 } while (!(status & SCxSR_TEND(port)));
168
164 sci_out(port, SCSCR, 0); /* TE=0, RE=0 */ 169 sci_out(port, SCSCR, 0); /* TE=0, RE=0 */
165 sci_out(port, SCSMR, 0); 170 sci_out(port, SCSMR, 0);
166 171
167 /* Set baud rate */ 172 /* Set baud rate */
168 sci_out(port, SCBRR, (CONFIG_SH_PCLK_FREQ + 16 * baud) / 173 sci_out(port, SCBRR, (CONFIG_SH_PCLK_FREQ + 16 * baud) /
169 (32 * baud) - 1); 174 (32 * baud) - 1);
175 udelay((1000000+(baud-1)) / baud); /* Wait one bit interval */
170 176
171 sci_out(port, SCFCR, 12); 177 sci_out(port, SCFCR, 12);
172 sci_out(port, SCFCR, 8); 178 sci_out(port, SCFCR, 8);