Thread (12 messages) 12 messages, 2 authors, 2021-12-16

Re: [PATCH 1/4] dt-bindings: usb: chipidea: Convert to json-schema

From: Thierry Reding <hidden>
Date: 2021-12-16 16:12:13
Also in: linux-tegra, linux-usb

On Wed, Dec 15, 2021 at 01:25:08PM -0600, Rob Herring wrote:
On Thu, Dec 09, 2021 at 05:53:36PM +0100, Thierry Reding wrote:
quoted
From: Thierry Reding <redacted>

Convert the ChipIdea USB2 bindings from the free-form text format to
json-schema.

Signed-off-by: Thierry Reding <redacted>
---
 .../bindings/usb/chipidea,usb2.yaml           | 310 ++++++++++++++++++
 .../devicetree/bindings/usb/ci-hdrc-usb2.txt  | 158 ---------
 2 files changed, 310 insertions(+), 158 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/usb/chipidea,usb2.yaml
 delete mode 100644 Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt
diff --git a/Documentation/devicetree/bindings/usb/chipidea,usb2.yaml b/Documentation/devicetree/bindings/usb/chipidea,usb2.yaml
new file mode 100644
index 000000000000..0e36259f23ba
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/chipidea,usb2.yaml
@@ -0,0 +1,310 @@
+# SPDX-License-Identifier: GPL-2.0-only
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/usb/chipidea,usb2.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: USB2 ChipIdea USB controller for ci13xxx
+
+maintainers:
+  - Peter Chen <peter.chen@freescale.com>
This should have a reference to usb-drd.yaml I think.
quoted
+
+properties:
+  compatible:
+    oneOf:
+      - enum:
+          - fsl,imx23-usb
+          - fsl,imx27-usb
+          - fsl,imx28-usb
+          - fsl,imx6q-usb
+          - fsl,imx6sl-usb
+          - fsl,imx6sx-usb
+          - fsl,imx6ul-usb
+          - fsl,imx7d-usb
+          - fsl,imx7ulp-usb
+          - lsi,zevio-usb
+          - qcom,ci-hdrc
+          - chipidea,usb2
+          - xlnx,zynq-usb-2.20a
+          - nvidia,tegra20-udc
+          - nvidia,tegra30-udc
+          - nvidia,tegra114-udc
+          - nvidia,tegra124-udc
+      - items:
+          - const: fsl,imx6q-usb
+          - const: fsl,imx27-usb
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  phy_type:
+    $ref: /schemas/types.yaml#/definitions/string
+    description: The type of the PHY connected to the core. Without this property the PORTSC
+      register won't be touched.
+    enum:
+      - utmi
+      - utmi_wide
+      - ulpi
+      - serial
+      - hsic
+
+  dr_mode:
+    $ref: /schemas/types.yaml#/definitions/string
+    description: dual-role mode of the interface
+    enum:
+      - host
+      - peripheral
+      - otg
+    default:
+      const: otg
+
+  clocks:
+    items:
+      - description: reference to the USB clock
From the report, i.MX needs 3 clocks.
Okay, I'll look into that.
quoted
+  # USB bus
+  "#address-cells":
+    const: 1
+
+  "#size-cells":
+    const: 0
Covered by common schema (I think).
Yeah, so this can be both used in peripheral mode and host mode, so it
probably needs usb-hcd.yaml and usb-drd.yaml, and then #address-cells
and #size-cells will get pulled in.
quoted
+
+patternProperties:
+  "^pinctrl-[0-9]+$": true
+
+additionalProperties:
+  $ref: usb-device.yaml
This is wrong as usb.device.yaml applies to child nodes.
Originally the idea behind this was that any additionalProperties would
have to be child nodes that represent hard-wired USB devices. Given the
above and that I'm now including usb-hcd.yaml here, this is taken care
of automatically.

Thierry

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help