diff mbox series

[2/6] dt-bindings: i2c: renesas,riic: Document RZ/T2H support

Message ID 20250530143135.366417-3-prabhakar.mahadev-lad.rj@bp.renesas.com
State Superseded
Headers show
Series Add RIIC support for RZ/T2H and RZ/N2H SoCs | expand

Commit Message

Prabhakar May 30, 2025, 2:31 p.m. UTC
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

Document support for the I2C Bus Interface (RIIC) found on the Renesas
RZ/T2H (R9A09G077) SoC. The RIIC IP on this SoC is similar to that on
the RZ/V2H(P) SoC but supports fewer interrupts, lacks FM+ support and
does not require resets. Due to these differences, add a new compatible
string `renesas,riic-r9a09g077` for the RZ/T2H SoC.

Unlike earlier SoCs that use eight distinct interrupts, the RZ/T2H uses
only four, including a combined error/event interrupt. Update the binding
schema to reflect this interrupt layout and skip the `resets` property
check, as it is not required on these SoCs.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
 .../devicetree/bindings/i2c/renesas,riic.yaml | 71 ++++++++++++++-----
 1 file changed, 52 insertions(+), 19 deletions(-)

Comments

Wolfram Sang May 31, 2025, 12:07 p.m. UTC | #1
On Fri, May 30, 2025 at 03:31:31PM +0100, Prabhakar wrote:
> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> 
> Document support for the I2C Bus Interface (RIIC) found on the Renesas
> RZ/T2H (R9A09G077) SoC. The RIIC IP on this SoC is similar to that on
> the RZ/V2H(P) SoC but supports fewer interrupts, lacks FM+ support and
> does not require resets. Due to these differences, add a new compatible
> string `renesas,riic-r9a09g077` for the RZ/T2H SoC.
> 
> Unlike earlier SoCs that use eight distinct interrupts, the RZ/T2H uses
> only four, including a combined error/event interrupt. Update the binding
> schema to reflect this interrupt layout and skip the `resets` property
> check, as it is not required on these SoCs.
> 
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Geert Uytterhoeven June 6, 2025, 1:21 p.m. UTC | #2
Hi Prabhakar,

On Fri, 30 May 2025 at 16:31, Prabhakar <prabhakar.csengg@gmail.com> wrote:
> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
>
> Document support for the I2C Bus Interface (RIIC) found on the Renesas
> RZ/T2H (R9A09G077) SoC. The RIIC IP on this SoC is similar to that on
> the RZ/V2H(P) SoC but supports fewer interrupts, lacks FM+ support and
> does not require resets. Due to these differences, add a new compatible
> string `renesas,riic-r9a09g077` for the RZ/T2H SoC.
>
> Unlike earlier SoCs that use eight distinct interrupts, the RZ/T2H uses
> only four, including a combined error/event interrupt. Update the binding
> schema to reflect this interrupt layout and skip the `resets` property
> check, as it is not required on these SoCs.
>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

Thanks for your patch!

> --- a/Documentation/devicetree/bindings/i2c/renesas,riic.yaml
> +++ b/Documentation/devicetree/bindings/i2c/renesas,riic.yaml
> @@ -29,32 +29,46 @@ properties:
>                - renesas,riic-r9a09g056   # RZ/V2N
>            - const: renesas,riic-r9a09g057   # RZ/V2H(P)
>
> -      - const: renesas,riic-r9a09g057   # RZ/V2H(P)
> +      - enum:
> +          - renesas,riic-r9a09g057   # RZ/V2H(P)
> +          - renesas,riic-r9a09g077   # RZ/T2H
>
>    reg:
>      maxItems: 1
>
>    interrupts:
> -    items:
> -      - description: Transmit End Interrupt
> -      - description: Receive Data Full Interrupt
> -      - description: Transmit Data Empty Interrupt
> -      - description: Stop Condition Detection Interrupt
> -      - description: Start Condition Detection Interrupt
> -      - description: NACK Reception Interrupt
> -      - description: Arbitration-Lost Interrupt
> -      - description: Timeout Interrupt
> +    oneOf:
> +      - items:
> +          - description: Transmit End Interrupt
> +          - description: Receive Data Full Interrupt
> +          - description: Transmit Data Empty Interrupt
> +          - description: Stop Condition Detection Interrupt
> +          - description: Start Condition Detection Interrupt
> +          - description: NACK Reception Interrupt
> +          - description: Arbitration-Lost Interrupt
> +          - description: Timeout Interrupt
> +      - items:
> +          - description: Transmit End Interrupt
> +          - description: Receive Data Full Interrupt
> +          - description: Transmit Data Empty Interrupt
> +          - description: Transmit error or event Interrupt

Nit: the documentation calls it "Transfer error or event generation".

>
>    interrupt-names:
> -    items:
> -      - const: tei
> -      - const: ri
> -      - const: ti
> -      - const: spi
> -      - const: sti
> -      - const: naki
> -      - const: ali
> -      - const: tmoi
> +    oneOf:
> +      - items:
> +          - const: tei
> +          - const: ri
> +          - const: ti
> +          - const: spi
> +          - const: sti
> +          - const: naki
> +          - const: ali
> +          - const: tmoi
> +      - items:
> +          - const: tei
> +          - const: ri
> +          - const: ti

Given you have a new set of names, perhaps "rxi" and "txi",
to match the documentation?

> +          - const: eei

Perhaps use the order from the documentation: eei, rxi, txi, tei?

Gr{oetje,eeting}s,

                        Geert
Prabhakar June 9, 2025, 4:24 p.m. UTC | #3
Hi Geert,

Thank you for the review.

On Fri, Jun 6, 2025 at 2:21 PM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>
> Hi Prabhakar,
>
> On Fri, 30 May 2025 at 16:31, Prabhakar <prabhakar.csengg@gmail.com> wrote:
> > From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> >
> > Document support for the I2C Bus Interface (RIIC) found on the Renesas
> > RZ/T2H (R9A09G077) SoC. The RIIC IP on this SoC is similar to that on
> > the RZ/V2H(P) SoC but supports fewer interrupts, lacks FM+ support and
> > does not require resets. Due to these differences, add a new compatible
> > string `renesas,riic-r9a09g077` for the RZ/T2H SoC.
> >
> > Unlike earlier SoCs that use eight distinct interrupts, the RZ/T2H uses
> > only four, including a combined error/event interrupt. Update the binding
> > schema to reflect this interrupt layout and skip the `resets` property
> > check, as it is not required on these SoCs.
> >
> > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
>
> Thanks for your patch!
>
> > --- a/Documentation/devicetree/bindings/i2c/renesas,riic.yaml
> > +++ b/Documentation/devicetree/bindings/i2c/renesas,riic.yaml
> > @@ -29,32 +29,46 @@ properties:
> >                - renesas,riic-r9a09g056   # RZ/V2N
> >            - const: renesas,riic-r9a09g057   # RZ/V2H(P)
> >
> > -      - const: renesas,riic-r9a09g057   # RZ/V2H(P)
> > +      - enum:
> > +          - renesas,riic-r9a09g057   # RZ/V2H(P)
> > +          - renesas,riic-r9a09g077   # RZ/T2H
> >
> >    reg:
> >      maxItems: 1
> >
> >    interrupts:
> > -    items:
> > -      - description: Transmit End Interrupt
> > -      - description: Receive Data Full Interrupt
> > -      - description: Transmit Data Empty Interrupt
> > -      - description: Stop Condition Detection Interrupt
> > -      - description: Start Condition Detection Interrupt
> > -      - description: NACK Reception Interrupt
> > -      - description: Arbitration-Lost Interrupt
> > -      - description: Timeout Interrupt
> > +    oneOf:
> > +      - items:
> > +          - description: Transmit End Interrupt
> > +          - description: Receive Data Full Interrupt
> > +          - description: Transmit Data Empty Interrupt
> > +          - description: Stop Condition Detection Interrupt
> > +          - description: Start Condition Detection Interrupt
> > +          - description: NACK Reception Interrupt
> > +          - description: Arbitration-Lost Interrupt
> > +          - description: Timeout Interrupt
> > +      - items:
> > +          - description: Transmit End Interrupt
> > +          - description: Receive Data Full Interrupt
> > +          - description: Transmit Data Empty Interrupt
> > +          - description: Transmit error or event Interrupt
>
> Nit: the documentation calls it "Transfer error or event generation".
>
Agreed I will update it to `Transmit Error Or Event Generation`.

> >
> >    interrupt-names:
> > -    items:
> > -      - const: tei
> > -      - const: ri
> > -      - const: ti
> > -      - const: spi
> > -      - const: sti
> > -      - const: naki
> > -      - const: ali
> > -      - const: tmoi
> > +    oneOf:
> > +      - items:
> > +          - const: tei
> > +          - const: ri
> > +          - const: ti
> > +          - const: spi
> > +          - const: sti
> > +          - const: naki
> > +          - const: ali
> > +          - const: tmoi
> > +      - items:
> > +          - const: tei
> > +          - const: ri
> > +          - const: ti
>
> Given you have a new set of names, perhaps "rxi" and "txi",
> to match the documentation?
>
Ok.

> > +          - const: eei
>
> Perhaps use the order from the documentation: eei, rxi, txi, tei?
>
Agreed, I will update it as mentioned above,

- items:
- const: eei
- const: rxi
- const: txi
- const: tei

Cheers,
Prabhakar
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/i2c/renesas,riic.yaml b/Documentation/devicetree/bindings/i2c/renesas,riic.yaml
index bfcc400655dc..d2b11a702be0 100644
--- a/Documentation/devicetree/bindings/i2c/renesas,riic.yaml
+++ b/Documentation/devicetree/bindings/i2c/renesas,riic.yaml
@@ -29,32 +29,46 @@  properties:
               - renesas,riic-r9a09g056   # RZ/V2N
           - const: renesas,riic-r9a09g057   # RZ/V2H(P)
 
-      - const: renesas,riic-r9a09g057   # RZ/V2H(P)
+      - enum:
+          - renesas,riic-r9a09g057   # RZ/V2H(P)
+          - renesas,riic-r9a09g077   # RZ/T2H
 
   reg:
     maxItems: 1
 
   interrupts:
-    items:
-      - description: Transmit End Interrupt
-      - description: Receive Data Full Interrupt
-      - description: Transmit Data Empty Interrupt
-      - description: Stop Condition Detection Interrupt
-      - description: Start Condition Detection Interrupt
-      - description: NACK Reception Interrupt
-      - description: Arbitration-Lost Interrupt
-      - description: Timeout Interrupt
+    oneOf:
+      - items:
+          - description: Transmit End Interrupt
+          - description: Receive Data Full Interrupt
+          - description: Transmit Data Empty Interrupt
+          - description: Stop Condition Detection Interrupt
+          - description: Start Condition Detection Interrupt
+          - description: NACK Reception Interrupt
+          - description: Arbitration-Lost Interrupt
+          - description: Timeout Interrupt
+      - items:
+          - description: Transmit End Interrupt
+          - description: Receive Data Full Interrupt
+          - description: Transmit Data Empty Interrupt
+          - description: Transmit error or event Interrupt
 
   interrupt-names:
-    items:
-      - const: tei
-      - const: ri
-      - const: ti
-      - const: spi
-      - const: sti
-      - const: naki
-      - const: ali
-      - const: tmoi
+    oneOf:
+      - items:
+          - const: tei
+          - const: ri
+          - const: ti
+          - const: spi
+          - const: sti
+          - const: naki
+          - const: ali
+          - const: tmoi
+      - items:
+          - const: tei
+          - const: ri
+          - const: ti
+          - const: eei
 
   clock-frequency:
     description:
@@ -84,6 +98,25 @@  required:
 allOf:
   - $ref: /schemas/i2c/i2c-controller.yaml#
 
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: renesas,riic-r9a09g077
+    then:
+      properties:
+        interrupts:
+          maxItems: 4
+        interrupt-names:
+          maxItems: 4
+        resets: false
+    else:
+      properties:
+        interrupts:
+          minItems: 8
+        interrupt-names:
+          minItems: 8
+
   - if:
       properties:
         compatible: