From 966caedfa89acaeceb6968f051b7ae26c4c6673f Mon Sep 17 00:00:00 2001 From: Paul Barker Date: Thu, 19 Oct 2023 15:30:44 +0100 Subject: serial: sh: Add RZ/G2L SCIF support Extend the existing driver to support the SCIF serial ports on the Renesas RZ/G2L (R9A07G044) SoC. This also requires us to ensure that if there is a reset signal defined in the device tree, it is de-asserted before we try to talk to the SCIF module. Signed-off-by: Paul Barker Reviewed-by: Biju Das Reviewed-by: Lad Prabhakar Reviewed-by: Marek Vasut Tested-by: Marek Vasut # R-Car H3 Salvator-XS --- drivers/serial/serial_sh.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'drivers/serial/serial_sh.c') diff --git a/drivers/serial/serial_sh.c b/drivers/serial/serial_sh.c index 9a698b19ccd..c034ab54e15 100644 --- a/drivers/serial/serial_sh.c +++ b/drivers/serial/serial_sh.c @@ -12,10 +12,12 @@ #include #include #include +#include #include #include #include #include +#include #include #include "serial_sh.h" @@ -199,12 +201,24 @@ 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; + /* De-assert the module reset if it is defined. */ + ret = reset_get_by_index(dev, 0, &rst); + if (!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; @@ -221,6 +235,7 @@ static const struct dm_serial_ops sh_serial_ops = { static const struct udevice_id sh_serial_id[] ={ {.compatible = "renesas,sci", .data = PORT_SCI}, {.compatible = "renesas,scif", .data = PORT_SCIF}, + {.compatible = "renesas,scif-r9a07g044", .data = PORT_SCIFA}, {.compatible = "renesas,scifa", .data = PORT_SCIFA}, {.compatible = "renesas,hscif", .data = PORT_HSCIF}, {} -- cgit v1.2.3