[PATCH v2 12/19] serial: sh: Add RZ/G2L SCIF support

Marek Vasut marek.vasut at mailbox.org
Sat Oct 14 21:53:35 CEST 2023


On 10/9/23 18:46, Paul Barker wrote:
> Extend the existing driver to support the SCIF serial ports on the
> Renesas RZ/G2L (R9A07G044) SoC. This also requires us to ensure that the
> relevant reset signal is de-asserted before we try to talk to the SCIF
> module.
> 
> Signed-off-by: Paul Barker <paul.barker.ct at bp.renesas.com>
> Reviewed-by: Biju Das <biju.das.jz at bp.renesas.com>
> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj at bp.renesas.com>
> ---
> v1->v2:
>    * Moved handle_error() changes out to a separate patch earlier in the
>      series.
>    * Unconditionally de-assert the module reset during probe.
> 
>   arch/arm/mach-rmobile/Kconfig |  1 +
>   drivers/serial/serial_sh.c    | 17 +++++++++++++++++
>   drivers/serial/serial_sh.h    | 19 ++++++++++++++++++-
>   3 files changed, 36 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-rmobile/Kconfig b/arch/arm/mach-rmobile/Kconfig
> index c30ff2caad17..c421181c89cf 100644
> --- a/arch/arm/mach-rmobile/Kconfig
> +++ b/arch/arm/mach-rmobile/Kconfig
> @@ -77,6 +77,7 @@ config RZG2L
>   	imply MULTI_DTB_FIT_USER_DEFINED_AREA
>   	imply PINCTRL_RZG2L
>   	imply RENESAS_SDHI
> +	imply SCIF_CONSOLE
>   	imply SYS_MALLOC_F
>   	help
>   	  Enable support for the Renesas RZ/G2L family of SoCs. Currently
> diff --git a/drivers/serial/serial_sh.c b/drivers/serial/serial_sh.c
> index 2b650d458e71..6ea8da34d434 100644
> --- a/drivers/serial/serial_sh.c
> +++ b/drivers/serial/serial_sh.c
> @@ -17,6 +17,8 @@
>   #include <linux/compiler.h>
>   #include <dm/platform_data/serial_sh.h>
>   #include <linux/delay.h>
> +#include <dm/device_compat.h>
> +#include <reset.h>
>   #include "serial_sh.h"
>   
>   DECLARE_GLOBAL_DATA_PTR;
> @@ -199,12 +201,26 @@ static int sh_serial_probe(struct udevice *dev)
>   {
>   	struct sh_serial_plat *plat = dev_get_plat(dev);
>   	struct uart_port *priv = dev_get_priv(dev);
> +	struct reset_ctl rst;
> +	int ret;
>   
>   	priv->membase	= (unsigned char *)plat->base;
>   	priv->mapbase	= plat->base;
>   	priv->type	= plat->type;
>   	priv->clk_mode	= plat->clk_mode;
>   
> +	ret = reset_get_by_index(dev, 0, &rst);
> +	if (ret < 0) {
> +		dev_err(dev, "failed to get reset line\n");
> +		return ret;
> +	}
> +
> +	ret = reset_deassert(&rst);
> +	if (ret < 0) {
> +		dev_err(dev, "failed to de-assert reset line\n");
> +		return ret;
> +	}
> +
>   	sh_serial_init_generic(priv);
>   
>   	return 0;
> @@ -223,6 +239,7 @@ static const struct udevice_id sh_serial_id[] ={
>   	{.compatible = "renesas,scif", .data = PORT_SCIF},
>   	{.compatible = "renesas,scifa", .data = PORT_SCIFA},

Please keep the list sorted, the entry should be here.

>   	{.compatible = "renesas,hscif", .data = PORT_HSCIF},
> +	{.compatible = "renesas,scif-r9a07g044", .data = PORT_SCIFA},
>   	{}
>   };

With that fixed:

Reviewed-by: Marek Vasut <marek.vasut+renesas at mailbox.org>


More information about the U-Boot mailing list