]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[SERIAL] 8250: add tsi108 serial support
authorZang Roy-r61911 <tie-fei.zang@freescale.com>
Fri, 30 Jun 2006 09:29:58 +0000 (02:29 -0700)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sun, 9 Jul 2006 20:11:09 +0000 (21:11 +0100)
The following patch gets rid of CONFIG_TSI108_BRIDGE.  I add UPIO_TSI to
handle IIR and IER register in serial_in and serial_out.

(1) the reason to rewrite serial_in:

    TSI108 rev Z1 version ERRATA.  Reading the UART's Interrupt
    Identification Register (IIR) clears the Transmit Holding Register
    Empty (THRE) and Transmit buffer Empty (TEMP) interrupts even if they
    are not enabled in the Interrupt Enable Register (IER).  This leads to
    loss of the interrupts.  Interrupts are not cleared when reading UART
    registers as 32-bit word.

(2) the reason to rewrite serial_out:

    Check for UART_IER_UUE bit in the autoconfig routine.  This section
    of autoconfig is excluded for Tsi108/109 because bits 7 and 6 are
    reserved for internal use.  They are R/W bits.  In addition to
    incorrect identification, changing these bits (from 00) will make
    Tsi108/109 UART non-functional.

Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
drivers/serial/8250.c
drivers/serial/serial_core.c
include/linux/serial_core.h

index 0995430e4cf1ca3d4f5927856d0cb64739e0f7ac..5443fcd3835550259eff3d3b18a493ff9ccbd1d0 100644 (file)
@@ -299,6 +299,7 @@ static inline int map_8250_out_reg(struct uart_8250_port *up, int offset)
 
 static unsigned int serial_in(struct uart_8250_port *up, int offset)
 {
+       unsigned int tmp;
        offset = map_8250_in_reg(up, offset) << up->port.regshift;
 
        switch (up->port.iotype) {
@@ -317,6 +318,13 @@ static unsigned int serial_in(struct uart_8250_port *up, int offset)
                return __raw_readl(up->port.membase + offset);
 #endif
 
+       case UPIO_TSI:
+               if (offset == UART_IIR) {
+                       tmp = readl((u32 *)(up->port.membase + UART_RX));
+                       return (cpu_to_le32(tmp) >> 8) & 0xff;
+               } else
+                       return readb(up->port.membase + offset);
+
        default:
                return inb(up->port.iobase + offset);
        }
@@ -346,6 +354,10 @@ serial_out(struct uart_8250_port *up, int offset, int value)
                __raw_writel(value, up->port.membase + offset);
                break;
 #endif
+       case UPIO_TSI:
+               if (!((offset == UART_IER) && (value & UART_IER_UUE)))
+                       writeb(value, up->port.membase + offset);
+               break;
 
        default:
                outb(value, up->port.iobase + offset);
index d5f636fbf29a727b751c0e6a933f4b41137517fa..80ef7d482756a3c9fec9b70b0646b4c25919472d 100644 (file)
@@ -2036,6 +2036,7 @@ uart_report_port(struct uart_driver *drv, struct uart_port *port)
        case UPIO_MEM:
        case UPIO_MEM32:
        case UPIO_AU:
+       case UPIO_TSI:
                snprintf(address, sizeof(address),
                         "MMIO 0x%lx", port->mapbase);
                break;
index 058cba70818a57654dc1fc0534fce9ecf0877a9b..86501a3de2ac1d771c9b32958ca5b3fdf8a99dee 100644 (file)
@@ -227,6 +227,7 @@ struct uart_port {
 #define UPIO_MEM               (2)
 #define UPIO_MEM32             (3)
 #define UPIO_AU                        (4)                     /* Au1x00 type IO */
+#define UPIO_TSI               (5)                     /* Tsi108/109 type IO */
 
        unsigned int            read_status_mask;       /* driver specific */
        unsigned int            ignore_status_mask;     /* driver specific */