b995422d1346f209cafc7ef1090c8911df49c586
[openwrt.git] / target / linux / ramips / patches-3.8 / 0015-serial-ralink-adds-support-for-the-serial-core-found.patch
1 From 219ec2244c2e9085e6900dc515a24f6655c79827 Mon Sep 17 00:00:00 2001
2 From: John Crispin <blogic@openwrt.org>
3 Date: Fri, 25 Jan 2013 19:39:51 +0100
4 Subject: [PATCH 15/79] serial: ralink: adds support for the serial core found
5  on ralink wisoc
6
7 The MIPS based Ralink WiSoC platform has 1 or more 8250 compatible serial cores.
8 To make them work we require the same quirks that are used by AU1x00.
9
10 Signed-off-by: John Crispin <blogic@openwrt.org>
11 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 ---
13  drivers/tty/serial/8250/8250.c  |    6 +++---
14  drivers/tty/serial/8250/Kconfig |    8 ++++++++
15  include/linux/serial_core.h     |    2 +-
16  3 files changed, 12 insertions(+), 4 deletions(-)
17
18 diff --git a/drivers/tty/serial/8250/8250.c b/drivers/tty/serial/8250/8250.c
19 index f932043..f72eb7d 100644
20 --- a/drivers/tty/serial/8250/8250.c
21 +++ b/drivers/tty/serial/8250/8250.c
22 @@ -324,9 +324,9 @@ static void default_serial_dl_write(struct uart_8250_port *up, int value)
23         serial_out(up, UART_DLM, value >> 8 & 0xff);
24  }
25  
26 -#ifdef CONFIG_MIPS_ALCHEMY
27 +#if defined(CONFIG_MIPS_ALCHEMY) || defined(CONFIG_SERIAL_8250_RT288X)
28  
29 -/* Au1x00 UART hardware has a weird register layout */
30 +/* Au1x00/RT288x UART hardware has a weird register layout */
31  static const u8 au_io_in_map[] = {
32         [UART_RX]  = 0,
33         [UART_IER] = 2,
34 @@ -506,7 +506,7 @@ static void set_io_from_upio(struct uart_port *p)
35                 break;
36  #endif
37  
38 -#ifdef CONFIG_MIPS_ALCHEMY
39 +#if defined(CONFIG_MIPS_ALCHEMY) || defined(CONFIG_SERIAL_8250_RT288X)
40         case UPIO_AU:
41                 p->serial_in = au_serial_in;
42                 p->serial_out = au_serial_out;
43 diff --git a/drivers/tty/serial/8250/Kconfig b/drivers/tty/serial/8250/Kconfig
44 index c31133a..9e4febd 100644
45 --- a/drivers/tty/serial/8250/Kconfig
46 +++ b/drivers/tty/serial/8250/Kconfig
47 @@ -277,3 +277,11 @@ config SERIAL_8250_EM
48           Selecting this option will add support for the integrated serial
49           port hardware found on the Emma Mobile line of processors.
50           If unsure, say N.
51 +
52 +config SERIAL_8250_RT288X
53 +       bool "Ralink RT288x/RT305x/RT3662/RT3883 serial port support"
54 +       depends on SERIAL_8250 && (SOC_RT288X || SOC_RT305X || SOC_RT3883)
55 +       help
56 +         If you have a Ralink RT288x/RT305x SoC based board and want to use the
57 +         serial port, say Y to this option. The driver can handle up to 2 serial
58 +         ports. If unsure, say N.
59 diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
60 index c6690a2..0b428d6 100644
61 --- a/include/linux/serial_core.h
62 +++ b/include/linux/serial_core.h
63 @@ -134,7 +134,7 @@ struct uart_port {
64  #define UPIO_HUB6              (1)
65  #define UPIO_MEM               (2)
66  #define UPIO_MEM32             (3)
67 -#define UPIO_AU                        (4)                     /* Au1x00 type IO */
68 +#define UPIO_AU                        (4)                     /* Au1x00 and RT288x type IO */
69  #define UPIO_TSI               (5)                     /* Tsi108/109 type IO */
70  #define UPIO_RM9000            (6)                     /* RM9000 type IO */
71  
72 -- 
73 1.7.10.4
74