diff options
| author | Ley Foon Tan <lftan@altera.com> | 2013-03-06 21:28:37 -0500 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-03-12 11:53:23 -0400 |
| commit | e06c93cacb82dd147266fd1bdb2d0a0bd45ff2c1 (patch) | |
| tree | 8698db9dbce9510e5d4b8ddab82f9db0d822f0a3 | |
| parent | 5771a8051d5ebaac0651a957885f55b5f6221a02 (diff) | |
tty/serial: Add support for Altera serial port
Add support for Altera 8250/16550 compatible serial port.
Signed-off-by: Ley Foon Tan <lftan@altera.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| -rw-r--r-- | Documentation/devicetree/bindings/tty/serial/of-serial.txt | 3 | ||||
| -rw-r--r-- | drivers/tty/serial/8250/8250.c | 23 | ||||
| -rw-r--r-- | drivers/tty/serial/of_serial.c | 6 | ||||
| -rw-r--r-- | include/uapi/linux/serial_core.h | 5 |
4 files changed, 35 insertions, 2 deletions
diff --git a/Documentation/devicetree/bindings/tty/serial/of-serial.txt b/Documentation/devicetree/bindings/tty/serial/of-serial.txt index 1e1145ca4f3c..8f01cb190f25 100644 --- a/Documentation/devicetree/bindings/tty/serial/of-serial.txt +++ b/Documentation/devicetree/bindings/tty/serial/of-serial.txt | |||
| @@ -11,6 +11,9 @@ Required properties: | |||
| 11 | - "nvidia,tegra20-uart" | 11 | - "nvidia,tegra20-uart" |
| 12 | - "nxp,lpc3220-uart" | 12 | - "nxp,lpc3220-uart" |
| 13 | - "ibm,qpace-nwp-serial" | 13 | - "ibm,qpace-nwp-serial" |
| 14 | - "altr,16550-FIFO32" | ||
| 15 | - "altr,16550-FIFO64" | ||
| 16 | - "altr,16550-FIFO128" | ||
| 14 | - "serial" if the port type is unknown. | 17 | - "serial" if the port type is unknown. |
| 15 | - reg : offset and length of the register set for the device. | 18 | - reg : offset and length of the register set for the device. |
| 16 | - interrupts : should contain uart interrupt. | 19 | - interrupts : should contain uart interrupt. |
diff --git a/drivers/tty/serial/8250/8250.c b/drivers/tty/serial/8250/8250.c index 0efc815a4968..661096d25620 100644 --- a/drivers/tty/serial/8250/8250.c +++ b/drivers/tty/serial/8250/8250.c | |||
| @@ -301,7 +301,28 @@ static const struct serial8250_config uart_config[] = { | |||
| 301 | }, | 301 | }, |
| 302 | [PORT_8250_CIR] = { | 302 | [PORT_8250_CIR] = { |
| 303 | .name = "CIR port" | 303 | .name = "CIR port" |
| 304 | } | 304 | }, |
| 305 | [PORT_ALTR_16550_F32] = { | ||
| 306 | .name = "Altera 16550 FIFO32", | ||
| 307 | .fifo_size = 32, | ||
| 308 | .tx_loadsz = 32, | ||
| 309 | .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10, | ||
| 310 | .flags = UART_CAP_FIFO | UART_CAP_AFE, | ||
| 311 | }, | ||
| 312 | [PORT_ALTR_16550_F64] = { | ||
| 313 | .name = "Altera 16550 FIFO64", | ||
| 314 | .fifo_size = 64, | ||
| 315 | .tx_loadsz = 64, | ||
| 316 | .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10, | ||
| 317 | .flags = UART_CAP_FIFO | UART_CAP_AFE, | ||
| 318 | }, | ||
| 319 | [PORT_ALTR_16550_F128] = { | ||
| 320 | .name = "Altera 16550 FIFO128", | ||
| 321 | .fifo_size = 128, | ||
| 322 | .tx_loadsz = 128, | ||
| 323 | .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10, | ||
| 324 | .flags = UART_CAP_FIFO | UART_CAP_AFE, | ||
| 325 | }, | ||
| 305 | }; | 326 | }; |
| 306 | 327 | ||
| 307 | /* Uart divisor latch read */ | 328 | /* Uart divisor latch read */ |
diff --git a/drivers/tty/serial/of_serial.c b/drivers/tty/serial/of_serial.c index d5874605682b..b025d5438275 100644 --- a/drivers/tty/serial/of_serial.c +++ b/drivers/tty/serial/of_serial.c | |||
| @@ -241,6 +241,12 @@ static struct of_device_id of_platform_serial_table[] = { | |||
| 241 | { .compatible = "ns16850", .data = (void *)PORT_16850, }, | 241 | { .compatible = "ns16850", .data = (void *)PORT_16850, }, |
| 242 | { .compatible = "nvidia,tegra20-uart", .data = (void *)PORT_TEGRA, }, | 242 | { .compatible = "nvidia,tegra20-uart", .data = (void *)PORT_TEGRA, }, |
| 243 | { .compatible = "nxp,lpc3220-uart", .data = (void *)PORT_LPC3220, }, | 243 | { .compatible = "nxp,lpc3220-uart", .data = (void *)PORT_LPC3220, }, |
| 244 | { .compatible = "altr,16550-FIFO32", | ||
| 245 | .data = (void *)PORT_ALTR_16550_F32, }, | ||
| 246 | { .compatible = "altr,16550-FIFO64", | ||
| 247 | .data = (void *)PORT_ALTR_16550_F64, }, | ||
| 248 | { .compatible = "altr,16550-FIFO128", | ||
| 249 | .data = (void *)PORT_ALTR_16550_F128, }, | ||
| 244 | #ifdef CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL | 250 | #ifdef CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL |
| 245 | { .compatible = "ibm,qpace-nwp-serial", | 251 | { .compatible = "ibm,qpace-nwp-serial", |
| 246 | .data = (void *)PORT_NWPSERIAL, }, | 252 | .data = (void *)PORT_NWPSERIAL, }, |
diff --git a/include/uapi/linux/serial_core.h b/include/uapi/linux/serial_core.h index b6a23a483d74..74c2bf7211f8 100644 --- a/include/uapi/linux/serial_core.h +++ b/include/uapi/linux/serial_core.h | |||
| @@ -51,7 +51,10 @@ | |||
| 51 | #define PORT_8250_CIR 23 /* CIR infrared port, has its own driver */ | 51 | #define PORT_8250_CIR 23 /* CIR infrared port, has its own driver */ |
| 52 | #define PORT_XR17V35X 24 /* Exar XR17V35x UARTs */ | 52 | #define PORT_XR17V35X 24 /* Exar XR17V35x UARTs */ |
| 53 | #define PORT_BRCM_TRUMANAGE 25 | 53 | #define PORT_BRCM_TRUMANAGE 25 |
| 54 | #define PORT_MAX_8250 25 /* max port ID */ | 54 | #define PORT_ALTR_16550_F32 26 /* Altera 16550 UART with 32 FIFOs */ |
| 55 | #define PORT_ALTR_16550_F64 27 /* Altera 16550 UART with 64 FIFOs */ | ||
| 56 | #define PORT_ALTR_16550_F128 28 /* Altera 16550 UART with 128 FIFOs */ | ||
| 57 | #define PORT_MAX_8250 28 /* max port ID */ | ||
| 55 | 58 | ||
| 56 | /* | 59 | /* |
| 57 | * ARM specific type numbers. These are not currently guaranteed | 60 | * ARM specific type numbers. These are not currently guaranteed |
