From: Alexander Stein <alexander.stein@ew.tq-group.com>
To: Sherry Sun <sherry.sun@nxp.com>
Cc: gregkh@linuxfoundation.org, jirislaby@kernel.org,
linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-imx@nxp.com
Subject: Re: [PATCH 5/6] tty: serial: fsl_lpuart: set RTS watermark for lpuart
Date: Thu, 02 Feb 2023 08:14:09 +0100 [thread overview]
Message-ID: <5646686.DvuYhMxLoT@steina-w> (raw)
In-Reply-To: <20230130064449.9564-6-sherry.sun@nxp.com>
Am Montag, 30. Januar 2023, 07:44:48 CET schrieb Sherry Sun:
> Add RTS watermark support for LPUART. The RX RTS_B output negates when
> the number of empty words in the receive FIFO is greater or equal to
> RTSWATER. Here set the RTSWATER to half of the rxfifo_size.
>
> Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
> ---
> drivers/tty/serial/fsl_lpuart.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/tty/serial/fsl_lpuart.c
> b/drivers/tty/serial/fsl_lpuart.c index 2789749d3d0d..c35e49a09bcc 100644
> --- a/drivers/tty/serial/fsl_lpuart.c
> +++ b/drivers/tty/serial/fsl_lpuart.c
> @@ -201,6 +201,7 @@
> #define UARTDATA_MASK 0x3ff
>
> #define UARTMODIR_IREN 0x00020000
> +#define UARTMODIR_RTSWATER GENMASK(10, 8)
> #define UARTMODIR_TXCTSSRC 0x00000020
> #define UARTMODIR_TXCTSC 0x00000010
> #define UARTMODIR_RXRTSE 0x00000008
> @@ -1573,6 +1574,13 @@ static void lpuart32_setup_watermark(struct
> lpuart_port *sport) (0x0 << UARTWATER_TXWATER_OFF);
> lpuart32_write(&sport->port, val, UARTWATER);
>
> + /* set RTS watermark */
> + if (!uart_console(&sport->port)) {
> + val = lpuart32_read(&sport->port, UARTMODIR);
> + val |= FIELD_PREP(UARTMODIR_RTSWATER, sport->rxfifo_size
>> 1);
> + lpuart32_write(&sport->port, val, UARTMODIR);
On LS1021A these bits are reserved (please refer to QorIQ LS1021A Reference
manual Rev 3.1 02/2020 section 27.3.6). Is it okay to write to them?
Best regards
Alexander
> + }
> +
> /* Restore cr2 */
> lpuart32_write(&sport->port, ctrl_saved, UARTCTRL);
> }
next prev parent reply other threads:[~2023-02-02 7:14 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 ` [PATCH 2/6] tty: serial: fsl_lpuart: set receive watermark for imx8qxp platform Sherry Sun
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 [this message]
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=5646686.DvuYhMxLoT@steina-w \
--to=alexander.stein@ew.tq-group.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 \
--cc=sherry.sun@nxp.com \
/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;
as well as URLs for NNTP newsgroup(s).