Re: [PATCH v2 1/3] dt-bindings: usb: Convert cdns-usb3.txt to YAML schema

2020-09-14 Thread Rob Herring
On Wed, Sep 02, 2020 at 04:35:41PM +0300, Roger Quadros wrote:
> Converts cdns-usb3.txt to YAML schema cdns,usb3.yaml
> 
> Signed-off-by: Roger Quadros 
> ---
>  .../devicetree/bindings/usb/cdns,usb3.yaml| 89 +++
>  .../devicetree/bindings/usb/cdns-usb3.txt | 45 --
>  2 files changed, 89 insertions(+), 45 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/usb/cdns,usb3.yaml
>  delete mode 100644 Documentation/devicetree/bindings/usb/cdns-usb3.txt
> 
> diff --git a/Documentation/devicetree/bindings/usb/cdns,usb3.yaml 
> b/Documentation/devicetree/bindings/usb/cdns,usb3.yaml
> new file mode 100644
> index ..7bc0263accee
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/usb/cdns,usb3.yaml
> @@ -0,0 +1,89 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/usb/cdns,usb3.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Cadence USBSS-DRD controller bindings
> +
> +maintainers:
> +  - Pawel Laszczak 
> +
> +properties:
> +  compatible:
> +oneOf:
> +  - const: cdns,usb3

Don't need 'oneOf' with only 1 entry.

> +
> +  reg:
> +items:
> +  - description: OTG controller registers
> +  - description: XHCI Host controller registers
> +  - description: DEVICE controller registers
> +
> +  reg-names:
> +items:
> +  - const: otg
> +  - const: xhci
> +  - const: dev
> +
> +  interrupts:
> +items:
> +  - description: OTG/DRD controller interrupt
> +  - description: XHCI host controller interrupt
> +  - description: Device controller interrupt
> +
> +  interrupt-names:
> +items:
> +  - const: host
> +  - const: peripheral
> +  - const: otg
> +
> +  dr_mode:
> +enum: [host, otg, peripheral]
> +
> +  maximum-speed:
> +enum: [super-speed, high-speed, full-speed]
> +
> +  phys:
> +   minItems: 1
> +   maxItems: 2
> +
> +  phy-names:
> +minItems: 1
> +maxItems: 2

Need to define the names and what each entry is.

> +
> +  cdns,on-chip-buff-size:
> +description:
> +  size of memory intended as internal memory for endpoints
> +  buffers expressed in KB
> +$ref: /schemas/types.yaml#/definitions/uint32
> +
> +required:
> +  - compatible
> +  - reg
> +  - reg-names
> +  - interrupts
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +#include 
> +bus {
> +#address-cells = <2>;
> +#size-cells = <2>;
> +
> +usb@600 {
> +compatible = "cdns,usb3";
> +reg = <0x00 0x600 0x00 0x1>,
> +  <0x00 0x601 0x00 0x1>,
> +  <0x00 0x602 0x00 0x1>;
> +reg-names = "otg", "xhci", "dev";
> +interrupts = ,
> + ,
> + ;
> +interrupt-names = "host", "peripheral", "otg";
> +maximum-speed = "super-speed";
> +dr_mode = "otg";
> +};
> +};
> diff --git a/Documentation/devicetree/bindings/usb/cdns-usb3.txt 
> b/Documentation/devicetree/bindings/usb/cdns-usb3.txt
> deleted file mode 100644
> index b7dc606d37b5..
> --- a/Documentation/devicetree/bindings/usb/cdns-usb3.txt
> +++ /dev/null
> @@ -1,45 +0,0 @@
> -Binding for the Cadence USBSS-DRD controller
> -
> -Required properties:
> - - reg: Physical base address and size of the controller's register areas.
> -  Controller has 3 different regions:
> -  - HOST registers area
> -  - DEVICE registers area
> -  - OTG/DRD registers area
> - - reg-names - register memory area names:
> - "xhci" - for HOST registers space
> - "dev" - for DEVICE registers space
> - "otg" - for OTG/DRD registers space
> - - compatible: Should contain: "cdns,usb3"
> - - interrupts: Interrupts used by cdns3 controller:
> - "host" - interrupt used by XHCI driver.
> - "peripheral" - interrupt used by device driver
> - "otg" - interrupt used by DRD/OTG  part of driver
> -
> -Optional properties:
> - - maximum-speed : valid arguments are "super-speed", "high-speed" and
> -   "full-speed"; refer to usb/generic.txt
> - - dr_mode: Should be one of "host", "peripheral" or "otg".
> - - phys: reference to the USB PHY
> - - phy-names: from the *Generic PHY* bindings;
> - Supported names are:
> - - cdns3,usb2-phy
> - - cdns3,usb3-phy
> -
> - - cdns,on-chip-buff-size : size of memory intended as internal memory for 
> endpoints
> - buffers expressed in KB
> -
> -Example:
> - usb@f300 {
> - compatible = "cdns,usb3";
> - interrupts = ,
> - ,
> - ;
> - interrupt-names = "host", "peripheral", "otg";
> - reg = <0xf300 0x1>, /* memory area for HOST 
> registers */
> - <0xf301 0x1>,   /* memory area for DEVICE 
> registers 

Re: [PATCH v2 1/3] dt-bindings: usb: Convert cdns-usb3.txt to YAML schema

2020-09-08 Thread Felipe Balbi

Hi,


Roger Quadros  writes:
> Converts cdns-usb3.txt to YAML schema cdns,usb3.yaml
>
> Signed-off-by: Roger Quadros 
> ---
>  .../devicetree/bindings/usb/cdns,usb3.yaml| 89 +++
>  .../devicetree/bindings/usb/cdns-usb3.txt | 45 --

Rob, should I wait for your Ack on yaml conversions?
-- 
balbi


signature.asc
Description: PGP signature


[PATCH v2 1/3] dt-bindings: usb: Convert cdns-usb3.txt to YAML schema

2020-09-02 Thread Roger Quadros
Converts cdns-usb3.txt to YAML schema cdns,usb3.yaml

Signed-off-by: Roger Quadros 
---
 .../devicetree/bindings/usb/cdns,usb3.yaml| 89 +++
 .../devicetree/bindings/usb/cdns-usb3.txt | 45 --
 2 files changed, 89 insertions(+), 45 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/usb/cdns,usb3.yaml
 delete mode 100644 Documentation/devicetree/bindings/usb/cdns-usb3.txt

diff --git a/Documentation/devicetree/bindings/usb/cdns,usb3.yaml 
b/Documentation/devicetree/bindings/usb/cdns,usb3.yaml
new file mode 100644
index ..7bc0263accee
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/cdns,usb3.yaml
@@ -0,0 +1,89 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/usb/cdns,usb3.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Cadence USBSS-DRD controller bindings
+
+maintainers:
+  - Pawel Laszczak 
+
+properties:
+  compatible:
+oneOf:
+  - const: cdns,usb3
+
+  reg:
+items:
+  - description: OTG controller registers
+  - description: XHCI Host controller registers
+  - description: DEVICE controller registers
+
+  reg-names:
+items:
+  - const: otg
+  - const: xhci
+  - const: dev
+
+  interrupts:
+items:
+  - description: OTG/DRD controller interrupt
+  - description: XHCI host controller interrupt
+  - description: Device controller interrupt
+
+  interrupt-names:
+items:
+  - const: host
+  - const: peripheral
+  - const: otg
+
+  dr_mode:
+enum: [host, otg, peripheral]
+
+  maximum-speed:
+enum: [super-speed, high-speed, full-speed]
+
+  phys:
+   minItems: 1
+   maxItems: 2
+
+  phy-names:
+minItems: 1
+maxItems: 2
+
+  cdns,on-chip-buff-size:
+description:
+  size of memory intended as internal memory for endpoints
+  buffers expressed in KB
+$ref: /schemas/types.yaml#/definitions/uint32
+
+required:
+  - compatible
+  - reg
+  - reg-names
+  - interrupts
+
+additionalProperties: false
+
+examples:
+  - |
+#include 
+bus {
+#address-cells = <2>;
+#size-cells = <2>;
+
+usb@600 {
+compatible = "cdns,usb3";
+reg = <0x00 0x600 0x00 0x1>,
+  <0x00 0x601 0x00 0x1>,
+  <0x00 0x602 0x00 0x1>;
+reg-names = "otg", "xhci", "dev";
+interrupts = ,
+ ,
+ ;
+interrupt-names = "host", "peripheral", "otg";
+maximum-speed = "super-speed";
+dr_mode = "otg";
+};
+};
diff --git a/Documentation/devicetree/bindings/usb/cdns-usb3.txt 
b/Documentation/devicetree/bindings/usb/cdns-usb3.txt
deleted file mode 100644
index b7dc606d37b5..
--- a/Documentation/devicetree/bindings/usb/cdns-usb3.txt
+++ /dev/null
@@ -1,45 +0,0 @@
-Binding for the Cadence USBSS-DRD controller
-
-Required properties:
- - reg: Physical base address and size of the controller's register areas.
-Controller has 3 different regions:
-- HOST registers area
-- DEVICE registers area
-- OTG/DRD registers area
- - reg-names - register memory area names:
-   "xhci" - for HOST registers space
-   "dev" - for DEVICE registers space
-   "otg" - for OTG/DRD registers space
- - compatible: Should contain: "cdns,usb3"
- - interrupts: Interrupts used by cdns3 controller:
-   "host" - interrupt used by XHCI driver.
-   "peripheral" - interrupt used by device driver
-   "otg" - interrupt used by DRD/OTG  part of driver
-
-Optional properties:
- - maximum-speed : valid arguments are "super-speed", "high-speed" and
-   "full-speed"; refer to usb/generic.txt
- - dr_mode: Should be one of "host", "peripheral" or "otg".
- - phys: reference to the USB PHY
- - phy-names: from the *Generic PHY* bindings;
-   Supported names are:
-   - cdns3,usb2-phy
-   - cdns3,usb3-phy
-
- - cdns,on-chip-buff-size : size of memory intended as internal memory for 
endpoints
-   buffers expressed in KB
-
-Example:
-   usb@f300 {
-   compatible = "cdns,usb3";
-   interrupts = ,
-   ,
-   ;
-   interrupt-names = "host", "peripheral", "otg";
-   reg = <0xf300 0x1>, /* memory area for HOST 
registers */
-   <0xf301 0x1>,   /* memory area for DEVICE 
registers */
-   <0xf302 0x1>;   /* memory area for OTG/DRD 
registers */
-   reg-names = "xhci", "dev", "otg";
-   phys = <_phy>, <_phy>;
-   phy-names = "cdns3,usb2-phy", "cnds3,usb3-phy";
-   };
-- 
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki