Skip to content

Commit ec99e28

Browse files
Ley Foon Tangregkh
authored andcommitted
tty/serial: Add support for Altera serial port
commit e06c93c upstream. Add support for Altera 8250/16550 compatible serial port. Signed-off-by: Ley Foon Tan <lftan@altera.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 53b9033 commit ec99e28

4 files changed

Lines changed: 35 additions & 2 deletions

File tree

‎Documentation/devicetree/bindings/tty/serial/of-serial.txt‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ Required properties:
1111
- "nvidia,tegra20-uart"
1212
- "nxp,lpc3220-uart"
1313
- "ibm,qpace-nwp-serial"
14+
- "altr,16550-FIFO32"
15+
- "altr,16550-FIFO64"
16+
- "altr,16550-FIFO128"
1417
- "serial" if the port type is unknown.
1518
- reg : offset and length of the register set for the device.
1619
- interrupts : should contain uart interrupt.

‎drivers/tty/serial/8250/8250.c‎

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,28 @@ static const struct serial8250_config uart_config[] = {
308308
},
309309
[PORT_8250_CIR] = {
310310
.name = "CIR port"
311-
}
311+
},
312+
[PORT_ALTR_16550_F32] = {
313+
.name = "Altera 16550 FIFO32",
314+
.fifo_size = 32,
315+
.tx_loadsz = 32,
316+
.fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10,
317+
.flags = UART_CAP_FIFO | UART_CAP_AFE,
318+
},
319+
[PORT_ALTR_16550_F64] = {
320+
.name = "Altera 16550 FIFO64",
321+
.fifo_size = 64,
322+
.tx_loadsz = 64,
323+
.fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10,
324+
.flags = UART_CAP_FIFO | UART_CAP_AFE,
325+
},
326+
[PORT_ALTR_16550_F128] = {
327+
.name = "Altera 16550 FIFO128",
328+
.fifo_size = 128,
329+
.tx_loadsz = 128,
330+
.fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10,
331+
.flags = UART_CAP_FIFO | UART_CAP_AFE,
332+
},
312333
};
313334

314335
/* Uart divisor latch read */

‎drivers/tty/serial/of_serial.c‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,12 @@ static struct of_device_id of_platform_serial_table[] = {
240240
{ .compatible = "ns16850", .data = (void *)PORT_16850, },
241241
{ .compatible = "nvidia,tegra20-uart", .data = (void *)PORT_TEGRA, },
242242
{ .compatible = "nxp,lpc3220-uart", .data = (void *)PORT_LPC3220, },
243+
{ .compatible = "altr,16550-FIFO32",
244+
.data = (void *)PORT_ALTR_16550_F32, },
245+
{ .compatible = "altr,16550-FIFO64",
246+
.data = (void *)PORT_ALTR_16550_F64, },
247+
{ .compatible = "altr,16550-FIFO128",
248+
.data = (void *)PORT_ALTR_16550_F128, },
243249
#ifdef CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL
244250
{ .compatible = "ibm,qpace-nwp-serial",
245251
.data = (void *)PORT_NWPSERIAL, },

‎include/uapi/linux/serial_core.h‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@
5151
#define PORT_8250_CIR 23 /* CIR infrared port, has its own driver */
5252
#define PORT_XR17V35X 24 /* Exar XR17V35x UARTs */
5353
#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 */
5558

5659
/*
5760
* ARM specific type numbers. These are not currently guaranteed

0 commit comments

Comments
 (0)