From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Justin Chen <justin.chen@broadcom.com>
Cc: linux-serial@vger.kernel.org, opendmb@gmail.com,
"Al Cooper" <alcooperx@gmail.com>,
"Broadcom internal kernel review list"
<bcm-kernel-feedback-list@broadcom.com>,
"Jiri Slaby" <jirislaby@kernel.org>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
"John Ogness" <john.ogness@linutronix.de>,
"Jiaqing Zhao" <jiaqing.zhao@linux.intel.com>,
"open list:TTY LAYER" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] serial: 8250_bcm7271: improve bcm7271 8250 port
Date: Sat, 12 Aug 2023 12:50:45 +0200 [thread overview]
Message-ID: <2023081221-truth-footsie-b5ab@gregkh> (raw)
In-Reply-To: <1691792050-25042-1-git-send-email-justin.chen@broadcom.com>
On Fri, Aug 11, 2023 at 03:14:01PM -0700, Justin Chen wrote:
> The 8250 bcm7271 UART is not a direct match to PORT_16550A. The
> Fifo is 32 and rxtrig values are {1, 8, 16, 30}. Create a PORT_BCM7271
> to better capture the HW CAPS.
>
> Default the rxtrig level to 8.
>
> Signed-off-by: Justin Chen <justin.chen@broadcom.com>
> ---
> drivers/tty/serial/8250/8250_bcm7271.c | 4 +---
> drivers/tty/serial/8250/8250_port.c | 8 ++++++++
> include/uapi/linux/serial_core.h | 3 +++
> 3 files changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/tty/serial/8250/8250_bcm7271.c b/drivers/tty/serial/8250/8250_bcm7271.c
> index d4b05d7ad9e8..aa5aff046756 100644
> --- a/drivers/tty/serial/8250/8250_bcm7271.c
> +++ b/drivers/tty/serial/8250/8250_bcm7271.c
> @@ -1042,7 +1042,7 @@ static int brcmuart_probe(struct platform_device *pdev)
> dev_dbg(dev, "DMA is %senabled\n", priv->dma_enabled ? "" : "not ");
>
> memset(&up, 0, sizeof(up));
> - up.port.type = PORT_16550A;
> + up.port.type = PORT_BCM7271;
> up.port.uartclk = clk_rate;
> up.port.dev = dev;
> up.port.mapbase = mapbase;
> @@ -1056,8 +1056,6 @@ static int brcmuart_probe(struct platform_device *pdev)
> | UPF_FIXED_PORT | UPF_FIXED_TYPE;
> up.port.dev = dev;
> up.port.private_data = priv;
> - up.capabilities = UART_CAP_FIFO | UART_CAP_AFE;
> - up.port.fifosize = 32;
>
> /* Check for a fixed line number */
> ret = of_alias_get_id(np, "serial");
> diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
> index 16aeb1420137..a6259a264041 100644
> --- a/drivers/tty/serial/8250/8250_port.c
> +++ b/drivers/tty/serial/8250/8250_port.c
> @@ -322,6 +322,14 @@ static const struct serial8250_config uart_config[] = {
> .rxtrig_bytes = {2, 66, 130, 194},
> .flags = UART_CAP_FIFO,
> },
> + [PORT_BCM7271] = {
> + .name = "bcm7271_uart",
> + .fifo_size = 32,
> + .tx_loadsz = 32,
> + .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_01,
> + .rxtrig_bytes = {1, 8, 16, 30},
> + .flags = UART_CAP_FIFO | UART_CAP_AFE
> + },
> };
>
> /* Uart divisor latch read */
> diff --git a/include/uapi/linux/serial_core.h b/include/uapi/linux/serial_core.h
> index 281fa286555c..369f845a3d1d 100644
> --- a/include/uapi/linux/serial_core.h
> +++ b/include/uapi/linux/serial_core.h
> @@ -279,4 +279,7 @@
> /* Sunplus UART */
> #define PORT_SUNPLUS 123
>
> +/* Broadcom 7271 UART */
> +#define PORT_BCM7271 124
Why is this new id required? What in userspace is going to use it and
why can't the generic value be used instead?
thanks,
greg k-h
next prev parent reply other threads:[~2023-08-12 10:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-11 22:14 [PATCH] serial: 8250_bcm7271: improve bcm7271 8250 port Justin Chen
2023-08-11 23:40 ` Florian Fainelli
2023-08-12 10:50 ` Greg Kroah-Hartman [this message]
2023-08-13 4:24 ` Justin Chen
2023-08-14 15:12 ` Andy Shevchenko
2023-08-14 16:28 ` Justin Chen
2023-08-14 18:09 ` Doug Berger
2023-08-15 6:43 ` Andy Shevchenko
2023-08-14 18:13 ` Doug Berger
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=2023081221-truth-footsie-b5ab@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=alcooperx@gmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=jiaqing.zhao@linux.intel.com \
--cc=jirislaby@kernel.org \
--cc=john.ogness@linutronix.de \
--cc=justin.chen@broadcom.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=opendmb@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.