diff mbox series

[linux-next,V2] dt-bindings: usb: snps,dwc3: correct i.MX8MQ support

Message ID 20230322125618.3402577-1-peng.fan@oss.nxp.com
State Superseded
Headers show
Series [linux-next,V2] dt-bindings: usb: snps,dwc3: correct i.MX8MQ support | expand

Commit Message

Peng Fan (OSS) March 22, 2023, 12:56 p.m. UTC
From: Peng Fan <peng.fan@nxp.com>

The previous i.MX8MQ support breaks rockchip,dwc3 support,
so use select to restrict i.MX8MQ support and avoid break others.

Fixes: 3754c41c7686 ("dt-bindings: usb: snps,dwc3: support i.MX8MQ")
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---

V2:
 Add a new yaml file for i.MX8MQ DWC3. I am not sure whether this is right,
 still meet dtbs error:
 arch/arm64/boot/dts/freescale/imx8mq-kontron-pitx-imx8m.dtb: usb@38100000:
 Unevaluated properties are not allowed ('phys', 'phy-names', 'maximum-speed'
 were unexpected)
 But there is already ref to snps,dwc3.yaml and dwc3 yaml ref to usb-x.yaml

 .../bindings/usb/fsl,imx8mq-dwc3.yaml         | 74 +++++++++++++++++++
 .../devicetree/bindings/usb/snps,dwc3.yaml    | 12 ++-
 2 files changed, 79 insertions(+), 7 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/usb/fsl,imx8mq-dwc3.yaml

Comments

Krzysztof Kozlowski March 22, 2023, 10:04 p.m. UTC | #1
On 22/03/2023 13:56, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> The previous i.MX8MQ support breaks rockchip,dwc3 support,
> so use select to restrict i.MX8MQ support and avoid break others.
> 
> Fixes: 3754c41c7686 ("dt-bindings: usb: snps,dwc3: support i.MX8MQ")
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
> 
> V2:
>  Add a new yaml file for i.MX8MQ DWC3. I am not sure whether this is right,
>  still meet dtbs error:
>  arch/arm64/boot/dts/freescale/imx8mq-kontron-pitx-imx8m.dtb: usb@38100000:
>  Unevaluated properties are not allowed ('phys', 'phy-names', 'maximum-speed'
>  were unexpected)
>  But there is already ref to snps,dwc3.yaml and dwc3 yaml ref to usb-x.yaml

Because your DTS has invalid properties, like usb3-resume-missing-cas
and others. Drop all properties which are not allowed by snps,dwc3.yaml.

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/usb/fsl,imx8mq-dwc3.yaml b/Documentation/devicetree/bindings/usb/fsl,imx8mq-dwc3.yaml
new file mode 100644
index 000000000000..055ffb122db7
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/fsl,imx8mq-dwc3.yaml
@@ -0,0 +1,74 @@ 
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/usb/fsl,imx8mq-dwc3.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP iMX8MQ Soc USB Controller
+
+maintainers:
+  - Li Jun <jun.li@nxp.com>
+  - Peng Fan <peng.fan@nxp.com>
+
+select:
+  properties:
+    compatible:
+      contains:
+        enum:
+          - fsl,imx8mq-dwc3
+  required:
+    - compatible
+
+properties:
+  compatible:
+    items:
+      - const: fsl,imx8mq-dwc3
+      - const: snps,dwc3
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    items:
+      - description: Controller root clock
+      - description: Controller core reference clock
+      - description: clock that used for wakeup
+
+  clock-names:
+    items:
+      - const: bus_early
+      - const: ref
+      - const: suspend
+
+  power-domains:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupts
+
+allOf:
+  - $ref: snps,dwc3.yaml#
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/imx8mq-clock.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    usb_dwc3_1: usb@38200000 {
+        compatible = "fsl,imx8mq-dwc3", "snps,dwc3";
+        reg = <0x38200000 0x10000>;
+        clocks = <&clk IMX8MQ_CLK_USB2_CTRL_ROOT>,
+                 <&clk IMX8MQ_CLK_USB_CORE_REF>,
+                 <&clk IMX8MQ_CLK_32K>;
+        clock-names = "bus_early", "ref", "suspend";
+        interrupts = <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>;
+        phys = <&usb3_phy1>, <&usb3_phy1>;
+        phy-names = "usb2-phy", "usb3-phy";
+    };
diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
index 16c7d06c9172..c167fd577cae 100644
--- a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
+++ b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
@@ -30,13 +30,11 @@  allOf:
 
 properties:
   compatible:
-    oneOf:
-      - items:
-          - const: fsl,imx8mq-dwc3
-          - const: snps,dwc3
-      - const: snps,dwc3
-      - const: synopsys,dwc3
-        deprecated: true
+    contains:
+      oneOf:
+        - const: snps,dwc3
+        - const: synopsys,dwc3
+          deprecated: true
 
   reg:
     maxItems: 1