diff mbox series

[RFC,1/5] dt-bindings: add binding for CDNSP-DRD controller

Message ID 20200626045450.10205-2-pawell@cadence.com
State Changes Requested
Headers show
Series Introduced new Cadence USBSSP DRD Driver. | expand

Checks

Context Check Description
robh/checkpatch success
robh/dt-meta-schema fail build log

Commit Message

Pawel Laszczak June 26, 2020, 4:54 a.m. UTC
This patch aim at documenting USB related dt-bindings for the
Cadence CDNSP-DRD controller.

Signed-off-by: Pawel Laszczak <pawell@cadence.com>
---
 .../devicetree/bindings/usb/cdns-cdnsp.yaml   | 104 ++++++++++++++++++
 1 file changed, 104 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/cdns-cdnsp.yaml

Comments

Rob Herring June 29, 2020, 10:03 p.m. UTC | #1
On Fri, 26 Jun 2020 06:54:46 +0200, Pawel Laszczak wrote:
> This patch aim at documenting USB related dt-bindings for the
> Cadence CDNSP-DRD controller.
> 
> Signed-off-by: Pawel Laszczak <pawell@cadence.com>
> ---
>  .../devicetree/bindings/usb/cdns-cdnsp.yaml   | 104 ++++++++++++++++++
>  1 file changed, 104 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/usb/cdns-cdnsp.yaml
> 


My bot found errors running 'make dt_binding_check' on your patch:

/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/cdns-cdnsp.example.dt.yaml: example-0: usb@f3000000:reg:0: [0, 29437952, 0, 1024] is too long
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/cdns-cdnsp.example.dt.yaml: example-0: usb@f3000000:reg:1: [0, 4076929024, 0, 65536] is too long
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/cdns-cdnsp.example.dt.yaml: example-0: usb@f3000000:reg:2: [0, 4076994560, 0, 65536] is too long


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

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

pip3 install git+https://github.com/devicetree-org/dt-schema.git@master --upgrade

Please check and re-submit.
Pawel Laszczak June 30, 2020, 8:19 a.m. UTC | #2
H Rob

Yes, I see the same issue.  As you wrote probably dt-schema was not up to data. 

I have fresh system, and I had problem with running 'make dt_binding_check' 

The script complain for:
dtc needs libyaml for DT schema validation support. Install the necessary libyaml development package
but in reality it was lacking pkg-config.

It could be good to add some information about this package in documentation or some checking in script. 

I leave it to your decision.

>
>
>On Fri, 26 Jun 2020 06:54:46 +0200, Pawel Laszczak wrote:
>> This patch aim at documenting USB related dt-bindings for the
>> Cadence CDNSP-DRD controller.
>>
>> Signed-off-by: Pawel Laszczak <pawell@cadence.com>
>> ---
>>  .../devicetree/bindings/usb/cdns-cdnsp.yaml   | 104 ++++++++++++++++++
>>  1 file changed, 104 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/usb/cdns-cdnsp.yaml
>>
>
>
>My bot found errors running 'make dt_binding_check' on your patch:
>
>/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/cdns-cdnsp.example.dt.yaml: example-0:
>usb@f3000000:reg:0: [0, 29437952, 0, 1024] is too long
>/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/cdns-cdnsp.example.dt.yaml: example-0:
>usb@f3000000:reg:1: [0, 4076929024, 0, 65536] is too long
>/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/cdns-cdnsp.example.dt.yaml: example-0:
>usb@f3000000:reg:2: [0, 4076994560, 0, 65536] is too long
>
>
>See https://urldefense.com/v3/__https://patchwork.ozlabs.org/patch/1317380__;!!EHscmS1ygiU1lA!THRFzEi4Bx7XfHahLfM_Oo53V-
>hW49AW-xHAcJ7J53DIaLVRbpAOTe92Jrsu6A$
>
>If you already ran 'make dt_binding_check' and didn't see the above
>error(s), then make sure dt-schema is up to date:
>
>pip3 install git+https://github.com/devicetree-org/dt-schema.git@master --upgrade
>
>Please check and re-submit.

thanks,
pawell
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/usb/cdns-cdnsp.yaml b/Documentation/devicetree/bindings/usb/cdns-cdnsp.yaml
new file mode 100644
index 000000000000..83d353711e31
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/cdns-cdnsp.yaml
@@ -0,0 +1,104 @@ 
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/usb/cdns-cdnsp.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title:  Device tree binding for Cadence CDNSP (Super Speed Plus) controller
+
+maintainers:
+  - Pawel Laszczak <pawell@cadence.com>
+
+description:
+  The Cadence CDNSP controller support Host, Device and DRD mode.
+  It also supports Full Speed, Hight Speed, Super Speed and
+  Super Speed Plus protocols.
+
+properties:
+  compatible:
+    items:
+      - enum:
+        - cdns,usbssp
+
+  reg:
+    description: Physical base address and size of the
+                 controller's register areas. Controller has
+                 three  different regions.
+    minItems: 2
+    maxItems: 3
+    items:
+      - description: HOST registers area.
+      - description: DEVICE registers area.
+      - description: OTG/DRD registers area.
+
+  reg-names:
+    items:
+      - const: xhci
+      - const: dev
+      - const: otg
+
+  interrupts:
+    minItems: 2
+    maxItems: 3
+    items:
+      - description: Interrupt used by XHCI driver.
+      - description: Interrupt used by device driver.
+      - description: Interrupt used by DRD part of driver.
+
+  interrupt-names:
+    items:
+      - const: host
+      - const: peripheral
+      - const: otg
+
+  maximum-speed:
+    enum:
+      - full-speed
+      - high-speed
+      - super-speed
+      - super-speed-plus
+
+  dr_mode:
+    enum:
+      - host
+      - peripheral
+      - otg
+
+  phys:
+    description:
+      Reference to the USB PHY.
+      Must contain an entry for each entry in phy-names.
+      See ../phy/phy-bindings.txt for details.
+
+  phy-names:
+    items:
+      - const: cdnsp,usb2-phy
+      - const: cdnsp,usb3-phy
+
+required:
+  - compatible
+  - reg
+  - reg-names
+  - interrupts
+  - interrupt-names
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    usb_otg: usb@f3000000 {
+      compatible = "cdns,usbssp";
+      reg = <0x00 0x01c13000 0x00 0x0400>,
+            <0x00 0xf3010000 0x00 0x10000>,
+            <0x00 0xf3020000 0x00 0x10000>;
+      reg-names = "xhci", "dev", "otg";
+      interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>,
+                   <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>,
+                   <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>;
+      interrupt-names = "host", "peripheral", "otg";
+      phys = <&usbphy 0>;
+      phy-names = "cdnsp,usb2-phy", "cdnsp,usb3-phy";
+      dr_mode = "peripheral";
+    };
+
+...