aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMans Rullgard <mans@mansr.com>2015-09-15 12:54:13 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-10-04 14:09:21 -0400
commit9b2256c8274c72bacb7eca7dee5ffe85832cb5e0 (patch)
tree8e00e3e6fa94ae0f35554a47adfd3531dbefa067
parentce59e48fdbad2aa6609ceb87e1306ec69e577e05 (diff)
serial: 8250: simplify ralink/alchemy register remap selection
Some SoCs, including Ralink/Mediatek and Alchemy Au1xxx, have a 16550-like UART with a non-standard register layout. These are supported by a simple mapping table in 8250_port.c Rather than list every SoC type using this access mode in the ifdefs there, allow selecting the SERIAL_8250_RT288X Kconfig option with any system and default it to y for the known cases needing it. The help text is reworded accordingly. This change simplifies adding support for other SoCs also using the same UART. The name of the option is a little misleading, but not knowing the true origin of this UART, it is as good a choice as any. Signed-off-by: Mans Rullgard <mans@mansr.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/tty/serial/8250/8250_port.c4
-rw-r--r--drivers/tty/serial/8250/Kconfig9
2 files changed, 7 insertions, 6 deletions
diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
index c4dac1be3ec1..554a63e4c4a0 100644
--- a/drivers/tty/serial/8250/8250_port.c
+++ b/drivers/tty/serial/8250/8250_port.c
@@ -276,7 +276,7 @@ static void default_serial_dl_write(struct uart_8250_port *up, int value)
276 serial_out(up, UART_DLM, value >> 8 & 0xff); 276 serial_out(up, UART_DLM, value >> 8 & 0xff);
277} 277}
278 278
279#if defined(CONFIG_MIPS_ALCHEMY) || defined(CONFIG_SERIAL_8250_RT288X) 279#ifdef CONFIG_SERIAL_8250_RT288X
280 280
281/* Au1x00/RT288x UART hardware has a weird register layout */ 281/* Au1x00/RT288x UART hardware has a weird register layout */
282static const s8 au_io_in_map[8] = { 282static const s8 au_io_in_map[8] = {
@@ -427,7 +427,7 @@ static void set_io_from_upio(struct uart_port *p)
427 p->serial_out = mem32be_serial_out; 427 p->serial_out = mem32be_serial_out;
428 break; 428 break;
429 429
430#if defined(CONFIG_MIPS_ALCHEMY) || defined(CONFIG_SERIAL_8250_RT288X) 430#ifdef CONFIG_SERIAL_8250_RT288X
431 case UPIO_AU: 431 case UPIO_AU:
432 p->serial_in = au_serial_in; 432 p->serial_in = au_serial_in;
433 p->serial_out = au_serial_out; 433 p->serial_out = au_serial_out;
diff --git a/drivers/tty/serial/8250/Kconfig b/drivers/tty/serial/8250/Kconfig
index f5c4b01f6f1d..656a1737d509 100644
--- a/drivers/tty/serial/8250/Kconfig
+++ b/drivers/tty/serial/8250/Kconfig
@@ -294,11 +294,12 @@ config SERIAL_8250_EM
294 294
295config SERIAL_8250_RT288X 295config SERIAL_8250_RT288X
296 bool "Ralink RT288x/RT305x/RT3662/RT3883 serial port support" 296 bool "Ralink RT288x/RT305x/RT3662/RT3883 serial port support"
297 depends on SERIAL_8250 && (SOC_RT288X || SOC_RT305X || SOC_RT3883 || SOC_MT7620) 297 depends on SERIAL_8250
298 default y if MIPS_ALCHEMY || SOC_RT288X || SOC_RT305X || SOC_RT3883 || SOC_MT7620
298 help 299 help
299 If you have a Ralink RT288x/RT305x SoC based board and want to use the 300 Selecting this option will add support for the alternate register
300 serial port, say Y to this option. The driver can handle up to 2 serial 301 layout used by Ralink RT288x/RT305x, Alchemy Au1xxx, and some others.
301 ports. If unsure, say N. 302 If unsure, say N.
302 303
303config SERIAL_8250_OMAP 304config SERIAL_8250_OMAP
304 tristate "Support for OMAP internal UART (8250 based driver)" 305 tristate "Support for OMAP internal UART (8250 based driver)"