All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sh-sci: add R8A7743/5 support
@ 2016-09-29 21:37 Sergei Shtylyov
  2016-09-30  6:35 ` Simon Horman
  2016-09-30  8:38 ` Geert Uytterhoeven
  0 siblings, 2 replies; 12+ messages in thread
From: Sergei Shtylyov @ 2016-09-29 21:37 UTC (permalink / raw)
  To: gregkh, jslaby, linux-serial, robh+dt, mark.rutland; +Cc: linux-renesas-soc

Renesas  RZ/G SoC also have the SCIF, SCIFA, SCIFB, and HSCIF ports.
Document RZ/G1[ME] (also known as R8A774[35]) SoC bindings along with
the RZ/G family bindings.  The driver itself also needs to recognize
the latter binding for the SCIF ports, so teach it...

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

---
This patch is against the 'tty-next' branch of GregKH's 'tty.git' repo.

 Documentation/devicetree/bindings/serial/renesas,sci-serial.txt |   12 ++++++++++
 drivers/tty/serial/sh-sci.c                                     |    3 ++
 2 files changed, 15 insertions(+)

Index: tty/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt
===================================================================
--- tty.orig/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt
+++ tty/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt
@@ -9,6 +9,14 @@ Required properties:
     - "renesas,scifb-r8a73a4" for R8A73A4 (R-Mobile APE6) SCIFB compatible UART.
     - "renesas,scifa-r8a7740" for R8A7740 (R-Mobile A1) SCIFA compatible UART.
     - "renesas,scifb-r8a7740" for R8A7740 (R-Mobile A1) SCIFB compatible UART.
+    - "renesas,scif-r8a7743" for R8A7743 (RZ/G1M) SCIF compatible UART.
+    - "renesas,scifa-r8a7743" for R8A7743 (RZ/G1M) SCIFA compatible UART.
+    - "renesas,scifb-r8a7743" for R8A7743 (RZ/G1M) SCIFB compatible UART.
+    - "renesas,hscif-r8a7743" for R8A7743 (RZ/G1M) HSCIF compatible UART.
+    - "renesas,scif-r8a7745" for R8A7745 (RZ/G1E) SCIF compatible UART.
+    - "renesas,scifa-r8a7745" for R8A7745 (RZ/G1E) SCIFA compatible UART.
+    - "renesas,scifb-r8a7745" for R8A7745 (RZ/G1E) SCIFB compatible UART.
+    - "renesas,hscif-r8a7745" for R8A7745 (RZ/G1E) HSCIF compatible UART.
     - "renesas,scif-r8a7778" for R8A7778 (R-Car M1) SCIF compatible UART.
     - "renesas,scif-r8a7779" for R8A7779 (R-Car H1) SCIF compatible UART.
     - "renesas,scif-r8a7790" for R8A7790 (R-Car H2) SCIF compatible UART.
@@ -38,11 +46,15 @@ Required properties:
     - "renesas,rcar-gen1-scif" for R-Car Gen1 SCIF compatible UART,
     - "renesas,rcar-gen2-scif" for R-Car Gen2 SCIF compatible UART,
     - "renesas,rcar-gen3-scif" for R-Car Gen3 SCIF compatible UART,
+    - "renesas,rzg-scif" for RZ/G SCIF compatible UART.
     - "renesas,rcar-gen2-scifa" for R-Car Gen2 SCIFA compatible UART,
+    - "renesas,rzg-scifa" for RZ/G SCIFA compatible UART.
     - "renesas,rcar-gen2-scifb" for R-Car Gen2 SCIFB compatible UART,
+    - "renesas,rzg-scifb" for RZ/G SCIFB compatible UART.
     - "renesas,rcar-gen1-hscif" for R-Car Gen1 HSCIF compatible UART,
     - "renesas,rcar-gen2-hscif" for R-Car Gen2 HSCIF compatible UART,
     - "renesas,rcar-gen3-hscif" for R-Car Gen3 HSCIF compatible UART,
+    - "renesas,rzg-hscif" for RZ/G HSCIF compatible UART.
     - "renesas,scif" for generic SCIF compatible UART.
     - "renesas,scifa" for generic SCIFA compatible UART.
     - "renesas,scifb" for generic SCIFB compatible UART.
Index: tty/drivers/tty/serial/sh-sci.c
===================================================================
--- tty.orig/drivers/tty/serial/sh-sci.c
+++ tty/drivers/tty/serial/sh-sci.c
@@ -2950,6 +2950,9 @@ static const struct of_device_id of_sci_
 	}, {
 		.compatible = "renesas,rcar-gen3-scif",
 		.data = SCI_OF_DATA(PORT_SCIF, SCIx_SH4_SCIF_BRG_REGTYPE),
+	}, {
+		.compatible = "renesas,rzg-scif",
+		.data = SCI_OF_DATA(PORT_SCIF, SCIx_SH4_SCIF_BRG_REGTYPE),
 	},
 	/* Generic types */
 	{

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] sh-sci: add R8A7743/5 support
  2016-09-29 21:37 [PATCH] sh-sci: add R8A7743/5 support Sergei Shtylyov
@ 2016-09-30  6:35 ` Simon Horman
  2016-09-30  8:38 ` Geert Uytterhoeven
  1 sibling, 0 replies; 12+ messages in thread
From: Simon Horman @ 2016-09-30  6:35 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: gregkh, jslaby, linux-serial, robh+dt, mark.rutland, linux-renesas-soc

On Fri, Sep 30, 2016 at 12:37:13AM +0300, Sergei Shtylyov wrote:
> Renesas  RZ/G SoC also have the SCIF, SCIFA, SCIFB, and HSCIF ports.
> Document RZ/G1[ME] (also known as R8A774[35]) SoC bindings along with
> the RZ/G family bindings.  The driver itself also needs to recognize
> the latter binding for the SCIF ports, so teach it...
> 
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

Acked-by: Simon Horman <horms+renesas@verge.net.au>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] sh-sci: add R8A7743/5 support
  2016-09-29 21:37 [PATCH] sh-sci: add R8A7743/5 support Sergei Shtylyov
  2016-09-30  6:35 ` Simon Horman
@ 2016-09-30  8:38 ` Geert Uytterhoeven
  2016-09-30 15:06   ` Sergei Shtylyov
  2016-10-05  9:55   ` Laurent Pinchart
  1 sibling, 2 replies; 12+ messages in thread
From: Geert Uytterhoeven @ 2016-09-30  8:38 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: Greg KH, Jiri Slaby, linux-serial, Rob Herring, Mark Rutland,
	Linux-Renesas

Hi Sergei,

On Thu, Sep 29, 2016 at 11:37 PM, Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
> Renesas  RZ/G SoC also have the SCIF, SCIFA, SCIFB, and HSCIF ports.
> Document RZ/G1[ME] (also known as R8A774[35]) SoC bindings along with
> the RZ/G family bindings.  The driver itself also needs to recognize
> the latter binding for the SCIF ports, so teach it...
>
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>
> ---
> This patch is against the 'tty-next' branch of GregKH's 'tty.git' repo.
>
>  Documentation/devicetree/bindings/serial/renesas,sci-serial.txt |   12 ++++++++++
>  drivers/tty/serial/sh-sci.c                                     |    3 ++
>  2 files changed, 15 insertions(+)
>
> Index: tty/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt
> ===================================================================
> --- tty.orig/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt
> +++ tty/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt
> @@ -9,6 +9,14 @@ Required properties:
>      - "renesas,scifb-r8a73a4" for R8A73A4 (R-Mobile APE6) SCIFB compatible UART.
>      - "renesas,scifa-r8a7740" for R8A7740 (R-Mobile A1) SCIFA compatible UART.
>      - "renesas,scifb-r8a7740" for R8A7740 (R-Mobile A1) SCIFB compatible UART.
> +    - "renesas,scif-r8a7743" for R8A7743 (RZ/G1M) SCIF compatible UART.
> +    - "renesas,scifa-r8a7743" for R8A7743 (RZ/G1M) SCIFA compatible UART.
> +    - "renesas,scifb-r8a7743" for R8A7743 (RZ/G1M) SCIFB compatible UART.
> +    - "renesas,hscif-r8a7743" for R8A7743 (RZ/G1M) HSCIF compatible UART.
> +    - "renesas,scif-r8a7745" for R8A7745 (RZ/G1E) SCIF compatible UART.
> +    - "renesas,scifa-r8a7745" for R8A7745 (RZ/G1E) SCIFA compatible UART.
> +    - "renesas,scifb-r8a7745" for R8A7745 (RZ/G1E) SCIFB compatible UART.
> +    - "renesas,hscif-r8a7745" for R8A7745 (RZ/G1E) HSCIF compatible UART.
>      - "renesas,scif-r8a7778" for R8A7778 (R-Car M1) SCIF compatible UART.
>      - "renesas,scif-r8a7779" for R8A7779 (R-Car H1) SCIF compatible UART.
>      - "renesas,scif-r8a7790" for R8A7790 (R-Car H2) SCIF compatible UART.

For the part above:
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>

> @@ -38,11 +46,15 @@ Required properties:
>      - "renesas,rcar-gen1-scif" for R-Car Gen1 SCIF compatible UART,
>      - "renesas,rcar-gen2-scif" for R-Car Gen2 SCIF compatible UART,
>      - "renesas,rcar-gen3-scif" for R-Car Gen3 SCIF compatible UART,
> +    - "renesas,rzg-scif" for RZ/G SCIF compatible UART.
>      - "renesas,rcar-gen2-scifa" for R-Car Gen2 SCIFA compatible UART,
> +    - "renesas,rzg-scifa" for RZ/G SCIFA compatible UART.
>      - "renesas,rcar-gen2-scifb" for R-Car Gen2 SCIFB compatible UART,
> +    - "renesas,rzg-scifb" for RZ/G SCIFB compatible UART.
>      - "renesas,rcar-gen1-hscif" for R-Car Gen1 HSCIF compatible UART,
>      - "renesas,rcar-gen2-hscif" for R-Car Gen2 HSCIF compatible UART,
>      - "renesas,rcar-gen3-hscif" for R-Car Gen3 HSCIF compatible UART,
> +    - "renesas,rzg-hscif" for RZ/G HSCIF compatible UART.
>      - "renesas,scif" for generic SCIF compatible UART.
>      - "renesas,scifa" for generic SCIFA compatible UART.
>      - "renesas,scifb" for generic SCIFB compatible UART.
> Index: tty/drivers/tty/serial/sh-sci.c
> ===================================================================
> --- tty.orig/drivers/tty/serial/sh-sci.c
> +++ tty/drivers/tty/serial/sh-sci.c
> @@ -2950,6 +2950,9 @@ static const struct of_device_id of_sci_
>         }, {
>                 .compatible = "renesas,rcar-gen3-scif",
>                 .data = SCI_OF_DATA(PORT_SCIF, SCIx_SH4_SCIF_BRG_REGTYPE),
> +       }, {
> +               .compatible = "renesas,rzg-scif",
> +               .data = SCI_OF_DATA(PORT_SCIF, SCIx_SH4_SCIF_BRG_REGTYPE),
>         },
>         /* Generic types */
>         {

However, I wouldn't bother adding RZ/G family-specific DT bindings, as
RZ/G is a derivative of R-Car Gen2.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] sh-sci: add R8A7743/5 support
  2016-09-30  8:38 ` Geert Uytterhoeven
@ 2016-09-30 15:06   ` Sergei Shtylyov
  2016-10-05  9:55   ` Laurent Pinchart
  1 sibling, 0 replies; 12+ messages in thread
From: Sergei Shtylyov @ 2016-09-30 15:06 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Greg KH, Jiri Slaby, linux-serial, Rob Herring, Mark Rutland,
	Linux-Renesas

On 09/30/2016 11:38 AM, Geert Uytterhoeven wrote:

>> Renesas  RZ/G SoC also have the SCIF, SCIFA, SCIFB, and HSCIF ports.
>> Document RZ/G1[ME] (also known as R8A774[35]) SoC bindings along with
>> the RZ/G family bindings.  The driver itself also needs to recognize
>> the latter binding for the SCIF ports, so teach it...
>>
>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
[...]

>> ===================================================================
>> --- tty.orig/drivers/tty/serial/sh-sci.c
>> +++ tty/drivers/tty/serial/sh-sci.c
>> @@ -2950,6 +2950,9 @@ static const struct of_device_id of_sci_
>>         }, {
>>                 .compatible = "renesas,rcar-gen3-scif",
>>                 .data = SCI_OF_DATA(PORT_SCIF, SCIx_SH4_SCIF_BRG_REGTYPE),
>> +       }, {
>> +               .compatible = "renesas,rzg-scif",
>> +               .data = SCI_OF_DATA(PORT_SCIF, SCIx_SH4_SCIF_BRG_REGTYPE),
>>         },
>>         /* Generic types */
>>         {
>
> However, I wouldn't bother adding RZ/G family-specific DT bindings, as
> RZ/G is a derivative of R-Car Gen2.

    Then we shouldn't have added gen2/3 bindings too since they resolve to the 
same register mapping as gen1. :-)

> Gr{oetje,eeting}s,
>
>                         Geert

MBR, Sergei

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] sh-sci: add R8A7743/5 support
  2016-09-30  8:38 ` Geert Uytterhoeven
  2016-09-30 15:06   ` Sergei Shtylyov
@ 2016-10-05  9:55   ` Laurent Pinchart
  2016-10-05 10:03     ` Geert Uytterhoeven
  2016-10-05 13:28     ` Rob Herring
  1 sibling, 2 replies; 12+ messages in thread
From: Laurent Pinchart @ 2016-10-05  9:55 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Sergei Shtylyov, Greg KH, Jiri Slaby, linux-serial, Rob Herring,
	Mark Rutland, Linux-Renesas

On Friday 30 Sep 2016 10:38:48 Geert Uytterhoeven wrote:
> On Thu, Sep 29, 2016 at 11:37 PM, Sergei Shtylyov wrote:
> > Renesas  RZ/G SoC also have the SCIF, SCIFA, SCIFB, and HSCIF ports.
> > Document RZ/G1[ME] (also known as R8A774[35]) SoC bindings along with
> > the RZ/G family bindings.  The driver itself also needs to recognize
> > the latter binding for the SCIF ports, so teach it...
> > 
> > Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> > 
> > ---
> > This patch is against the 'tty-next' branch of GregKH's 'tty.git' repo.
> > 
> >  Documentation/devicetree/bindings/serial/renesas,sci-serial.txt |   12
> >  ++++++++++
> >  drivers/tty/serial/sh-sci.c                                     |    3 ++
> >  2 files changed, 15 insertions(+)
> > 
> > Index: tty/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt
> > ===================================================================
> > ---
> > tty.orig/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt
> > +++ tty/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt> 
> > @@ -9,6 +9,14 @@ Required properties:
> >      - "renesas,scifb-r8a73a4" for R8A73A4 (R-Mobile APE6) SCIFB
> >      compatible UART. - "renesas,scifa-r8a7740" for R8A7740 (R-Mobile A1)
> >      SCIFA compatible UART. - "renesas,scifb-r8a7740" for R8A7740
> >      (R-Mobile A1) SCIFB compatible UART.> 
> > +    - "renesas,scif-r8a7743" for R8A7743 (RZ/G1M) SCIF compatible UART.
> > +    - "renesas,scifa-r8a7743" for R8A7743 (RZ/G1M) SCIFA compatible UART.
> > +    - "renesas,scifb-r8a7743" for R8A7743 (RZ/G1M) SCIFB compatible UART.
> > +    - "renesas,hscif-r8a7743" for R8A7743 (RZ/G1M) HSCIF compatible UART.
> > +    - "renesas,scif-r8a7745" for R8A7745 (RZ/G1E) SCIF compatible UART.
> > +    - "renesas,scifa-r8a7745" for R8A7745 (RZ/G1E) SCIFA compatible UART.
> > +    - "renesas,scifb-r8a7745" for R8A7745 (RZ/G1E) SCIFB compatible UART.
> > +    - "renesas,hscif-r8a7745" for R8A7745 (RZ/G1E) HSCIF compatible UART.

Are we *really* going to add four compat string for each RZ/G* SoC ? We're 
reaching the limit of sanity...

> >      - "renesas,scif-r8a7778" for R8A7778 (R-Car M1) SCIF compatible UART.
> >      - "renesas,scif-r8a7779" for R8A7779 (R-Car H1) SCIF compatible UART.
> >      - "renesas,scif-r8a7790" for R8A7790 (R-Car H2) SCIF compatible UART.
> 
> For the part above:
> Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
> 
> > @@ -38,11 +46,15 @@ Required properties:
> >      - "renesas,rcar-gen1-scif" for R-Car Gen1 SCIF compatible UART,
> >      - "renesas,rcar-gen2-scif" for R-Car Gen2 SCIF compatible UART,
> >      - "renesas,rcar-gen3-scif" for R-Car Gen3 SCIF compatible UART,
> > +    - "renesas,rzg-scif" for RZ/G SCIF compatible UART.
> >      - "renesas,rcar-gen2-scifa" for R-Car Gen2 SCIFA compatible UART,
> > +    - "renesas,rzg-scifa" for RZ/G SCIFA compatible UART.
> >      - "renesas,rcar-gen2-scifb" for R-Car Gen2 SCIFB compatible UART,
> > +    - "renesas,rzg-scifb" for RZ/G SCIFB compatible UART.
> >      - "renesas,rcar-gen1-hscif" for R-Car Gen1 HSCIF compatible UART,
> >      - "renesas,rcar-gen2-hscif" for R-Car Gen2 HSCIF compatible UART,
> >      - "renesas,rcar-gen3-hscif" for R-Car Gen3 HSCIF compatible UART,
> > +    - "renesas,rzg-hscif" for RZ/G HSCIF compatible UART.
> >      - "renesas,scif" for generic SCIF compatible UART.
> >      - "renesas,scifa" for generic SCIFA compatible UART.
> >      - "renesas,scifb" for generic SCIFB compatible UART.
> > 
> > Index: tty/drivers/tty/serial/sh-sci.c
> > ===================================================================
> > --- tty.orig/drivers/tty/serial/sh-sci.c
> > +++ tty/drivers/tty/serial/sh-sci.c
> > @@ -2950,6 +2950,9 @@ static const struct of_device_id of_sci_
> >         }, {
> >                 .compatible = "renesas,rcar-gen3-scif",
> >                 .data = SCI_OF_DATA(PORT_SCIF, SCIx_SH4_SCIF_BRG_REGTYPE),
> > 
> > +       }, {
> > +               .compatible = "renesas,rzg-scif",
> > +               .data = SCI_OF_DATA(PORT_SCIF, SCIx_SH4_SCIF_BRG_REGTYPE),
> >         },
> >         /* Generic types */
> >         {
> 
> However, I wouldn't bother adding RZ/G family-specific DT bindings, as
> RZ/G is a derivative of R-Car Gen2.

I agree, we need to stop the compat string proliferation madness.

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] sh-sci: add R8A7743/5 support
  2016-10-05  9:55   ` Laurent Pinchart
@ 2016-10-05 10:03     ` Geert Uytterhoeven
  2016-10-05 13:28       ` Laurent Pinchart
  2016-10-05 13:28     ` Rob Herring
  1 sibling, 1 reply; 12+ messages in thread
From: Geert Uytterhoeven @ 2016-10-05 10:03 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Sergei Shtylyov, Greg KH, Jiri Slaby, linux-serial, Rob Herring,
	Mark Rutland, Linux-Renesas

Hi Laurent,

On Wed, Oct 5, 2016 at 11:55 AM, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
> On Friday 30 Sep 2016 10:38:48 Geert Uytterhoeven wrote:
>> On Thu, Sep 29, 2016 at 11:37 PM, Sergei Shtylyov wrote:
>> > Renesas  RZ/G SoC also have the SCIF, SCIFA, SCIFB, and HSCIF ports.
>> > Document RZ/G1[ME] (also known as R8A774[35]) SoC bindings along with
>> > the RZ/G family bindings.  The driver itself also needs to recognize
>> > the latter binding for the SCIF ports, so teach it...
>> >
>> > Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>> >
>> > ---
>> > This patch is against the 'tty-next' branch of GregKH's 'tty.git' repo.
>> >
>> >  Documentation/devicetree/bindings/serial/renesas,sci-serial.txt |   12
>> >  ++++++++++
>> >  drivers/tty/serial/sh-sci.c                                     |    3 ++
>> >  2 files changed, 15 insertions(+)
>> >
>> > Index: tty/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt
>> > ===================================================================
>> > ---
>> > tty.orig/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt
>> > +++ tty/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt>
>> > @@ -9,6 +9,14 @@ Required properties:
>> >      - "renesas,scifb-r8a73a4" for R8A73A4 (R-Mobile APE6) SCIFB
>> >      compatible UART. - "renesas,scifa-r8a7740" for R8A7740 (R-Mobile A1)
>> >      SCIFA compatible UART. - "renesas,scifb-r8a7740" for R8A7740
>> >      (R-Mobile A1) SCIFB compatible UART.>
>> > +    - "renesas,scif-r8a7743" for R8A7743 (RZ/G1M) SCIF compatible UART.
>> > +    - "renesas,scifa-r8a7743" for R8A7743 (RZ/G1M) SCIFA compatible UART.
>> > +    - "renesas,scifb-r8a7743" for R8A7743 (RZ/G1M) SCIFB compatible UART.
>> > +    - "renesas,hscif-r8a7743" for R8A7743 (RZ/G1M) HSCIF compatible UART.
>> > +    - "renesas,scif-r8a7745" for R8A7745 (RZ/G1E) SCIF compatible UART.
>> > +    - "renesas,scifa-r8a7745" for R8A7745 (RZ/G1E) SCIFA compatible UART.
>> > +    - "renesas,scifb-r8a7745" for R8A7745 (RZ/G1E) SCIFB compatible UART.
>> > +    - "renesas,hscif-r8a7745" for R8A7745 (RZ/G1E) HSCIF compatible UART.
>
> Are we *really* going to add four compat string for each RZ/G* SoC ? We're
> reaching the limit of sanity...

Soon we can use soc_device_match(), if we ever need to handle r8a7743 or
r8a7745 quirks?

Declaring it is compatible with renesas,rcar-gen2-scif is still good/needed for
the BRG (Baud Rate Generator for External Clock), which is not present on e.g.
RZ/A1H.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] sh-sci: add R8A7743/5 support
  2016-10-05  9:55   ` Laurent Pinchart
  2016-10-05 10:03     ` Geert Uytterhoeven
@ 2016-10-05 13:28     ` Rob Herring
  2016-10-05 13:37       ` Laurent Pinchart
  1 sibling, 1 reply; 12+ messages in thread
From: Rob Herring @ 2016-10-05 13:28 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Geert Uytterhoeven, Sergei Shtylyov, Greg KH, Jiri Slaby,
	linux-serial, Mark Rutland, Linux-Renesas

On Wed, Oct 5, 2016 at 4:55 AM, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
> On Friday 30 Sep 2016 10:38:48 Geert Uytterhoeven wrote:
>> On Thu, Sep 29, 2016 at 11:37 PM, Sergei Shtylyov wrote:
>> > Renesas  RZ/G SoC also have the SCIF, SCIFA, SCIFB, and HSCIF ports.
>> > Document RZ/G1[ME] (also known as R8A774[35]) SoC bindings along with
>> > the RZ/G family bindings.  The driver itself also needs to recognize
>> > the latter binding for the SCIF ports, so teach it...
>> >
>> > Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>> >
>> > ---
>> > This patch is against the 'tty-next' branch of GregKH's 'tty.git' repo.
>> >
>> >  Documentation/devicetree/bindings/serial/renesas,sci-serial.txt |   12
>> >  ++++++++++
>> >  drivers/tty/serial/sh-sci.c                                     |    3 ++
>> >  2 files changed, 15 insertions(+)
>> >
>> > Index: tty/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt
>> > ===================================================================
>> > ---
>> > tty.orig/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt
>> > +++ tty/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt>
>> > @@ -9,6 +9,14 @@ Required properties:
>> >      - "renesas,scifb-r8a73a4" for R8A73A4 (R-Mobile APE6) SCIFB
>> >      compatible UART. - "renesas,scifa-r8a7740" for R8A7740 (R-Mobile A1)
>> >      SCIFA compatible UART. - "renesas,scifb-r8a7740" for R8A7740
>> >      (R-Mobile A1) SCIFB compatible UART.>
>> > +    - "renesas,scif-r8a7743" for R8A7743 (RZ/G1M) SCIF compatible UART.
>> > +    - "renesas,scifa-r8a7743" for R8A7743 (RZ/G1M) SCIFA compatible UART.
>> > +    - "renesas,scifb-r8a7743" for R8A7743 (RZ/G1M) SCIFB compatible UART.
>> > +    - "renesas,hscif-r8a7743" for R8A7743 (RZ/G1M) HSCIF compatible UART.
>> > +    - "renesas,scif-r8a7745" for R8A7745 (RZ/G1E) SCIF compatible UART.
>> > +    - "renesas,scifa-r8a7745" for R8A7745 (RZ/G1E) SCIFA compatible UART.
>> > +    - "renesas,scifb-r8a7745" for R8A7745 (RZ/G1E) SCIFB compatible UART.
>> > +    - "renesas,hscif-r8a7745" for R8A7745 (RZ/G1E) HSCIF compatible UART.
>
> Are we *really* going to add four compat string for each RZ/G* SoC ? We're
> reaching the limit of sanity...

Is it really 4 distinct UARTs on a chip? DT can't fix that insanity.

Rob

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] sh-sci: add R8A7743/5 support
  2016-10-05 10:03     ` Geert Uytterhoeven
@ 2016-10-05 13:28       ` Laurent Pinchart
  0 siblings, 0 replies; 12+ messages in thread
From: Laurent Pinchart @ 2016-10-05 13:28 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Sergei Shtylyov, Greg KH, Jiri Slaby, linux-serial, Rob Herring,
	Mark Rutland, Linux-Renesas

On Wednesday 05 Oct 2016 12:03:24 Geert Uytterhoeven wrote:
> Hi Laurent,
> 
> On Wed, Oct 5, 2016 at 11:55 AM, Laurent Pinchart
> 
> <laurent.pinchart@ideasonboard.com> wrote:
> > On Friday 30 Sep 2016 10:38:48 Geert Uytterhoeven wrote:
> >> On Thu, Sep 29, 2016 at 11:37 PM, Sergei Shtylyov wrote:
> >> > Renesas  RZ/G SoC also have the SCIF, SCIFA, SCIFB, and HSCIF ports.
> >> > Document RZ/G1[ME] (also known as R8A774[35]) SoC bindings along with
> >> > the RZ/G family bindings.  The driver itself also needs to recognize
> >> > the latter binding for the SCIF ports, so teach it...
> >> > 
> >> > Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> >> > 
> >> > ---
> >> > This patch is against the 'tty-next' branch of GregKH's 'tty.git' repo.
> >> > 
> >> >  Documentation/devicetree/bindings/serial/renesas,sci-serial.txt |   12
> >> >  ++++++++++
> >> >  drivers/tty/serial/sh-sci.c                                     |    3
> >> >  ++
> >> >  2 files changed, 15 insertions(+)
> >> > 
> >> > Index:
> >> > tty/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt
> >> > ===================================================================
> >> > ---
> >> > tty.orig/Documentation/devicetree/bindings/serial/renesas,sci-serial.tx
> >> > t
> >> > +++
> >> > tty/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt>
> >> > 
> >> > @@ -9,6 +9,14 @@ Required properties:
> >> >      - "renesas,scifb-r8a73a4" for R8A73A4 (R-Mobile APE6) SCIFB
> >> >      compatible UART. - "renesas,scifa-r8a7740" for R8A7740 (R-Mobile
> >> >      A1)
> >> >      SCIFA compatible UART. - "renesas,scifb-r8a7740" for R8A7740
> >> >      (R-Mobile A1) SCIFB compatible UART.>
> >> > 
> >> > +    - "renesas,scif-r8a7743" for R8A7743 (RZ/G1M) SCIF compatible
> >> > UART.
> >> > +    - "renesas,scifa-r8a7743" for R8A7743 (RZ/G1M) SCIFA compatible
> >> > UART.
> >> > +    - "renesas,scifb-r8a7743" for R8A7743 (RZ/G1M) SCIFB compatible
> >> > UART.
> >> > +    - "renesas,hscif-r8a7743" for R8A7743 (RZ/G1M) HSCIF compatible
> >> > UART.
> >> > +    - "renesas,scif-r8a7745" for R8A7745 (RZ/G1E) SCIF compatible
> >> > UART.
> >> > +    - "renesas,scifa-r8a7745" for R8A7745 (RZ/G1E) SCIFA compatible
> >> > UART.
> >> > +    - "renesas,scifb-r8a7745" for R8A7745 (RZ/G1E) SCIFB compatible
> >> > UART.
> >> > +    - "renesas,hscif-r8a7745" for R8A7745 (RZ/G1E) HSCIF compatible
> >> > UART.
> > 
> > Are we *really* going to add four compat string for each RZ/G* SoC ? We're
> > reaching the limit of sanity...
> 
> Soon we can use soc_device_match(), if we ever need to handle r8a7743 or
> r8a7745 quirks?

We could, but I believe usage of soc_device_match() should be kept minimal, 
otherwise we could remove all compat strings but one and handle all 
differences in the driver with soc_device_match(). That's a topic I'd like to 
discuss face to face in Berlin. The recent new compatible strings show we have 
a problem, and we need to agree on how to address it.

> Declaring it is compatible with renesas,rcar-gen2-scif is still good/needed
> for the BRG (Baud Rate Generator for External Clock), which is not present
> on e.g. RZ/A1H.

Given that the RZ/G1[ME] SCIFs seem to be compatible with the Gen2 SCIFs using 
the renesas,rcar-gen2-scif compat string seems fine to me.

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] sh-sci: add R8A7743/5 support
  2016-10-05 13:28     ` Rob Herring
@ 2016-10-05 13:37       ` Laurent Pinchart
  2016-10-05 13:50         ` Chris Brandt
  2016-10-06 20:55         ` Geert Uytterhoeven
  0 siblings, 2 replies; 12+ messages in thread
From: Laurent Pinchart @ 2016-10-05 13:37 UTC (permalink / raw)
  To: Rob Herring
  Cc: Geert Uytterhoeven, Sergei Shtylyov, Greg KH, Jiri Slaby,
	linux-serial, Mark Rutland, Linux-Renesas

On Wednesday 05 Oct 2016 08:28:05 Rob Herring wrote:
> On Wed, Oct 5, 2016 at 4:55 AM, Laurent Pinchart
> 
> <laurent.pinchart@ideasonboard.com> wrote:
> > On Friday 30 Sep 2016 10:38:48 Geert Uytterhoeven wrote:
> >> On Thu, Sep 29, 2016 at 11:37 PM, Sergei Shtylyov wrote:
> >> > Renesas  RZ/G SoC also have the SCIF, SCIFA, SCIFB, and HSCIF ports.
> >> > Document RZ/G1[ME] (also known as R8A774[35]) SoC bindings along with
> >> > the RZ/G family bindings.  The driver itself also needs to recognize
> >> > the latter binding for the SCIF ports, so teach it...
> >> > 
> >> > Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> >> > 
> >> > ---
> >> > This patch is against the 'tty-next' branch of GregKH's 'tty.git' repo.
> >> > 
> >> >  Documentation/devicetree/bindings/serial/renesas,sci-serial.txt |   12
> >> >  ++++++++++
> >> >  drivers/tty/serial/sh-sci.c                                     |    3
> >> >  ++
> >> >  2 files changed, 15 insertions(+)
> >> > 
> >> > Index:
> >> > tty/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt
> >> > ===================================================================
> >> > ---
> >> > tty.orig/Documentation/devicetree/bindings/serial/renesas,sci-serial.tx
> >> > t
> >> > +++
> >> > tty/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt>
> >> > 
> >> > @@ -9,6 +9,14 @@ Required properties:
> >> >      - "renesas,scifb-r8a73a4" for R8A73A4 (R-Mobile APE6) SCIFB
> >> >      compatible UART. - "renesas,scifa-r8a7740" for R8A7740 (R-Mobile
> >> >      A1)
> >> >      SCIFA compatible UART. - "renesas,scifb-r8a7740" for R8A7740
> >> >      (R-Mobile A1) SCIFB compatible UART.>
> >> > 
> >> > +    - "renesas,scif-r8a7743" for R8A7743 (RZ/G1M) SCIF compatible
> >> > UART.
> >> > +    - "renesas,scifa-r8a7743" for R8A7743 (RZ/G1M) SCIFA compatible
> >> > UART.
> >> > +    - "renesas,scifb-r8a7743" for R8A7743 (RZ/G1M) SCIFB compatible
> >> > UART.
> >> > +    - "renesas,hscif-r8a7743" for R8A7743 (RZ/G1M) HSCIF compatible
> >> > UART.
> >> > +    - "renesas,scif-r8a7745" for R8A7745 (RZ/G1E) SCIF compatible
> >> > UART.
> >> > +    - "renesas,scifa-r8a7745" for R8A7745 (RZ/G1E) SCIFA compatible
> >> > UART.
> >> > +    - "renesas,scifb-r8a7745" for R8A7745 (RZ/G1E) SCIFB compatible
> >> > UART.
> >> > +    - "renesas,hscif-r8a7745" for R8A7745 (RZ/G1E) HSCIF compatible
> >> > UART.
> > 
> > Are we *really* going to add four compat string for each RZ/G* SoC ? We're
> > reaching the limit of sanity...
> 
> Is it really 4 distinct UARTs on a chip? DT can't fix that insanity.

It's really 4 different UART types on a chip, yes. We have actually 5 
different UART types, named SCI, SCIF, SCIFA, SCIFB and HSCIF. Only the last 4 
are used on R-Car SoCs.

There are 34 compatible strings defined, one per UART + SoC combination, plus 
a set of more generic ones. So far, the driver handles the r7s72100 compatible 
string separately as the UART on that chip is quite peculiar, but for all 
other SoCs we only need to match against

- the five generic renesas,(h)sci(f|fa|fb)? types
- the per-family renesas,rcar-gen[123]-scif types for the SCIF only

This means that there's a high level of compatibility between UARTs instances 
in different SoCs (we might need a few more per-family compatible strings to 
tell models apart that could present have family-dependent features currently 
not supported in the driver, but I believe my argument still remains largely 
true). However, due to the combination of the "DT is an ABI" and "IPs that 
appear identical in the datasheet could actually have differences that we 
haven't found yet" dogmas, the proliferation of per-SoC compatible strings is 
getting out of hands.

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: [PATCH] sh-sci: add R8A7743/5 support
  2016-10-05 13:37       ` Laurent Pinchart
@ 2016-10-05 13:50         ` Chris Brandt
  2016-10-05 14:10           ` Laurent Pinchart
  2016-10-06 20:55         ` Geert Uytterhoeven
  1 sibling, 1 reply; 12+ messages in thread
From: Chris Brandt @ 2016-10-05 13:50 UTC (permalink / raw)
  To: Laurent Pinchart, Rob Herring
  Cc: Geert Uytterhoeven, Sergei Shtylyov, Greg KH, Jiri Slaby,
	linux-serial, Mark Rutland, Linux-Renesas

> There are 34 compatible strings defined, one per UART + SoC combination,
> plus a set of more generic ones. So far, the driver handles the r7s72100
> compatible string separately as the UART on that chip is quite peculiar,
> but for all other SoCs we only need to match against

Just FYI...
There are 2 different types of UARTS (SCI) on r7s72100: SCIF and SCI

Getting  the "SCI" ones to work takes some 'tweaking' of some registers in the interrupt controller that are outside of the scope of the SCI driver. Basically, the power on reset values for some IRQ signaling is wrong but can be adjusted with a register. At the moment, I've been fixing that in u-boot.

So in reality, a "renesas,sci-r7s72100" is probably needed too if you want to throw that one on the pile....


Chris

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] sh-sci: add R8A7743/5 support
  2016-10-05 13:50         ` Chris Brandt
@ 2016-10-05 14:10           ` Laurent Pinchart
  0 siblings, 0 replies; 12+ messages in thread
From: Laurent Pinchart @ 2016-10-05 14:10 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Rob Herring, Geert Uytterhoeven, Sergei Shtylyov, Greg KH,
	Jiri Slaby, linux-serial, Mark Rutland, Linux-Renesas

Hi Chris,

On Wednesday 05 Oct 2016 13:50:18 Chris Brandt wrote:
> > There are 34 compatible strings defined, one per UART + SoC combination,
> > plus a set of more generic ones. So far, the driver handles the r7s72100
> > compatible string separately as the UART on that chip is quite peculiar,
> > but for all other SoCs we only need to match against
> 
> Just FYI...
> There are 2 different types of UARTS (SCI) on r7s72100: SCIF and SCI
> 
> Getting  the "SCI" ones to work takes some 'tweaking' of some registers in
> the interrupt controller that are outside of the scope of the SCI driver.
> Basically, the power on reset values for some IRQ signaling is wrong but
> can be adjusted with a register. At the moment, I've been fixing that in
> u-boot.
> 
> So in reality, a "renesas,sci-r7s72100" is probably needed too if you want
> to throw that one on the pile....

I'm totally fine adding compatible strings when it makes sense, what bothers 
me is a pile of compat strings to describe IP cores that are identical :-)

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] sh-sci: add R8A7743/5 support
  2016-10-05 13:37       ` Laurent Pinchart
  2016-10-05 13:50         ` Chris Brandt
@ 2016-10-06 20:55         ` Geert Uytterhoeven
  1 sibling, 0 replies; 12+ messages in thread
From: Geert Uytterhoeven @ 2016-10-06 20:55 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Rob Herring, Sergei Shtylyov, Greg KH, Jiri Slaby, linux-serial,
	Mark Rutland, Linux-Renesas

On Wed, Oct 5, 2016 at 3:37 PM, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
> On Wednesday 05 Oct 2016 08:28:05 Rob Herring wrote:
>> Is it really 4 distinct UARTs on a chip? DT can't fix that insanity.
>
> It's really 4 different UART types on a chip, yes. We have actually 5
> different UART types, named SCI, SCIF, SCIFA, SCIFB and HSCIF. Only the last 4
> are used on R-Car SoCs.

And even that is a simplification ;-)

AFAIU, evolution seems to have been

    SCI --> SCIF ---> SCIF + BRG ---> HSCIF
              |
              +---> SCIFA ---> SCIFB

Now, that's a simplication, too ;-) There are many intermediate variants
with slightly different features and register bits,esp. on SuperH.
They're all handled by the same sh-sci.c driver.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-10-06 20:56 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-29 21:37 [PATCH] sh-sci: add R8A7743/5 support Sergei Shtylyov
2016-09-30  6:35 ` Simon Horman
2016-09-30  8:38 ` Geert Uytterhoeven
2016-09-30 15:06   ` Sergei Shtylyov
2016-10-05  9:55   ` Laurent Pinchart
2016-10-05 10:03     ` Geert Uytterhoeven
2016-10-05 13:28       ` Laurent Pinchart
2016-10-05 13:28     ` Rob Herring
2016-10-05 13:37       ` Laurent Pinchart
2016-10-05 13:50         ` Chris Brandt
2016-10-05 14:10           ` Laurent Pinchart
2016-10-06 20:55         ` Geert Uytterhoeven

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.