linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH v6 1/9] dt-bindings: usb: usbmisc-imx: add fsl,imx8ulp-usbmisc compatible
  2024-02-21 14:58 [PATCH v6 1/9] dt-bindings: usb: usbmisc-imx: add fsl,imx8ulp-usbmisc compatible Xu Yang
@ 2024-02-21  7:28 ` Krzysztof Kozlowski
  2024-02-21  7:53   ` [EXT] " Xu Yang
  2024-02-21 14:58 ` [PATCH v6 2/9] arm64: dts: imx8ulp: add usb nodes Xu Yang
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 16+ messages in thread
From: Krzysztof Kozlowski @ 2024-02-21  7:28 UTC (permalink / raw)
  To: Xu Yang, gregkh, robh+dt, krzysztof.kozlowski+dt, shawnguo, conor+dt
  Cc: s.hauer, kernel, festevam, linux-imx, peter.chen, jun.li,
	linux-usb, devicetree, linux-arm-kernel, linux-kernel

On 21/02/2024 15:58, Xu Yang wrote:
> Add "fsl,imx8ulp-usbmisc" compatible.
> 
> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
> 

Please fix your machine time, so this does not appear in +8 hours in the
future. It unnecessarily goes to the top of my inbox, so I will ignore
the patchset.

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 16+ messages in thread

* RE: [EXT] Re: [PATCH v6 1/9] dt-bindings: usb: usbmisc-imx: add fsl,imx8ulp-usbmisc compatible
  2024-02-21  7:28 ` Krzysztof Kozlowski
@ 2024-02-21  7:53   ` Xu Yang
  0 siblings, 0 replies; 16+ messages in thread
From: Xu Yang @ 2024-02-21  7:53 UTC (permalink / raw)
  To: Krzysztof Kozlowski, gregkh, robh+dt, krzysztof.kozlowski+dt,
	shawnguo, conor+dt
  Cc: s.hauer, kernel, festevam, dl-linux-imx, peter.chen, Jun Li,
	linux-usb, devicetree, linux-arm-kernel, linux-kernel


> 
> On 21/02/2024 15:58, Xu Yang wrote:
> > Add "fsl,imx8ulp-usbmisc" compatible.
> >
> > Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
> >
> 
> Please fix your machine time, so this does not appear in +8 hours in the
> future. It unnecessarily goes to the top of my inbox, so I will ignore
> the patchset.

Thanks for reminder of the time offset. I'll resend the patchset later.

Thanks,
Xu Yang


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH v6 1/9] dt-bindings: usb: usbmisc-imx: add fsl,imx8ulp-usbmisc compatible
@ 2024-02-21 14:58 Xu Yang
  2024-02-21  7:28 ` Krzysztof Kozlowski
                   ` (8 more replies)
  0 siblings, 9 replies; 16+ messages in thread
From: Xu Yang @ 2024-02-21 14:58 UTC (permalink / raw)
  To: gregkh, robh+dt, krzysztof.kozlowski+dt, shawnguo, conor+dt
  Cc: s.hauer, kernel, festevam, linux-imx, peter.chen, xu.yang_2,
	jun.li, linux-usb, devicetree, linux-arm-kernel, linux-kernel

Add "fsl,imx8ulp-usbmisc" compatible.

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Xu Yang <xu.yang_2@nxp.com>

---
Changes in v3:
 - new patch due to missed this little one
Changes in v4:
 - no changes
Changes in v5:
 - add Acked-by tag
Changes in v6:
 - no changes
---
 Documentation/devicetree/bindings/usb/fsl,usbmisc.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/usb/fsl,usbmisc.yaml b/Documentation/devicetree/bindings/usb/fsl,usbmisc.yaml
index 2d3589d284b2..0a6e7ac1b37e 100644
--- a/Documentation/devicetree/bindings/usb/fsl,usbmisc.yaml
+++ b/Documentation/devicetree/bindings/usb/fsl,usbmisc.yaml
@@ -33,6 +33,7 @@ properties:
               - fsl,imx7ulp-usbmisc
               - fsl,imx8mm-usbmisc
               - fsl,imx8mn-usbmisc
+              - fsl,imx8ulp-usbmisc
           - const: fsl,imx7d-usbmisc
           - const: fsl,imx6q-usbmisc
       - items:
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v6 2/9] arm64: dts: imx8ulp: add usb nodes
  2024-02-21 14:58 [PATCH v6 1/9] dt-bindings: usb: usbmisc-imx: add fsl,imx8ulp-usbmisc compatible Xu Yang
  2024-02-21  7:28 ` Krzysztof Kozlowski
@ 2024-02-21 14:58 ` Xu Yang
  2024-02-21 14:58 ` [PATCH v6 3/9] arm64: dts: imx8ulp-evk: enable usb nodes and add ptn5150 nodes Xu Yang
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 16+ messages in thread
From: Xu Yang @ 2024-02-21 14:58 UTC (permalink / raw)
  To: gregkh, robh+dt, krzysztof.kozlowski+dt, shawnguo, conor+dt
  Cc: s.hauer, kernel, festevam, linux-imx, peter.chen, xu.yang_2,
	jun.li, linux-usb, devicetree, linux-arm-kernel, linux-kernel

Add USB nodes on i.MX8ULP platform which has 2 USB controllers.

Signed-off-by: Xu Yang <xu.yang_2@nxp.com>

---
Changes in v2:
 - no changes
Changes in v3:
 - no changes
Changes in v4:
 - no changes
Changes in v5:
 - no changes
Changes in v6:
 - drop usbphy aliases
---
 arch/arm64/boot/dts/freescale/imx8ulp.dtsi | 62 ++++++++++++++++++++++
 1 file changed, 62 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/imx8ulp.dtsi b/arch/arm64/boot/dts/freescale/imx8ulp.dtsi
index c4a0082f30d3..7da9461a5745 100644
--- a/arch/arm64/boot/dts/freescale/imx8ulp.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8ulp.dtsi
@@ -472,6 +472,68 @@ usdhc2: mmc@298f0000 {
 				status = "disabled";
 			};
 
+			usbotg1: usb@29900000 {
+				compatible = "fsl,imx8ulp-usb", "fsl,imx7ulp-usb", "fsl,imx6ul-usb";
+				reg = <0x29900000 0x200>;
+				interrupts = <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&pcc4 IMX8ULP_CLK_USB0>;
+				power-domains = <&scmi_devpd IMX8ULP_PD_USB0>;
+				phys = <&usbphy1>;
+				fsl,usbmisc = <&usbmisc1 0>;
+				ahb-burst-config = <0x0>;
+				tx-burst-size-dword = <0x8>;
+				rx-burst-size-dword = <0x8>;
+				status = "disabled";
+			};
+
+			usbmisc1: usbmisc@29900200 {
+				compatible = "fsl,imx8ulp-usbmisc", "fsl,imx7d-usbmisc",
+						"fsl,imx6q-usbmisc";
+				#index-cells = <1>;
+				reg = <0x29900200 0x200>;
+				status = "disabled";
+			};
+
+			usbphy1: usb-phy@29910000 {
+				compatible = "fsl,imx8ulp-usbphy", "fsl,imx7ulp-usbphy";
+				reg = <0x29910000 0x10000>;
+				interrupts = <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&pcc4 IMX8ULP_CLK_USB0_PHY>;
+				#phy-cells = <0>;
+				status = "disabled";
+			};
+
+			usbotg2: usb@29920000 {
+				compatible = "fsl,imx8ulp-usb", "fsl,imx7ulp-usb", "fsl,imx6ul-usb";
+				reg = <0x29920000 0x200>;
+				interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&pcc4 IMX8ULP_CLK_USB1>;
+				power-domains = <&scmi_devpd IMX8ULP_PD_USDHC2_USB1>;
+				phys = <&usbphy2>;
+				fsl,usbmisc = <&usbmisc2 0>;
+				ahb-burst-config = <0x0>;
+				tx-burst-size-dword = <0x8>;
+				rx-burst-size-dword = <0x8>;
+				status = "disabled";
+			};
+
+			usbmisc2: usbmisc@29920200 {
+				compatible = "fsl,imx8ulp-usbmisc", "fsl,imx7d-usbmisc",
+						"fsl,imx6q-usbmisc";
+				#index-cells = <1>;
+				reg = <0x29920200 0x200>;
+				status = "disabled";
+			};
+
+			usbphy2: usb-phy@29930000 {
+				compatible = "fsl,imx8ulp-usbphy", "fsl,imx7ulp-usbphy";
+				reg = <0x29930000 0x10000>;
+				interrupts = <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&pcc4 IMX8ULP_CLK_USB1_PHY>;
+				#phy-cells = <0>;
+				status = "disabled";
+			};
+
 			fec: ethernet@29950000 {
 				compatible = "fsl,imx8ulp-fec", "fsl,imx6ul-fec", "fsl,imx6q-fec";
 				reg = <0x29950000 0x10000>;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v6 3/9] arm64: dts: imx8ulp-evk: enable usb nodes and add ptn5150 nodes
  2024-02-21 14:58 [PATCH v6 1/9] dt-bindings: usb: usbmisc-imx: add fsl,imx8ulp-usbmisc compatible Xu Yang
  2024-02-21  7:28 ` Krzysztof Kozlowski
  2024-02-21 14:58 ` [PATCH v6 2/9] arm64: dts: imx8ulp: add usb nodes Xu Yang
@ 2024-02-21 14:58 ` Xu Yang
  2024-02-21 14:58 ` [PATCH v6 4/9] dt-bindings: usb: add NXP ChipIdea USB2 Controller schema Xu Yang
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 16+ messages in thread
From: Xu Yang @ 2024-02-21 14:58 UTC (permalink / raw)
  To: gregkh, robh+dt, krzysztof.kozlowski+dt, shawnguo, conor+dt
  Cc: s.hauer, kernel, festevam, linux-imx, peter.chen, xu.yang_2,
	jun.li, linux-usb, devicetree, linux-arm-kernel, linux-kernel

Enable 2 USB nodes and add 2 PTN5150 nodes on i.MX8ULP evk board.

Signed-off-by: Xu Yang <xu.yang_2@nxp.com>

---
Changes in v2:
 - fix format as suggusted by Fabio
 - add PTN5150 nodes
Changes in v3:
 - no changes
Changes in v4:
 - no changes
Changes in v5:
 - no changes
Changes in v6:
 - no changes
---
 arch/arm64/boot/dts/freescale/imx8ulp-evk.dts | 84 +++++++++++++++++++
 1 file changed, 84 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/imx8ulp-evk.dts b/arch/arm64/boot/dts/freescale/imx8ulp-evk.dts
index 69dd8e31027c..bf418af31039 100644
--- a/arch/arm64/boot/dts/freescale/imx8ulp-evk.dts
+++ b/arch/arm64/boot/dts/freescale/imx8ulp-evk.dts
@@ -133,6 +133,64 @@ pcal6408: gpio@21 {
 		gpio-controller;
 		#gpio-cells = <2>;
 	};
+
+	ptn5150_1: typec@1d {
+		compatible = "nxp,ptn5150";
+		reg = <0x1d>;
+		int-gpios = <&gpiof 3 IRQ_TYPE_EDGE_FALLING>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_typec1>;
+		status = "disabled";
+	};
+
+	ptn5150_2: typec@3d {
+		compatible = "nxp,ptn5150";
+		reg = <0x3d>;
+		int-gpios = <&gpiof 5 IRQ_TYPE_EDGE_FALLING>;
+			pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_typec2>;
+		status = "disabled";
+	};
+};
+
+&usbotg1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_usb1>;
+	dr_mode = "otg";
+	hnp-disable;
+	srp-disable;
+	adp-disable;
+	over-current-active-low;
+	status = "okay";
+};
+
+&usbphy1 {
+	fsl,tx-d-cal = <110>;
+	status = "okay";
+};
+
+&usbmisc1 {
+	status = "okay";
+};
+
+&usbotg2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_usb2>;
+	dr_mode = "otg";
+	hnp-disable;
+	srp-disable;
+	adp-disable;
+	over-current-active-low;
+	status = "okay";
+};
+
+&usbphy2 {
+	fsl,tx-d-cal = <110>;
+	status = "okay";
+};
+
+&usbmisc2 {
+	status = "okay";
 };
 
 &usdhc0 {
@@ -224,6 +282,32 @@ MX8ULP_PAD_PTE13__LPI2C7_SDA	0x20
 		>;
 	};
 
+	pinctrl_typec1: typec1grp {
+		fsl,pins = <
+			MX8ULP_PAD_PTF3__PTF3           0x3
+		>;
+	};
+
+	pinctrl_typec2: typec2grp {
+		fsl,pins = <
+			MX8ULP_PAD_PTF5__PTF5           0x3
+		>;
+	};
+
+	pinctrl_usb1: usb1grp {
+		fsl,pins = <
+			MX8ULP_PAD_PTF2__USB0_ID	0x10003
+			MX8ULP_PAD_PTF4__USB0_OC	0x10003
+		>;
+	};
+
+	pinctrl_usb2: usb2grp {
+		fsl,pins = <
+			MX8ULP_PAD_PTD23__USB1_ID	0x10003
+			MX8ULP_PAD_PTF6__USB1_OC	0x10003
+		>;
+	};
+
 	pinctrl_usdhc0: usdhc0grp {
 		fsl,pins = <
 			MX8ULP_PAD_PTD1__SDHC0_CMD	0x3
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v6 4/9] dt-bindings: usb: add NXP ChipIdea USB2 Controller schema
  2024-02-21 14:58 [PATCH v6 1/9] dt-bindings: usb: usbmisc-imx: add fsl,imx8ulp-usbmisc compatible Xu Yang
                   ` (2 preceding siblings ...)
  2024-02-21 14:58 ` [PATCH v6 3/9] arm64: dts: imx8ulp-evk: enable usb nodes and add ptn5150 nodes Xu Yang
@ 2024-02-21 14:58 ` Xu Yang
  2024-02-23 14:02   ` Rob Herring
  2024-02-21 14:58 ` [PATCH v6 5/9] dt-bindings: usb: ci-hdrc-usb2-imx: add restrictions for reg, interrupts, clock and clock-names properties Xu Yang
                   ` (4 subsequent siblings)
  8 siblings, 1 reply; 16+ messages in thread
From: Xu Yang @ 2024-02-21 14:58 UTC (permalink / raw)
  To: gregkh, robh+dt, krzysztof.kozlowski+dt, shawnguo, conor+dt
  Cc: s.hauer, kernel, festevam, linux-imx, peter.chen, xu.yang_2,
	jun.li, linux-usb, devicetree, linux-arm-kernel, linux-kernel

As more and more NXP i.MX chips come out, it becomes harder to maintain
ci-hdrc-usb2.yaml if more stuffs like property restrictions are added to
this file. This will separate i.MX parts out of ci-hdrc-usb2.yaml and add
a new schema for NXP ChipIdea USB2 Controller.

Signed-off-by: Xu Yang <xu.yang_2@nxp.com>

---
Changes in v6:
 - new patch
---
 .../bindings/usb/ci-hdrc-usb2-imx.yaml        | 75 +++++++++++++++++++
 1 file changed, 75 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/ci-hdrc-usb2-imx.yaml

diff --git a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2-imx.yaml b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2-imx.yaml
new file mode 100644
index 000000000000..2ec62f564bf5
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2-imx.yaml
@@ -0,0 +1,75 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/usb/ci-hdrc-usb2-imx.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP USB2 ChipIdea USB controller
+
+maintainers:
+  - Xu Yang <xu.yang_2@nxp.com>
+
+properties:
+  compatible:
+    oneOf:
+      - enum:
+          - fsl,imx27-usb
+      - items:
+          - enum:
+              - fsl,imx23-usb
+              - fsl,imx25-usb
+              - fsl,imx28-usb
+              - fsl,imx35-usb
+              - fsl,imx50-usb
+              - fsl,imx51-usb
+              - fsl,imx53-usb
+              - fsl,imx6q-usb
+              - fsl,imx6sl-usb
+              - fsl,imx6sx-usb
+              - fsl,imx6ul-usb
+              - fsl,imx7d-usb
+              - fsl,vf610-usb
+          - const: fsl,imx27-usb
+      - items:
+          - enum:
+              - fsl,imx8dxl-usb
+              - fsl,imx8ulp-usb
+          - const: fsl,imx7ulp-usb
+          - const: fsl,imx6ul-usb
+      - items:
+          - enum:
+              - fsl,imx8mm-usb
+              - fsl,imx8mn-usb
+          - const: fsl,imx7d-usb
+          - const: fsl,imx27-usb
+      - items:
+          - enum:
+              - fsl,imx6sll-usb
+              - fsl,imx7ulp-usb
+          - const: fsl,imx6ul-usb
+          - const: fsl,imx27-usb
+
+allOf:
+  - $ref: ci-hdrc-usb2.yaml#
+
+required:
+  - compatible
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/clock/imx7d-clock.h>
+
+    usb@30b10000 {
+        compatible = "fsl,imx7d-usb", "fsl,imx27-usb";
+        reg = <0x30b10000 0x200>;
+        interrupts = <GIC_SPI 43 IRQ_TYPE_LEVEL_HIGH>;
+        clocks = <&clks IMX7D_USB_CTRL_CLK>;
+        fsl,usbphy = <&usbphynop1>;
+        fsl,usbmisc = <&usbmisc1 0>;
+        phy-clkgate-delay-us = <400>;
+    };
+
+...
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v6 5/9] dt-bindings: usb: ci-hdrc-usb2-imx: add restrictions for reg, interrupts, clock and clock-names properties
  2024-02-21 14:58 [PATCH v6 1/9] dt-bindings: usb: usbmisc-imx: add fsl,imx8ulp-usbmisc compatible Xu Yang
                   ` (3 preceding siblings ...)
  2024-02-21 14:58 ` [PATCH v6 4/9] dt-bindings: usb: add NXP ChipIdea USB2 Controller schema Xu Yang
@ 2024-02-21 14:58 ` Xu Yang
  2024-02-21 14:58 ` [PATCH v6 6/9] dt-bindings: usb: ci-hdrc-usb2-imx: add compatible and clock-names restriction for imx93 Xu Yang
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 16+ messages in thread
From: Xu Yang @ 2024-02-21 14:58 UTC (permalink / raw)
  To: gregkh, robh+dt, krzysztof.kozlowski+dt, shawnguo, conor+dt
  Cc: s.hauer, kernel, festevam, linux-imx, peter.chen, xu.yang_2,
	jun.li, linux-usb, devicetree, linux-arm-kernel, linux-kernel

Add restrictions for reg, interrupts, clock and clock-names properties
for imx Socs.

Signed-off-by: Xu Yang <xu.yang_2@nxp.com>

---
Changes in v4:
 - new patch since v3's discussion
 - split the reg, interrupts, clock and clock-names properties into
   common part and device-specific
Changes in v5:
 - keep common property unchanged
 - make if-then more readable
 - remove non imx part
Changes in v6:
 - new patch based on ci-hdrc-usb2-imx.yaml
---
 .../bindings/usb/ci-hdrc-usb2-imx.yaml        | 52 +++++++++++++++++++
 1 file changed, 52 insertions(+)

diff --git a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2-imx.yaml b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2-imx.yaml
index 2ec62f564bf5..20bb048938ff 100644
--- a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2-imx.yaml
+++ b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2-imx.yaml
@@ -49,11 +49,63 @@ properties:
           - const: fsl,imx6ul-usb
           - const: fsl,imx27-usb
 
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
 allOf:
   - $ref: ci-hdrc-usb2.yaml#
 
+  # imx27 Soc needs three clocks
+  - if:
+      properties:
+        compatible:
+          const: fsl,imx27-usb
+    then:
+      properties:
+        clocks:
+          minItems: 3
+          maxItems: 3
+        clock-names:
+          items:
+            - const: ipg
+            - const: ahb
+            - const: per
+    else:
+      # imx25 and imx35 Soc need three clocks
+      if:
+        properties:
+          compatible:
+            contains:
+              enum:
+                - fsl,imx25-usb
+                - fsl,imx35-usb
+      then:
+        properties:
+          clocks:
+            minItems: 3
+            maxItems: 3
+          clock-names:
+            items:
+              - const: ipg
+              - const: ahb
+              - const: per
+      else:
+        # other imx Socs only need one clock
+        properties:
+          clocks:
+            minItems: 1
+            maxItems: 1
+          clock-names:
+            minItems: 1
+            maxItems: 1
+
 required:
   - compatible
+  - reg
+  - interrupts
 
 unevaluatedProperties: false
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v6 6/9] dt-bindings: usb: ci-hdrc-usb2-imx: add compatible and clock-names restriction for imx93
  2024-02-21 14:58 [PATCH v6 1/9] dt-bindings: usb: usbmisc-imx: add fsl,imx8ulp-usbmisc compatible Xu Yang
                   ` (4 preceding siblings ...)
  2024-02-21 14:58 ` [PATCH v6 5/9] dt-bindings: usb: ci-hdrc-usb2-imx: add restrictions for reg, interrupts, clock and clock-names properties Xu Yang
@ 2024-02-21 14:58 ` Xu Yang
  2024-02-21 14:58 ` [PATCH v6 7/9] arm64: dts: imx93: add usb nodes Xu Yang
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 16+ messages in thread
From: Xu Yang @ 2024-02-21 14:58 UTC (permalink / raw)
  To: gregkh, robh+dt, krzysztof.kozlowski+dt, shawnguo, conor+dt
  Cc: s.hauer, kernel, festevam, linux-imx, peter.chen, xu.yang_2,
	jun.li, linux-usb, devicetree, linux-arm-kernel, linux-kernel

The i.MX93 needs a wakup clock to work properly. This will add compatible
and restriction for i.MX93 platform.

Signed-off-by: Xu Yang <xu.yang_2@nxp.com>

---
Changes in v2:
 - no changes
Changes in v3:
 - add clocks restriction
Changes in v4:
 - use 'contains' rather 'items'
Changes in v5:
 - rename clock name
Changes in v6:
 - new patch based on ci-hdrc-usb2-imx.yaml
---
 .../bindings/usb/ci-hdrc-usb2-imx.yaml        | 34 ++++++++++++++-----
 .../devicetree/bindings/usb/ci-hdrc-usb2.yaml |  1 +
 2 files changed, 27 insertions(+), 8 deletions(-)

diff --git a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2-imx.yaml b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2-imx.yaml
index 20bb048938ff..d509cfbcf0d5 100644
--- a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2-imx.yaml
+++ b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2-imx.yaml
@@ -40,6 +40,7 @@ properties:
           - enum:
               - fsl,imx8mm-usb
               - fsl,imx8mn-usb
+              - fsl,imx93-usb
           - const: fsl,imx7d-usb
           - const: fsl,imx27-usb
       - items:
@@ -93,14 +94,31 @@ allOf:
               - const: ahb
               - const: per
       else:
-        # other imx Socs only need one clock
-        properties:
-          clocks:
-            minItems: 1
-            maxItems: 1
-          clock-names:
-            minItems: 1
-            maxItems: 1
+        # imx93 Soc needs two clocks
+        if:
+          properties:
+            compatible:
+              contains:
+                enum:
+                  - fsl,imx93-usb
+        then:
+          properties:
+            clocks:
+              minItems: 2
+              maxItems: 2
+            clock-names:
+              items:
+                - const: usb_ctrl_root
+                - const: usb_wakeup
+        else:
+          # other imx Socs only need one clock
+          properties:
+            clocks:
+              minItems: 1
+              maxItems: 1
+            clock-names:
+              minItems: 1
+              maxItems: 1
 
 required:
   - compatible
diff --git a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.yaml b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.yaml
index 3b56e0edb1c6..ff826414bcb2 100644
--- a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.yaml
+++ b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.yaml
@@ -57,6 +57,7 @@ properties:
           - enum:
               - fsl,imx8mm-usb
               - fsl,imx8mn-usb
+              - fsl,imx93-usb
           - const: fsl,imx7d-usb
           - const: fsl,imx27-usb
       - items:
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v6 7/9] arm64: dts: imx93: add usb nodes
  2024-02-21 14:58 [PATCH v6 1/9] dt-bindings: usb: usbmisc-imx: add fsl,imx8ulp-usbmisc compatible Xu Yang
                   ` (5 preceding siblings ...)
  2024-02-21 14:58 ` [PATCH v6 6/9] dt-bindings: usb: ci-hdrc-usb2-imx: add compatible and clock-names restriction for imx93 Xu Yang
@ 2024-02-21 14:58 ` Xu Yang
  2024-02-21 14:58 ` [PATCH v6 8/9] arm64: dts: imx93-11x11-evk: enable usb and typec nodes Xu Yang
  2024-02-21 14:58 ` [PATCH v6 9/9] usb: chipidea: ci_hdrc_imx: align usb wakeup clock name with dt-bindings Xu Yang
  8 siblings, 0 replies; 16+ messages in thread
From: Xu Yang @ 2024-02-21 14:58 UTC (permalink / raw)
  To: gregkh, robh+dt, krzysztof.kozlowski+dt, shawnguo, conor+dt
  Cc: s.hauer, kernel, festevam, linux-imx, peter.chen, xu.yang_2,
	jun.li, linux-usb, devicetree, linux-arm-kernel, linux-kernel

There are 2 USB controllers on i.MX93. Add them.

Acked-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> # TQMa9352LA/CA
Signed-off-by: Xu Yang <xu.yang_2@nxp.com>

---
Changes in v2:
 - fix format as suggested by Alexander
 - change compatible from fsl,imx8mm-usb to fsl,imx93-usb
Changes in v3:
 - replace deprecated fsl,usbphy with phys as suggested by Alexander
 - reorder nodes
Changes in v4:
 - fix the alignment
Changes in v5:
 - rename usb_wakeup_clk to usb_wakeup
Changes in v6:
 - rename usb_ctrl_root_clk to usb_ctrl_root
---
 arch/arm64/boot/dts/freescale/imx93.dtsi | 58 ++++++++++++++++++++++++
 1 file changed, 58 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/imx93.dtsi b/arch/arm64/boot/dts/freescale/imx93.dtsi
index 8f2e7c42ad6e..4a7efccb4f67 100644
--- a/arch/arm64/boot/dts/freescale/imx93.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx93.dtsi
@@ -183,6 +183,20 @@ mqs2: mqs2 {
 		status = "disabled";
 	};
 
+	usbphynop1: usbphynop1 {
+		compatible = "usb-nop-xceiv";
+		#phy-cells = <0>;
+		clocks = <&clk IMX93_CLK_USB_PHY_BURUNIN>;
+		clock-names = "main_clk";
+	};
+
+	usbphynop2: usbphynop2 {
+		compatible = "usb-nop-xceiv";
+		#phy-cells = <0>;
+		clocks = <&clk IMX93_CLK_USB_PHY_BURUNIN>;
+		clock-names = "main_clk";
+	};
+
 	soc@0 {
 		compatible = "simple-bus";
 		#address-cells = <1>;
@@ -1167,6 +1181,50 @@ media_blk_ctrl: system-controller@4ac10000 {
 			status = "disabled";
 		};
 
+		usbotg1: usb@4c100000 {
+			compatible = "fsl,imx93-usb", "fsl,imx7d-usb", "fsl,imx27-usb";
+			reg = <0x4c100000 0x200>;
+			interrupts = <GIC_SPI 187 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&clk IMX93_CLK_USB_CONTROLLER_GATE>,
+				 <&clk IMX93_CLK_HSIO_32K_GATE>;
+			clock-names = "usb_ctrl_root", "usb_wakeup";
+			assigned-clocks = <&clk IMX93_CLK_HSIO>;
+			assigned-clock-parents = <&clk IMX93_CLK_SYS_PLL_PFD1_DIV2>;
+			assigned-clock-rates = <133000000>;
+			phys = <&usbphynop1>;
+			fsl,usbmisc = <&usbmisc1 0>;
+			status = "disabled";
+		};
+
+		usbmisc1: usbmisc@4c100200 {
+			compatible = "fsl,imx8mm-usbmisc", "fsl,imx7d-usbmisc",
+				     "fsl,imx6q-usbmisc";
+			reg = <0x4c100200 0x200>;
+			#index-cells = <1>;
+		};
+
+		usbotg2: usb@4c200000 {
+			compatible = "fsl,imx93-usb", "fsl,imx7d-usb", "fsl,imx27-usb";
+			reg = <0x4c200000 0x200>;
+			interrupts = <GIC_SPI 188 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&clk IMX93_CLK_USB_CONTROLLER_GATE>,
+				 <&clk IMX93_CLK_HSIO_32K_GATE>;
+			clock-names = "usb_ctrl_root", "usb_wakeup";
+			assigned-clocks = <&clk IMX93_CLK_HSIO>;
+			assigned-clock-parents = <&clk IMX93_CLK_SYS_PLL_PFD1_DIV2>;
+			assigned-clock-rates = <133000000>;
+			phys = <&usbphynop2>;
+			fsl,usbmisc = <&usbmisc2 0>;
+			status = "disabled";
+		};
+
+		usbmisc2: usbmisc@4c200200 {
+			compatible = "fsl,imx8mm-usbmisc", "fsl,imx7d-usbmisc",
+				     "fsl,imx6q-usbmisc";
+			reg = <0x4c200200 0x200>;
+			#index-cells = <1>;
+		};
+
 		ddr-pmu@4e300dc0 {
 			compatible = "fsl,imx93-ddr-pmu";
 			reg = <0x4e300dc0 0x200>;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v6 8/9] arm64: dts: imx93-11x11-evk: enable usb and typec nodes
  2024-02-21 14:58 [PATCH v6 1/9] dt-bindings: usb: usbmisc-imx: add fsl,imx8ulp-usbmisc compatible Xu Yang
                   ` (6 preceding siblings ...)
  2024-02-21 14:58 ` [PATCH v6 7/9] arm64: dts: imx93: add usb nodes Xu Yang
@ 2024-02-21 14:58 ` Xu Yang
  2024-02-21 14:58 ` [PATCH v6 9/9] usb: chipidea: ci_hdrc_imx: align usb wakeup clock name with dt-bindings Xu Yang
  8 siblings, 0 replies; 16+ messages in thread
From: Xu Yang @ 2024-02-21 14:58 UTC (permalink / raw)
  To: gregkh, robh+dt, krzysztof.kozlowski+dt, shawnguo, conor+dt
  Cc: s.hauer, kernel, festevam, linux-imx, peter.chen, xu.yang_2,
	jun.li, linux-usb, devicetree, linux-arm-kernel, linux-kernel

There are 2 Type-C ports and 2 USB controllers on i.MX93. Enable them.

Signed-off-by: Xu Yang <xu.yang_2@nxp.com>

---
Changes in v2:
 - remove status property in ptn5110 nodes
 - fix dt-schema warnings
Changes in v3:
 - no changes
Changes in v4:
 - no changes
Changes in v5:
 - no changes
Changes in v6:
 - no changes
---
 .../boot/dts/freescale/imx93-11x11-evk.dts    | 118 ++++++++++++++++++
 1 file changed, 118 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/imx93-11x11-evk.dts b/arch/arm64/boot/dts/freescale/imx93-11x11-evk.dts
index 9921ea13ab48..ec4cb50445fc 100644
--- a/arch/arm64/boot/dts/freescale/imx93-11x11-evk.dts
+++ b/arch/arm64/boot/dts/freescale/imx93-11x11-evk.dts
@@ -5,6 +5,7 @@
 
 /dts-v1/;
 
+#include <dt-bindings/usb/pd.h>
 #include "imx93.dtsi"
 
 / {
@@ -104,6 +105,80 @@ &mu2 {
 	status = "okay";
 };
 
+&lpi2c3 {
+	#address-cells = <1>;
+	#size-cells = <0>;
+	clock-frequency = <400000>;
+	pinctrl-names = "default", "sleep";
+	pinctrl-0 = <&pinctrl_lpi2c3>;
+	pinctrl-1 = <&pinctrl_lpi2c3>;
+	status = "okay";
+
+	ptn5110: tcpc@50 {
+		compatible = "nxp,ptn5110";
+		reg = <0x50>;
+		interrupt-parent = <&gpio3>;
+		interrupts = <27 IRQ_TYPE_LEVEL_LOW>;
+
+		typec1_con: connector {
+			compatible = "usb-c-connector";
+			label = "USB-C";
+			power-role = "dual";
+			data-role = "dual";
+			try-power-role = "sink";
+			source-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)>;
+			sink-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)
+				     PDO_VAR(5000, 20000, 3000)>;
+			op-sink-microwatt = <15000000>;
+			self-powered;
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				port@0 {
+					reg = <0>;
+					typec1_dr_sw: endpoint {
+						remote-endpoint = <&usb1_drd_sw>;
+					};
+				};
+			};
+		};
+	};
+
+	ptn5110_2: tcpc@51 {
+		compatible = "nxp,ptn5110";
+		reg = <0x51>;
+		interrupt-parent = <&gpio3>;
+		interrupts = <27 IRQ_TYPE_LEVEL_LOW>;
+
+		typec2_con: connector {
+			compatible = "usb-c-connector";
+			label = "USB-C";
+			power-role = "dual";
+			data-role = "dual";
+			try-power-role = "sink";
+			source-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)>;
+			sink-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)
+				     PDO_VAR(5000, 20000, 3000)>;
+			op-sink-microwatt = <15000000>;
+			self-powered;
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				port@0 {
+					reg = <0>;
+					typec2_dr_sw: endpoint {
+						remote-endpoint = <&usb2_drd_sw>;
+					};
+				};
+			};
+		};
+	};
+};
+
 &eqos {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_eqos>;
@@ -156,6 +231,42 @@ &lpuart5 {
 	status = "okay";
 };
 
+&usbotg1 {
+	dr_mode = "otg";
+	hnp-disable;
+	srp-disable;
+	adp-disable;
+	usb-role-switch;
+	disable-over-current;
+	samsung,picophy-pre-emp-curr-control = <3>;
+	samsung,picophy-dc-vol-level-adjust = <7>;
+	status = "okay";
+
+	port {
+		usb1_drd_sw: endpoint {
+			remote-endpoint = <&typec1_dr_sw>;
+		};
+	};
+};
+
+&usbotg2 {
+	dr_mode = "otg";
+	hnp-disable;
+	srp-disable;
+	adp-disable;
+	usb-role-switch;
+	disable-over-current;
+	samsung,picophy-pre-emp-curr-control = <3>;
+	samsung,picophy-dc-vol-level-adjust = <7>;
+	status = "okay";
+
+	port {
+		usb2_drd_sw: endpoint {
+			remote-endpoint = <&typec2_dr_sw>;
+		};
+	};
+};
+
 &usdhc1 {
 	pinctrl-names = "default", "state_100mhz", "state_200mhz";
 	pinctrl-0 = <&pinctrl_usdhc1>;
@@ -222,6 +333,13 @@ MX93_PAD_ENET2_TX_CTL__ENET1_RGMII_TX_CTL	0x57e
 		>;
 	};
 
+	pinctrl_lpi2c3: lpi2c3grp {
+		fsl,pins = <
+			MX93_PAD_GPIO_IO28__LPI2C3_SDA			0x40000b9e
+			MX93_PAD_GPIO_IO29__LPI2C3_SCL			0x40000b9e
+		>;
+	};
+
 	pinctrl_uart1: uart1grp {
 		fsl,pins = <
 			MX93_PAD_UART1_RXD__LPUART1_RX			0x31e
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v6 9/9] usb: chipidea: ci_hdrc_imx: align usb wakeup clock name with dt-bindings
  2024-02-21 14:58 [PATCH v6 1/9] dt-bindings: usb: usbmisc-imx: add fsl,imx8ulp-usbmisc compatible Xu Yang
                   ` (7 preceding siblings ...)
  2024-02-21 14:58 ` [PATCH v6 8/9] arm64: dts: imx93-11x11-evk: enable usb and typec nodes Xu Yang
@ 2024-02-21 14:58 ` Xu Yang
  8 siblings, 0 replies; 16+ messages in thread
From: Xu Yang @ 2024-02-21 14:58 UTC (permalink / raw)
  To: gregkh, robh+dt, krzysztof.kozlowski+dt, shawnguo, conor+dt
  Cc: s.hauer, kernel, festevam, linux-imx, peter.chen, xu.yang_2,
	jun.li, linux-usb, devicetree, linux-arm-kernel, linux-kernel

The dt-bindings is going to use "usb_wakeup" as wakup clock name. This will
align the change with dt-bindings.

Acked-by: Peter Chen <peter.chen@kernel.org>
Signed-off-by: Xu Yang <xu.yang_2@nxp.com>

---
Changes in v5:
 - new patch
Changes in v6:
 - add Acked-by tag
---
 drivers/usb/chipidea/ci_hdrc_imx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c
index ae9a6a17ec6e..a17b6d619305 100644
--- a/drivers/usb/chipidea/ci_hdrc_imx.c
+++ b/drivers/usb/chipidea/ci_hdrc_imx.c
@@ -212,7 +212,7 @@ static int imx_get_clks(struct device *dev)
 		/* Get wakeup clock. Not all of the platforms need to
 		 * handle this clock. So make it optional.
 		 */
-		data->clk_wakeup = devm_clk_get_optional(dev, "usb_wakeup_clk");
+		data->clk_wakeup = devm_clk_get_optional(dev, "usb_wakeup");
 		if (IS_ERR(data->clk_wakeup))
 			ret = dev_err_probe(dev, PTR_ERR(data->clk_wakeup),
 					"Failed to get wakeup clk\n");
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH v6 4/9] dt-bindings: usb: add NXP ChipIdea USB2 Controller schema
  2024-02-21 14:58 ` [PATCH v6 4/9] dt-bindings: usb: add NXP ChipIdea USB2 Controller schema Xu Yang
@ 2024-02-23 14:02   ` Rob Herring
  2024-02-23 14:56     ` [EXT] " Xu Yang
  0 siblings, 1 reply; 16+ messages in thread
From: Rob Herring @ 2024-02-23 14:02 UTC (permalink / raw)
  To: Xu Yang
  Cc: gregkh, krzysztof.kozlowski+dt, shawnguo, conor+dt, s.hauer,
	kernel, festevam, linux-imx, peter.chen, jun.li, linux-usb,
	devicetree, linux-arm-kernel, linux-kernel

On Wed, Feb 21, 2024 at 10:58:41PM +0800, Xu Yang wrote:
> As more and more NXP i.MX chips come out, it becomes harder to maintain
> ci-hdrc-usb2.yaml if more stuffs like property restrictions are added to
> this file. This will separate i.MX parts out of ci-hdrc-usb2.yaml and add
> a new schema for NXP ChipIdea USB2 Controller.
> 
> Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
> 
> ---
> Changes in v6:
>  - new patch
> ---
>  .../bindings/usb/ci-hdrc-usb2-imx.yaml        | 75 +++++++++++++++++++
>  1 file changed, 75 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/usb/ci-hdrc-usb2-imx.yaml
> 
> diff --git a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2-imx.yaml b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2-imx.yaml
> new file mode 100644
> index 000000000000..2ec62f564bf5
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2-imx.yaml
> @@ -0,0 +1,75 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/usb/ci-hdrc-usb2-imx.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: NXP USB2 ChipIdea USB controller
> +
> +maintainers:
> +  - Xu Yang <xu.yang_2@nxp.com>
> +
> +properties:
> +  compatible:
> +    oneOf:
> +      - enum:
> +          - fsl,imx27-usb
> +      - items:
> +          - enum:
> +              - fsl,imx23-usb
> +              - fsl,imx25-usb
> +              - fsl,imx28-usb
> +              - fsl,imx35-usb
> +              - fsl,imx50-usb
> +              - fsl,imx51-usb
> +              - fsl,imx53-usb
> +              - fsl,imx6q-usb
> +              - fsl,imx6sl-usb
> +              - fsl,imx6sx-usb
> +              - fsl,imx6ul-usb
> +              - fsl,imx7d-usb
> +              - fsl,vf610-usb
> +          - const: fsl,imx27-usb
> +      - items:
> +          - enum:
> +              - fsl,imx8dxl-usb
> +              - fsl,imx8ulp-usb
> +          - const: fsl,imx7ulp-usb
> +          - const: fsl,imx6ul-usb
> +      - items:
> +          - enum:
> +              - fsl,imx8mm-usb
> +              - fsl,imx8mn-usb
> +          - const: fsl,imx7d-usb
> +          - const: fsl,imx27-usb
> +      - items:
> +          - enum:
> +              - fsl,imx6sll-usb
> +              - fsl,imx7ulp-usb
> +          - const: fsl,imx6ul-usb
> +          - const: fsl,imx27-usb

Now you just duplicated all the compatibles, and now any new compatibles 
have to be added in 2 places. For this to work, you have to split 
ci-hdrc-usb2.yaml into 2 files. One with all the common properties and 
one with compatibles (minus imx). This is also needed if imx has any 
extra properties the other don't.

Didn't I say this already?

Rob


^ permalink raw reply	[flat|nested] 16+ messages in thread

* RE: [EXT] Re: [PATCH v6 4/9] dt-bindings: usb: add NXP ChipIdea USB2 Controller schema
  2024-02-23 14:02   ` Rob Herring
@ 2024-02-23 14:56     ` Xu Yang
  2024-02-23 17:53       ` Rob Herring
  2024-02-24 12:02       ` Krzysztof Kozlowski
  0 siblings, 2 replies; 16+ messages in thread
From: Xu Yang @ 2024-02-23 14:56 UTC (permalink / raw)
  To: Rob Herring
  Cc: gregkh, krzysztof.kozlowski+dt, shawnguo, conor+dt, s.hauer,
	kernel, festevam, dl-linux-imx, peter.chen, Jun Li, linux-usb,
	devicetree, linux-arm-kernel, linux-kernel

Hi Rob,

>
> On Wed, Feb 21, 2024 at 10:58:41PM +0800, Xu Yang wrote:
> > As more and more NXP i.MX chips come out, it becomes harder to maintain
> > ci-hdrc-usb2.yaml if more stuffs like property restrictions are added to
> > this file. This will separate i.MX parts out of ci-hdrc-usb2.yaml and add
> > a new schema for NXP ChipIdea USB2 Controller.
> >
> > Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
> >
> > ---
> > Changes in v6:
> >  - new patch
> > ---
> >  .../bindings/usb/ci-hdrc-usb2-imx.yaml        | 75 +++++++++++++++++++
> >  1 file changed, 75 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/usb/ci-hdrc-usb2-imx.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2-imx.yaml b/Documentation/devicetree/bindings/usb/ci-
> hdrc-usb2-imx.yaml
> > new file mode 100644
> > index 000000000000..2ec62f564bf5
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2-imx.yaml
> > @@ -0,0 +1,75 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/usb/ci-hdrc-
> usb2-
> imx.yaml%23&data=05%7C02%7Cxu.yang_2%40nxp.com%7C4ac0c60cd4b4433f0f9f08dc34782572%7C686ea1d3bc2b4c6fa92c
> d99c5c301635%7C0%7C0%7C638442937830606824%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIi
> LCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=7p1DzvYmBsTgN44jypH7lc56z9hVBsFBYXUwsblk9z8%3D&reserv
> ed=0
> > +$schema: http://devicetree.org/meta-
> schemas%2Fcore.yaml%23&data=05%7C02%7Cxu.yang_2%40nxp.com%7C4ac0c60cd4b4433f0f9f08dc34782572%7C686ea1d3
> bc2b4c6fa92cd99c5c301635%7C0%7C0%7C638442937830615622%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLC
> JQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=fWWy9enbGK5yeKiovday7go3Gss5L%2F%2Fe%2F
> OZcANny0QA%3D&reserved=0
> > +
> > +title: NXP USB2 ChipIdea USB controller
> > +
> > +maintainers:
> > +  - Xu Yang <xu.yang_2@nxp.com>
> > +
> > +properties:
> > +  compatible:
> > +    oneOf:
> > +      - enum:
> > +          - fsl,imx27-usb
> > +      - items:
> > +          - enum:
> > +              - fsl,imx23-usb
> > +              - fsl,imx25-usb
> > +              - fsl,imx28-usb
> > +              - fsl,imx35-usb
> > +              - fsl,imx50-usb
> > +              - fsl,imx51-usb
> > +              - fsl,imx53-usb
> > +              - fsl,imx6q-usb
> > +              - fsl,imx6sl-usb
> > +              - fsl,imx6sx-usb
> > +              - fsl,imx6ul-usb
> > +              - fsl,imx7d-usb
> > +              - fsl,vf610-usb
> > +          - const: fsl,imx27-usb
> > +      - items:
> > +          - enum:
> > +              - fsl,imx8dxl-usb
> > +              - fsl,imx8ulp-usb
> > +          - const: fsl,imx7ulp-usb
> > +          - const: fsl,imx6ul-usb
> > +      - items:
> > +          - enum:
> > +              - fsl,imx8mm-usb
> > +              - fsl,imx8mn-usb
> > +          - const: fsl,imx7d-usb
> > +          - const: fsl,imx27-usb
> > +      - items:
> > +          - enum:
> > +              - fsl,imx6sll-usb
> > +              - fsl,imx7ulp-usb
> > +          - const: fsl,imx6ul-usb
> > +          - const: fsl,imx27-usb
>
> Now you just duplicated all the compatibles, and now any new compatibles
> have to be added in 2 places. For this to work, you have to split
> ci-hdrc-usb2.yaml into 2 files. One with all the common properties and
> one with compatibles (minus imx). This is also needed if imx has any
> extra properties the other don't.
>
> Didn't I say this already?
>

Yes, I know.

But according to your words, I need to split ci-hdrc-usb2.yaml into 1 common
file and more than 1 vendor specific files (imx, nvidia, qcom, nuvoton and
others). In this patchset, I only focus on imx part and KK said he or someone
will take over other parts, therefore I just duplicated all the imx compatibles.
If I only create imx specific yaml file and remove all compatilbles from common
file, nvidia, qcom, nuvoton and others compatible info will be lost, is this
feasible? Or should I create mutiple vendor specific files at the same time?

Thanks,
Xu Yang

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [EXT] Re: [PATCH v6 4/9] dt-bindings: usb: add NXP ChipIdea USB2 Controller schema
  2024-02-23 14:56     ` [EXT] " Xu Yang
@ 2024-02-23 17:53       ` Rob Herring
  2024-02-24 12:02       ` Krzysztof Kozlowski
  1 sibling, 0 replies; 16+ messages in thread
From: Rob Herring @ 2024-02-23 17:53 UTC (permalink / raw)
  To: Xu Yang
  Cc: gregkh, krzysztof.kozlowski+dt, shawnguo, conor+dt, s.hauer,
	kernel, festevam, dl-linux-imx, peter.chen, Jun Li, linux-usb,
	devicetree, linux-arm-kernel, linux-kernel

On Fri, Feb 23, 2024 at 7:56 AM Xu Yang <xu.yang_2@nxp.com> wrote:
>
> Hi Rob,
>
> >
> > On Wed, Feb 21, 2024 at 10:58:41PM +0800, Xu Yang wrote:
> > > As more and more NXP i.MX chips come out, it becomes harder to maintain
> > > ci-hdrc-usb2.yaml if more stuffs like property restrictions are added to
> > > this file. This will separate i.MX parts out of ci-hdrc-usb2.yaml and add
> > > a new schema for NXP ChipIdea USB2 Controller.
> > >
> > > Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
> > >
> > > ---
> > > Changes in v6:
> > >  - new patch
> > > ---
> > >  .../bindings/usb/ci-hdrc-usb2-imx.yaml        | 75 +++++++++++++++++++
> > >  1 file changed, 75 insertions(+)
> > >  create mode 100644 Documentation/devicetree/bindings/usb/ci-hdrc-usb2-imx.yaml
> > >
> > > diff --git a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2-imx.yaml b/Documentation/devicetree/bindings/usb/ci-
> > hdrc-usb2-imx.yaml
> > > new file mode 100644
> > > index 000000000000..2ec62f564bf5
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2-imx.yaml
> > > @@ -0,0 +1,75 @@
> > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > > +%YAML 1.2
> > > +---
> > > +$id: http://devicetree.org/schemas/usb/ci-hdrc-
> > usb2-
> > imx.yaml%23&data=05%7C02%7Cxu.yang_2%40nxp.com%7C4ac0c60cd4b4433f0f9f08dc34782572%7C686ea1d3bc2b4c6fa92c
> > d99c5c301635%7C0%7C0%7C638442937830606824%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIi
> > LCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=7p1DzvYmBsTgN44jypH7lc56z9hVBsFBYXUwsblk9z8%3D&reserv
> > ed=0
> > > +$schema: http://devicetree.org/meta-
> > schemas%2Fcore.yaml%23&data=05%7C02%7Cxu.yang_2%40nxp.com%7C4ac0c60cd4b4433f0f9f08dc34782572%7C686ea1d3
> > bc2b4c6fa92cd99c5c301635%7C0%7C0%7C638442937830615622%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLC
> > JQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=fWWy9enbGK5yeKiovday7go3Gss5L%2F%2Fe%2F
> > OZcANny0QA%3D&reserved=0
> > > +
> > > +title: NXP USB2 ChipIdea USB controller
> > > +
> > > +maintainers:
> > > +  - Xu Yang <xu.yang_2@nxp.com>
> > > +
> > > +properties:
> > > +  compatible:
> > > +    oneOf:
> > > +      - enum:
> > > +          - fsl,imx27-usb
> > > +      - items:
> > > +          - enum:
> > > +              - fsl,imx23-usb
> > > +              - fsl,imx25-usb
> > > +              - fsl,imx28-usb
> > > +              - fsl,imx35-usb
> > > +              - fsl,imx50-usb
> > > +              - fsl,imx51-usb
> > > +              - fsl,imx53-usb
> > > +              - fsl,imx6q-usb
> > > +              - fsl,imx6sl-usb
> > > +              - fsl,imx6sx-usb
> > > +              - fsl,imx6ul-usb
> > > +              - fsl,imx7d-usb
> > > +              - fsl,vf610-usb
> > > +          - const: fsl,imx27-usb
> > > +      - items:
> > > +          - enum:
> > > +              - fsl,imx8dxl-usb
> > > +              - fsl,imx8ulp-usb
> > > +          - const: fsl,imx7ulp-usb
> > > +          - const: fsl,imx6ul-usb
> > > +      - items:
> > > +          - enum:
> > > +              - fsl,imx8mm-usb
> > > +              - fsl,imx8mn-usb
> > > +          - const: fsl,imx7d-usb
> > > +          - const: fsl,imx27-usb
> > > +      - items:
> > > +          - enum:
> > > +              - fsl,imx6sll-usb
> > > +              - fsl,imx7ulp-usb
> > > +          - const: fsl,imx6ul-usb
> > > +          - const: fsl,imx27-usb
> >
> > Now you just duplicated all the compatibles, and now any new compatibles
> > have to be added in 2 places. For this to work, you have to split
> > ci-hdrc-usb2.yaml into 2 files. One with all the common properties and
> > one with compatibles (minus imx). This is also needed if imx has any
> > extra properties the other don't.
> >
> > Didn't I say this already?
> >
>
> Yes, I know.
>
> But according to your words, I need to split ci-hdrc-usb2.yaml into 1 common
> file and more than 1 vendor specific files (imx, nvidia, qcom, nuvoton and
> others). In this patchset, I only focus on imx part and KK said he or someone
> will take over other parts, therefore I just duplicated all the imx compatibles.

This series is just wasting our time because it can't be applied without that.

> If I only create imx specific yaml file and remove all compatilbles from common
> file, nvidia, qcom, nuvoton and others compatible info will be lost, is this
> feasible? Or should I create mutiple vendor specific files at the same time?

You don't have to split each vendor to a separate vendor schema file.
Just move everything common to ci-hdrc-usb2-common.yaml and add a
reference to it. Then imx can reference the common file.

Rob

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [EXT] Re: [PATCH v6 4/9] dt-bindings: usb: add NXP ChipIdea USB2 Controller schema
  2024-02-23 14:56     ` [EXT] " Xu Yang
  2024-02-23 17:53       ` Rob Herring
@ 2024-02-24 12:02       ` Krzysztof Kozlowski
  2024-02-26  3:30         ` Xu Yang
  1 sibling, 1 reply; 16+ messages in thread
From: Krzysztof Kozlowski @ 2024-02-24 12:02 UTC (permalink / raw)
  To: Xu Yang, Rob Herring
  Cc: gregkh, krzysztof.kozlowski+dt, shawnguo, conor+dt, s.hauer,
	kernel, festevam, dl-linux-imx, peter.chen, Jun Li, linux-usb,
	devicetree, linux-arm-kernel, linux-kernel

On 23/02/2024 15:56, Xu Yang wrote:
> Hi Rob,
> 
>>
>> On Wed, Feb 21, 2024 at 10:58:41PM +0800, Xu Yang wrote:
>>> As more and more NXP i.MX chips come out, it becomes harder to maintain
>>> ci-hdrc-usb2.yaml if more stuffs like property restrictions are added to
>>> this file. This will separate i.MX parts out of ci-hdrc-usb2.yaml and add
>>> a new schema for NXP ChipIdea USB2 Controller.
>>>
>>> Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
>>>
>>> ---
>>> Changes in v6:
>>>  - new patch
>>> ---
>>>  .../bindings/usb/ci-hdrc-usb2-imx.yaml        | 75 +++++++++++++++++++
>>>  1 file changed, 75 insertions(+)
>>>  create mode 100644 Documentation/devicetree/bindings/usb/ci-hdrc-usb2-imx.yaml
>>>
>>> diff --git a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2-imx.yaml b/Documentation/devicetree/bindings/usb/ci-
>> hdrc-usb2-imx.yaml
>>> new file mode 100644
>>> index 000000000000..2ec62f564bf5
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2-imx.yaml
>>> @@ -0,0 +1,75 @@
>>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>>> +%YAML 1.2
>>> +---
>>> +$id: http://devicetree.org/schemas/usb/ci-hdrc-
>> usb2-
>> imx.yaml%23&data=05%7C02%7Cxu.yang_2%40nxp.com%7C4ac0c60cd4b4433f0f9f08dc34782572%7C686ea1d3bc2b4c6fa92c
>> d99c5c301635%7C0%7C0%7C638442937830606824%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIi
>> LCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=7p1DzvYmBsTgN44jypH7lc56z9hVBsFBYXUwsblk9z8%3D&reserv
>> ed=0
>>> +$schema: http://devicetree.org/meta-
>> schemas%2Fcore.yaml%23&data=05%7C02%7Cxu.yang_2%40nxp.com%7C4ac0c60cd4b4433f0f9f08dc34782572%7C686ea1d3
>> bc2b4c6fa92cd99c5c301635%7C0%7C0%7C638442937830615622%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLC
>> JQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=fWWy9enbGK5yeKiovday7go3Gss5L%2F%2Fe%2F
>> OZcANny0QA%3D&reserved=0
>>> +
>>> +title: NXP USB2 ChipIdea USB controller
>>> +
>>> +maintainers:
>>> +  - Xu Yang <xu.yang_2@nxp.com>
>>> +
>>> +properties:
>>> +  compatible:
>>> +    oneOf:
>>> +      - enum:
>>> +          - fsl,imx27-usb
>>> +      - items:
>>> +          - enum:
>>> +              - fsl,imx23-usb
>>> +              - fsl,imx25-usb
>>> +              - fsl,imx28-usb
>>> +              - fsl,imx35-usb
>>> +              - fsl,imx50-usb
>>> +              - fsl,imx51-usb
>>> +              - fsl,imx53-usb
>>> +              - fsl,imx6q-usb
>>> +              - fsl,imx6sl-usb
>>> +              - fsl,imx6sx-usb
>>> +              - fsl,imx6ul-usb
>>> +              - fsl,imx7d-usb
>>> +              - fsl,vf610-usb
>>> +          - const: fsl,imx27-usb
>>> +      - items:
>>> +          - enum:
>>> +              - fsl,imx8dxl-usb
>>> +              - fsl,imx8ulp-usb
>>> +          - const: fsl,imx7ulp-usb
>>> +          - const: fsl,imx6ul-usb
>>> +      - items:
>>> +          - enum:
>>> +              - fsl,imx8mm-usb
>>> +              - fsl,imx8mn-usb
>>> +          - const: fsl,imx7d-usb
>>> +          - const: fsl,imx27-usb
>>> +      - items:
>>> +          - enum:
>>> +              - fsl,imx6sll-usb
>>> +              - fsl,imx7ulp-usb
>>> +          - const: fsl,imx6ul-usb
>>> +          - const: fsl,imx27-usb
>>
>> Now you just duplicated all the compatibles, and now any new compatibles
>> have to be added in 2 places. For this to work, you have to split
>> ci-hdrc-usb2.yaml into 2 files. One with all the common properties and
>> one with compatibles (minus imx). This is also needed if imx has any
>> extra properties the other don't.
>>
>> Didn't I say this already?
>>
> 
> Yes, I know.
> 
> But according to your words, I need to split ci-hdrc-usb2.yaml into 1 common
> file and more than 1 vendor specific files (imx, nvidia, qcom, nuvoton and
> others). In this patchset, I only focus on imx part and KK said he or someone
> will take over other parts, therefore I just duplicated all the imx compatibles.

Someone will take over their bits, but it does not mean you can
duplicate IMX. Why you cannot use the approach I asked - move IMX out of
that schema?

https://lore.kernel.org/all/a0134089-a283-488b-8d7f-3f59dd938b60@linaro.org/

Look:
"... and move IMX to own file."

Move is not "copy". Please run: `man mv`

> If I only create imx specific yaml file and remove all compatilbles from common

Why would you remove ALL of others? What is the point of this.

> file, nvidia, qcom, nuvoton and others compatible info will be lost, is this
> feasible? Or should I create mutiple vendor specific files at the same time?

You can take a look how it is done in my recent Qualcomm PCI dt-bindings
series.

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 16+ messages in thread

* RE: [EXT] Re: [PATCH v6 4/9] dt-bindings: usb: add NXP ChipIdea USB2 Controller schema
  2024-02-24 12:02       ` Krzysztof Kozlowski
@ 2024-02-26  3:30         ` Xu Yang
  0 siblings, 0 replies; 16+ messages in thread
From: Xu Yang @ 2024-02-26  3:30 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Rob Herring
  Cc: gregkh, krzysztof.kozlowski+dt, shawnguo, conor+dt, s.hauer,
	kernel, festevam, dl-linux-imx, peter.chen, Jun Li, linux-usb,
	devicetree, linux-arm-kernel, linux-kernel


> 
> On 23/02/2024 15:56, Xu Yang wrote:
> > Hi Rob,
> >
> >>
> >> On Wed, Feb 21, 2024 at 10:58:41PM +0800, Xu Yang wrote:
> >>> As more and more NXP i.MX chips come out, it becomes harder to maintain
> >>> ci-hdrc-usb2.yaml if more stuffs like property restrictions are added to
> >>> this file. This will separate i.MX parts out of ci-hdrc-usb2.yaml and add
> >>> a new schema for NXP ChipIdea USB2 Controller.
> >>>
> >>> Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
> >>>
> >>> ---
> >>> Changes in v6:
> >>>  - new patch
> >>> ---
> >>>  .../bindings/usb/ci-hdrc-usb2-imx.yaml        | 75 +++++++++++++++++++
> >>>  1 file changed, 75 insertions(+)
> >>>  create mode 100644 Documentation/devicetree/bindings/usb/ci-hdrc-usb2-imx.yaml
> >>>
> >>> diff --git a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2-imx.yaml
> b/Documentation/devicetree/bindings/usb/ci-
> >> hdrc-usb2-imx.yaml
> >>> new file mode 100644
> >>> index 000000000000..2ec62f564bf5
> >>> --- /dev/null
> >>> +++ b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2-imx.yaml
> >>> @@ -0,0 +1,75 @@
> >>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> >>> +%YAML 1.2

[...]

> 
> > If I only create imx specific yaml file and remove all compatilbles from common
> 
> Why would you remove ALL of others? What is the point of this.

I originally thought ci-hdrc-usb2.yaml should be removed and only
ci-hdrc-usb2-comm.yaml is kept. So I'm not sure where other compatibles
should go. I looked though your Qualcomm PCI dt-bindings series and now
I know how to do.

Thanks,
Xu Yang


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2024-02-26  3:30 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-21 14:58 [PATCH v6 1/9] dt-bindings: usb: usbmisc-imx: add fsl,imx8ulp-usbmisc compatible Xu Yang
2024-02-21  7:28 ` Krzysztof Kozlowski
2024-02-21  7:53   ` [EXT] " Xu Yang
2024-02-21 14:58 ` [PATCH v6 2/9] arm64: dts: imx8ulp: add usb nodes Xu Yang
2024-02-21 14:58 ` [PATCH v6 3/9] arm64: dts: imx8ulp-evk: enable usb nodes and add ptn5150 nodes Xu Yang
2024-02-21 14:58 ` [PATCH v6 4/9] dt-bindings: usb: add NXP ChipIdea USB2 Controller schema Xu Yang
2024-02-23 14:02   ` Rob Herring
2024-02-23 14:56     ` [EXT] " Xu Yang
2024-02-23 17:53       ` Rob Herring
2024-02-24 12:02       ` Krzysztof Kozlowski
2024-02-26  3:30         ` Xu Yang
2024-02-21 14:58 ` [PATCH v6 5/9] dt-bindings: usb: ci-hdrc-usb2-imx: add restrictions for reg, interrupts, clock and clock-names properties Xu Yang
2024-02-21 14:58 ` [PATCH v6 6/9] dt-bindings: usb: ci-hdrc-usb2-imx: add compatible and clock-names restriction for imx93 Xu Yang
2024-02-21 14:58 ` [PATCH v6 7/9] arm64: dts: imx93: add usb nodes Xu Yang
2024-02-21 14:58 ` [PATCH v6 8/9] arm64: dts: imx93-11x11-evk: enable usb and typec nodes Xu Yang
2024-02-21 14:58 ` [PATCH v6 9/9] usb: chipidea: ci_hdrc_imx: align usb wakeup clock name with dt-bindings Xu Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).