Skip to contentSkip to conversation

dt-bindings: usb: Convert fsl-usb to yaml

PATCH Superseded Frank Li 2 participants 4 messages Jun 25, 2024 – Jun 27, 2024

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Frank Li

author maintainer
#0 lore raw

PATCH 1/1 dt-bindings: usb: Convert fsl-usb to yaml

Convert fsl-usb binding doc to yaml format.

Additional change:
- Remove port0 and port1 from required list.
- Use common usb-drd.yaml for dr_mode property
- Keep two difference examples.
- Add interrupts to required property list.
- Remove #address-cells and #size-cells in example.
- Use predefined irq type macro.

---
 .../devicetree/bindings/usb/fsl-usb.txt       | 81 ----------------
 .../devicetree/bindings/usb/fsl-usb.yaml      | 96 +++++++++++++++++++
 2 files changed, 96 insertions(+), 81 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/usb/fsl-usb.txt
 create mode 100644 Documentation/devicetree/bindings/usb/fsl-usb.yaml
Documentation/devicetree/bindings/usb/fsl-usb.txt deleted +0 -81
deleted file mode 100644
index 0b08b006c5ead..0000000000000
@@ -1,81 +0,0 @@
-Freescale SOC USB controllers
-
-The device node for a USB controller that is part of a Freescale
-SOC is as described in the document "Open Firmware Recommended
-Practice : Universal Serial Bus" with the following modifications
-and additions :
-
-Required properties :
- - compatible : Should be "fsl-usb2-mph" for multi port host USB
-   controllers, or "fsl-usb2-dr" for dual role USB controllers
-   or "fsl,mpc5121-usb2-dr" for dual role USB controllers of MPC5121.
-   Wherever applicable, the IP version of the USB controller should
-   also be mentioned (for eg. fsl-usb2-dr-v2.2 for bsc9132).
- - phy_type : For multi port host USB controllers, should be one of
-   "ulpi", or "serial". For dual role USB controllers, should be
-   one of "ulpi", "utmi", "utmi_wide", or "serial".
- - reg : Offset and length of the register set for the device
- - port0 : boolean; if defined, indicates port0 is connected for
-   fsl-usb2-mph compatible controllers.  Either this property or
-   "port1" (or both) must be defined for "fsl-usb2-mph" compatible
-   controllers.
- - port1 : boolean; if defined, indicates port1 is connected for
-   fsl-usb2-mph compatible controllers.  Either this property or
-   "port0" (or both) must be defined for "fsl-usb2-mph" compatible
-   controllers.
- - dr_mode : indicates the working mode for "fsl-usb2-dr" compatible
-   controllers.  Can be "host", "peripheral", or "otg".  Default to
-   "host" if not defined for backward compatibility.
-
-Recommended properties :
- - interrupts : <a b> where a is the interrupt number and b is a
-   field that represents an encoding of the sense and level
-   information for the interrupt.  This should be encoded based on
-   the information in section 2) depending on the type of interrupt
-   controller you have.
-
-Optional properties :
- - fsl,invert-drvvbus : boolean; for MPC5121 USB0 only. Indicates the
-   port power polarity of internal PHY signal DRVVBUS is inverted.
- - fsl,invert-pwr-fault : boolean; for MPC5121 USB0 only. Indicates
-   the PWR_FAULT signal polarity is inverted.
-
-Example multi port host USB controller device node :
-	usb@22000 {
-		compatible = "fsl-usb2-mph";
-		reg = <22000 1000>;
-		#address-cells = <1>;
-		#size-cells = <0>;
-		interrupt-parent = <700>;
-		interrupts = <27 1>;
-		phy_type = "ulpi";
-		port0;
-		port1;
-	};
-
-Example dual role USB controller device node :
-	usb@23000 {
-		compatible = "fsl-usb2-dr";
-		reg = <23000 1000>;
-		#address-cells = <1>;
-		#size-cells = <0>;
-		interrupt-parent = <700>;
-		interrupts = <26 1>;
-		dr_mode = "otg";
-		phy = "ulpi";
-	};
-
-Example dual role USB controller device node for MPC5121ADS:
-
-	usb@4000 {
-		compatible = "fsl,mpc5121-usb2-dr";
-		reg = <0x4000 0x1000>;
-		#address-cells = <1>;
-		#size-cells = <0>;
-		interrupt-parent = < &ipic >;
-		interrupts = <44 0x8>;
-		dr_mode = "otg";
-		phy_type = "utmi_wide";
-		fsl,invert-drvvbus;
-		fsl,invert-pwr-fault;
-	};
Documentation/devicetree/bindings/usb/fsl-usb.yaml new file +96 -0

96 lines not on this page · raw message

Signature · 1 line
2.34.1
#1 lore raw

Documentation/devicetree/bindings/usb/fsl-usb.yaml

Quoted 22 lines · Frank Li

Convert fsl-usb binding doc to yaml format.

Additional change:

Documentation/devicetree/bindings/usb/fsl-usb.txt deleted +0 -12
-	usb@4000 {
-		compatible = "fsl,mpc5121-usb2-dr";
-		reg = <0x4000 0x1000>;
-		#address-cells = <1>;
-		#size-cells = <0>;
-		interrupt-parent = < &ipic >;
-		interrupts = <44 0x8>;
-		dr_mode = "otg";
-		phy_type = "utmi_wide";
-		fsl,invert-drvvbus;
-		fsl,invert-pwr-fault;
-	};
Documentation/devicetree/bindings/usb/fsl-usb.yaml new file +0 -0
new file mode 100644
index 0000000000000..8b5724e213f09

fsl,usb.yaml
or: fsl,usb2.yaml

Documentation/devicetree/bindings/usb/fsl-usb.yaml line 12

Quoted 5 lines
Documentation/devicetree/bindings/usb/fsl-usb.yaml new file +5 -0
+
+maintainers:
+  - Frank Li <[email protected]>
+
+description: |

Do not need '|' unless you need to preserve formatting.

Documentation/devicetree/bindings/usb/fsl-usb.yaml line 24

Quoted 12 lines
Documentation/devicetree/bindings/usb/fsl-usb.yaml new file +12 -0
+  The device node for a USB controller that is part of a Freescale
+  SOC is as described in the document "Open Firmware Recommended
+  Practice: Universal Serial Bus" with the following modifications
+  and additions.
+
+properties:
+  compatible:
+    oneOf:
+      - enum:
+          - fsl-usb2-mph
+          - fsl-usb2-dr
+          - fsl-usb2-dr-v2.2

It cannot be standalone and not-standalone. Cannot be both. Choose one.

Quoted 33 lines
Documentation/devicetree/bindings/usb/fsl-usb.yaml new file +33 -0
+      - items:
+          - enum:
+              - fsl-usb2-dr-v2.2
+              - fsl-usb2-dr-v2.5
+          - const: fsl-usb2-dr
+
+  phy_type:
+    $ref: /schemas/types.yaml#/definitions/string
+    enum: [ulpi, serial, utmi, utmi_wide]
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  port0:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description:
+      Indicates port0 is connected for fsl-usb2-mph compatible controllers.
+
+  port1:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description:
+      Indicates port1 is connected for "fsl-usb2-mph" compatible controllers.
+
+  fsl,invert-drvvbus:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description:
+      for MPC5121 USB0 only. Indicates the
+      port power polarity of internal PHY signal DRVVBUS is inverted.
+
+  fsl,invert-pwr-fault:

Documentation/devicetree/bindings/usb/fsl-usb.yaml line 67

Quoted 10 lines
Documentation/devicetree/bindings/usb/fsl-usb.yaml new file +10 -0
+    $ref: /schemas/types.yaml#/definitions/flag
+    description:
+      for MPC5121 USB0 only. Indicates
+      the PWR_FAULT signal polarity is inverted.
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - phy_type

Keep the same order as in "properties:". Preferably this order, so adjust "properties:" to match "required:".

Documentation/devicetree/bindings/usb/fsl-usb.yaml line 71

Quoted 4 lines
Documentation/devicetree/bindings/usb/fsl-usb.yaml new file +4 -0
+
+allOf:
+  - $ref: usb-drd.yaml#
+

Best regards,
Krzysztof

author maintainer
#2 lore raw
Quoted 27 lines · Krzysztof Kozlowski

Documentation/devicetree/bindings/usb/fsl-usb.yaml

Quoted 22 lines · Frank Li

Convert fsl-usb binding doc to yaml format.

Additional change:

Documentation/devicetree/bindings/usb/fsl-usb.txt deleted +0 -12
-	usb@4000 {
-		compatible = "fsl,mpc5121-usb2-dr";
-		reg = <0x4000 0x1000>;
-		#address-cells = <1>;
-		#size-cells = <0>;
-		interrupt-parent = < &ipic >;
-		interrupts = <44 0x8>;
-		dr_mode = "otg";
-		phy_type = "utmi_wide";
-		fsl,invert-drvvbus;
-		fsl,invert-pwr-fault;
-	};
Documentation/devicetree/bindings/usb/fsl-usb.yaml new file +0 -0
new file mode 100644
index 0000000000000..8b5724e213f09

fsl,usb.yaml
or: fsl,usb2.yaml

Quoted 7 lines

Documentation/devicetree/bindings/usb/fsl-usb.yaml line 12

Quoted 5 lines
Documentation/devicetree/bindings/usb/fsl-usb.yaml new file +5 -0
+
+maintainers:
+  - Frank Li <[email protected]>
+
+description: |

Do not need '|' unless you need to preserve formatting.

dt_binding_check report error without '|'
fsl,usb2.yaml:15:11: [error] syntax error: mapping values are not allowed here (syntax)

"Practice:" impact yaml parse.

Quoted 72 lines

Documentation/devicetree/bindings/usb/fsl-usb.yaml line 24

Quoted 13 lines
Documentation/devicetree/bindings/usb/fsl-usb.yaml new file +12 -0
+  The device node for a USB controller that is part of a Freescale
+  SOC is as described in the document "Open Firmware Recommended
+  Practice: Universal Serial Bus" with the following modifications
+  and additions.
+
+properties:
+  compatible:
+    oneOf:
+      - enum:
+          - fsl-usb2-mph
+          - fsl-usb2-dr
+          - fsl-usb2-dr-v2.2

It cannot be standalone and not-standalone. Cannot be both. Choose one.

Quoted 33 lines
Documentation/devicetree/bindings/usb/fsl-usb.yaml new file +33 -0
+      - items:
+          - enum:
+              - fsl-usb2-dr-v2.2
+              - fsl-usb2-dr-v2.5
+          - const: fsl-usb2-dr
+
+  phy_type:
+    $ref: /schemas/types.yaml#/definitions/string
+    enum: [ulpi, serial, utmi, utmi_wide]
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  port0:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description:
+      Indicates port0 is connected for fsl-usb2-mph compatible controllers.
+
+  port1:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description:
+      Indicates port1 is connected for "fsl-usb2-mph" compatible controllers.
+
+  fsl,invert-drvvbus:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description:
+      for MPC5121 USB0 only. Indicates the
+      port power polarity of internal PHY signal DRVVBUS is inverted.
+
+  fsl,invert-pwr-fault:

Documentation/devicetree/bindings/usb/fsl-usb.yaml line 67

Quoted 10 lines
Documentation/devicetree/bindings/usb/fsl-usb.yaml new file +10 -0
+    $ref: /schemas/types.yaml#/definitions/flag
+    description:
+      for MPC5121 USB0 only. Indicates
+      the PWR_FAULT signal polarity is inverted.
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - phy_type

Keep the same order as in "properties:". Preferably this order, so adjust "properties:" to match "required:".

Documentation/devicetree/bindings/usb/fsl-usb.yaml line 71

Quoted 4 lines
Documentation/devicetree/bindings/usb/fsl-usb.yaml new file +4 -0
+
+allOf:
+  - $ref: usb-drd.yaml#
+

Best regards,
Krzysztof

#3 lore raw
Quoted 36 lines · Frank Li
Quoted 27 lines · Krzysztof Kozlowski

Documentation/devicetree/bindings/usb/fsl-usb.yaml

Quoted 22 lines · Frank Li

Convert fsl-usb binding doc to yaml format.

Additional change:

Documentation/devicetree/bindings/usb/fsl-usb.txt deleted +0 -12
-	usb@4000 {
-		compatible = "fsl,mpc5121-usb2-dr";
-		reg = <0x4000 0x1000>;
-		#address-cells = <1>;
-		#size-cells = <0>;
-		interrupt-parent = < &ipic >;
-		interrupts = <44 0x8>;
-		dr_mode = "otg";
-		phy_type = "utmi_wide";
-		fsl,invert-drvvbus;
-		fsl,invert-pwr-fault;
-	};
Documentation/devicetree/bindings/usb/fsl-usb.yaml new file +0 -0
new file mode 100644
index 0000000000000..8b5724e213f09

fsl,usb.yaml
or: fsl,usb2.yaml

Quoted 7 lines

Documentation/devicetree/bindings/usb/fsl-usb.yaml line 12

Quoted 5 lines
Documentation/devicetree/bindings/usb/fsl-usb.yaml new file +5 -0
+
+maintainers:
+  - Frank Li <[email protected]>
+
+description: |

Do not need '|' unless you need to preserve formatting.

Quoted 4 lines

dt_binding_check report error without '|'
fsl,usb2.yaml:15:11: [error] syntax error: mapping values are not allowed here (syntax)

"Practice:" impact yaml parse.

Ah, indeed.

Best regards,
Krzysztof