diff mbox series

[v6,03/13] dt-bindings: serial: Add compatible for Renesas RZ/T2H SoC in sci

Message ID 20250331122657.3390355-4-thierry.bultel.yh@bp.renesas.com (mailing list archive)
State New
Delegated to: Geert Uytterhoeven
Headers show
Series Add initial support for Renesas RZ/T2H SoC | expand

Commit Message

Thierry Bultel March 31, 2025, 12:26 p.m. UTC
The SCI of RZ/T2H SoC (a.k.a r9a09g077), as a lot
of similarities with other Renesas SoC like G2L, G3S, V2L;
However, it has a different set of registers, and in addition to serial,
this IP also supports SCIe (encoder), SmartCard, i2c and spi.
This is why the 'renesas,sci' fallback for generic SCI does not apply for it.

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Thierry Bultel <thierry.bultel.yh@bp.renesas.com>
---
Changes v5->v6: none
Changes v4->v5: none
Changes v3->v4:
  - Added more details in commit description about why renesas,sci 
    does not apply.
  - Removed uart-has-rtscts for !rzsci.
----
 .../bindings/serial/renesas,sci.yaml          | 63 ++++++++++++-------
 1 file changed, 39 insertions(+), 24 deletions(-)

Comments

Geert Uytterhoeven March 31, 2025, 1:04 p.m. UTC | #1
Hi Thierry,

Thanks for the update!

On Mon, 31 Mar 2025 at 14:27, Thierry Bultel
<thierry.bultel.yh@bp.renesas.com> wrote:
> The SCI of RZ/T2H SoC (a.k.a r9a09g077), as a lot

RSCI in the RZ/T2H SoC ... has

> of similarities with other Renesas SoC like G2L, G3S, V2L;

... with SCI in other ..

> However, it has a different set of registers, and in addition to serial,
> this IP also supports SCIe (encoder), SmartCard, i2c and spi.
> This is why the 'renesas,sci' fallback for generic SCI does not apply for it.
>
> Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
> Signed-off-by: Thierry Bultel <thierry.bultel.yh@bp.renesas.com>

> --- a/Documentation/devicetree/bindings/serial/renesas,sci.yaml
> +++ b/Documentation/devicetree/bindings/serial/renesas,sci.yaml

Given we're now using the "RSCI" naming, I think it deserves its own
DT binding document.

> @@ -9,9 +9,6 @@ title: Renesas Serial Communication Interface
>  maintainers:
>    - Geert Uytterhoeven <geert+renesas@glider.be>
>
> -allOf:
> -  - $ref: serial.yaml#
> -
>  properties:
>    compatible:
>      oneOf:
> @@ -22,6 +19,8 @@ properties:
>                - renesas,r9a07g054-sci     # RZ/V2L
>            - const: renesas,sci            # generic SCI compatible UART
>
> +      - const: renesas,r9a09g077-sci      # RZ/T2H

renesas,r9a09g077-rsci

> +
>        - items:
>            - const: renesas,sci            # generic SCI compatible UART
>

Gr{oetje,eeting}s,

                        Geert
Thierry Bultel March 31, 2025, 1:55 p.m. UTC | #2
Hi Geert,

> -----Original Message-----
> From: Geert Uytterhoeven <geert@linux-m68k.org>
> Sent: lundi 31 mars 2025 15:04
> To: Thierry Bultel <thierry.bultel.yh@bp.renesas.com>
> Cc: thierry.bultel@linatsea.fr; linux-renesas-soc@vger.kernel.org; Paul
> Barker <paul.barker.ct@bp.renesas.com>; Rob Herring <robh@kernel.org>;
> Geert Uytterhoeven <geert+renesas@glider.be>; linux-
> kernel@vger.kernel.org; linux-serial@vger.kernel.org;
> devicetree@vger.kernel.org
> Subject: Re: [PATCH v6 03/13] dt-bindings: serial: Add compatible for
> Renesas RZ/T2H SoC in sci
> 
> Hi Thierry,
> 
> Thanks for the update!
> 
> On Mon, 31 Mar 2025 at 14:27, Thierry Bultel
> <thierry.bultel.yh@bp.renesas.com> wrote:
> > The SCI of RZ/T2H SoC (a.k.a r9a09g077), as a lot
> 
> RSCI in the RZ/T2H SoC ... has
> 
> > of similarities with other Renesas SoC like G2L, G3S, V2L;
> 
> ... with SCI in other ..
> 
> > However, it has a different set of registers, and in addition to
> > serial, this IP also supports SCIe (encoder), SmartCard, i2c and spi.
> > This is why the 'renesas,sci' fallback for generic SCI does not apply
> for it.
> >
> > Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
> > Signed-off-by: Thierry Bultel <thierry.bultel.yh@bp.renesas.com>
> 
> > --- a/Documentation/devicetree/bindings/serial/renesas,sci.yaml
> > +++ b/Documentation/devicetree/bindings/serial/renesas,sci.yaml
> 
> Given we're now using the "RSCI" naming, I think it deserves its own DT
> binding document.

All right, but I have then several questions
1) I am not sure it can have generic fallback,
e.g. something like :

properties:
  compatible:
    - const: renesas,r9a09g077-rsci      # RZ/T2H

... is just enough, can you confirm ?

2) Should I also change the node name in .dtsi file from 'sci0' to 'rsci0' ?

Thanks !

> 
> > @@ -9,9 +9,6 @@ title: Renesas Serial Communication Interface
> >  maintainers:
> >    - Geert Uytterhoeven <geert+renesas@glider.be>
> >
> > -allOf:
> > -  - $ref: serial.yaml#
> > -
> >  properties:
> >    compatible:
> >      oneOf:
> > @@ -22,6 +19,8 @@ properties:
> >                - renesas,r9a07g054-sci     # RZ/V2L
> >            - const: renesas,sci            # generic SCI compatible UART
> >
> > +      - const: renesas,r9a09g077-sci      # RZ/T2H
> 
> renesas,r9a09g077-rsci
> 
> > +
> >        - items:
> >            - const: renesas,sci            # generic SCI compatible UART
> >
> 
> 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
Geert Uytterhoeven March 31, 2025, 2:27 p.m. UTC | #3
Hi Thierry,

On Mon, 31 Mar 2025 at 15:55, Thierry Bultel
<thierry.bultel.yh@bp.renesas.com> wrote:
> > From: Geert Uytterhoeven <geert@linux-m68k.org>
> > On Mon, 31 Mar 2025 at 14:27, Thierry Bultel
> > <thierry.bultel.yh@bp.renesas.com> wrote:
> > > The SCI of RZ/T2H SoC (a.k.a r9a09g077), as a lot
> >
> > RSCI in the RZ/T2H SoC ... has
> >
> > > of similarities with other Renesas SoC like G2L, G3S, V2L;
> >
> > ... with SCI in other ..
> >
> > > However, it has a different set of registers, and in addition to
> > > serial, this IP also supports SCIe (encoder), SmartCard, i2c and spi.
> > > This is why the 'renesas,sci' fallback for generic SCI does not apply
> > for it.
> > >
> > > Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
> > > Signed-off-by: Thierry Bultel <thierry.bultel.yh@bp.renesas.com>
> >
> > > --- a/Documentation/devicetree/bindings/serial/renesas,sci.yaml
> > > +++ b/Documentation/devicetree/bindings/serial/renesas,sci.yaml
> >
> > Given we're now using the "RSCI" naming, I think it deserves its own DT
> > binding document.
>
> All right, but I have then several questions
> 1) I am not sure it can have generic fallback,
> e.g. something like :
>
> properties:
>   compatible:
>     - const: renesas,r9a09g077-rsci      # RZ/T2H
>
> ... is just enough, can you confirm ?

I don't think we need a generic fallback at this point.
You didn't have one before.

> 2) Should I also change the node name in .dtsi file from 'sci0' to 'rsci0' ?

You mean the labels? The node name is always "serial".
I think keeping sci0 for the label is fine, as that matches the name
of the instance in the documentation.

Gr{oetje,eeting}s,

                        Geert
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/serial/renesas,sci.yaml b/Documentation/devicetree/bindings/serial/renesas,sci.yaml
index 64d3db6e54e5..13c5c47cd72f 100644
--- a/Documentation/devicetree/bindings/serial/renesas,sci.yaml
+++ b/Documentation/devicetree/bindings/serial/renesas,sci.yaml
@@ -9,9 +9,6 @@  title: Renesas Serial Communication Interface
 maintainers:
   - Geert Uytterhoeven <geert+renesas@glider.be>
 
-allOf:
-  - $ref: serial.yaml#
-
 properties:
   compatible:
     oneOf:
@@ -22,6 +19,8 @@  properties:
               - renesas,r9a07g054-sci     # RZ/V2L
           - const: renesas,sci            # generic SCI compatible UART
 
+      - const: renesas,r9a09g077-sci      # RZ/T2H
+
       - items:
           - const: renesas,sci            # generic SCI compatible UART
 
@@ -54,8 +53,6 @@  properties:
         - fck # UART functional clock
         - sck # optional external clock input
 
-  uart-has-rtscts: false
-
 required:
   - compatible
   - reg
@@ -63,25 +60,43 @@  required:
   - clocks
   - clock-names
 
-if:
-  properties:
-    compatible:
-      contains:
-        enum:
-          - renesas,r9a07g043-sci
-          - renesas,r9a07g044-sci
-          - renesas,r9a07g054-sci
-then:
-  properties:
-    resets:
-      maxItems: 1
-
-    power-domains:
-      maxItems: 1
-
-  required:
-    - resets
-    - power-domains
+allOf:
+  - $ref: serial.yaml#
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: renesas,r9a09g077-sci
+    then:
+      properties:
+        power-domains:
+          maxItems: 1
+      required:
+        - power-domains
+
+    else:
+      properties:
+        uart-has-rtscts: false
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - renesas,r9a07g043-sci
+              - renesas,r9a07g044-sci
+              - renesas,r9a07g054-sci
+    then:
+      properties:
+        resets:
+          maxItems: 1
+
+        power-domains:
+          maxItems: 1
+
+      required:
+        - resets
+        - power-domains
 
 unevaluatedProperties: false