From: Sherry Sun <sherry.sun@nxp.com>
To: gregkh@linuxfoundation.org, jirislaby@kernel.org
Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-imx@nxp.com
Subject: [PATCH 2/6] tty: serial: fsl_lpuart: set receive watermark for imx8qxp platform
Date: Mon, 30 Jan 2023 14:44:45 +0800 [thread overview]
Message-ID: <20230130064449.9564-3-sherry.sun@nxp.com> (raw)
In-Reply-To: <20230130064449.9564-1-sherry.sun@nxp.com>
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: Sherry Sun <sherry.sun@nxp.com>
---
drivers/tty/serial/fsl_lpuart.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
index e4aa161e61bf..868c2783d2c7 100644
--- a/drivers/tty/serial/fsl_lpuart.c
+++ b/drivers/tty/serial/fsl_lpuart.c
@@ -321,7 +321,7 @@ static struct lpuart_soc_data imx8qxp_data = {
.devtype = IMX8QXP_LPUART,
.iotype = UPIO_MEM32,
.reg_off = IMX_REG_OFF,
- .rx_watermark = 1,
+ .rx_watermark = 31,
};
static struct lpuart_soc_data imxrt1050_data = {
.devtype = IMXRT1050_LPUART,
@@ -1527,6 +1527,8 @@ static void lpuart_setup_watermark(struct lpuart_port *sport)
writeb(UARTSFIFO_RXUF, sport->port.membase + UARTSFIFO);
}
+ if (uart_console(&sport->port))
+ sport->rx_watermark = 1;
writeb(0, sport->port.membase + UARTTWFIFO);
writeb(sport->rx_watermark, sport->port.membase + UARTRWFIFO);
@@ -1563,6 +1565,8 @@ static void lpuart32_setup_watermark(struct lpuart_port *sport)
lpuart32_write(&sport->port, val, UARTFIFO);
/* set the watermark */
+ if (uart_console(&sport->port))
+ sport->rx_watermark = 1;
val = (sport->rx_watermark << UARTWATER_RXWATER_OFF) |
(0x0 << UARTWATER_TXWATER_OFF);
lpuart32_write(&sport->port, val, UARTWATER);
--
2.17.1
next prev parent reply other threads:[~2023-01-30 6:47 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-30 6:44 [PATCH 0/6] tty: serial: fsl_lpuart: improve RXWATER setting and add imx8ulp support Sherry Sun
2023-01-30 6:44 ` [PATCH 1/6] tty: serial: fsl_lpuart: make rx_watermark configurable for different platforms Sherry Sun
2023-01-30 6:44 ` Sherry Sun [this message]
2023-01-30 6:44 ` [PATCH 3/6] tty: serial: fsl_lpuart: Fix the wrong RXWATER setting for rx dma case Sherry Sun
2023-01-30 6:44 ` [PATCH 4/6] tty: serial: fsl_lpuart: Enable Receiver Idle Empty function for LPUART Sherry Sun
2023-01-30 6:44 ` [PATCH 5/6] tty: serial: fsl_lpuart: set RTS watermark for lpuart Sherry Sun
2023-02-02 7:14 ` Alexander Stein
2023-02-02 7:56 ` Sherry Sun
2023-01-30 6:44 ` [PATCH 6/6] tty: serial: fsl_lpuart: add imx8ulp support Sherry Sun
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230130064449.9564-3-sherry.sun@nxp.com \
--to=sherry.sun@nxp.com \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®