Commit 7c010590 authored by Sherry Sun's avatar Sherry Sun Committed by Greg Kroah-Hartman

tty: serial: fsl_lpuart: set receive watermark for imx8qxp platform

Since imx8qxp RX FIFO depth is 64 datawords, it will be better to set
the rx watermark as 31, which means when the number of datawords in the
receive FIFO(>= 32) is greater than the watermark, an interrupt or a DMA
request is generated.
Also keep the console rx watermark as 1 to make sure it responsive.
Signed-off-by: default avatarSherry Sun <sherry.sun@nxp.com>
Link: https://lore.kernel.org/r/20230130064449.9564-3-sherry.sun@nxp.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 34ebb26f
...@@ -321,7 +321,7 @@ static struct lpuart_soc_data imx8qxp_data = { ...@@ -321,7 +321,7 @@ static struct lpuart_soc_data imx8qxp_data = {
.devtype = IMX8QXP_LPUART, .devtype = IMX8QXP_LPUART,
.iotype = UPIO_MEM32, .iotype = UPIO_MEM32,
.reg_off = IMX_REG_OFF, .reg_off = IMX_REG_OFF,
.rx_watermark = 1, .rx_watermark = 31,
}; };
static struct lpuart_soc_data imxrt1050_data = { static struct lpuart_soc_data imxrt1050_data = {
.devtype = IMXRT1050_LPUART, .devtype = IMXRT1050_LPUART,
...@@ -1527,6 +1527,8 @@ static void lpuart_setup_watermark(struct lpuart_port *sport) ...@@ -1527,6 +1527,8 @@ static void lpuart_setup_watermark(struct lpuart_port *sport)
writeb(UARTSFIFO_RXUF, sport->port.membase + UARTSFIFO); writeb(UARTSFIFO_RXUF, sport->port.membase + UARTSFIFO);
} }
if (uart_console(&sport->port))
sport->rx_watermark = 1;
writeb(0, sport->port.membase + UARTTWFIFO); writeb(0, sport->port.membase + UARTTWFIFO);
writeb(sport->rx_watermark, sport->port.membase + UARTRWFIFO); writeb(sport->rx_watermark, sport->port.membase + UARTRWFIFO);
...@@ -1563,6 +1565,8 @@ static void lpuart32_setup_watermark(struct lpuart_port *sport) ...@@ -1563,6 +1565,8 @@ static void lpuart32_setup_watermark(struct lpuart_port *sport)
lpuart32_write(&sport->port, val, UARTFIFO); lpuart32_write(&sport->port, val, UARTFIFO);
/* set the watermark */ /* set the watermark */
if (uart_console(&sport->port))
sport->rx_watermark = 1;
val = (sport->rx_watermark << UARTWATER_RXWATER_OFF) | val = (sport->rx_watermark << UARTWATER_RXWATER_OFF) |
(0x0 << UARTWATER_TXWATER_OFF); (0x0 << UARTWATER_TXWATER_OFF);
lpuart32_write(&sport->port, val, UARTWATER); lpuart32_write(&sport->port, val, UARTWATER);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment