Linux Renesas SOC kernel development
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Biju Das <biju.das.jz@bp.renesas.com>
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Jiri Slaby" <jirislaby@kernel.org>,
	"Geert Uytterhoeven" <geert+renesas@glider.be>,
	linux-serial@vger.kernel.org,
	"Fabrizio Castro" <fabrizio.castro.jz@renesas.com>,
	linux-renesas-soc@vger.kernel.org,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Subject: Re: [PATCH v3 2/3] serial: 8250_em: Update RZ/V2M port type as PORT_16750
Date: Sun, 12 Feb 2023 13:02:52 +0200	[thread overview]
Message-ID: <Y+jHXKGlIs1Fnj3x@smile.fi.intel.com> (raw)
In-Reply-To: <20230210203439.174913-3-biju.das.jz@bp.renesas.com>

On Fri, Feb 10, 2023 at 08:34:38PM +0000, Biju Das wrote:
> The UART IP found on RZ/V2M SoC is Register-compatible with the
> general-purpose 16750 UART chip. This patch updates RZ/V2M
> port type from 16550A->16750 and also enables 64-bytes fifo support.

LGTM,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
> ---
> v2->v3:
>  * Replaced of_device_get_match_data()->device_get_match_data().
>  * Replaced of_device.h->property.h
>  * Dropped struct serial8250_em_hw_info *info from priv and started
>    using a local variable info in probe().
>  * Retained Rb tag from Ilpo as changes are trivial.
> v2:
>  * New patch
> ---
>  drivers/tty/serial/8250/8250_em.c | 28 ++++++++++++++++++++++++----
>  1 file changed, 24 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/tty/serial/8250/8250_em.c b/drivers/tty/serial/8250/8250_em.c
> index 9781bf73ed0c..69cd3b611501 100644
> --- a/drivers/tty/serial/8250/8250_em.c
> +++ b/drivers/tty/serial/8250/8250_em.c
> @@ -9,6 +9,7 @@
>  #include <linux/io.h>
>  #include <linux/module.h>
>  #include <linux/mod_devicetable.h>
> +#include <linux/property.h>
>  #include <linux/serial_8250.h>
>  #include <linux/serial_reg.h>
>  #include <linux/platform_device.h>
> @@ -19,6 +20,11 @@
>  #define UART_DLL_EM 9
>  #define UART_DLM_EM 10
>  
> +struct serial8250_em_hw_info {
> +	unsigned int type;
> +	upf_t flags;
> +};
> +
>  struct serial8250_em_priv {
>  	int line;
>  };
> @@ -76,6 +82,7 @@ static void serial8250_em_serial_dl_write(struct uart_8250_port *up, int value)
>  
>  static int serial8250_em_probe(struct platform_device *pdev)
>  {
> +	const struct serial8250_em_hw_info *info;
>  	struct serial8250_em_priv *priv;
>  	struct device *dev = &pdev->dev;
>  	struct uart_8250_port up;
> @@ -83,6 +90,8 @@ static int serial8250_em_probe(struct platform_device *pdev)
>  	struct clk *sclk;
>  	int irq, ret;
>  
> +	info = device_get_match_data(dev);
> +
>  	irq = platform_get_irq(pdev, 0);
>  	if (irq < 0)
>  		return irq;
> @@ -102,8 +111,8 @@ static int serial8250_em_probe(struct platform_device *pdev)
>  	memset(&up, 0, sizeof(up));
>  	up.port.mapbase = regs->start;
>  	up.port.irq = irq;
> -	up.port.type = PORT_UNKNOWN;
> -	up.port.flags = UPF_BOOT_AUTOCONF | UPF_FIXED_PORT | UPF_IOREMAP;
> +	up.port.type = info->type;
> +	up.port.flags = info->flags;
>  	up.port.dev = dev;
>  	up.port.private_data = priv;
>  
> @@ -132,9 +141,20 @@ static int serial8250_em_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> +static const struct serial8250_em_hw_info emma_mobile_uart_hw_info = {
> +	.type = PORT_UNKNOWN,
> +	.flags = UPF_BOOT_AUTOCONF | UPF_FIXED_PORT | UPF_IOREMAP,
> +};
> +
> +static const struct serial8250_em_hw_info rzv2m_uart_hw_info = {
> +	.type = PORT_16750,
> +	.flags = UPF_BOOT_AUTOCONF | UPF_FIXED_PORT | UPF_IOREMAP | UPF_FIXED_TYPE,
> +};
> +
>  static const struct of_device_id serial8250_em_dt_ids[] = {
> -	{ .compatible = "renesas,em-uart", },
> -	{},
> +	{ .compatible = "renesas,r9a09g011-uart", .data = &rzv2m_uart_hw_info },
> +	{ .compatible = "renesas,em-uart", .data = &emma_mobile_uart_hw_info },
> +	{ /* Sentinel */ }
>  };
>  MODULE_DEVICE_TABLE(of, serial8250_em_dt_ids);
>  
> -- 
> 2.25.1
> 
> 

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2023-02-12 11:03 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-10 20:34 [PATCH v3 0/3] Update Renesas RZ/V2M UART Port type Biju Das
2023-02-10 20:34 ` [PATCH v3 1/3] serial: 8250_em: Use dev_err_probe() Biju Das
2023-02-13  6:23   ` Jiri Slaby
2023-02-14 11:07     ` Biju Das
2023-02-10 20:34 ` [PATCH v3 2/3] serial: 8250_em: Update RZ/V2M port type as PORT_16750 Biju Das
2023-02-12 11:02   ` Andy Shevchenko [this message]
2023-02-13  6:26   ` Jiri Slaby
2023-02-13 16:02     ` Biju Das
2023-02-10 20:34 ` [PATCH v3 3/3] serial: 8250_em: Add serial_out() to struct serial8250_em_hw_info Biju Das
2023-02-12 11:09   ` Andy Shevchenko
2023-02-13  8:42   ` Ilpo Järvinen
2023-02-13  8:53     ` Biju Das
2023-02-13  9:10       ` Jiri Slaby
2023-02-13  9:12         ` Jiri Slaby
2023-02-13  9:14           ` Jiri Slaby
2023-02-13  9:31             ` Biju Das
2023-02-13  9:32               ` Jiri Slaby
2023-02-13 11:12                 ` Biju Das
2023-02-13 11:31                   ` Ilpo Järvinen
2023-02-13 11:40                     ` Biju Das
2023-02-13 12:05                       ` Ilpo Järvinen
2023-02-13 12:18                         ` Biju Das
2023-02-13 16:06                           ` Biju Das
2023-02-13  9:57               ` Niklas Söderlund
2023-02-13 10:06                 ` Biju Das
2023-02-13 10:29                   ` Niklas Söderlund
2023-02-13 13:01                     ` Biju Das
2023-02-13 14:09                       ` Niklas Söderlund
2023-02-13 14:26                         ` Biju Das
2023-02-13  9:22           ` Ilpo Järvinen
2023-02-13  9:28             ` Jiri Slaby
2023-02-13  9:40               ` Ilpo Järvinen
2023-02-13  9:53                 ` Jiri Slaby
2023-02-13  9:12       ` Ilpo Järvinen
2023-02-13  8:37 ` [PATCH v3 0/3] Update Renesas RZ/V2M UART Port type Ilpo Järvinen

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=Y+jHXKGlIs1Fnj3x@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=fabrizio.castro.jz@renesas.com \
    --cc=geert+renesas@glider.be \
    --cc=gregkh@linuxfoundation.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jirislaby@kernel.org \
    --cc=linux-renesas-soc@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