diff mbox series

[v3,3/6] dt-bindings: usb: dwc3-imx8mp: add imx8mp dwc3 glue bindings

Message ID 1600771612-30727-4-git-send-email-jun.li@nxp.com (mailing list archive)
State New, archived
Headers show
Series add NXP imx8mp usb support | expand

Commit Message

Jun Li Sept. 22, 2020, 10:46 a.m. UTC
NXP imx8mp integrates 2 dwc3 3.30b IP and add some wakeup logic
to support low power mode, the glue layer is for this wakeup
functionality, which has a separated interrupt, can support
wakeup from U3 and connect events for host, and vbus wakeup for
device.

Signed-off-by: Li Jun <jun.li@nxp.com>
---
 .../devicetree/bindings/usb/fsl,imx8mp-dwc3.yaml   | 99 ++++++++++++++++++++++
 1 file changed, 99 insertions(+)

Comments

Krzysztof Kozlowski Sept. 22, 2020, 2:32 p.m. UTC | #1
On Tue, 22 Sep 2020 at 12:56, Li Jun <jun.li@nxp.com> wrote:
>
> NXP imx8mp integrates 2 dwc3 3.30b IP and add some wakeup logic
> to support low power mode, the glue layer is for this wakeup
> functionality, which has a separated interrupt, can support
> wakeup from U3 and connect events for host, and vbus wakeup for
> device.
>
> Signed-off-by: Li Jun <jun.li@nxp.com>
> ---
>  .../devicetree/bindings/usb/fsl,imx8mp-dwc3.yaml   | 99 ++++++++++++++++++++++
>  1 file changed, 99 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/usb/fsl,imx8mp-dwc3.yaml b/Documentation/devicetree/bindings/usb/fsl,imx8mp-dwc3.yaml
> new file mode 100644
> index 0000000..a5d5566
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/usb/fsl,imx8mp-dwc3.yaml
> @@ -0,0 +1,99 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +# Copyright (c) 2020 NXP
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/usb/fsl,imx8mp-dwc3.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: NXP iMX8MP Soc USB Controller
> +
> +maintainers:
> +  - Li Jun <jun.li@nxp.com>
> +
> +properties:
> +  compatible:
> +    items:

Items are not necessary


> +    - const: fsl,imx8mp-dwc3
> +
> +  reg:
> +    maxItems: 1
> +    description: Address and length of the register set for the wrapper of
> +      dwc3 core on the SOC.
> +
> +  "#address-cells":
> +    enum: [ 1, 2 ]
> +
> +  "#size-cells":
> +    enum: [ 1, 2 ]
> +
> +  ranges: true
> +
> +  interrupts:
> +    maxItems: 1
> +    description: The interrupt that is asserted when a wakeup event is
> +      received.
> +
> +  clocks:
> +    description:
> +      A list of phandle and clock-specifier pairs for the clocks
> +      listed in clock-names.
> +    items:
> +      - description: system hsio root clock.
> +      - description: suspend clock, used for usb wakeup logic.
> +
> +  clock-names:
> +    items:
> +      - const: hsio
> +      - const: suspend
> +
> +# Required child node:
> +
> +patternProperties:
> +  "^dwc3@[0-9a-f]+$":
> +    type: object
> +    description:
> +      A child node must exist to represent the core DWC3 IP block
> +      The content of the node is defined in dwc3.txt.
> +
> +required:
> +  - compatible
> +  - reg
> +  - "#address-cells"
> +  - "#size-cells"
> +  - ranges
> +  - clocks
> +  - clock-names
> +  - interrupts
> +
> +additionalProperties: false

Do you actually validate your DTS changes with this schema? They do
not look like passing the validation...

Best regards,
Krzysztof
Jun Li Sept. 22, 2020, 4:45 p.m. UTC | #2
> -----Original Message-----
> From: Krzysztof Kozlowski <krzk@kernel.org>
> Sent: Tuesday, September 22, 2020 10:33 PM
> To: Jun Li <jun.li@nxp.com>
> Cc: robh+dt@kernel.org; shawnguo@kernel.org; balbi@kernel.org;
> mathias.nyman@intel.com; gregkh@linuxfoundation.org;
> s.hauer@pengutronix.de; kernel@pengutronix.de; festevam@gmail.com;
> dl-linux-imx <linux-imx@nxp.com>; Anson Huang <anson.huang@nxp.com>;
> Aisheng Dong <aisheng.dong@nxp.com>; Peng Fan <peng.fan@nxp.com>; Andy Duan
> <fugang.duan@nxp.com>; Joakim Zhang <qiangqing.zhang@nxp.com>; Horia
> Geanta <horia.geanta@nxp.com>; linux-usb@vger.kernel.org;
> devicetree@vger.kernel.org; linux-arm-kernel@lists.infradead.org
> Subject: Re: [PATCH v3 3/6] dt-bindings: usb: dwc3-imx8mp: add imx8mp dwc3
> glue bindings
> 
> On Tue, 22 Sep 2020 at 12:56, Li Jun <jun.li@nxp.com> wrote:
> >
> > NXP imx8mp integrates 2 dwc3 3.30b IP and add some wakeup logic to
> > support low power mode, the glue layer is for this wakeup
> > functionality, which has a separated interrupt, can support wakeup
> > from U3 and connect events for host, and vbus wakeup for device.
> >
> > Signed-off-by: Li Jun <jun.li@nxp.com>
> > ---
> >  .../devicetree/bindings/usb/fsl,imx8mp-dwc3.yaml   | 99
> ++++++++++++++++++++++
> >  1 file changed, 99 insertions(+)
> >
> > diff --git
> > a/Documentation/devicetree/bindings/usb/fsl,imx8mp-dwc3.yaml
> > b/Documentation/devicetree/bindings/usb/fsl,imx8mp-dwc3.yaml
> > new file mode 100644
> > index 0000000..a5d5566
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/usb/fsl,imx8mp-dwc3.yaml
> > @@ -0,0 +1,99 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) # Copyright
> > +(c) 2020 NXP %YAML 1.2
> > +---
> > +$id:
> >
> +https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdevi
> >
> +cetree.org%2Fschemas%2Fusb%2Ffsl%2Cimx8mp-dwc3.yaml%23&amp;data=02%7C
> >
> +01%7Cjun.li%40nxp.com%7Ceaedeb64ec15472183d108d85f046841%7C686ea1d3bc
> >
> +2b4c6fa92cd99c5c301635%7C0%7C0%7C637363819819667936&amp;sdata=IvFQ8l0
> > +7VXUMbG8riyITSTZb1P50oIXs%2BkAV%2FeX8ntk%3D&amp;reserved=0
> > +$schema:
> >
> +https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdevi
> >
> +cetree.org%2Fmeta-schemas%2Fcore.yaml%23&amp;data=02%7C01%7Cjun.li%40
> >
> +nxp.com%7Ceaedeb64ec15472183d108d85f046841%7C686ea1d3bc2b4c6fa92cd99c
> >
> +5c301635%7C0%7C0%7C637363819819677934&amp;sdata=H3%2BcwgiLKBynHv4N%2F
> > +dogBi3SwaizVHmqieJXVrErv0I%3D&amp;reserved=0
> > +
> > +title: NXP iMX8MP Soc USB Controller
> > +
> > +maintainers:
> > +  - Li Jun <jun.li@nxp.com>
> > +
> > +properties:
> > +  compatible:
> > +    items:
> 
> Items are not necessary
> 
> 
> > +    - const: fsl,imx8mp-dwc3
> > +
> > +  reg:
> > +    maxItems: 1
> > +    description: Address and length of the register set for the wrapper
> of
> > +      dwc3 core on the SOC.
> > +
> > +  "#address-cells":
> > +    enum: [ 1, 2 ]
> > +
> > +  "#size-cells":
> > +    enum: [ 1, 2 ]
> > +
> > +  ranges: true
> > +
> > +  interrupts:
> > +    maxItems: 1
> > +    description: The interrupt that is asserted when a wakeup event is
> > +      received.
> > +
> > +  clocks:
> > +    description:
> > +      A list of phandle and clock-specifier pairs for the clocks
> > +      listed in clock-names.
> > +    items:
> > +      - description: system hsio root clock.
> > +      - description: suspend clock, used for usb wakeup logic.
> > +
> > +  clock-names:
> > +    items:
> > +      - const: hsio
> > +      - const: suspend
> > +
> > +# Required child node:
> > +
> > +patternProperties:
> > +  "^dwc3@[0-9a-f]+$":
> > +    type: object
> > +    description:
> > +      A child node must exist to represent the core DWC3 IP block
> > +      The content of the node is defined in dwc3.txt.
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +  - "#address-cells"
> > +  - "#size-cells"
> > +  - ranges
> > +  - clocks
> > +  - clock-names
> > +  - interrupts
> > +
> > +additionalProperties: false
> 
> Do you actually validate your DTS changes with this schema? They do not look
> like passing the validation...

I did run dt_binding_check, maybe I missed some errors as there are always some other
failures, I will re-run to double check.

Li Jun
> 
> Best regards,
> Krzysztof
Krzysztof Kozlowski Sept. 22, 2020, 6:22 p.m. UTC | #3
On Tue, 22 Sep 2020 at 18:45, Jun Li <jun.li@nxp.com> wrote:
>
>
>
> > -----Original Message-----
> > From: Krzysztof Kozlowski <krzk@kernel.org>
> > Sent: Tuesday, September 22, 2020 10:33 PM
> > To: Jun Li <jun.li@nxp.com>
> > Cc: robh+dt@kernel.org; shawnguo@kernel.org; balbi@kernel.org;
> > mathias.nyman@intel.com; gregkh@linuxfoundation.org;
> > s.hauer@pengutronix.de; kernel@pengutronix.de; festevam@gmail.com;
> > dl-linux-imx <linux-imx@nxp.com>; Anson Huang <anson.huang@nxp.com>;
> > Aisheng Dong <aisheng.dong@nxp.com>; Peng Fan <peng.fan@nxp.com>; Andy Duan
> > <fugang.duan@nxp.com>; Joakim Zhang <qiangqing.zhang@nxp.com>; Horia
> > Geanta <horia.geanta@nxp.com>; linux-usb@vger.kernel.org;
> > devicetree@vger.kernel.org; linux-arm-kernel@lists.infradead.org
> > Subject: Re: [PATCH v3 3/6] dt-bindings: usb: dwc3-imx8mp: add imx8mp dwc3
> > glue bindings
> >
> > On Tue, 22 Sep 2020 at 12:56, Li Jun <jun.li@nxp.com> wrote:
> > >
> > > NXP imx8mp integrates 2 dwc3 3.30b IP and add some wakeup logic to
> > > support low power mode, the glue layer is for this wakeup
> > > functionality, which has a separated interrupt, can support wakeup
> > > from U3 and connect events for host, and vbus wakeup for device.
> > >
> > > Signed-off-by: Li Jun <jun.li@nxp.com>
> > > ---
> > >  .../devicetree/bindings/usb/fsl,imx8mp-dwc3.yaml   | 99
> > ++++++++++++++++++++++
> > >  1 file changed, 99 insertions(+)
> > >
> > > diff --git
> > > a/Documentation/devicetree/bindings/usb/fsl,imx8mp-dwc3.yaml
> > > b/Documentation/devicetree/bindings/usb/fsl,imx8mp-dwc3.yaml
> > > new file mode 100644
> > > index 0000000..a5d5566
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/usb/fsl,imx8mp-dwc3.yaml
> > > @@ -0,0 +1,99 @@
> > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) # Copyright
> > > +(c) 2020 NXP %YAML 1.2
> > > +---
> > > +$id:
> > >
> > +https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdevi
> > >
> > +cetree.org%2Fschemas%2Fusb%2Ffsl%2Cimx8mp-dwc3.yaml%23&amp;data=02%7C
> > >
> > +01%7Cjun.li%40nxp.com%7Ceaedeb64ec15472183d108d85f046841%7C686ea1d3bc
> > >
> > +2b4c6fa92cd99c5c301635%7C0%7C0%7C637363819819667936&amp;sdata=IvFQ8l0
> > > +7VXUMbG8riyITSTZb1P50oIXs%2BkAV%2FeX8ntk%3D&amp;reserved=0
> > > +$schema:
> > >
> > +https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdevi
> > >
> > +cetree.org%2Fmeta-schemas%2Fcore.yaml%23&amp;data=02%7C01%7Cjun.li%40
> > >
> > +nxp.com%7Ceaedeb64ec15472183d108d85f046841%7C686ea1d3bc2b4c6fa92cd99c
> > >
> > +5c301635%7C0%7C0%7C637363819819677934&amp;sdata=H3%2BcwgiLKBynHv4N%2F
> > > +dogBi3SwaizVHmqieJXVrErv0I%3D&amp;reserved=0
> > > +
> > > +title: NXP iMX8MP Soc USB Controller
> > > +
> > > +maintainers:
> > > +  - Li Jun <jun.li@nxp.com>
> > > +
> > > +properties:
> > > +  compatible:
> > > +    items:
> >
> > Items are not necessary
> >
> >
> > > +    - const: fsl,imx8mp-dwc3
> > > +
> > > +  reg:
> > > +    maxItems: 1
> > > +    description: Address and length of the register set for the wrapper
> > of
> > > +      dwc3 core on the SOC.
> > > +
> > > +  "#address-cells":
> > > +    enum: [ 1, 2 ]
> > > +
> > > +  "#size-cells":
> > > +    enum: [ 1, 2 ]
> > > +
> > > +  ranges: true
> > > +
> > > +  interrupts:
> > > +    maxItems: 1
> > > +    description: The interrupt that is asserted when a wakeup event is
> > > +      received.
> > > +
> > > +  clocks:
> > > +    description:
> > > +      A list of phandle and clock-specifier pairs for the clocks
> > > +      listed in clock-names.
> > > +    items:
> > > +      - description: system hsio root clock.
> > > +      - description: suspend clock, used for usb wakeup logic.
> > > +
> > > +  clock-names:
> > > +    items:
> > > +      - const: hsio
> > > +      - const: suspend
> > > +
> > > +# Required child node:
> > > +
> > > +patternProperties:
> > > +  "^dwc3@[0-9a-f]+$":
> > > +    type: object
> > > +    description:
> > > +      A child node must exist to represent the core DWC3 IP block
> > > +      The content of the node is defined in dwc3.txt.
> > > +
> > > +required:
> > > +  - compatible
> > > +  - reg
> > > +  - "#address-cells"
> > > +  - "#size-cells"
> > > +  - ranges
> > > +  - clocks
> > > +  - clock-names
> > > +  - interrupts
> > > +
> > > +additionalProperties: false
> >
> > Do you actually validate your DTS changes with this schema? They do not look
> > like passing the validation...
>
> I did run dt_binding_check, maybe I missed some errors as there are always some other
> failures, I will re-run to double check.

dt_binding_check is good for the binding and example. Except this you
need to run dtbs_check so your new DTS will be checked. In this case
it points to missing properties in the bindings.

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/usb/fsl,imx8mp-dwc3.yaml b/Documentation/devicetree/bindings/usb/fsl,imx8mp-dwc3.yaml
new file mode 100644
index 0000000..a5d5566
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/fsl,imx8mp-dwc3.yaml
@@ -0,0 +1,99 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright (c) 2020 NXP
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/usb/fsl,imx8mp-dwc3.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP iMX8MP Soc USB Controller
+
+maintainers:
+  - Li Jun <jun.li@nxp.com>
+
+properties:
+  compatible:
+    items:
+    - const: fsl,imx8mp-dwc3
+
+  reg:
+    maxItems: 1
+    description: Address and length of the register set for the wrapper of
+      dwc3 core on the SOC.
+
+  "#address-cells":
+    enum: [ 1, 2 ]
+
+  "#size-cells":
+    enum: [ 1, 2 ]
+
+  ranges: true
+
+  interrupts:
+    maxItems: 1
+    description: The interrupt that is asserted when a wakeup event is
+      received.
+
+  clocks:
+    description:
+      A list of phandle and clock-specifier pairs for the clocks
+      listed in clock-names.
+    items:
+      - description: system hsio root clock.
+      - description: suspend clock, used for usb wakeup logic.
+
+  clock-names:
+    items:
+      - const: hsio
+      - const: suspend
+
+# Required child node:
+
+patternProperties:
+  "^dwc3@[0-9a-f]+$":
+    type: object
+    description:
+      A child node must exist to represent the core DWC3 IP block
+      The content of the node is defined in dwc3.txt.
+
+required:
+  - compatible
+  - reg
+  - "#address-cells"
+  - "#size-cells"
+  - ranges
+  - clocks
+  - clock-names
+  - interrupts
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/imx8mp-clock.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    usb3_0: usb@32f10100 {
+      compatible = "fsl,imx8mp-dwc3";
+      reg = <0x32f10100 0x8>;
+      clocks = <&clk IMX8MP_CLK_HSIO_ROOT>,
+               <&clk IMX8MP_CLK_USB_ROOT>;
+      clock-names = "hsio", "suspend";
+      interrupts = <GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>;
+      #address-cells = <1>;
+      #size-cells = <1>;
+      ranges;
+
+      dwc3@38100000 {
+        compatible = "snps,dwc3";
+        reg = <0x38100000 0x10000>;
+        clocks = <&clk IMX8MP_CLK_HSIO_AXI>,
+                 <&clk IMX8MP_CLK_USB_CORE_REF>,
+                 <&clk IMX8MP_CLK_USB_ROOT>;
+        clock-names = "bus_early", "ref", "suspend";
+        assigned-clocks = <&clk IMX8MP_CLK_HSIO_AXI>;
+        assigned-clock-parents = <&clk IMX8MP_SYS_PLL2_500M>;
+        assigned-clock-rates = <500000000>;
+        interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>;
+        phys = <&usb3_phy0>, <&usb3_phy0>;
+        phy-names = "usb2-phy", "usb3-phy";
+      };
+    };