Linux Serial subsystem development
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Biju Das <biju.das.jz@bp.renesas.com>
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Jiri Slaby" <jirislaby@kernel.org>,
	"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Maciej W. Rozycki" <macro@orcam.me.uk>,
	"Eric Tremblay" <etremblay@distech-controls.com>,
	"Wander Lairson Costa" <wander@redhat.com>,
	linux-serial <linux-serial@vger.kernel.org>,
	"Geert Uytterhoeven" <geert+renesas@glider.be>,
	"Fabrizio Castro" <fabrizio.castro.jz@renesas.com>,
	linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH 1/3] serial: 8250: Identify Renesas RZ/V2M 16750 UART
Date: Thu, 9 Feb 2023 16:08:57 +0200 (EET)	[thread overview]
Message-ID: <4470e054-ebe6-b3ca-ffd7-1c7c3ae09f1a@linux.intel.com> (raw)
In-Reply-To: <20230209132630.194947-2-biju.das.jz@bp.renesas.com>

On Thu, 9 Feb 2023, Biju Das wrote:

> Add identification support for RZ/V2M 16750 UART.
> 
> Currently, RZ/V2M UART is detected as 16550A instead of 16750.
> "a4040000.serial: ttyS0 at MMIO 0xa4040000 (irq = 14, base_baud = 3000000)
> is a 16550A"
> 
> After adding identification support, it is detected as
> "a4040000.serial: ttyS0 at MMIO 0xa4040000 (irq = 24, base_baud = 3000000)
> is a Renesas RZ/V2M 16750".
> 
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> ---
>  drivers/tty/serial/8250/8250_port.c | 27 +++++++++++++++++++++++++++
>  1 file changed, 27 insertions(+)
> 
> diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
> index e61753c295d5..e4b205e3756b 100644
> --- a/drivers/tty/serial/8250/8250_port.c
> +++ b/drivers/tty/serial/8250/8250_port.c
> @@ -111,6 +111,15 @@ static const struct serial8250_config uart_config[] = {
>  		.rxtrig_bytes	= {1, 16, 32, 56},
>  		.flags		= UART_CAP_FIFO | UART_CAP_SLEEP | UART_CAP_AFE,
>  	},
> +	[PORT_16750] = {
> +		.name		= "Renesas RZ/V2M 16750",
> +		.fifo_size	= 64,
> +		.tx_loadsz	= 64,
> +		.fcr		= UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10 |
> +				  UART_FCR7_64BYTE,
> +		.rxtrig_bytes	= {1, 16, 32, 56},
> +		.flags		= UART_CAP_FIFO | UART_CAP_AFE,
> +	},

Eh, how can you reuse [PORT_16750] again in the initializer like that?

-- 
 i.

>  	[PORT_STARTECH] = {
>  		.name		= "Startech",
>  		.fifo_size	= 1,
> @@ -1142,6 +1151,24 @@ static void autoconfig_16550a(struct uart_8250_port *up)
>  		return;
>  	}
>  
> +	/*
> +	 * No EFR.  Try to detect a Renesas RZ/V2M 16750, which only sets bit 5
> +	 * of the IIR when 64 byte FIFO mode is enabled.
> +	 * Try setting/clear bit5 of FCR.
> +	 */
> +	serial_out(up, UART_FCR, UART_FCR_ENABLE_FIFO);
> +	status1 = serial_in(up, UART_IIR) & (UART_IIR_64BYTE_FIFO | UART_IIR_FIFO_ENABLED);
> +
> +	serial_out(up, UART_FCR, UART_FCR_ENABLE_FIFO | UART_FCR7_64BYTE);
> +	status2 = serial_in(up, UART_IIR) & (UART_IIR_64BYTE_FIFO | UART_IIR_FIFO_ENABLED);
> +
> +	if (status1 == UART_IIR_FIFO_ENABLED_16550A &&
> +	    status2 == (UART_IIR_64BYTE_FIFO | UART_IIR_FIFO_ENABLED_16550A)) {
> +		up->port.type = PORT_16750;
> +		up->capabilities |= UART_CAP_AFE;
> +		return;
> +	}
> +
>  	/*
>  	 * Try writing and reading the UART_IER_UUE bit (b6).
>  	 * If it works, this is probably one of the Xscale platform's
> 


  reply	other threads:[~2023-02-09 14:21 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-09 13:26 [PATCH 0/3] Add Identification and 64 bit fifo support to Renesas RZ/V2M 16750 UART Biju Das
2023-02-09 13:26 ` [PATCH 1/3] serial: 8250: Identify " Biju Das
2023-02-09 14:08   ` Ilpo Järvinen [this message]
2023-02-09 14:28     ` Biju Das
2023-02-09 21:52       ` Andy Shevchenko
2023-02-10  7:14         ` Biju Das
2023-02-10 10:59           ` Andy Shevchenko
2023-02-10 11:53             ` Biju Das
2023-02-10 15:56               ` Andy Shevchenko
2023-02-09 13:26 ` [PATCH 2/3] serial: 8250_em: Use dev_err_probe() Biju Das
2023-02-09 17:49   ` Geert Uytterhoeven
2023-02-10 12:19     ` Biju Das
2023-02-09 13:26 ` [PATCH 3/3] serial: 8250_em: Add serial8250_rzv2m_reg_update() Biju Das
2023-02-09 14:29   ` Ilpo Järvinen
2023-02-10 13:47     ` Biju Das
2023-02-09 17:53   ` Geert Uytterhoeven
2023-02-10 13:49     ` Biju Das
2023-02-10 13:56       ` Ilpo Järvinen
2023-02-10 14:51         ` Biju Das

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=4470e054-ebe6-b3ca-ffd7-1c7c3ae09f1a@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=etremblay@distech-controls.com \
    --cc=fabrizio.castro.jz@renesas.com \
    --cc=geert+renesas@glider.be \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=macro@orcam.me.uk \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=wander@redhat.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