diff mbox series

[v2,06/11] dt-bindings: usb: generic-ohci: Document RZ/G2L SoC bindings

Message ID 20210621093943.12143-7-biju.das.jz@bp.renesas.com (mailing list archive)
State New, archived
Headers show
Series None | expand

Commit Message

Biju Das June 21, 2021, 9:39 a.m. UTC
Renesas RZ/G2L SoC has USBPHY Control and USB2.0 PHY module. We need to
turn on both these phy modules before accessing host registers.

Apart from this, document the optional property dr_mode present on both
RZ/G2 and R-Car Gen3 SoCs.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
 .../devicetree/bindings/usb/generic-ohci.yaml | 32 +++++++++++++++++--
 1 file changed, 30 insertions(+), 2 deletions(-)

Comments

Rob Herring June 21, 2021, 5:40 p.m. UTC | #1
On Mon, 21 Jun 2021 10:39:38 +0100, Biju Das wrote:
> Renesas RZ/G2L SoC has USBPHY Control and USB2.0 PHY module. We need to
> turn on both these phy modules before accessing host registers.
> 
> Apart from this, document the optional property dr_mode present on both
> RZ/G2 and R-Car Gen3 SoCs.
> 
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> ---
>  .../devicetree/bindings/usb/generic-ohci.yaml | 32 +++++++++++++++++--
>  1 file changed, 30 insertions(+), 2 deletions(-)
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:
./Documentation/devicetree/bindings/usb/generic-ohci.yaml:14:13: [warning] wrong indentation: expected 10 but found 12 (indentation)

dtschema/dtc warnings/errors:
\ndoc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/patch/1494981

This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit.
Biju Das June 22, 2021, 10:03 a.m. UTC | #2
Hi Rob,

I can reproduce the issue now, after installing 'yamllint' and  using "DT_CHECKER_FLAGS=-m dt_binding_check".

I will fix this and send v3.


Regards,
Biju

> -----Original Message-----
> From: Rob Herring <robh@kernel.org>
> Sent: 21 June 2021 18:40
> To: Biju Das <biju.das.jz@bp.renesas.com>
> Cc: Rob Herring <robh+dt@kernel.org>; Yoshihiro Shimoda
> <yoshihiro.shimoda.uh@renesas.com>; Chris Paterson
> <Chris.Paterson2@renesas.com>; linux-usb@vger.kernel.org; Greg Kroah-
> Hartman <gregkh@linuxfoundation.org>; Geert Uytterhoeven
> <geert+renesas@glider.be>; Biju Das <biju.das@bp.renesas.com>; linux-
> renesas-soc@vger.kernel.org; Prabhakar Mahadev Lad <prabhakar.mahadev-
> lad.rj@bp.renesas.com>; devicetree@vger.kernel.org
> Subject: Re: [PATCH v2 06/11] dt-bindings: usb: generic-ohci: Document
> RZ/G2L SoC bindings
> 
> On Mon, 21 Jun 2021 10:39:38 +0100, Biju Das wrote:
> > Renesas RZ/G2L SoC has USBPHY Control and USB2.0 PHY module. We need
> > to turn on both these phy modules before accessing host registers.
> >
> > Apart from this, document the optional property dr_mode present on
> > both
> > RZ/G2 and R-Car Gen3 SoCs.
> >
> > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> > Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> > ---
> >  .../devicetree/bindings/usb/generic-ohci.yaml | 32
> > +++++++++++++++++--
> >  1 file changed, 30 insertions(+), 2 deletions(-)
> >
> 
> My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
> on your patch (DT_CHECKER_FLAGS is new in v5.13):
> 
> yamllint warnings/errors:
> ./Documentation/devicetree/bindings/usb/generic-ohci.yaml:14:13: [warning]
> wrong indentation: expected 10 but found 12 (indentation)
> 
> dtschema/dtc warnings/errors:
> \ndoc reference errors (make refcheckdocs):
> 
> See
> https://jpn01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatchwor
> k.ozlabs.org%2Fpatch%2F1494981&amp;data=04%7C01%7Cbiju.das.jz%40bp.renesas
> .com%7C948f485a377b4f12c7ea08d934dba3ba%7C53d82571da1947e49cb4625a166a4a2a
> %7C0%7C0%7C637598940229461664%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAi
> LCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=4rFbOwmthR
> BAmn7MNMAHqQD8hm2lgLSKhUNg9i95A5M%3D&amp;reserved=0
> 
> This check can fail if there are any dependencies. The base for a patch
> series is generally the most recent rc1.
> 
> If you already ran 'make dt_binding_check' and didn't see the above
> error(s), then make sure 'yamllint' is installed and dt-schema is up to
> date:
> 
> pip3 install dtschema --upgrade
> 
> Please check and re-submit.
Rob Herring June 22, 2021, 7:30 p.m. UTC | #3
On Mon, Jun 21, 2021 at 10:39:38AM +0100, Biju Das wrote:
> Renesas RZ/G2L SoC has USBPHY Control and USB2.0 PHY module. We need to
> turn on both these phy modules before accessing host registers.
> 
> Apart from this, document the optional property dr_mode present on both
> RZ/G2 and R-Car Gen3 SoCs.
> 
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> ---
>  .../devicetree/bindings/usb/generic-ohci.yaml | 32 +++++++++++++++++--
>  1 file changed, 30 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/usb/generic-ohci.yaml b/Documentation/devicetree/bindings/usb/generic-ohci.yaml
> index 0f5f6ea702d0..c0644fae5db9 100644
> --- a/Documentation/devicetree/bindings/usb/generic-ohci.yaml
> +++ b/Documentation/devicetree/bindings/usb/generic-ohci.yaml
> @@ -8,6 +8,26 @@ title: USB OHCI Controller Device Tree Bindings
>  
>  allOf:
>    - $ref: "usb-hcd.yaml"
> +  - if:
> +      properties:
> +        compatible:
> +            contains:
> +              const: renesas,r9a07g044-ohci
> +    then:
> +      properties:
> +        phys:
> +          maxItems: 2
> +        phy-names:
> +          items:
> +            - const: usbphyctrl
> +            - const: usb

Why can't your extra thing be last? Then you only need to set 
minItems/maxItems in the if/then schema.

Though this seems like an abuse of the phy binding. There's not 2 phys, 
right? Just some extra registers related to the phy? Can't it be hidden 
in your phy driver?

> +    else:
> +      properties:
> +        phys:
> +          maxItems: 1
> +        phy-names:
> +          items:
> +            - const: usb
>  
>  maintainers:
>    - Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> @@ -43,6 +63,7 @@ properties:
>                - brcm,bcm7435-ohci
>                - ibm,476gtr-ohci
>                - ingenic,jz4740-ohci
> +              - renesas,r9a07g044-ohci
>                - snps,hsdk-v1.0-ohci
>            - const: generic-ohci
>        - const: generic-ohci
> @@ -101,14 +122,21 @@ properties:
>        Overrides the detected port count
>  
>    phys:
> -    maxItems: 1
> +    minItems: 1
> +    maxItems: 2
>  
>    phy-names:
> -    const: usb
> +    minItems: 1
> +    maxItems: 2
>  
>    iommus:
>      maxItems: 1
>  
> +  dr_mode:
> +    enum:
> +      - host
> +      - otg
> +
>  required:
>    - compatible
>    - reg
> -- 
> 2.17.1
> 
>
Biju Das June 23, 2021, 2:20 p.m. UTC | #4
Hi Rob,

Thanks for the feedback.

> Subject: Re: [PATCH v2 06/11] dt-bindings: usb: generic-ohci: Document
> RZ/G2L SoC bindings
> 
> On Mon, Jun 21, 2021 at 10:39:38AM +0100, Biju Das wrote:
> > Renesas RZ/G2L SoC has USBPHY Control and USB2.0 PHY module. We need
> > to turn on both these phy modules before accessing host registers.
> >
> > Apart from this, document the optional property dr_mode present on
> > both
> > RZ/G2 and R-Car Gen3 SoCs.
> >
> > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> > Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> > ---
> >  .../devicetree/bindings/usb/generic-ohci.yaml | 32
> > +++++++++++++++++--
> >  1 file changed, 30 insertions(+), 2 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/usb/generic-ohci.yaml
> > b/Documentation/devicetree/bindings/usb/generic-ohci.yaml
> > index 0f5f6ea702d0..c0644fae5db9 100644
> > --- a/Documentation/devicetree/bindings/usb/generic-ohci.yaml
> > +++ b/Documentation/devicetree/bindings/usb/generic-ohci.yaml
> > @@ -8,6 +8,26 @@ title: USB OHCI Controller Device Tree Bindings
> >
> >  allOf:
> >    - $ref: "usb-hcd.yaml"
> > +  - if:
> > +      properties:
> > +        compatible:
> > +            contains:
> > +              const: renesas,r9a07g044-ohci
> > +    then:
> > +      properties:
> > +        phys:
> > +          maxItems: 2
> > +        phy-names:
> > +          items:
> > +            - const: usbphyctrl
> > +            - const: usb
> 
> Why can't your extra thing be last? Then you only need to set
> minItems/maxItems in the if/then schema.

OK. will move this to the last and will take out phy-names.

> 
> Though this seems like an abuse of the phy binding. There's not 2 phys,
> right? Just some extra registers related to the phy? Can't it be hidden in
> your phy driver?

Usbphyctrl is separate IP block which mainly controls reset and power down of the actual USB/PHY.
This block has separate registers. So modelled as separate driver and device handles port reset
Based on port index.

Will remove phy-names "usbphyctrl" and will just use "usb" like example here[1]. Is it ok?

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/usb/usb-hcd.yaml?h=v5.13-rc7

Regards,
Biju


> 
> > +    else:
> > +      properties:
> > +        phys:
> > +          maxItems: 1
> > +        phy-names:
> > +          items:
> > +            - const: usb
> >
> >  maintainers:
> >    - Greg Kroah-Hartman <gregkh@linuxfoundation.org> @@ -43,6 +63,7 @@
> > properties:
> >                - brcm,bcm7435-ohci
> >                - ibm,476gtr-ohci
> >                - ingenic,jz4740-ohci
> > +              - renesas,r9a07g044-ohci
> >                - snps,hsdk-v1.0-ohci
> >            - const: generic-ohci
> >        - const: generic-ohci
> > @@ -101,14 +122,21 @@ properties:
> >        Overrides the detected port count
> >
> >    phys:
> > -    maxItems: 1
> > +    minItems: 1
> > +    maxItems: 2
> >
> >    phy-names:
> > -    const: usb
> > +    minItems: 1
> > +    maxItems: 2
> >
> >    iommus:
> >      maxItems: 1
> >
> > +  dr_mode:
> > +    enum:
> > +      - host
> > +      - otg
> > +
> >  required:
> >    - compatible
> >    - reg
> > --
> > 2.17.1
> >
> >
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/usb/generic-ohci.yaml b/Documentation/devicetree/bindings/usb/generic-ohci.yaml
index 0f5f6ea702d0..c0644fae5db9 100644
--- a/Documentation/devicetree/bindings/usb/generic-ohci.yaml
+++ b/Documentation/devicetree/bindings/usb/generic-ohci.yaml
@@ -8,6 +8,26 @@  title: USB OHCI Controller Device Tree Bindings
 
 allOf:
   - $ref: "usb-hcd.yaml"
+  - if:
+      properties:
+        compatible:
+            contains:
+              const: renesas,r9a07g044-ohci
+    then:
+      properties:
+        phys:
+          maxItems: 2
+        phy-names:
+          items:
+            - const: usbphyctrl
+            - const: usb
+    else:
+      properties:
+        phys:
+          maxItems: 1
+        phy-names:
+          items:
+            - const: usb
 
 maintainers:
   - Greg Kroah-Hartman <gregkh@linuxfoundation.org>
@@ -43,6 +63,7 @@  properties:
               - brcm,bcm7435-ohci
               - ibm,476gtr-ohci
               - ingenic,jz4740-ohci
+              - renesas,r9a07g044-ohci
               - snps,hsdk-v1.0-ohci
           - const: generic-ohci
       - const: generic-ohci
@@ -101,14 +122,21 @@  properties:
       Overrides the detected port count
 
   phys:
-    maxItems: 1
+    minItems: 1
+    maxItems: 2
 
   phy-names:
-    const: usb
+    minItems: 1
+    maxItems: 2
 
   iommus:
     maxItems: 1
 
+  dr_mode:
+    enum:
+      - host
+      - otg
+
 required:
   - compatible
   - reg