]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/sh/kernel/early_printk.c
serial: sh-sci: Reorder the SCxTDR write after the TDxE clear.
[linux-2.6-omap-h63xx.git] / arch / sh / kernel / early_printk.c
index 11b4c85999b73f7746903c50c0fb71b6fa9fbe33..a952dcf9999d43bedbef8ff275aa3517fb13ab91 100644 (file)
@@ -75,6 +75,7 @@ static struct console bios_console = {
 #endif
 
 static struct uart_port scif_port = {
+       .type           = PORT_SCIF,
        .mapbase        = CONFIG_EARLY_SCIF_CONSOLE_PORT,
        .membase        = (char __iomem *)CONFIG_EARLY_SCIF_CONSOLE_PORT,
 };
@@ -84,9 +85,9 @@ static void scif_sercon_putc(int c)
        while (((sci_in(&scif_port, SCFDR) & EPK_FIFO_BITS) >= EPK_FIFO_SIZE))
                ;
 
-       sci_out(&scif_port, SCxTDR, c);
        sci_in(&scif_port, SCxSR);
        sci_out(&scif_port, SCxSR, 0xf3 & ~(0x20 | 0x40));
+       sci_out(&scif_port, SCxTDR, c);
 
        while ((sci_in(&scif_port, SCxSR) & 0x40) == 0)
                ;
@@ -167,6 +168,7 @@ static void scif_sercon_init(char *s)
        } while (!(status & SCxSR_TEND(port)));
 
        sci_out(port, SCSCR, 0);         /* TE=0, RE=0 */
+       sci_out(port, SCFCR, SCFCR_RFRST | SCFCR_TFRST);
        sci_out(port, SCSMR, 0);
 
        /* Set baud rate */
@@ -174,12 +176,11 @@ static void scif_sercon_init(char *s)
                (32 * baud) - 1);
        udelay((1000000+(baud-1)) / baud); /* Wait one bit interval */
 
-       sci_out(port, SCFCR, 12);
-       sci_out(port, SCFCR, 8);
-
        sci_out(port, SCSPTR, 0);
        sci_out(port, SCxSR, 0x60);
        sci_out(port, SCLSR, 0);
+
+       sci_out(port, SCFCR, 0);
        sci_out(port, SCSCR, 0x30);      /* TE=1, RE=1 */
 }
 #endif /* defined(CONFIG_CPU_SUBTYPE_SH7720) */