PATCH - U6715 16550A serial driver support

by Philippe Langlaison 2010-07-29T15:13:57+00:00
UART Features extract from STEricsson U6715 data-sheet (arm926 SoC for mobile phone):
* Fully compatible with industry standard 16C550 and 16C450 from various
manufacturers
* RX and TX 64 byte FIFO reduces CPU interrupts
* Full double buffering
* Modem control signals include CTS, RTS, (and DSR, DTR on UART1 only)
* Automatic baud rate selection
* Manual or automatic RTS/CTS smart hardware flow control
* Programmable serial characteristics:
– Baud rate generation (50 to 3.25M baud)
– 5, 6, 7 or 8-bit characters
– Even, odd or no-parity bit generation and detection
– 1, 1.5 or 2 stop bit generation
* Independent control of transmit, receive, line status, data set interrupts and FIFOs
* Full status-reporting capabilities
* Separate DMA signaling for RX and TX
* Timed interrupt to spread receive interrupt on known duration
* DMA time-out interrupt to allow detection of end of reception
* Carkit pulse coding and decoding compliant with USB carkit control interface [40]
In 16550A auto-configuration, if the fifo size is 64 then it's an U6 16550A port
Add set-termios hook & export serial8250-do-set-termios to change uart
clock following baudrate
Signed-off-by: Philippe Langlais
diff #if defined (CONFIG-SERIAL-8250-AU1X00)
@@ -1075,6 +1082,15 @@ static void autoconfig-16550a(struct uart-8250-port *up)
DEBUG-AUTOCONF("Couldn't force IER-UUE to 0 ");
}
serial-outp(up, UART-IER, iersave);
+
+ /*
+ * We distinguish between 16550A and U6 16550A by counting
+ * how many bytes are in the FIFO.
+ */
+ if (up-+ up-+ up-+ }
}
/*
@@ -2229,9 +2245,9 @@ static unsigned int serial8250-get-divisor(struct uart-port *port, unsigned int
return quot;
}
-static void
-serial8250-set-termios(struct uart-port *port, struct ktermios *termios,
- struct ktermios *old)
+void
+serial8250-do-set-termios(struct uart-port *port, struct ktermios *termios,
+ struct ktermios *old)
{
struct uart-8250-port *up = (struct uart-8250-port *)port;
unsigned char cval, fcr = 0;
@@ -2407,6 +2423,17 @@ serial8250-set-termios(struct uart-port *port, struct ktermios *termios,
if (tty-termios-baud-rate(termios))
tty-termios-encode-baud-rate(termios, baud, baud);
}
+EXPORT-SYMBOL(serial8250-do-set-termios);
+
+static void
+serial8250-set-termios(struct uart-port *port, struct ktermios *termios,
+ struct ktermios *old)
+{
+ if (port-+ port-+ else
+ serial8250-do-set-termios(port, termios, old);
+}
static void
serial8250-set-ldisc(struct uart-port *port, int new)
@@ -2989,6 +3016,7 @@ static int ret = uart-add-one-port(&serial8250-reg, &uart- if (ret == 0)
diff #define SERIAL-IO-PORT 0
#define SERIAL-IO-HUB6 1
diff /*
@@ -71,5 +74,7 @@ extern int early-serial-setup(struct uart-port *port);
extern int serial8250-find-port(struct uart-port *p);
extern int serial8250-find-port-for-earlycon(void);
extern int setup-early-serial8250-console(char *cmdline);
+extern void serial8250-do-set-termios(struct uart-port *port,
+ struct ktermios *termios, struct ktermios *old);
#endif
diff More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Re: PATCH - U6715 16550A serial driver support

by Alan Coxon 2010-07-29T15:31:48+00:00.
On Thu, 29 Jul 2010 17:13:57 +0200
Acked-by: Alan Cox
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/