Skip to content

Commit 42a569c

Browse files
Ryceancurrygregkh
authored andcommitted
serial: 8250_bcm7271: improve bcm7271 8250 port
The 8250 BCM7271 UART is not a direct match to PORT_16550A and other generic ports do not match its hardware capabilities. PORT_ALTR matches the rx trigger levels, but its vendor configurations are not compatible. Unfortunately this means we need to create another port to fully capture the hardware capabilities of the BCM7271 UART. To alleviate some latency pressures, we default the rx trigger level to 8. Signed-off-by: Justin Chen <justin.chen@broadcom.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Acked-by: Doug Berger <opendmb@gmail.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/1692643978-16570-1-git-send-email-justin.chen@broadcom.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent b4a7783 commit 42a569c

3 files changed

Lines changed: 12 additions & 3 deletions

File tree

drivers/tty/serial/8250/8250_bcm7271.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,7 +1042,7 @@ static int brcmuart_probe(struct platform_device *pdev)
10421042
dev_dbg(dev, "DMA is %senabled\n", priv->dma_enabled ? "" : "not ");
10431043

10441044
memset(&up, 0, sizeof(up));
1045-
up.port.type = PORT_16550A;
1045+
up.port.type = PORT_BCM7271;
10461046
up.port.uartclk = clk_rate;
10471047
up.port.dev = dev;
10481048
up.port.mapbase = mapbase;
@@ -1056,8 +1056,6 @@ static int brcmuart_probe(struct platform_device *pdev)
10561056
| UPF_FIXED_PORT | UPF_FIXED_TYPE;
10571057
up.port.dev = dev;
10581058
up.port.private_data = priv;
1059-
up.capabilities = UART_CAP_FIFO | UART_CAP_AFE;
1060-
up.port.fifosize = 32;
10611059

10621060
/* Check for a fixed line number */
10631061
ret = of_alias_get_id(np, "serial");

drivers/tty/serial/8250/8250_port.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,14 @@ static const struct serial8250_config uart_config[] = {
322322
.rxtrig_bytes = {2, 66, 130, 194},
323323
.flags = UART_CAP_FIFO,
324324
},
325+
[PORT_BCM7271] = {
326+
.name = "Broadcom BCM7271 UART",
327+
.fifo_size = 32,
328+
.tx_loadsz = 32,
329+
.fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_01,
330+
.rxtrig_bytes = {1, 8, 16, 30},
331+
.flags = UART_CAP_FIFO | UART_CAP_AFE,
332+
},
325333
};
326334

327335
/* Uart divisor latch read */

include/uapi/linux/serial_core.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@
123123
/* Xilinx uartlite */
124124
#define PORT_UARTLITE 74
125125

126+
/* Broadcom BCM7271 UART */
127+
#define PORT_BCM7271 76
128+
126129
/* Broadcom SB1250, etc. SOC */
127130
#define PORT_SB1250_DUART 77
128131

0 commit comments

Comments
 (0)