Re: [PATCH v3 12/13] serial: sh-sci: Add support for RZ/G3E RSCI SCIF

From: Geert Uytterhoeven

Date: Fri Nov 21 2025 - 09:46:42 EST


Hi Biju,

On Fri, 14 Nov 2025 at 11:52, Biju <biju.das.au@xxxxxxxxx> wrote:
> From: Biju Das <biju.das.jz@xxxxxxxxxxxxxx>
>
> Add support for RZ/G3E RSCI SCIF(a.k.a FIFO mode). RSCI IP found on the
> RZ/G3E SoC is similar to RZ/T2H, but it has a 32-stage FIFO. it has 6
> clocks(5 module clocks + 1 external clock) instead of 3 clocks(2 module
> clocks + 1 external clock) on T2H and has multiple resets. Add support
> for the hardware flow control.
>
> Signed-off-by: Biju Das <biju.das.jz@xxxxxxxxxxxxxx>
> ---
> v2->v3:
> * Dropped cpu_relax() from rsci_finish_console_write() and added a
> comment.
> * Added sci_is_rsci_fifo_type() helper for reuse in probe() and remove().

Thanks for the update!

> --- a/drivers/tty/serial/sh-sci.c
> +++ b/drivers/tty/serial/sh-sci.c
> @@ -3563,6 +3563,11 @@ static struct uart_driver sci_uart_driver = {
> .cons = SCI_CONSOLE,
> };
>
> +static bool sci_is_rsci_fifo_type(u8 type)
> +{
> + return (type == SCI_PORT_RSCI || type == RSCI_PORT_SCIF);
> +}
> +
> static void sci_remove(struct platform_device *dev)
> {
> struct sci_port *s = platform_get_drvdata(dev);
> @@ -3574,7 +3579,7 @@ static void sci_remove(struct platform_device *dev)
> if (s->port.fifosize > 1)
> device_remove_file(&dev->dev, &dev_attr_rx_fifo_trigger);
> if (type == PORT_SCIFA || type == PORT_SCIFB || type == PORT_HSCIF ||
> - type == SCI_PORT_RSCI)
> + sci_is_rsci_fifo_type(type))

I think Jiri intended[1] having a helper that covers all cases, not
just the two RSCI variants. E.g. sci_has_fifo(u8 type).

> device_remove_file(&dev->dev, &dev_attr_rx_fifo_timeout);
> }
>
> @@ -3669,6 +3674,10 @@ static const struct of_device_id of_sci_match[] __maybe_unused = {
> .data = &of_sci_scif_rzv2h,
> },
> #ifdef CONFIG_SERIAL_RSCI
> + {
> + .compatible = "renesas,r9a09g047-rscif",
> + .data = &of_rsci_scif_data,
> + },
> {
> .compatible = "renesas,r9a09g077-rsci",
> .data = &of_sci_rsci_data,
> @@ -3936,7 +3945,7 @@ static int sci_probe(struct platform_device *dev)
> return ret;
> }
> if (sp->type == PORT_SCIFA || sp->type == PORT_SCIFB ||
> - sp->type == PORT_HSCIF || sp->type == SCI_PORT_RSCI) {
> + sp->type == PORT_HSCIF || sci_is_rsci_fifo_type(sp->type)) {
> ret = device_create_file(&dev->dev, &dev_attr_rx_fifo_timeout);
> if (ret) {
> if (sp->port.fifosize > 1) {

[1] https://lore.kernel.org/all/19a08b75-13ca-45f9-884d-f96602336dfd@xxxxxxxxxx

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds