]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
ARM: OMAP: Set serial 8250 ECB for TX fifo
authorTony Lindgren <tony@atomide.com>
Mon, 20 Feb 2006 23:51:49 +0000 (15:51 -0800)
committerTony Lindgren <tony@atomide.com>
Mon, 20 Feb 2006 23:51:49 +0000 (15:51 -0800)
Code to fix serial TX fifo by Richard Woodruff.

The extended capabilities bit is needed to write fcr, or else some
settings don't get set.  That is what the OMAP-UART data sheet says.
The write water mark bits 4:5 are not accessible unless ECB is set.

The data sheet says it is TI16C750 compatible but it seems to share more
with what the code calls a TI16C752.  The 750 has a DLAB to set 64bit
fifo and I don't believe that is the case for ours.

A minor note is we are still only using 32 bytes of the 64 byte TX fifo
for transmits in the current code.  I'm not sure if there is an
application that this matters to.

Note that the current code id's OMAP serial ports as a 16654 which isn't
quite correct.

Also note that to use the actual TX watermark interrupt set at 32bytes
required too ugly of a hack to use (not use OMAP_SCR=0).

drivers/serial/8250.c

index c79c8d1782504bdc6267671f92bf1ebe0b8bc507..494e8b897156693b3350e6fe2e2f06cfb41bc96a 100644 (file)
@@ -1891,6 +1891,19 @@ serial8250_set_termios(struct uart_port *port, struct termios *termios,
                        /* emulated UARTs (Lucent Venus 167x) need two steps */
                        serial_outp(up, UART_FCR, UART_FCR_ENABLE_FIFO);
                }
+
+               /* Note that we need to set ECB to access write water mark
+                * bits. First allow FCR tx fifo write, then set fcr with
+                * possible TX fifo settings. */
+               if (uart_config[up->port.type].flags & UART_CAP_EFR) {
+                       serial_outp(up, UART_LCR, 0xbf);        /* Access EFR */
+                       serial_outp(up, UART_EFR, UART_EFR_ECB);
+                       serial_outp(up, UART_LCR, 0x0);         /* Access FCR */
+                       serial_outp(up, UART_FCR, fcr);
+                       serial_outp(up, UART_LCR, 0xbf);        /* Access EFR */
+                       serial_outp(up, UART_EFR, 0);
+                       serial_outp(up, UART_LCR, cval);        /* Access FCR */
+        } else
                serial_outp(up, UART_FCR, fcr);         /* set fcr */
        }
        serial8250_set_mctrl(&up->port, up->port.mctrl);