cavium: 8250 serial driver changes
As mentioned in '[PATCH 1/2] serial: Allow for replaceable I/O
functions in 8250 driver.', we are in the process of preparing kernel
support for the Cavium Networks OCTEON processor for inclusion in the
main-line kernel sources.
The OCTEON's UART differs from the existing uart_configs, so we add a
new uart_config and check for it in several places.
This patch depends on the aforementioned 'Allow for replaceable I/O
functions in 8250 driver' patch.
Since this patch is part of the Cavium OCTEON processor port, we don't
expect that it would be committed until the rest of the port is
accepted. However we would like feedback so that it might be
adjusted if necessary.
Signed-off-by: Tomaso Paoletti <tpaoletti@caviumnetworks.com>
Signed-off-by: David Daney <ddaney@caviumnetworks.com>
---
drivers/serial/8250.c | 30 +++++++++++++++++++++++++++---
include/linux/serial_core.h | 3 ++-
include/linux/serial_reg.h | 6 ++++++
3 files changed, 35 insertions(+), 4 deletions(-)
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index 02771d6..2ef79e9 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -264,6 +264,13 @@ static const struct serial8250_config uart_config[] = {
.fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10,
.flags = UART_CAP_FIFO,
},
+ [PORT_OCTEON] = {
+ .name = "OCTEON",
+ .fifo_size = 64,
+ .tx_loadsz = 64,
+ .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10,
+ .flags = UART_CAP_FIFO,
+ },
};
#if defined (CONFIG_SERIAL_8250_AU1X00)
@@ -902,7 +909,14 @@ static void autoconfig_16550a(struct uart_8250_port *up)
unsigned char status1, status2;
unsigned int iersave;
- up->port.type = PORT_16550A;
+#ifdef CONFIG_CPU_CAVIUM_OCTEON
+ /* UPF_FIXED_PORT indicates an internal UART. */
+ if (up->port.flags & UPF_FIXED_PORT)
+ up->port.type = PORT_OCTEON;
+ else
+#endif
+ up->port.type = PORT_16550A;
+
up->capabilities |= UART...