mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 00/11] arm64: dts: allwinner: Add Allwinner A733 USB 3.0 support
@ 2026-11-27  7:32 Alastair D'Silva
  2026-11-27  7:32 ` [PATCH 01/11] dt-bindings: phy: allwinner,sun60i-a733-u2phy: Add Allwinner A733 USB 2.0 PHY Alastair D'Silva
                   ` (11 more replies)
  0 siblings, 12 replies; 14+ messages in thread
From: Alastair D'Silva @ 2026-11-27  7:32 UTC (permalink / raw)
  To: Vinod Koul, Neil Armstrong, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
	Greg Kroah-Hartman, Stephen Boyd, Brian Masney, Jerome Brunet,
	Thinh Nguyen, Mathias Nyman
  Cc: linux-phy, devicetree, linux-arm-kernel, linux-sunxi, linux-usb,
	linux-clk, linux-kernel, Alastair D'Silva

This series adds USB 3.0 host support for the Allwinner A733 SoC and
enables it on the Xunlong OrangePi 4 Pro.

It adds the USB 2.0 UTMI PHY driver, USB 3.0 mode for ComboPHY0, USB2
CCU gates, DWC3 glue support, an xHCI W1C port change quirk, and DT
nodes.

Verified on the Xunlong OrangePi 4 Pro with a SuperSpeed (5000M) USB
3.0 flash drive.

Prerequisite series:
- arm64: dts: allwinner: Add Xunlong OrangePi 4 Pro support (v2):
  https://lore.kernel.org/r/20261127065343.1449675-1-alastair@d-silva.org
- Add Allwinner A733 (sun60i) PCIe and Combo PHY support:
  https://lore.kernel.org/r/20261125062948.1234677-1-alastair@d-silva.org
- Allwinner A733 PCK-600 power domain fix and DT node (included in
  prerequisite-patch-id below).

Alastair D'Silva (11):
  dt-bindings: phy: allwinner,sun60i-a733-u2phy: Add Allwinner A733 USB 2.0 PHY
  dt-bindings: phy: allwinner,sun60i-a733-combophy: Add combophy0 USB 3.0 support
  dt-bindings: clock: sun60i-a733: Add USB2 bus and sys clock IDs
  clk: sunxi-ng: sun60i-a733: Add USB2 bus and sys clocks
  dt-bindings: usb: allwinner,sun60i-a733-dwc3: Add Allwinner A733 DWC3
  phy: allwinner: Add Allwinner A733 USB 2.0 PHY driver
  phy: allwinner: sun60i-combophy: Add USB 3.0 PHY mode support
  usb: dwc3: Add Allwinner A733 DWC3 support
  usb: host: xhci: Add W1C port change quirk for Allwinner A733
  arm64: dts: allwinner: sun60i-a733: Add USB 3.0 controller and PHYs
  arm64: dts: allwinner: sun60i-a733-orangepi-4-pro: Enable USB 3.0

 .../phy/allwinner,sun60i-a733-combophy.yaml        |   5 +
 .../bindings/phy/allwinner,sun60i-a733-u2phy.yaml  |  58 +++
 .../bindings/usb/allwinner,sun60i-a733-dwc3.yaml   | 103 ++++
 .../dts/allwinner/sun60i-a733-orangepi-4-pro.dts   |  31 ++
 arch/arm64/boot/dts/allwinner/sun60i-a733.dtsi     |  61 +++
 drivers/clk/sunxi-ng/ccu-sun60i-a733.c             |  10 +-
 drivers/phy/allwinner/Kconfig                      |  17 +-
 drivers/phy/allwinner/Makefile                     |   1 +
 drivers/phy/allwinner/phy-sun60i-combophy.c        | 573 ++++++++++++++++++++-
 drivers/phy/allwinner/phy-sun60i-u2phy.c           | 233 +++++++++
 drivers/usb/dwc3/core.c                            |  18 +-
 drivers/usb/dwc3/core.h                            |   8 +
 drivers/usb/dwc3/dwc3-generic-plat.c               |  15 +-
 drivers/usb/dwc3/glue.h                            |   6 +
 drivers/usb/dwc3/host.c                            |  10 +
 drivers/usb/host/xhci-hub.c                        |  53 +-
 drivers/usb/host/xhci-plat.c                       |   3 +
 drivers/usb/host/xhci.h                            |   2 +
 .../dt-bindings/clock/allwinner,sun60i-a733-ccu.h  |   2 +
 19 files changed, 1177 insertions(+), 32 deletions(-)

base-commit: 9437046953b2fb3bf55b36582450ea0267df82a7
prerequisite-patch-id: 19691099774bd3dc41f56585c03ddefb7bdc6f9c
prerequisite-patch-id: 85db03df3394cdcb2780a0da122a74b2c1fe220d
prerequisite-patch-id: a3e883da50bf03e8f522444def66fec7f996ffbe
prerequisite-patch-id: c6889699a6dc13c336ce4cf4659e21b551e9a9fc
prerequisite-patch-id: ef2f0344452092edb2221b93c44a3e82cb896a2d
prerequisite-patch-id: c598480f753e36b7f6230129b864c559b9f185d5
prerequisite-patch-id: f86b468a896a40f132adfcba885700327dff1bc5
prerequisite-patch-id: 079d60101e1b9e5425458060314bde3e9cc2fe4c
prerequisite-patch-id: 090c5ff78d4e2150804aa8d294581cd338b1e971
prerequisite-patch-id: af0aebcae7c38d58354925119c412178b5821b5e
prerequisite-patch-id: beb8a098ba14724e316ff243bdf8e00e729243c1
prerequisite-patch-id: 63342c5ec38e8eb9e55c8c74d3c5a81a630d5f69
prerequisite-patch-id: 1dc8d70f80674c98b2b15d09556dd27f643b20da
prerequisite-patch-id: 4555860586ef50f27bf787a23f6ba693e9c3b0d6
prerequisite-patch-id: 0279f281cd59cf54bceee39b0fa4d0b6a7b87c48
prerequisite-patch-id: 14424bd8324b6cae2b8c4d6840df0db626d1385f
prerequisite-patch-id: 7b42728bc8271e5dfd57fffec47a7f5745eff357
prerequisite-patch-id: 74f5c7d066477024a374a789b3180e841398fb07
prerequisite-patch-id: 309a5a3ca5b216915907263dea7024263abf1d1c
prerequisite-patch-id: 55e543b9854c7ae2fa86969233d05ccadd3792e9
prerequisite-patch-id: cfcad85224e288ec2168e7f245b4a1c63e9a34a7
prerequisite-patch-id: 18dadb9c1e41141d015422b658b7dd0d153b7d69
prerequisite-patch-id: 47a863f533ee9ae1589e25618f27a7282a0f8d37
prerequisite-patch-id: 54181ce00a78f9f69031d3964f14bf800dd98e0f
prerequisite-patch-id: 5a6d6dac4f6b42edf911fbca2078508e977bdce9
prerequisite-patch-id: e919d9591e97e3b69fa86625a868583ee74d16db
-- 
2.47.3

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

* [PATCH 01/11] dt-bindings: phy: allwinner,sun60i-a733-u2phy: Add Allwinner A733 USB 2.0 PHY
  2026-11-27  7:32 [PATCH 00/11] arm64: dts: allwinner: Add Allwinner A733 USB 3.0 support Alastair D'Silva
@ 2026-11-27  7:32 ` Alastair D'Silva
  2026-11-27  7:32 ` [PATCH 02/11] dt-bindings: phy: allwinner,sun60i-a733-combophy: Add combophy0 USB 3.0 support Alastair D'Silva
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: Alastair D'Silva @ 2026-11-27  7:32 UTC (permalink / raw)
  To: Vinod Koul, Neil Armstrong, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
	Greg Kroah-Hartman, Stephen Boyd, Brian Masney, Jerome Brunet,
	Thinh Nguyen, Mathias Nyman
  Cc: linux-phy, devicetree, linux-arm-kernel, linux-sunxi, linux-usb,
	linux-clk, linux-kernel, Alastair D'Silva

Add DT binding schema for the Allwinner A733 USB 2.0 PHY.

Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
---
 .../phy/allwinner,sun60i-a733-u2phy.yaml      | 58 +++++++++++++++++++
 1 file changed, 58 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/phy/allwinner,sun60i-a733-u2phy.yaml

diff --git a/Documentation/devicetree/bindings/phy/allwinner,sun60i-a733-u2phy.yaml b/Documentation/devicetree/bindings/phy/allwinner,sun60i-a733-u2phy.yaml
new file mode 100644
index 000000000000..7291311d3c4d
--- /dev/null
+++ b/Documentation/devicetree/bindings/phy/allwinner,sun60i-a733-u2phy.yaml
@@ -0,0 +1,58 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/phy/allwinner,sun60i-a733-u2phy.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Allwinner A733 USB 2.0 PHY
+
+maintainers:
+  - Alastair D'Silva <alastair@d-silva.org>
+
+properties:
+  compatible:
+    const: allwinner,sun60i-a733-u2phy
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    items:
+      - description: OTG bus clock
+      - description: USB subsystem AHB clock
+
+  clock-names:
+    items:
+      - const: bus
+      - const: ahb
+
+  resets:
+    maxItems: 1
+
+  "#phy-cells":
+    const: 0
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - resets
+  - "#phy-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/allwinner,sun60i-a733-ccu.h>
+    #include <dt-bindings/reset/allwinner,sun60i-a733-ccu.h>
+
+    phy@6b00000 {
+        compatible = "allwinner,sun60i-a733-u2phy";
+        reg = <0x06b00000 0x800>;
+        clocks = <&ccu CLK_BUS_OTG>,
+                 <&ccu CLK_AHB_USB_SYS>;
+        clock-names = "bus", "ahb";
+        resets = <&ccu RST_BUS_OTG>;
+        #phy-cells = <0>;
+    };
-- 
2.53.0


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

* [PATCH 02/11] dt-bindings: phy: allwinner,sun60i-a733-combophy: Add combophy0 USB 3.0 support
  2026-11-27  7:32 [PATCH 00/11] arm64: dts: allwinner: Add Allwinner A733 USB 3.0 support Alastair D'Silva
  2026-11-27  7:32 ` [PATCH 01/11] dt-bindings: phy: allwinner,sun60i-a733-u2phy: Add Allwinner A733 USB 2.0 PHY Alastair D'Silva
@ 2026-11-27  7:32 ` Alastair D'Silva
  2026-11-27  7:32 ` [PATCH 03/11] dt-bindings: clock: sun60i-a733: Add USB2 bus and sys clock IDs Alastair D'Silva
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: Alastair D'Silva @ 2026-11-27  7:32 UTC (permalink / raw)
  To: Vinod Koul, Neil Armstrong, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
	Greg Kroah-Hartman, Stephen Boyd, Brian Masney, Jerome Brunet,
	Thinh Nguyen, Mathias Nyman
  Cc: linux-phy, devicetree, linux-arm-kernel, linux-sunxi, linux-usb,
	linux-clk, linux-kernel, Alastair D'Silva

Add the combophy0 compatible string and clarify #phy-cells usage.

Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
---
 .../bindings/phy/allwinner,sun60i-a733-combophy.yaml         | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/phy/allwinner,sun60i-a733-combophy.yaml b/Documentation/devicetree/bindings/phy/allwinner,sun60i-a733-combophy.yaml
index 5182884109f9..58e7a3348bd4 100644
--- a/Documentation/devicetree/bindings/phy/allwinner,sun60i-a733-combophy.yaml
+++ b/Documentation/devicetree/bindings/phy/allwinner,sun60i-a733-combophy.yaml
@@ -12,6 +12,7 @@ maintainers:
 properties:
   compatible:
     enum:
+      - allwinner,sun60i-a733-combophy0
       - allwinner,sun60i-a733-combophy1
 
   reg:
@@ -39,6 +40,9 @@ properties:
 
   "#phy-cells":
     const: 1
+    description: |
+      PHY type from <dt-bindings/phy/phy.h> (e.g. PHY_TYPE_USB3 for
+      combophy0, PHY_TYPE_PCIE for combophy1).
 
   allwinner,serdes-syscon:
     $ref: /schemas/types.yaml#/definitions/phandle
@@ -79,4 +83,5 @@ examples:
         power-domains = <&pck600 PD_PCIE>;
         #phy-cells = <1>;
         allwinner,serdes-syscon = <&serdes_syscon>;
+        phy-supply = <&reg_serdes1v8>;
     };
-- 
2.53.0


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

* [PATCH 03/11] dt-bindings: clock: sun60i-a733: Add USB2 bus and sys clock IDs
  2026-11-27  7:32 [PATCH 00/11] arm64: dts: allwinner: Add Allwinner A733 USB 3.0 support Alastair D'Silva
  2026-11-27  7:32 ` [PATCH 01/11] dt-bindings: phy: allwinner,sun60i-a733-u2phy: Add Allwinner A733 USB 2.0 PHY Alastair D'Silva
  2026-11-27  7:32 ` [PATCH 02/11] dt-bindings: phy: allwinner,sun60i-a733-combophy: Add combophy0 USB 3.0 support Alastair D'Silva
@ 2026-11-27  7:32 ` Alastair D'Silva
  2026-11-27  7:32 ` [PATCH 04/11] clk: sunxi-ng: sun60i-a733: Add USB2 bus and sys clocks Alastair D'Silva
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: Alastair D'Silva @ 2026-11-27  7:32 UTC (permalink / raw)
  To: Vinod Koul, Neil Armstrong, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
	Greg Kroah-Hartman, Stephen Boyd, Brian Masney, Jerome Brunet,
	Thinh Nguyen, Mathias Nyman
  Cc: linux-phy, devicetree, linux-arm-kernel, linux-sunxi, linux-usb,
	linux-clk, linux-kernel, Alastair D'Silva

Define CLK_BUS_USB2 and CLK_USB2_SYS for the A733 CCU.

Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
---
 include/dt-bindings/clock/allwinner,sun60i-a733-ccu.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/dt-bindings/clock/allwinner,sun60i-a733-ccu.h b/include/dt-bindings/clock/allwinner,sun60i-a733-ccu.h
index 81924cba58ec..1e751cfd75e3 100644
--- a/include/dt-bindings/clock/allwinner,sun60i-a733-ccu.h
+++ b/include/dt-bindings/clock/allwinner,sun60i-a733-ccu.h
@@ -287,5 +287,7 @@
 #define CLK_FANOUT1		274
 #define CLK_FANOUT2		275
 #define CLK_FANOUT3		276
+#define CLK_BUS_USB2		277
+#define CLK_USB2_SYS		278
 
 #endif /* _DT_BINDINGS_CLK_ALLWINNER_SUN60I_A733_CCU_H_ */
-- 
2.53.0


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

* [PATCH 04/11] clk: sunxi-ng: sun60i-a733: Add USB2 bus and sys clocks
  2026-11-27  7:32 [PATCH 00/11] arm64: dts: allwinner: Add Allwinner A733 USB 3.0 support Alastair D'Silva
                   ` (2 preceding siblings ...)
  2026-11-27  7:32 ` [PATCH 03/11] dt-bindings: clock: sun60i-a733: Add USB2 bus and sys clock IDs Alastair D'Silva
@ 2026-11-27  7:32 ` Alastair D'Silva
  2026-11-27  7:32 ` [PATCH 05/11] dt-bindings: usb: allwinner,sun60i-a733-dwc3: Add Allwinner A733 DWC3 Alastair D'Silva
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: Alastair D'Silva @ 2026-11-27  7:32 UTC (permalink / raw)
  To: Vinod Koul, Neil Armstrong, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
	Greg Kroah-Hartman, Stephen Boyd, Brian Masney, Jerome Brunet,
	Thinh Nguyen, Mathias Nyman
  Cc: linux-phy, devicetree, linux-arm-kernel, linux-sunxi, linux-usb,
	linux-clk, linux-kernel, Alastair D'Silva

Implement CLK_BUS_USB2 and CLK_USB2_SYS gate clocks for the A733 USB 3.0
controller.

Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
---
 drivers/clk/sunxi-ng/ccu-sun60i-a733.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/sunxi-ng/ccu-sun60i-a733.c b/drivers/clk/sunxi-ng/ccu-sun60i-a733.c
index 958a2a2bcf76..ef22e82a4e05 100644
--- a/drivers/clk/sunxi-ng/ccu-sun60i-a733.c
+++ b/drivers/clk/sunxi-ng/ccu-sun60i-a733.c
@@ -1317,6 +1317,8 @@ static SUNXI_CCU_M_DATA_WITH_MUX_GATE(usb2_mf_clk, "usb2-mf", usb2_mf_utmi_paren
 				      BIT(31),	/* gate */
 				      0);
 
+static SUNXI_CCU_GATE_HWS(bus_usb2_clk, "bus-usb2", ahb_hws, 0x135c, BIT(0), 0);
+
 static SUNXI_CCU_M_DATA_WITH_MUX_GATE(usb2_u3_utmi_clk, "usb2-u3-utmi", usb2_mf_utmi_parents,
 				      0x1360,
 				      0, 5,	/* M */
@@ -1569,6 +1571,8 @@ static SUNXI_CCU_M_HW_WITH_MUX_GATE(isp_clk, "isp", isp_parents, 0x1860,
 
 static SUNXI_CCU_GATE_DATA(res_dcap_24m_clk, "res-dcap-24m", hosc, 0x1a00, BIT(3), 0);
 
+static SUNXI_CCU_GATE_HWS(usb2_sys_clk, "usb2-sys", mbus_hws, 0x1b30, BIT(0), 0);
+
 static const struct clk_parent_data apb2jtag_parents[] = {
 	{ .hw = &sys_24M_clk.hw },
 	{ .fw_name = "losc" },
@@ -1855,6 +1859,8 @@ static struct ccu_common *sun60i_a733_ccu_clks[] = {
 	&usb2_mf_clk.common,
 	&usb2_u3_utmi_clk.common,
 	&usb2_u2_pipe_clk.common,
+	&bus_usb2_clk.common,
+	&usb2_sys_clk.common,
 	&pcie_aux_clk.common,
 	&pcie_axi_slv_clk.common,
 	&serdes_phy_clk.common,
@@ -2189,8 +2195,10 @@ static struct clk_hw_onecell_data sun60i_a733_hw_clks = {
 		[CLK_FANOUT1]		= &fanout1_clk.common.hw,
 		[CLK_FANOUT2]		= &fanout2_clk.common.hw,
 		[CLK_FANOUT3]		= &fanout3_clk.common.hw,
+		[CLK_BUS_USB2]		= &bus_usb2_clk.common.hw,
+		[CLK_USB2_SYS]		= &usb2_sys_clk.common.hw,
 	},
-	.num	= CLK_FANOUT3 + 1,
+	.num	= CLK_USB2_SYS + 1,
 };
 
 static const struct ccu_reset_map sun60i_a733_ccu_resets[] = {
-- 
2.53.0


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

* [PATCH 05/11] dt-bindings: usb: allwinner,sun60i-a733-dwc3: Add Allwinner A733 DWC3
  2026-11-27  7:32 [PATCH 00/11] arm64: dts: allwinner: Add Allwinner A733 USB 3.0 support Alastair D'Silva
                   ` (3 preceding siblings ...)
  2026-11-27  7:32 ` [PATCH 04/11] clk: sunxi-ng: sun60i-a733: Add USB2 bus and sys clocks Alastair D'Silva
@ 2026-11-27  7:32 ` Alastair D'Silva
  2026-11-27  7:32 ` [PATCH 06/11] phy: allwinner: Add Allwinner A733 USB 2.0 PHY driver Alastair D'Silva
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: Alastair D'Silva @ 2026-11-27  7:32 UTC (permalink / raw)
  To: Vinod Koul, Neil Armstrong, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
	Greg Kroah-Hartman, Stephen Boyd, Brian Masney, Jerome Brunet,
	Thinh Nguyen, Mathias Nyman
  Cc: linux-phy, devicetree, linux-arm-kernel, linux-sunxi, linux-usb,
	linux-clk, linux-kernel, Alastair D'Silva

Add DT binding schema for the Allwinner A733 DWC3 USB 3.0 controller.

Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
---
 .../usb/allwinner,sun60i-a733-dwc3.yaml       | 103 ++++++++++++++++++
 1 file changed, 103 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/allwinner,sun60i-a733-dwc3.yaml

diff --git a/Documentation/devicetree/bindings/usb/allwinner,sun60i-a733-dwc3.yaml b/Documentation/devicetree/bindings/usb/allwinner,sun60i-a733-dwc3.yaml
new file mode 100644
index 000000000000..012247ba0ac2
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/allwinner,sun60i-a733-dwc3.yaml
@@ -0,0 +1,103 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/usb/allwinner,sun60i-a733-dwc3.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Allwinner A733 SuperSpeed DWC3 USB Controller
+
+maintainers:
+  - Alastair D'Silva <alastair@d-silva.org>
+
+allOf:
+  - $ref: snps,dwc3-common.yaml#
+
+properties:
+  compatible:
+    const: allwinner,sun60i-a733-dwc3
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    items:
+      - description: USB2 bus clock
+      - description: USB2 main function reference clock
+      - description: USB2 suspend clock
+      - description: USB subsystem AHB clock
+      - description: USB3 UTMI clock
+      - description: USB2 PIPE clock
+      - description: USB2 system clock
+
+  clock-names:
+    items:
+      - const: bus_early
+      - const: ref
+      - const: suspend
+      - const: ahb
+      - const: utmi
+      - const: pipe
+      - const: sys
+
+  resets:
+    maxItems: 1
+
+  power-domains:
+    maxItems: 1
+
+  phys:
+    items:
+      - description: USB 2.0 PHY
+      - description: USB 3.0 ComboPHY
+
+  phy-names:
+    items:
+      - const: usb2-phy
+      - const: usb3-phy
+
+  vbus-supply:
+    description: Regulator supplying VBUS in host mode.
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - clock-names
+  - resets
+  - power-domains
+  - phys
+  - phy-names
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/allwinner,sun60i-a733-ccu.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/phy/phy.h>
+    #include <dt-bindings/power/allwinner,sun60i-a733-pck-600.h>
+    #include <dt-bindings/reset/allwinner,sun60i-a733-ccu.h>
+
+    usb@6a00000 {
+        compatible = "allwinner,sun60i-a733-dwc3";
+        reg = <0x06a00000 0x100000>;
+        interrupts = <GIC_SPI 155 IRQ_TYPE_LEVEL_HIGH 0>;
+        clocks = <&ccu CLK_BUS_USB2>,
+                 <&ccu CLK_USB2_MF>,
+                 <&ccu CLK_USB2_SUSPEND>,
+                 <&ccu CLK_AHB_USB_SYS>,
+                 <&ccu CLK_USB2_U3_UTMI>,
+                 <&ccu CLK_USB2_U2_PIPE>,
+                 <&ccu CLK_USB2_SYS>;
+        clock-names = "bus_early", "ref", "suspend",
+                      "ahb", "utmi", "pipe", "sys";
+        resets = <&ccu RST_BUS_USB2>;
+        power-domains = <&pck600 PD_USB2>;
+        phys = <&u2phy>, <&combophy0 PHY_TYPE_USB3>;
+        phy-names = "usb2-phy", "usb3-phy";
+        dr_mode = "host";
+    };
-- 
2.53.0


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

* [PATCH 06/11] phy: allwinner: Add Allwinner A733 USB 2.0 PHY driver
  2026-11-27  7:32 [PATCH 00/11] arm64: dts: allwinner: Add Allwinner A733 USB 3.0 support Alastair D'Silva
                   ` (4 preceding siblings ...)
  2026-11-27  7:32 ` [PATCH 05/11] dt-bindings: usb: allwinner,sun60i-a733-dwc3: Add Allwinner A733 DWC3 Alastair D'Silva
@ 2026-11-27  7:32 ` Alastair D'Silva
  2026-11-27  7:32 ` [PATCH 07/11] phy: allwinner: sun60i-combophy: Add USB 3.0 PHY mode support Alastair D'Silva
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: Alastair D'Silva @ 2026-11-27  7:32 UTC (permalink / raw)
  To: Vinod Koul, Neil Armstrong, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
	Greg Kroah-Hartman, Stephen Boyd, Brian Masney, Jerome Brunet,
	Thinh Nguyen, Mathias Nyman
  Cc: linux-phy, devicetree, linux-arm-kernel, linux-sunxi, linux-usb,
	linux-clk, linux-kernel, Alastair D'Silva

Add USB 2.0 PHY driver for the Allwinner A733 DWC3 controller.

Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
---
 drivers/phy/allwinner/Kconfig            |  12 ++
 drivers/phy/allwinner/Makefile           |   1 +
 drivers/phy/allwinner/phy-sun60i-u2phy.c | 233 +++++++++++++++++++++++
 3 files changed, 246 insertions(+)
 create mode 100644 drivers/phy/allwinner/phy-sun60i-u2phy.c

diff --git a/drivers/phy/allwinner/Kconfig b/drivers/phy/allwinner/Kconfig
index 7518c4b5c379..f8dc4931378b 100644
--- a/drivers/phy/allwinner/Kconfig
+++ b/drivers/phy/allwinner/Kconfig
@@ -68,3 +68,15 @@ config PHY_SUN60I_COMBOPHY
 	help
 	  Enable this to support the SerDes ComboPHY controller on
 	  Allwinner A733 SoCs.
+
+config PHY_SUN60I_U2PHY
+	tristate "Allwinner A733 USB 2.0 PHY driver"
+	depends on ARCH_SUNXI || COMPILE_TEST
+	depends on HAS_IOMEM && COMMON_CLK && OF
+	depends on RESET_CONTROLLER
+	select GENERIC_PHY
+	help
+	  Enable this to support the USB 2.0 PHY paired with the DWC3
+	  controller on Allwinner A733 SoCs. This driver handles UTMI
+	  PHY initialization, tuning, and host/device mode switching.
+	  If unsure, say N.
diff --git a/drivers/phy/allwinner/Makefile b/drivers/phy/allwinner/Makefile
index 483e9053bb5f..22793d59c4cd 100644
--- a/drivers/phy/allwinner/Makefile
+++ b/drivers/phy/allwinner/Makefile
@@ -4,3 +4,4 @@ obj-$(CONFIG_PHY_SUN6I_MIPI_DPHY)	+= phy-sun6i-mipi-dphy.o
 obj-$(CONFIG_PHY_SUN9I_USB)		+= phy-sun9i-usb.o
 obj-$(CONFIG_PHY_SUN50I_USB3)		+= phy-sun50i-usb3.o
 obj-$(CONFIG_PHY_SUN60I_COMBOPHY)	+= phy-sun60i-combophy.o
+obj-$(CONFIG_PHY_SUN60I_U2PHY)		+= phy-sun60i-u2phy.o
diff --git a/drivers/phy/allwinner/phy-sun60i-u2phy.c b/drivers/phy/allwinner/phy-sun60i-u2phy.c
new file mode 100644
index 000000000000..7788fe55ee56
--- /dev/null
+++ b/drivers/phy/allwinner/phy-sun60i-u2phy.c
@@ -0,0 +1,233 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Allwinner A733 USB 2.0 PHY driver
+ *
+ * Copyright (C) 2026 Alastair D'Silva <alastair@d-silva.org>
+ */
+
+#include <linux/bits.h>
+#include <linux/cleanup.h>
+#include <linux/clk.h>
+#include <linux/io.h>
+#include <linux/mod_devicetable.h>
+#include <linux/module.h>
+#include <linux/mutex.h>
+#include <linux/phy/phy.h>
+#include <linux/platform_device.h>
+#include <linux/reset.h>
+
+#define PHY_USB2_ISCR			0x00
+#define   FORCE_ID_MASK			GENMASK(15, 14)
+#define   FORCE_ID_HOST			BIT(15)
+#define   FORCE_ID_DEVICE		GENMASK(15, 14)
+#define   FORCE_VBUS_VALID_MASK		GENMASK(13, 12)
+#define   FORCE_VBUS_VALID_HIGH		GENMASK(13, 12)
+
+#define PHY_USB2_PHYCTL			0x10
+#define   OTGDISABLE			BIT(10)
+#define   VBUSVLDEXT			BIT(5)
+#define   SIDDQ				BIT(3)
+
+#define PHY_USB2_PHYTUNE		0x18
+/* Vendor BSP default USB2 PHY tuning value for A733. */
+#define   PHYTUNE_A733_DEFAULT		0x143338d6
+
+struct sun60i_u2phy {
+	void __iomem *base;
+	struct clk_bulk_data *clks;
+	int num_clks;
+	struct reset_control *reset;
+	struct mutex lock; /* protects mode and initialized state */
+	enum phy_mode mode;
+	bool initialized;
+};
+
+static const char * const sun60i_u2phy_clks[] = {
+	"bus",
+	"ahb",
+};
+
+static void sun60i_u2phy_apply_mode(struct sun60i_u2phy *u2phy)
+{
+	u32 val;
+
+	val = readl(u2phy->base + PHY_USB2_ISCR);
+	val &= ~(FORCE_ID_MASK | FORCE_VBUS_VALID_MASK);
+
+	switch (u2phy->mode) {
+	case PHY_MODE_USB_HOST:
+		val |= FORCE_ID_HOST | FORCE_VBUS_VALID_HIGH;
+		break;
+	case PHY_MODE_USB_DEVICE:
+		val |= FORCE_ID_DEVICE | FORCE_VBUS_VALID_HIGH;
+		break;
+	case PHY_MODE_USB_OTG:
+	default:
+		break;
+	}
+
+	writel(val, u2phy->base + PHY_USB2_ISCR);
+}
+
+static int sun60i_u2phy_init(struct phy *phy)
+{
+	struct sun60i_u2phy *u2phy = phy_get_drvdata(phy);
+	u32 val;
+	int ret;
+
+	guard(mutex)(&u2phy->lock);
+
+	ret = reset_control_deassert(u2phy->reset);
+	if (ret)
+		return ret;
+
+	ret = clk_bulk_prepare_enable(u2phy->num_clks, u2phy->clks);
+	if (ret) {
+		reset_control_assert(u2phy->reset);
+		return ret;
+	}
+
+	sun60i_u2phy_apply_mode(u2phy);
+
+	val = readl(u2phy->base + PHY_USB2_PHYCTL);
+	val |= OTGDISABLE | VBUSVLDEXT;
+	val &= ~SIDDQ;
+	writel(val, u2phy->base + PHY_USB2_PHYCTL);
+
+	writel(PHYTUNE_A733_DEFAULT, u2phy->base + PHY_USB2_PHYTUNE);
+	u2phy->initialized = true;
+
+	return 0;
+}
+
+static int sun60i_u2phy_exit(struct phy *phy)
+{
+	struct sun60i_u2phy *u2phy = phy_get_drvdata(phy);
+	u32 val;
+
+	guard(mutex)(&u2phy->lock);
+
+	u2phy->initialized = false;
+
+	val = readl(u2phy->base + PHY_USB2_PHYCTL);
+	val &= ~(OTGDISABLE | VBUSVLDEXT);
+	val |= SIDDQ;
+	writel(val, u2phy->base + PHY_USB2_PHYCTL);
+
+	val = readl(u2phy->base + PHY_USB2_ISCR);
+	val &= ~(FORCE_ID_MASK | FORCE_VBUS_VALID_MASK);
+	writel(val, u2phy->base + PHY_USB2_ISCR);
+
+	clk_bulk_disable_unprepare(u2phy->num_clks, u2phy->clks);
+	return reset_control_assert(u2phy->reset);
+}
+
+static int sun60i_u2phy_set_mode(struct phy *phy, enum phy_mode mode,
+				 int submode)
+{
+	struct sun60i_u2phy *u2phy = phy_get_drvdata(phy);
+
+	guard(mutex)(&u2phy->lock);
+
+	switch (mode) {
+	case PHY_MODE_USB_HOST:
+	case PHY_MODE_USB_HOST_LS:
+	case PHY_MODE_USB_HOST_FS:
+	case PHY_MODE_USB_HOST_HS:
+	case PHY_MODE_USB_HOST_SS:
+		u2phy->mode = PHY_MODE_USB_HOST;
+		break;
+	case PHY_MODE_USB_DEVICE:
+	case PHY_MODE_USB_DEVICE_LS:
+	case PHY_MODE_USB_DEVICE_FS:
+	case PHY_MODE_USB_DEVICE_HS:
+	case PHY_MODE_USB_DEVICE_SS:
+		u2phy->mode = PHY_MODE_USB_DEVICE;
+		break;
+	case PHY_MODE_USB_OTG:
+		u2phy->mode = PHY_MODE_USB_OTG;
+		break;
+	default:
+		return -EINVAL;
+	}
+
+	if (u2phy->initialized)
+		sun60i_u2phy_apply_mode(u2phy);
+
+	return 0;
+}
+
+static const struct phy_ops sun60i_u2phy_ops = {
+	.init = sun60i_u2phy_init,
+	.exit = sun60i_u2phy_exit,
+	.set_mode = sun60i_u2phy_set_mode,
+	.owner = THIS_MODULE,
+};
+
+static int sun60i_u2phy_probe(struct platform_device *pdev)
+{
+	struct device *dev = &pdev->dev;
+	struct sun60i_u2phy *u2phy;
+	struct phy_provider *phy_provider;
+	struct phy *phy;
+	int i, ret;
+
+	u2phy = devm_kzalloc(dev, sizeof(*u2phy), GFP_KERNEL);
+	if (!u2phy)
+		return -ENOMEM;
+
+	ret = devm_mutex_init(dev, &u2phy->lock);
+	if (ret)
+		return ret;
+	u2phy->mode = PHY_MODE_USB_HOST;
+	u2phy->base = devm_platform_ioremap_resource(pdev, 0);
+	if (IS_ERR(u2phy->base))
+		return PTR_ERR(u2phy->base);
+
+	u2phy->num_clks = ARRAY_SIZE(sun60i_u2phy_clks);
+	u2phy->clks = devm_kcalloc(dev, u2phy->num_clks, sizeof(*u2phy->clks),
+				   GFP_KERNEL);
+	if (!u2phy->clks)
+		return -ENOMEM;
+
+	for (i = 0; i < u2phy->num_clks; i++)
+		u2phy->clks[i].id = sun60i_u2phy_clks[i];
+
+	ret = devm_clk_bulk_get(dev, u2phy->num_clks, u2phy->clks);
+	if (ret)
+		return dev_err_probe(dev, ret, "failed to get clocks\n");
+
+	u2phy->reset = devm_reset_control_get_shared(dev, NULL);
+	if (IS_ERR(u2phy->reset))
+		return dev_err_probe(dev, PTR_ERR(u2phy->reset),
+				     "failed to get reset\n");
+
+	phy = devm_phy_create(dev, NULL, &sun60i_u2phy_ops);
+	if (IS_ERR(phy))
+		return dev_err_probe(dev, PTR_ERR(phy),
+				     "failed to create PHY\n");
+
+	phy_set_drvdata(phy, u2phy);
+
+	phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);
+	return PTR_ERR_OR_ZERO(phy_provider);
+}
+
+static const struct of_device_id sun60i_u2phy_of_match[] = {
+	{ .compatible = "allwinner,sun60i-a733-u2phy" },
+	{ /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, sun60i_u2phy_of_match);
+
+static struct platform_driver sun60i_u2phy_driver = {
+	.probe = sun60i_u2phy_probe,
+	.driver = {
+		.name = "sun60i-u2phy",
+		.of_match_table = sun60i_u2phy_of_match,
+	},
+};
+module_platform_driver(sun60i_u2phy_driver);
+
+MODULE_DESCRIPTION("Allwinner A733 USB 2.0 PHY driver");
+MODULE_AUTHOR("Alastair D'Silva <alastair@d-silva.org>");
+MODULE_LICENSE("GPL");
-- 
2.53.0


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

* [PATCH 07/11] phy: allwinner: sun60i-combophy: Add USB 3.0 PHY mode support
  2026-11-27  7:32 [PATCH 00/11] arm64: dts: allwinner: Add Allwinner A733 USB 3.0 support Alastair D'Silva
                   ` (5 preceding siblings ...)
  2026-11-27  7:32 ` [PATCH 06/11] phy: allwinner: Add Allwinner A733 USB 2.0 PHY driver Alastair D'Silva
@ 2026-11-27  7:32 ` Alastair D'Silva
  2026-11-27  7:32 ` [PATCH 08/11] usb: dwc3: Add Allwinner A733 DWC3 support Alastair D'Silva
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: Alastair D'Silva @ 2026-11-27  7:32 UTC (permalink / raw)
  To: Vinod Koul, Neil Armstrong, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
	Greg Kroah-Hartman, Stephen Boyd, Brian Masney, Jerome Brunet,
	Thinh Nguyen, Mathias Nyman
  Cc: linux-phy, devicetree, linux-arm-kernel, linux-sunxi, linux-usb,
	linux-clk, linux-kernel, Alastair D'Silva

Add combophy0 USB 3.0 initialization, calibrate callback, and shared
syscon read-modify-write updates.

Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
---
 drivers/phy/allwinner/Kconfig               |   5 +-
 drivers/phy/allwinner/phy-sun60i-combophy.c | 573 +++++++++++++++++++-
 2 files changed, 553 insertions(+), 25 deletions(-)

diff --git a/drivers/phy/allwinner/Kconfig b/drivers/phy/allwinner/Kconfig
index f8dc4931378b..e3e8f7260ede 100644
--- a/drivers/phy/allwinner/Kconfig
+++ b/drivers/phy/allwinner/Kconfig
@@ -61,13 +61,14 @@ config PHY_SUN50I_USB3
 config PHY_SUN60I_COMBOPHY
 	tristate "Allwinner A733 SerDes ComboPHY driver"
 	depends on ARCH_SUNXI || COMPILE_TEST
-	depends on HAS_IOMEM && OF
+	depends on HAS_IOMEM && COMMON_CLK && OF
 	depends on RESET_CONTROLLER
 	select GENERIC_PHY
 	select MFD_SYSCON
 	help
 	  Enable this to support the SerDes ComboPHY controller on
-	  Allwinner A733 SoCs.
+	  Allwinner A733 SoCs. This driver configures the shared SerDes
+	  subsystem and lane routing for USB 3.0 and PCIe PHYs.
 
 config PHY_SUN60I_U2PHY
 	tristate "Allwinner A733 USB 2.0 PHY driver"
diff --git a/drivers/phy/allwinner/phy-sun60i-combophy.c b/drivers/phy/allwinner/phy-sun60i-combophy.c
index ed7a0d432ae2..4f9779171df0 100644
--- a/drivers/phy/allwinner/phy-sun60i-combophy.c
+++ b/drivers/phy/allwinner/phy-sun60i-combophy.c
@@ -7,15 +7,16 @@
 
 #include <dt-bindings/phy/phy.h>
 #include <linux/bitfield.h>
+#include <linux/bits.h>
 #include <linux/clk.h>
 #include <linux/delay.h>
 #include <linux/io.h>
 #include <linux/mfd/syscon.h>
 #include <linux/module.h>
-#include <linux/of.h>
 #include <linux/phy/phy.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
+#include <linux/property.h>
 #include <linux/regmap.h>
 #include <linux/regulator/consumer.h>
 #include <linux/reset.h>
@@ -24,28 +25,74 @@
 #define SERDES_PCIE_BGR				0x0004
 #define   SERDES_PCIE_GATING			GENMASK(18, 16)
 #define   SERDES_PCIE_RST			GENMASK(3, 0)
+#define SERDES_USB3P1_BGR			0x0008
+#define   USB3P1_ONLY_UTMI_CLK_SEL		BIT(21)
+#define   USB3P1_ONLY_PIPE_CLK_SEL		BIT(20)
+#define   USB3P1_ACLK_EN			BIT(17)
+#define   USB3P1_HCLK_EN			BIT(16)
+#define   USB3P1_USB2P0_PHY_RSTN		BIT(4)
+#define   USB3P1_BGR_RST_MASK			(BIT(5) | BIT(1) | BIT(0))
 #define SERDES_DBG_CTL				0x00f0
+#define   SERDES_DISABLE_COMBO0_AUTOGATING	BIT(28)
 #define   SERDES_DISABLE_COMBO1_AUTOGATING	BIT(29)
 
+#define SERDES_COMB0_TOP			0x1000
+#define SERDES_COMB0_LINK_CTRL0			(SERDES_COMB0_TOP + 0x0000)
+#define   PHY0_TYPEC_CONN_DIR			BIT(12)
+#define   PHY0_DP_LINK_RESET_N_SOFT		BIT(8)
+#define   PHY0_PIPE_LINK_RESET_N_SOFT		BIT(4)
+#define   PHY0_RESET_N				BIT(0)
+#define SERDES_COMB0_LINK_CTRL1			(SERDES_COMB0_TOP + 0x0004)
+#define   PHY0_PMA_CMN_PLL1_REFCLK_SEL		BIT(24)
+#define   PHY0_PMA_CMN_PLL0_REFCLK_SEL		BIT(20)
+#define   PHY0_PMA_CMN_REFCLK_DIG_SEL		BIT(0)
+#define SERDES_COMB0_LINK_CTRL2			(SERDES_COMB0_TOP + 0x0008)
+#define   PHY0_IDDQ_EN_SEL			BIT(1)
+#define   PHY0_IDDQ_EN_SOFT			BIT(0)
+#define SERDES_COMB0_LINK_CTRL3			(SERDES_COMB0_TOP + 0x000c)
+#define   PHY0_PMA_XCVR_POWER_STATE_REQ_MASK	GENMASK(9, 4)
+#define   PHY0_PMA_XCVR_POWER_STATE_REQ_LN(n)	\
+	FIELD_PREP(PHY0_PMA_XCVR_POWER_STATE_REQ_MASK, (n))
+#define   PHY0_PMA_XCVR_PLLCLK_EN_LN		BIT(0)
+#define SERDES_COMB0_LINK_STUS0			(SERDES_COMB0_TOP + 0x0900)
+#define   PHY0_PMA_CMN_READY			BIT(0)
+
 #define SERDES_COMB1_TOP			0x2000
 #define SERDES_COMB1_LINK_CTRL0			(SERDES_COMB1_TOP + 0x0000)
-#define   PHY1_LINK_CFG_LN(n)			(((n) & 0x3) << 4)
+#define   PHY1_LINK_CFG_LN_MASK			GENMASK(5, 4)
+#define   PHY1_LINK_CFG_LN(n)			FIELD_PREP(PHY1_LINK_CFG_LN_MASK, (n))
 #define   PHY1_RESET_N				BIT(0)
 #define SERDES_COMB1_LINK_CTRL1			(SERDES_COMB1_TOP + 0x0004)
 #define   PHY1_EN_REFCLK			BIT(28)
 #define SERDES_COMB1_LANE0_CTRL0		(SERDES_COMB1_TOP + 0x0100)
-#define   PHY1_L00_MODE(n)			(((n) & 0x3) << 4)
+#define   PHY1_L00_MODE_MASK			GENMASK(5, 4)
+#define   PHY1_L00_MODE(n)			FIELD_PREP(PHY1_L00_MODE_MASK, (n))
 #define   PHY1_L00_RESET_N_SW			BIT(0)
 #define SERDES_COMB1_LINK_STUS0			(SERDES_COMB1_TOP + 0x0900)
 #define   PHY1_PMA_CMN_READY			BIT(0)
 
 #define SERDES_TOP_COMBO			0x6000
+#define SERDES_TOP_ISOLATION_CTRL		(SERDES_TOP_COMBO + 0x0004)
+#define   SERDES_TOP_ISO_USB3_MASK		0x0ff1
+#define SERDES_USB3P1_PIPE_CLK_MAP_CTRL		(SERDES_TOP_COMBO + 0x0100)
+#define SERDES_USB3P1_PIPE_RXD_MAP_CTRL		(SERDES_TOP_COMBO + 0x0104)
+#define   USB3P1_PIPE_MAP_MASK			GENMASK(3, 0)
+#define SERDES_TOP_PIPE_MAP			(SERDES_TOP_COMBO + 0x0c24)
+#define   SERDES_TOP_PIPE_MAP_MASK		GENMASK(15, 0)
+#define SERDES_TOP_COMBO0_SEL			(SERDES_TOP_COMBO + 0x0c40)
+#define   SERDES_TOP_COMBO0_SEL_MASK		GENMASK(3, 0)
 #define SERDES_COMB1_PIPE			(SERDES_TOP_COMBO + 0x0c44)
+#define   SERDES_COMB1_PIPE_MASK		GENMASK(3, 0)
 #define   SERDES_COMB1_PIPE_PCIE		0x1
 
+#define COMB0_PMA_CMN_CTRL			0xc008
+#define   COMB0_PMA_CMN_CTRL_RST_MASK		GENMASK(11, 8)
+
 struct sun60i_combophy;
 
 struct sun60i_combophy_cfg {
+	u32 supported_type;
+	unsigned long serdes_rate;
 	int (*init)(struct sun60i_combophy *cphy);
 	int (*exit)(struct sun60i_combophy *cphy);
 };
@@ -59,15 +106,409 @@ struct sun60i_combophy {
 	struct reset_control *reset;
 	struct regulator *supply;
 	struct phy *phy;
-	u32 type;
 	const struct sun60i_combophy_cfg *cfg;
 };
 
+enum sun60i_combophy_clk_id {
+	SUN60I_COMBOPHY_CLK_SERDES,
+	SUN60I_COMBOPHY_CLK_AHB,
+	SUN60I_COMBOPHY_CLK_MBUS,
+	SUN60I_COMBOPHY_CLK_REF,
+};
+
 static const char * const sun60i_combophy_clks[] = {
-	"serdes",
-	"ahb",
-	"mbus",
-	"ref",
+	[SUN60I_COMBOPHY_CLK_SERDES] = "serdes",
+	[SUN60I_COMBOPHY_CLK_AHB] = "ahb",
+	[SUN60I_COMBOPHY_CLK_MBUS] = "mbus",
+	[SUN60I_COMBOPHY_CLK_REF] = "ref",
+};
+
+struct sun60i_combophy_reg {
+	u16 offset;
+	u16 val;
+};
+
+/*
+ * Vendor BSP Cadence Torrent USB3 PHY tuning sequence:
+ * CMN PLL0/1 configuration, lane Tx/Rx equalization, and PMA isolation.
+ */
+/* Cadence Torrent PHY register offsets */
+#define TX_LANE(ln, reg)		(0x4000 + ((ln) << 9) + (reg))
+#define RX_LANE(ln, reg)		(0x8000 + ((ln) << 9) + (reg))
+
+#define CMN_SSM_BIAS_TMR                0x0022
+#define CMN_PLLSM0_PLLPRE_TMR           0x002a
+#define CMN_PLLSM0_PLLLOCK_TMR          0x002c
+#define CMN_PLLSM1_PLLPRE_TMR           0x0032
+#define CMN_PLLSM1_PLLLOCK_TMR          0x0034
+#define CMN_CDIAG_CDB_PWRI_OVRD         0x0041
+#define CMN_CDIAG_XCVRC_PWRI_OVRD       0x0047
+#define CMN_BGCAL_INIT_TMR              0x0064
+#define CMN_BGCAL_ITER_TMR              0x0065
+#define CMN_IBCAL_INIT_TMR              0x0074
+#define CMN_PLL0_VCOCAL_TCTRL           0x0082
+#define CMN_PLL0_VCOCAL_INIT_TMR        0x0084
+#define CMN_PLL0_VCOCAL_ITER_TMR        0x0085
+#define CMN_PLL0_VCOCAL_REFTIM_START    0x0086
+#define CMN_PLL0_VCOCAL_PLLCNT_START    0x0088
+#define CMN_PLL0_INTDIV_M0              0x0090
+#define CMN_PLL0_FRACDIVL_M0            0x0091
+#define CMN_PLL0_FRACDIVH_M0            0x0092
+#define CMN_PLL0_HIGH_THR_M0            0x0093
+#define CMN_PLL0_DSM_DIAG_M0            0x0094
+#define CMN_PLL0_SS_CTRL1_M0            0x0098
+#define CMN_PLL0_SS_CTRL2_M0            0x0099
+#define CMN_PLL0_SS_CTRL3_M0            0x009a
+#define CMN_PLL0_SS_CTRL4_M0            0x009b
+#define CMN_PLL0_LOCK_REFCNT_START      0x009c
+#define CMN_PLL0_LOCK_PLLCNT_START      0x009e
+#define CMN_PLL0_LOCK_PLLCNT_THR        0x009f
+#define CMN_PLL1_VCOCAL_TCTRL           0x00c2
+#define CMN_PLL1_VCOCAL_INIT_TMR        0x00c4
+#define CMN_PLL1_VCOCAL_ITER_TMR        0x00c5
+#define CMN_PLL1_VCOCAL_REFTIM_START    0x00c6
+#define CMN_PLL1_VCOCAL_PLLCNT_START    0x00c8
+#define CMN_PLL1_INTDIV_M0              0x00d0
+#define CMN_PLL1_FRACDIVL_M0            0x00d1
+#define CMN_PLL1_FRACDIVH_M0            0x00d2
+#define CMN_PLL1_HIGH_THR_M0            0x00d3
+#define CMN_PLL1_DSM_DIAG_M0            0x00d4
+#define CMN_PLL1_SS_CTRL1_M0            0x00d8
+#define CMN_PLL1_SS_CTRL2_M0            0x00d9
+#define CMN_PLL1_SS_CTRL3_M0            0x00da
+#define CMN_PLL1_SS_CTRL4_M0            0x00db
+#define CMN_PLL1_LOCK_REFCNT_START      0x00dc
+#define CMN_PLL1_LOCK_PLLCNT_START      0x00de
+#define CMN_PLL1_LOCK_PLLCNT_THR        0x00df
+#define CMN_TXPUCAL_TUNE                0x0103
+#define CMN_TXPUCAL_INIT_TMR            0x0104
+#define CMN_TXPUCAL_ITER_TMR            0x0105
+#define CMN_TXPDCAL_TUNE                0x010b
+#define CMN_TXPDCAL_INIT_TMR            0x010c
+#define CMN_TXPDCAL_ITER_TMR            0x010d
+#define CMN_RXCAL_INIT_TMR              0x0114
+#define CMN_RXCAL_ITER_TMR              0x0115
+#define CMN_SD_CAL_INIT_TMR             0x0124
+#define CMN_SD_CAL_ITER_TMR             0x0125
+#define CMN_SD_CAL_REFTIM_START         0x0126
+#define CMN_SD_CAL_PLLCNT_START         0x0128
+#define CMN_PDIAG_PLL0_CTRL_M0          0x01a0
+#define CMN_PDIAG_PLL0_CLK_SEL_M0       0x01a1
+#define CMN_PDIAG_PLL0_CP_PADJ_M0       0x01a4
+#define CMN_PDIAG_PLL0_CP_IADJ_M0       0x01a5
+#define CMN_PDIAG_PLL0_FILT_PADJ_M0     0x01a6
+#define CMN_PDIAG_PLL1_CTRL_M0          0x01c0
+#define CMN_PDIAG_PLL1_CLK_SEL_M0       0x01c1
+#define CMN_PDIAG_PLL1_CP_PADJ_M0       0x01c4
+#define CMN_PDIAG_PLL1_CP_IADJ_M0       0x01c5
+#define CMN_PDIAG_PLL1_FILT_PADJ_M0     0x01c6
+
+#define TX_TXCC_CTRL                    0x0040
+#define TX_TXCC_CPOST_MULT_01           0x004d
+#define XCVR_DIAG_PLLDRC_CTRL           0x00e5
+#define XCVR_DIAG_HSCLK_SEL             0x00e6
+#define XCVR_DIAG_HSCLK_DIV             0x00e7
+#define XCVR_DIAG_BIDI_CTRL             0x00ea
+#define XCVR_DIAG_PSC_OVRD              0x00eb
+#define TX_PSC_A0                       0x0100
+#define TX_PSC_A1                       0x0101
+#define TX_PSC_A2                       0x0102
+#define TX_PSC_A3                       0x0103
+#define TX_RCVDET_ST_TMR                0x0123
+
+#define RX_PSC_A0                       0x0000
+#define RX_PSC_A1                       0x0001
+#define RX_PSC_A2                       0x0002
+#define RX_PSC_A3                       0x0003
+#define RX_SDCAL0_INIT_TMR              0x0044
+#define RX_SDCAL0_ITER_TMR              0x0045
+#define RX_SDCAL1_INIT_TMR              0x004c
+#define RX_SDCAL1_ITER_TMR              0x004d
+#define RX_CDRLF_CNFG                   0x0080
+#define RX_CDRLF_CNFG3                  0x0082
+#define RX_SIGDET_HL_FILT_TMR           0x0090
+#define RX_REE_GCSM1_CTRL               0x0108
+#define RX_REE_ATTEN_THR                0x0149
+#define RX_REE_TAP1_CLIP                0x0171
+#define RX_REE_TAP2TON_CLIP             0x0172
+#define RX_REE_SMGM_CTRL1               0x0177
+#define RX_REE_SMGM_CTRL2               0x0178
+#define RX_DIAG_DFE_AMP_TUNE_2          0x01e2
+#define RX_DIAG_DFE_AMP_TUNE_3          0x01e3
+#define RX_DIAG_NQST_CTRL               0x01e5
+#define RX_DIAG_SIGDET_TUNE             0x01e8
+#define RX_DIAG_PI_RATE                 0x01f4
+#define RX_DIAG_PI_CAP                  0x01f5
+#define RX_DIAG_ACYA                    0x01ff
+
+#define PHY_PMA_ISOLATION_CTRL          0xc010
+#define PHY_PMA_ISOLATION_DATA0         0xc011
+#define PHY_PMA_ISOLATION_DATA1         0xc018
+#define PHY_PMA_ISOLATION_DATA2         0xc01a
+#define PHY_PMA_ISOLATION_DATA3         0xc01b
+#define PHY_PCS_PLL_RAW_CTRL            0xe003
+
+static const struct sun60i_combophy_reg sun60i_combophy0_usb3_regs[] = {
+	{ CMN_SSM_BIAS_TMR, 0x001a },
+	{ CMN_PLLSM0_PLLPRE_TMR, 0x0034 },
+	{ CMN_PLLSM0_PLLLOCK_TMR, 0x00da },
+	{ CMN_PLLSM1_PLLPRE_TMR, 0x0034 },
+	{ CMN_PLLSM1_PLLLOCK_TMR, 0x00da },
+	{ CMN_BGCAL_INIT_TMR, 0x0082 },
+	{ CMN_BGCAL_ITER_TMR, 0x0082 },
+	{ CMN_IBCAL_INIT_TMR, 0x001a },
+	{ CMN_TXPUCAL_INIT_TMR, 0x0020 },
+	{ CMN_TXPUCAL_ITER_TMR, 0x0007 },
+	{ CMN_TXPDCAL_INIT_TMR, 0x0020 },
+	{ CMN_TXPDCAL_ITER_TMR, 0x0007 },
+	{ CMN_RXCAL_INIT_TMR, 0x030c },
+	{ CMN_RXCAL_ITER_TMR, 0x0007 },
+	{ CMN_SD_CAL_INIT_TMR, 0x0007 },
+	{ CMN_SD_CAL_ITER_TMR, 0x0003 },
+	{ CMN_SD_CAL_REFTIM_START, 0x000f },
+	{ CMN_SD_CAL_PLLCNT_START, 0x0132 },
+	{ RX_LANE(0, RX_SDCAL0_INIT_TMR), 0x001a },
+	{ RX_LANE(1, RX_SDCAL0_INIT_TMR), 0x001a },
+	{ RX_LANE(2, RX_SDCAL0_INIT_TMR), 0x001a },
+	{ RX_LANE(3, RX_SDCAL0_INIT_TMR), 0x001a },
+	{ RX_LANE(0, RX_SDCAL0_ITER_TMR), 0x0082 },
+	{ RX_LANE(1, RX_SDCAL0_ITER_TMR), 0x0082 },
+	{ RX_LANE(2, RX_SDCAL0_ITER_TMR), 0x0082 },
+	{ RX_LANE(3, RX_SDCAL0_ITER_TMR), 0x0082 },
+	{ RX_LANE(0, RX_SDCAL1_INIT_TMR), 0x001a },
+	{ RX_LANE(1, RX_SDCAL1_INIT_TMR), 0x001a },
+	{ RX_LANE(2, RX_SDCAL1_INIT_TMR), 0x001a },
+	{ RX_LANE(3, RX_SDCAL1_INIT_TMR), 0x001a },
+	{ RX_LANE(0, RX_SDCAL1_ITER_TMR), 0x0082 },
+	{ RX_LANE(1, RX_SDCAL1_ITER_TMR), 0x0082 },
+	{ RX_LANE(2, RX_SDCAL1_ITER_TMR), 0x0082 },
+	{ RX_LANE(3, RX_SDCAL1_ITER_TMR), 0x0082 },
+	{ TX_LANE(0, TX_RCVDET_ST_TMR), 0x0a28 },
+	{ TX_LANE(1, TX_RCVDET_ST_TMR), 0x0a28 },
+	{ TX_LANE(2, TX_RCVDET_ST_TMR), 0x0a28 },
+	{ TX_LANE(3, TX_RCVDET_ST_TMR), 0x0a28 },
+	{ CMN_PDIAG_PLL0_CLK_SEL_M0, 0x8600 },
+	{ CMN_PDIAG_PLL1_CLK_SEL_M0, 0x0701 },
+	{ TX_LANE(2, XCVR_DIAG_PLLDRC_CTRL), 0x0012 },
+	{ TX_LANE(3, XCVR_DIAG_PLLDRC_CTRL), 0x0012 },
+	{ TX_LANE(0, XCVR_DIAG_HSCLK_SEL), 0x0000 },
+	{ TX_LANE(1, XCVR_DIAG_HSCLK_SEL), 0x0000 },
+	{ TX_LANE(0, XCVR_DIAG_HSCLK_DIV), 0x0001 },
+	{ TX_LANE(1, XCVR_DIAG_HSCLK_DIV), 0x0001 },
+	{ TX_LANE(0, XCVR_DIAG_PLLDRC_CTRL), 0x0012 },
+	{ TX_LANE(1, XCVR_DIAG_PLLDRC_CTRL), 0x0012 },
+	{ TX_LANE(0, XCVR_DIAG_PLLDRC_CTRL), 0x0041 },
+	{ TX_LANE(1, XCVR_DIAG_PLLDRC_CTRL), 0x0041 },
+	{ TX_LANE(2, XCVR_DIAG_HSCLK_SEL), 0x0001 },
+	{ TX_LANE(3, XCVR_DIAG_HSCLK_SEL), 0x0001 },
+	{ TX_LANE(2, XCVR_DIAG_HSCLK_DIV), 0x0001 },
+	{ TX_LANE(3, XCVR_DIAG_HSCLK_DIV), 0x0001 },
+	{ TX_LANE(2, XCVR_DIAG_PLLDRC_CTRL), 0x0019 },
+	{ TX_LANE(3, XCVR_DIAG_PLLDRC_CTRL), 0x0019 },
+	{ CMN_PLL0_DSM_DIAG_M0, 0x0004 },
+	{ CMN_PLL1_DSM_DIAG_M0, 0x0004 },
+	{ CMN_PDIAG_PLL0_CP_PADJ_M0, 0x0509 },
+	{ CMN_PDIAG_PLL1_CP_PADJ_M0, 0x0509 },
+	{ CMN_PDIAG_PLL0_CP_IADJ_M0, 0x0f00 },
+	{ CMN_PDIAG_PLL1_CP_IADJ_M0, 0x0f00 },
+	{ CMN_PDIAG_PLL0_FILT_PADJ_M0, 0x0f08 },
+	{ CMN_PDIAG_PLL1_FILT_PADJ_M0, 0x0f08 },
+	{ CMN_PLL0_INTDIV_M0, 0x0180 },
+	{ CMN_PLL1_INTDIV_M0, 0x019f },
+	{ CMN_PLL0_FRACDIVL_M0, 0x9d8a },
+	{ CMN_PLL1_FRACDIVL_M0, 0x6276 },
+	{ CMN_PLL0_FRACDIVH_M0, 0x0002 },
+	{ CMN_PLL1_FRACDIVH_M0, 0x0002 },
+	{ CMN_PLL0_HIGH_THR_M0, 0x0102 },
+	{ CMN_PLL1_HIGH_THR_M0, 0x0116 },
+	{ CMN_PDIAG_PLL0_CTRL_M0, 0x0002 },
+	{ CMN_PDIAG_PLL1_CTRL_M0, 0x0002 },
+	{ CMN_PLL0_SS_CTRL1_M0, 0x0001 },
+	{ CMN_PLL1_SS_CTRL1_M0, 0x0002 },
+	{ CMN_PLL0_SS_CTRL2_M0, 0x045f },
+	{ CMN_PLL1_SS_CTRL2_M0, 0x04c4 },
+	{ CMN_PLL0_SS_CTRL3_M0, 0x006b },
+	{ CMN_PLL1_SS_CTRL3_M0, 0x006a },
+	{ CMN_PLL0_SS_CTRL4_M0, 0x0004 },
+	{ CMN_PLL1_SS_CTRL4_M0, 0x0004 },
+	{ CMN_PLL0_VCOCAL_INIT_TMR, 0x0104 },
+	{ CMN_PLL1_VCOCAL_INIT_TMR, 0x0104 },
+	{ CMN_PLL0_VCOCAL_ITER_TMR, 0x0005 },
+	{ CMN_PLL1_VCOCAL_ITER_TMR, 0x0005 },
+	{ CMN_PLL0_VCOCAL_REFTIM_START, 0x0337 },
+	{ CMN_PLL1_VCOCAL_REFTIM_START, 0x0337 },
+	{ CMN_PLL0_VCOCAL_PLLCNT_START, 0x0335 },
+	{ CMN_PLL1_VCOCAL_PLLCNT_START, 0x0335 },
+	{ CMN_PLL0_VCOCAL_TCTRL, 0x0003 },
+	{ CMN_PLL1_VCOCAL_TCTRL, 0x0003 },
+	{ CMN_PLL0_LOCK_REFCNT_START, 0x00cf },
+	{ CMN_PLL1_LOCK_REFCNT_START, 0x00cf },
+	{ CMN_PLL0_LOCK_PLLCNT_START, 0x00ce },
+	{ CMN_PLL1_LOCK_PLLCNT_START, 0x00ce },
+	{ CMN_PLL0_LOCK_PLLCNT_THR, 0x0005 },
+	{ CMN_PLL1_LOCK_PLLCNT_THR, 0x0005 },
+	{ PHY_PMA_ISOLATION_CTRL, 0x5100 },
+	{ PHY_PMA_ISOLATION_DATA0, 0x0100 },
+	{ PHY_PMA_ISOLATION_DATA1, 0x0a0a },
+	{ PHY_PMA_ISOLATION_DATA2, 0x1000 },
+	{ PHY_PMA_ISOLATION_DATA3, 0x0010 },
+	{ CMN_CDIAG_CDB_PWRI_OVRD, 0x8200 },
+	{ CMN_CDIAG_XCVRC_PWRI_OVRD, 0x8200 },
+	{ TX_LANE(3, TX_PSC_A0), 0x00fb },
+	{ TX_LANE(3, TX_PSC_A1), 0x04af },
+	{ TX_LANE(3, TX_PSC_A2), 0x04aa },
+	{ TX_LANE(3, TX_PSC_A3), 0x04aa },
+	{ RX_LANE(2, RX_PSC_A0), 0x091d },
+	{ RX_LANE(2, RX_PSC_A1), 0x091d },
+	{ RX_LANE(2, RX_PSC_A2), 0x0900 },
+	{ RX_LANE(2, RX_PSC_A3), 0x0000 },
+	{ TX_LANE(3, TX_TXCC_CTRL), 0x08a4 },
+	{ TX_LANE(3, TX_TXCC_CPOST_MULT_01), 0x0011 },
+	{ RX_LANE(2, RX_SIGDET_HL_FILT_TMR), 0x000c },
+	{ RX_LANE(2, RX_REE_GCSM1_CTRL), 0x0009 },
+	{ RX_LANE(2, RX_REE_ATTEN_THR), 0x0c02 },
+	{ RX_LANE(2, RX_REE_SMGM_CTRL1), 0x06f6 },
+	{ RX_LANE(2, RX_REE_SMGM_CTRL2), 0x4606 },
+	{ TX_LANE(2, XCVR_DIAG_PSC_OVRD), 0x0006 },
+	{ RX_LANE(2, RX_REE_TAP1_CLIP), 0x0519 },
+	{ RX_LANE(2, RX_REE_TAP2TON_CLIP), 0x0519 },
+	{ RX_LANE(2, RX_DIAG_SIGDET_TUNE), 0x1002 },
+	{ RX_LANE(2, RX_DIAG_NQST_CTRL), 0x0b98 },
+	{ RX_LANE(2, RX_DIAG_DFE_AMP_TUNE_2), 0x0c01 },
+	{ RX_LANE(2, RX_DIAG_DFE_AMP_TUNE_3), 0x0000 },
+	{ RX_LANE(2, RX_DIAG_PI_CAP), 0x0000 },
+	{ RX_LANE(2, RX_DIAG_PI_RATE), 0x0311 },
+	{ RX_LANE(2, RX_DIAG_ACYA), 0x0000 },
+	{ RX_LANE(3, RX_DIAG_ACYA), 0x0000 },
+	{ RX_LANE(2, RX_CDRLF_CNFG), 0x010a },
+	{ RX_LANE(2, RX_CDRLF_CNFG3), 0x0003 },
+	{ TX_LANE(3, XCVR_DIAG_BIDI_CTRL), 0x000f },
+	{ TX_LANE(2, XCVR_DIAG_BIDI_CTRL), 0x000f },
+	{ TX_LANE(0, TX_PSC_A0), 0x02ff },
+	{ TX_LANE(0, TX_PSC_A1), 0x06af },
+	{ TX_LANE(0, TX_PSC_A2), 0x06ae },
+	{ TX_LANE(0, TX_PSC_A3), 0x06ae },
+	{ RX_LANE(1, RX_PSC_A0), 0x0d1d },
+	{ RX_LANE(1, RX_PSC_A1), 0x0d1d },
+	{ RX_LANE(1, RX_PSC_A2), 0x0d00 },
+	{ RX_LANE(1, RX_PSC_A3), 0x0500 },
+	{ TX_LANE(0, TX_TXCC_CTRL), 0x2a82 },
+	{ TX_LANE(0, TX_TXCC_CPOST_MULT_01), 0x0014 },
+	{ RX_LANE(1, RX_SIGDET_HL_FILT_TMR), 0x0013 },
+	{ RX_LANE(1, RX_REE_GCSM1_CTRL), 0x0000 },
+	{ RX_LANE(1, RX_REE_ATTEN_THR), 0x0c02 },
+	{ RX_LANE(1, RX_REE_SMGM_CTRL1), 0x0330 },
+	{ RX_LANE(1, RX_REE_SMGM_CTRL2), 0x0300 },
+	{ TX_LANE(1, XCVR_DIAG_PSC_OVRD), 0x0003 },
+	{ RX_LANE(1, RX_REE_TAP1_CLIP), 0x0019 },
+	{ RX_LANE(1, RX_REE_TAP2TON_CLIP), 0x0019 },
+	{ RX_LANE(1, RX_DIAG_SIGDET_TUNE), 0x1004 },
+	{ RX_LANE(1, RX_DIAG_NQST_CTRL), 0x00f9 },
+	{ RX_LANE(1, RX_DIAG_DFE_AMP_TUNE_2), 0x0c01 },
+	{ RX_LANE(1, RX_DIAG_DFE_AMP_TUNE_3), 0x0002 },
+	{ RX_LANE(1, RX_DIAG_PI_CAP), 0x0000 },
+	{ RX_LANE(1, RX_DIAG_PI_RATE), 0x0031 },
+	{ RX_LANE(1, RX_DIAG_ACYA), 0x0001 },
+	{ RX_LANE(0, RX_DIAG_ACYA), 0x0002 },
+	{ RX_LANE(1, RX_CDRLF_CNFG), 0x018c },
+	{ RX_LANE(1, RX_CDRLF_CNFG3), 0x0003 },
+	{ TX_LANE(0, XCVR_DIAG_BIDI_CTRL), 0x000f },
+	{ TX_LANE(1, XCVR_DIAG_BIDI_CTRL), 0x00f0 },
+	{ PHY_PCS_PLL_RAW_CTRL, 0x0003 },
+	{ CMN_TXPUCAL_TUNE, 0x007f },
+	{ CMN_TXPDCAL_TUNE, 0x007f },
+};
+
+static int sun60i_combophy0_usb3_init(struct sun60i_combophy *cphy)
+{
+	u32 val;
+	u16 reg16;
+	int i, ret;
+
+	/* Keep CCU PIPE and UTMI clocks selected until controller resets finish. */
+	regmap_set_bits(cphy->syscon, SERDES_USB3P1_BGR,
+			USB3P1_ONLY_UTMI_CLK_SEL | USB3P1_ONLY_PIPE_CLK_SEL |
+			USB3P1_ACLK_EN | USB3P1_HCLK_EN |
+			USB3P1_USB2P0_PHY_RSTN | USB3P1_BGR_RST_MASK);
+	regmap_clear_bits(cphy->syscon, SERDES_DBG_CTL,
+			  SERDES_DISABLE_COMBO0_AUTOGATING);
+	regmap_set_bits(cphy->syscon, SERDES_TOP_ISOLATION_CTRL,
+			SERDES_TOP_ISO_USB3_MASK);
+	regmap_clear_bits(cphy->syscon, SERDES_USB3P1_PIPE_CLK_MAP_CTRL,
+			  USB3P1_PIPE_MAP_MASK);
+	regmap_clear_bits(cphy->syscon, SERDES_USB3P1_PIPE_RXD_MAP_CTRL,
+			  USB3P1_PIPE_MAP_MASK);
+	regmap_update_bits(cphy->syscon, SERDES_TOP_PIPE_MAP,
+			   SERDES_TOP_PIPE_MAP_MASK, SERDES_TOP_PIPE_MAP_MASK);
+	regmap_clear_bits(cphy->syscon, SERDES_TOP_COMBO0_SEL,
+			  SERDES_TOP_COMBO0_SEL_MASK);
+
+	regmap_clear_bits(cphy->syscon, SERDES_COMB0_LINK_CTRL2,
+			  PHY0_IDDQ_EN_SEL | PHY0_IDDQ_EN_SOFT);
+	regmap_set_bits(cphy->syscon, SERDES_COMB0_LINK_CTRL1,
+			PHY0_PMA_CMN_PLL1_REFCLK_SEL |
+			PHY0_PMA_CMN_PLL0_REFCLK_SEL |
+			PHY0_PMA_CMN_REFCLK_DIG_SEL);
+
+	for (i = 0; i < ARRAY_SIZE(sun60i_combophy0_usb3_regs); i++)
+		writew(sun60i_combophy0_usb3_regs[i].val,
+		       cphy->base + (sun60i_combophy0_usb3_regs[i].offset << 1));
+
+	regmap_clear_bits(cphy->syscon, SERDES_COMB0_LINK_CTRL0,
+			  PHY0_RESET_N | PHY0_TYPEC_CONN_DIR);
+	usleep_range(1000, 1500);
+	/* Release DP soft reset alongside PIPE reset to unblock PMA ready. */
+	regmap_set_bits(cphy->syscon, SERDES_COMB0_LINK_CTRL0,
+			PHY0_DP_LINK_RESET_N_SOFT |
+			PHY0_RESET_N | PHY0_PIPE_LINK_RESET_N_SOFT);
+	usleep_range(1000, 1500);
+
+	regmap_set_bits(cphy->syscon, SERDES_COMB0_LINK_CTRL3,
+			PHY0_PMA_XCVR_PLLCLK_EN_LN |
+			PHY0_PMA_XCVR_POWER_STATE_REQ_LN(1));
+
+	ret = regmap_read(cphy->syscon, SERDES_COMB0_LINK_STUS0, &val);
+	if (ret)
+		return ret;
+
+	if (!(val & PHY0_PMA_CMN_READY)) {
+		/* Clear PMA common reset bits if PMA is not ready yet. */
+		usleep_range(10000, 12000);
+		reg16 = readw(cphy->base + (COMB0_PMA_CMN_CTRL << 1));
+		reg16 &= ~COMB0_PMA_CMN_CTRL_RST_MASK;
+		writew(reg16, cphy->base + (COMB0_PMA_CMN_CTRL << 1));
+
+		ret = regmap_read_poll_timeout(cphy->syscon,
+					       SERDES_COMB0_LINK_STUS0, val,
+					       val & PHY0_PMA_CMN_READY,
+					       50, 50000);
+		if (ret) {
+			dev_err(cphy->dev, "combo0 PMA common ready timeout\n");
+			return ret;
+		}
+	}
+
+	return 0;
+}
+
+static int sun60i_combophy0_exit(struct sun60i_combophy *cphy)
+{
+	regmap_clear_bits(cphy->syscon, SERDES_COMB0_LINK_CTRL3,
+			  PHY0_PMA_XCVR_PLLCLK_EN_LN |
+			  PHY0_PMA_XCVR_POWER_STATE_REQ_LN(0x3f));
+	regmap_clear_bits(cphy->syscon, SERDES_COMB0_LINK_CTRL0,
+			  PHY0_DP_LINK_RESET_N_SOFT |
+			  PHY0_PIPE_LINK_RESET_N_SOFT | PHY0_RESET_N);
+	regmap_set_bits(cphy->syscon, SERDES_COMB0_LINK_CTRL2,
+			PHY0_IDDQ_EN_SEL | PHY0_IDDQ_EN_SOFT);
+	return 0;
+}
+
+static const struct sun60i_combophy_cfg sun60i_combophy0_cfg = {
+	.supported_type = PHY_TYPE_USB3,
+	.serdes_rate = 100000000,
+	.init = sun60i_combophy0_usb3_init,
+	.exit = sun60i_combophy0_exit,
 };
 
 static int sun60i_combophy1_pcie_init(struct sun60i_combophy *cphy)
@@ -79,10 +520,11 @@ static int sun60i_combophy1_pcie_init(struct sun60i_combophy *cphy)
 			SERDES_PCIE_GATING | SERDES_PCIE_RST);
 	regmap_set_bits(cphy->syscon, SERDES_DBG_CTL,
 			SERDES_DISABLE_COMBO1_AUTOGATING);
-	regmap_write(cphy->syscon, SERDES_COMB1_PIPE, SERDES_COMB1_PIPE_PCIE);
+	regmap_update_bits(cphy->syscon, SERDES_COMB1_PIPE,
+			   SERDES_COMB1_PIPE_MASK, SERDES_COMB1_PIPE_PCIE);
 
-	regmap_write(cphy->syscon, SERDES_COMB1_LINK_CTRL1,
-		     PHY1_EN_REFCLK | 0x01100001);
+	regmap_update_bits(cphy->syscon, SERDES_COMB1_LINK_CTRL1,
+			   PHY1_EN_REFCLK, PHY1_EN_REFCLK);
 	regmap_set_bits(cphy->syscon, SERDES_COMB1_LINK_CTRL0,
 			PHY1_LINK_CFG_LN(1) | PHY1_RESET_N);
 	regmap_set_bits(cphy->syscon, SERDES_COMB1_LANE0_CTRL0,
@@ -97,14 +539,6 @@ static int sun60i_combophy1_pcie_init(struct sun60i_combophy *cphy)
 	return ret;
 }
 
-static int sun60i_combophy1_init(struct sun60i_combophy *cphy)
-{
-	if (cphy->type != PHY_TYPE_PCIE)
-		return -EINVAL;
-
-	return sun60i_combophy1_pcie_init(cphy);
-}
-
 static int sun60i_combophy1_exit(struct sun60i_combophy *cphy)
 {
 	regmap_clear_bits(cphy->syscon, SERDES_COMB1_LINK_CTRL0, PHY1_RESET_N);
@@ -112,7 +546,9 @@ static int sun60i_combophy1_exit(struct sun60i_combophy *cphy)
 }
 
 static const struct sun60i_combophy_cfg sun60i_combophy1_cfg = {
-	.init = sun60i_combophy1_init,
+	.supported_type = PHY_TYPE_PCIE,
+	.serdes_rate = 100000000,
+	.init = sun60i_combophy1_pcie_init,
 	.exit = sun60i_combophy1_exit,
 };
 
@@ -121,16 +557,27 @@ static int sun60i_combophy_init(struct phy *phy)
 	struct sun60i_combophy *cphy = phy_get_drvdata(phy);
 	int ret;
 
+	ret = pm_runtime_resume_and_get(cphy->dev);
+	if (ret)
+		return ret;
+
 	if (cphy->supply) {
 		ret = regulator_enable(cphy->supply);
 		if (ret)
-			return ret;
+			goto err_pm;
 	}
 
 	ret = reset_control_deassert(cphy->reset);
 	if (ret)
 		goto err_regulator;
 
+	if (cphy->cfg->supported_type != PHY_TYPE_USB3) {
+		ret = clk_set_rate(cphy->clks[SUN60I_COMBOPHY_CLK_SERDES].clk,
+				   cphy->cfg->serdes_rate);
+		if (ret)
+			goto err_reset;
+	}
+
 	ret = clk_bulk_prepare_enable(cphy->num_clks, cphy->clks);
 	if (ret)
 		goto err_reset;
@@ -148,26 +595,46 @@ static int sun60i_combophy_init(struct phy *phy)
 err_regulator:
 	if (cphy->supply)
 		regulator_disable(cphy->supply);
+err_pm:
+	pm_runtime_put_sync(cphy->dev);
 	return ret;
 }
 
 static int sun60i_combophy_exit(struct phy *phy)
 {
 	struct sun60i_combophy *cphy = phy_get_drvdata(phy);
+	int ret = 0;
 
 	if (cphy->cfg->exit)
-		cphy->cfg->exit(cphy);
+		ret = cphy->cfg->exit(cphy);
 
 	clk_bulk_disable_unprepare(cphy->num_clks, cphy->clks);
 	reset_control_assert(cphy->reset);
 	if (cphy->supply)
 		regulator_disable(cphy->supply);
+	pm_runtime_put_sync(cphy->dev);
+
+	return ret;
+}
+
+static int sun60i_combophy_calibrate(struct phy *phy)
+{
+	struct sun60i_combophy *cphy = phy_get_drvdata(phy);
+
+	if (cphy->cfg->supported_type == PHY_TYPE_USB3) {
+		/* Hand over PIPE and UTMI clocks to SerDes after reset. */
+		regmap_update_bits(cphy->syscon, SERDES_USB3P1_BGR,
+				   USB3P1_ONLY_UTMI_CLK_SEL |
+				   USB3P1_ONLY_PIPE_CLK_SEL |
+				   USB3P1_BGR_RST_MASK, 0);
+	}
 
 	return 0;
 }
 
 static const struct phy_ops sun60i_combophy_ops = {
 	.init = sun60i_combophy_init,
+	.calibrate = sun60i_combophy_calibrate,
 	.exit = sun60i_combophy_exit,
 	.owner = THIS_MODULE,
 };
@@ -180,11 +647,61 @@ static struct phy *sun60i_combophy_xlate(struct device *dev,
 	if (args->args_count != 1)
 		return ERR_PTR(-EINVAL);
 
-	cphy->type = args->args[0];
+	if (args->args[0] != cphy->cfg->supported_type)
+		return ERR_PTR(-EINVAL);
 
 	return cphy->phy;
 }
 
+static void sun60i_combophy_usb3_bgr_disable(void *data)
+{
+	struct sun60i_combophy *cphy = data;
+
+	regmap_clear_bits(cphy->syscon, SERDES_USB3P1_BGR,
+			  USB3P1_ACLK_EN | USB3P1_HCLK_EN |
+			  USB3P1_USB2P0_PHY_RSTN | USB3P1_BGR_RST_MASK);
+	clk_bulk_disable_unprepare(cphy->num_clks, cphy->clks);
+	reset_control_assert(cphy->reset);
+	pm_runtime_put_sync(cphy->dev);
+}
+
+static int sun60i_combophy_usb3_bgr_enable(struct sun60i_combophy *cphy)
+{
+	int ret;
+
+	ret = pm_runtime_resume_and_get(cphy->dev);
+	if (ret)
+		return ret;
+
+	ret = reset_control_deassert(cphy->reset);
+	if (ret)
+		goto err_pm;
+
+	ret = clk_set_rate(cphy->clks[SUN60I_COMBOPHY_CLK_SERDES].clk,
+			   cphy->cfg->serdes_rate);
+	if (ret)
+		goto err_reset;
+
+	ret = clk_bulk_prepare_enable(cphy->num_clks, cphy->clks);
+	if (ret)
+		goto err_reset;
+
+	/* Un-gate USB3P1 BGR before DWC3 reads GSNPSID during probe. */
+	/* Keep CCU PIPE and UTMI clocks selected until controller resets finish. */
+	regmap_set_bits(cphy->syscon, SERDES_USB3P1_BGR,
+			USB3P1_ACLK_EN | USB3P1_HCLK_EN |
+			USB3P1_USB2P0_PHY_RSTN | USB3P1_BGR_RST_MASK);
+
+	return devm_add_action_or_reset(cphy->dev,
+					sun60i_combophy_usb3_bgr_disable, cphy);
+
+err_reset:
+	reset_control_assert(cphy->reset);
+err_pm:
+	pm_runtime_put_sync(cphy->dev);
+	return ret;
+}
+
 static int sun60i_combophy_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
@@ -244,6 +761,12 @@ static int sun60i_combophy_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
+	if (cphy->cfg->supported_type == PHY_TYPE_USB3) {
+		ret = sun60i_combophy_usb3_bgr_enable(cphy);
+		if (ret)
+			return ret;
+	}
+
 	cphy->phy = devm_phy_create(dev, NULL, &sun60i_combophy_ops);
 	if (IS_ERR(cphy->phy))
 		return dev_err_probe(dev, PTR_ERR(cphy->phy),
@@ -256,6 +779,10 @@ static int sun60i_combophy_probe(struct platform_device *pdev)
 }
 
 static const struct of_device_id sun60i_combophy_of_match[] = {
+	{
+		.compatible = "allwinner,sun60i-a733-combophy0",
+		.data = &sun60i_combophy0_cfg,
+	},
 	{
 		.compatible = "allwinner,sun60i-a733-combophy1",
 		.data = &sun60i_combophy1_cfg,
-- 
2.53.0


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

* [PATCH 08/11] usb: dwc3: Add Allwinner A733 DWC3 support
  2026-11-27  7:32 [PATCH 00/11] arm64: dts: allwinner: Add Allwinner A733 USB 3.0 support Alastair D'Silva
                   ` (6 preceding siblings ...)
  2026-11-27  7:32 ` [PATCH 07/11] phy: allwinner: sun60i-combophy: Add USB 3.0 PHY mode support Alastair D'Silva
@ 2026-11-27  7:32 ` Alastair D'Silva
  2026-11-27  7:32 ` [PATCH 09/11] usb: host: xhci: Add W1C port change quirk for Allwinner A733 Alastair D'Silva
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: Alastair D'Silva @ 2026-11-27  7:32 UTC (permalink / raw)
  To: Vinod Koul, Neil Armstrong, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
	Greg Kroah-Hartman, Stephen Boyd, Brian Masney, Jerome Brunet,
	Thinh Nguyen, Mathias Nyman
  Cc: linux-phy, devicetree, linux-arm-kernel, linux-sunxi, linux-usb,
	linux-clk, linux-kernel, Alastair D'Silva

Add inverted sync header support, A733 match data, and post-reset PHY
calibration on host start.

Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
---
 drivers/usb/dwc3/core.c              | 18 +++++++++++++++---
 drivers/usb/dwc3/core.h              |  8 ++++++++
 drivers/usb/dwc3/dwc3-generic-plat.c | 15 +++++++++++++--
 drivers/usb/dwc3/glue.h              |  6 ++++++
 drivers/usb/dwc3/host.c              | 10 ++++++++++
 5 files changed, 52 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index f4aa6a01e500..3fe68d085a85 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -1503,13 +1503,16 @@ int dwc3_core_init(struct dwc3 *dwc)
 	dwc3_config_threshold(dwc);
 
 	if (hw_mode != DWC3_GHWPARAMS0_MODE_GADGET &&
-	    (DWC3_IP_IS(DWC31)) &&
-	    dwc->maximum_speed == USB_SPEED_SUPER) {
+	    DWC3_IP_IS(DWC31) &&
+	    (dwc->maximum_speed == USB_SPEED_SUPER || dwc->inv_sync_hdr)) {
 		int i;
 
 		for (i = 0; i < dwc->num_usb3_ports; i++) {
 			reg = dwc3_readl(dwc, DWC3_LLUCTL(i));
-			reg |= DWC3_LLUCTL_FORCE_GEN1;
+			if (dwc->maximum_speed == USB_SPEED_SUPER)
+				reg |= DWC3_LLUCTL_FORCE_GEN1;
+			if (dwc->inv_sync_hdr)
+				reg |= DWC3_LLUCTL_INV_SYNC_HDR;
 			dwc3_writel(dwc, DWC3_LLUCTL(i), reg);
 		}
 	}
@@ -1694,6 +1697,15 @@ static void dwc3_get_software_properties(struct dwc3 *dwc,
 	if (properties->needs_full_reinit)
 		dwc->needs_full_reinit = true;
 
+	if (properties->inv_sync_hdr)
+		dwc->inv_sync_hdr = true;
+
+	if (properties->calibrate_on_start)
+		dwc->calibrate_on_start = true;
+
+	if (properties->xhci_w1c_port_change)
+		dwc->xhci_w1c_port_change = true;
+
 	dwc->gsbuscfg0_reqinfo = DWC3_GSBUSCFG0_REQINFO_UNSPECIFIED;
 
 	if (properties->gsbuscfg0_reqinfo !=
diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
index f635a9fbc151..e65629f9d437 100644
--- a/drivers/usb/dwc3/core.h
+++ b/drivers/usb/dwc3/core.h
@@ -677,6 +677,8 @@
 
 /* Force Gen1 speed on Gen2 link */
 #define DWC3_LLUCTL_FORCE_GEN1		BIT(10)
+/* Invert sync header on Cadence SerDes */
+#define DWC3_LLUCTL_INV_SYNC_HDR	BIT(30)
 
 /* Structures */
 
@@ -1151,6 +1153,9 @@ struct dwc3_glue_ops {
  * @dis_u1_entry_quirk: set if link entering into U1 state needs to be disabled.
  * @dis_u2_entry_quirk: set if link entering into U2 state needs to be disabled.
  * @dis_rxdet_inp3_quirk: set if we disable Rx.Detect in P3
+ * @inv_sync_hdr: set if Cadence SerDes requires inverted sync header
+ * @calibrate_on_start: calibrate USB3 PHYs after xHCI reset
+ * @xhci_w1c_port_change: enable xHCI W1C port change quirk
  * @async_callbacks: if set, indicate that async callbacks will be used.
  *
  * @dis_u2_freeclk_exists_quirk : set if we clear u2_freeclk_exists
@@ -1419,6 +1424,9 @@ struct dwc3 {
 	unsigned		dis_u1_entry_quirk:1;
 	unsigned		dis_u2_entry_quirk:1;
 	unsigned		dis_rxdet_inp3_quirk:1;
+	unsigned		inv_sync_hdr:1;
+	unsigned		calibrate_on_start:1;
+	unsigned		xhci_w1c_port_change:1;
 	unsigned		dis_u2_freeclk_exists_quirk:1;
 	unsigned		dis_del_phy_power_chg_quirk:1;
 	unsigned		dis_tx_ipgap_linecheck_quirk:1;
diff --git a/drivers/usb/dwc3/dwc3-generic-plat.c b/drivers/usb/dwc3/dwc3-generic-plat.c
index 3e90ddf25809..568fa1a26379 100644
--- a/drivers/usb/dwc3/dwc3-generic-plat.c
+++ b/drivers/usb/dwc3/dwc3-generic-plat.c
@@ -72,7 +72,7 @@ static int dwc3_eic7700_init(struct dwc3_generic *dwc3g)
 	return 0;
 }
 
-static int dwc3_spacemit_k1_init(struct dwc3_generic *dwc3g)
+static int dwc3_host_vbus_init(struct dwc3_generic *dwc3g)
 {
 	struct device *dev = dwc3g->dev;
 
@@ -219,10 +219,20 @@ static const struct dev_pm_ops dwc3_generic_dev_pm_ops = {
 };
 
 static const struct dwc3_generic_config spacemit_k1_dwc3 = {
-	.init = dwc3_spacemit_k1_init,
+	.init = dwc3_host_vbus_init,
 	.properties = DWC3_DEFAULT_PROPERTIES,
 };
 
+static const struct dwc3_generic_config sun60i_a733_dwc3 = {
+	.init = dwc3_host_vbus_init,
+	.properties = {
+		.gsbuscfg0_reqinfo = DWC3_GSBUSCFG0_REQINFO_UNSPECIFIED,
+		.inv_sync_hdr = true,
+		.calibrate_on_start = true,
+		.xhci_w1c_port_change = true,
+	},
+};
+
 static const struct dwc3_generic_config fsl_ls1028_dwc3 = {
 	.properties.gsbuscfg0_reqinfo = 0x2222,
 };
@@ -233,6 +243,7 @@ static const struct dwc3_generic_config eic7700_dwc3 =  {
 };
 
 static const struct of_device_id dwc3_generic_of_match[] = {
+	{ .compatible = "allwinner,sun60i-a733-dwc3", &sun60i_a733_dwc3 },
 	{ .compatible = "spacemit,k1-dwc3", &spacemit_k1_dwc3},
 	{ .compatible = "spacemit,k3-dwc3", },
 	{ .compatible = "fsl,ls1028a-dwc3", &fsl_ls1028_dwc3},
diff --git a/drivers/usb/dwc3/glue.h b/drivers/usb/dwc3/glue.h
index a1284c481390..12a24e9016eb 100644
--- a/drivers/usb/dwc3/glue.h
+++ b/drivers/usb/dwc3/glue.h
@@ -14,10 +14,16 @@
  * @gsbuscfg0_reqinfo: Value to be programmed in the GSBUSCFG0.REQINFO field
  * @needs_full_reinit: indicate the controller may not remain power during system
  *			pm and need full initialization
+ * @inv_sync_hdr: set DWC3_LLUCTL_INV_SYNC_HDR for Cadence SerDes
+ * @calibrate_on_start: calibrate USB3 PHYs after xHCI reset
+ * @xhci_w1c_port_change: enable xHCI W1C port change quirk
  */
 struct dwc3_properties {
 	u32 gsbuscfg0_reqinfo;
 	unsigned needs_full_reinit:1;
+	unsigned inv_sync_hdr:1;
+	unsigned calibrate_on_start:1;
+	unsigned xhci_w1c_port_change:1;
 };
 
 #define DWC3_DEFAULT_PROPERTIES ((struct dwc3_properties){		\
diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
index cd1e5204ac3a..e45d8b14b60c 100644
--- a/drivers/usb/dwc3/host.c
+++ b/drivers/usb/dwc3/host.c
@@ -68,6 +68,7 @@ static void dwc3_xhci_plat_start(struct usb_hcd *hcd)
 {
 	struct platform_device *pdev;
 	struct dwc3 *dwc;
+	int i;
 
 	if (!usb_hcd_is_primary_hcd(hcd))
 		return;
@@ -75,6 +76,12 @@ static void dwc3_xhci_plat_start(struct usb_hcd *hcd)
 	pdev = to_platform_device(hcd->self.controller);
 	dwc = dev_get_drvdata(pdev->dev.parent);
 
+	/* Calibrate PHYs after xHCI reset to complete clock handover. */
+	if (dwc->calibrate_on_start) {
+		for (i = 0; i < dwc->num_usb3_ports; i++)
+			phy_calibrate(dwc->usb3_generic_phy[i]);
+	}
+
 	dwc3_enable_susphy(dwc, true);
 }
 
@@ -174,6 +181,9 @@ int dwc3_host_init(struct dwc3 *dwc)
 	if (dwc->usb2_lpm_disable)
 		props[prop_idx++] = PROPERTY_ENTRY_BOOL("usb2-lpm-disable");
 
+	if (dwc->xhci_w1c_port_change)
+		props[prop_idx++] = PROPERTY_ENTRY_BOOL("xhci-w1c-port-change-quirk");
+
 	/**
 	 * WORKAROUND: dwc3 revisions <=3.00a have a limitation
 	 * where Port Disable command doesn't work.
-- 
2.53.0


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

* [PATCH 09/11] usb: host: xhci: Add W1C port change quirk for Allwinner A733
  2026-11-27  7:32 [PATCH 00/11] arm64: dts: allwinner: Add Allwinner A733 USB 3.0 support Alastair D'Silva
                   ` (7 preceding siblings ...)
  2026-11-27  7:32 ` [PATCH 08/11] usb: dwc3: Add Allwinner A733 DWC3 support Alastair D'Silva
@ 2026-11-27  7:32 ` Alastair D'Silva
  2026-11-27  7:32 ` [PATCH 10/11] arm64: dts: allwinner: sun60i-a733: Add USB 3.0 controller and PHYs Alastair D'Silva
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: Alastair D'Silva @ 2026-11-27  7:32 UTC (permalink / raw)
  To: Vinod Koul, Neil Armstrong, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
	Greg Kroah-Hartman, Stephen Boyd, Brian Masney, Jerome Brunet,
	Thinh Nguyen, Mathias Nyman
  Cc: linux-phy, devicetree, linux-arm-kernel, linux-sunxi, linux-usb,
	linux-clk, linux-kernel, Alastair D'Silva

Allwinner A733 xHCI PORTSC change bits do not clear on write-1-to-clear
when a SuperSpeed device is active. Track cleared bits per port and
sync connection state when reading PORTSC. Use warm port reset on
SuperSpeed port reset.

Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
---
 drivers/usb/host/xhci-hub.c  | 53 +++++++++++++++++++++++++++++++++++-
 drivers/usb/host/xhci-plat.c |  3 ++
 drivers/usb/host/xhci.h      |  2 ++
 3 files changed, 57 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
index 55430b673f1e..566cebbd0998 100644
--- a/drivers/usb/host/xhci-hub.c
+++ b/drivers/usb/host/xhci-hub.c
@@ -623,6 +623,9 @@ static void xhci_clear_port_change_bit(struct xhci_hcd *xhci, u16 wValue, struct
 	xhci_portsc_writel(port, portsc | status);
 	portsc = xhci_portsc_readl(port);
 
+	if (xhci->quirks & XHCI_W1C_PORT_CHANGE_QUIRK)
+		port->cleared_change_bits |= (portsc & status);
+
 	xhci_dbg(xhci, "clear port%d %s change, portsc: 0x%x\n",
 		 port->hcd_portnum + 1, port_change_bit, portsc);
 }
@@ -1122,6 +1125,33 @@ static void xhci_get_usb2_port_status(struct xhci_port *port, u32 *status,
 	}
 }
 
+static u32 xhci_w1c_filter_portsc(struct xhci_hcd *xhci, struct xhci_port *port,
+				  u32 portsc)
+{
+	u32 pls;
+
+	if (!(xhci->quirks & XHCI_W1C_PORT_CHANGE_QUIRK))
+		return portsc;
+
+	/*
+	 * Stuck W1C bits prevent new Port Status Change Events after initial
+	 * attach, so keep port->connected and port->link_inactive synced here.
+	 */
+	pls = portsc & PORT_PLS_MASK;
+	if (!(portsc & PORT_RESET)) {
+		port->link_inactive = (pls == XDEV_INACTIVE);
+		port->connected = !!(portsc & PORT_CONNECT);
+	}
+
+	if (!(portsc & PORT_CONNECT) || pls == XDEV_RXDETECT ||
+	    pls == XDEV_DISABLED || pls == XDEV_INACTIVE) {
+		port->cleared_change_bits = 0;
+		return portsc;
+	}
+
+	return portsc & ~port->cleared_change_bits;
+}
+
 /*
  * Converts a raw xHCI port status into the format that external USB 2.0 or USB
  * 3.0 hubs use.
@@ -1138,12 +1168,15 @@ static u32 xhci_get_port_status(struct usb_hcd *hcd, struct xhci_bus_state *bus_
 	__acquires(&xhci->lock)
 {
 	u32 status = 0;
+	struct xhci_hcd *xhci = hcd_to_xhci(hcd);
 	struct xhci_hub *rhub;
 	struct xhci_port *port;
 
 	rhub = xhci_get_rhub(hcd);
 	port = rhub->ports[portnum];
 
+	portsc = xhci_w1c_filter_portsc(xhci, port, portsc);
+
 	/* common wPortChange bits */
 	if (portsc & PORT_CSC)
 		status |= USB_PORT_STAT_C_CONNECTION << 16;
@@ -1472,7 +1505,21 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
 			xhci_set_port_power(xhci, port, true, &flags);
 			break;
 		case USB_PORT_FEAT_RESET:
-			portsc |= PORT_RESET;
+			if (xhci->quirks & XHCI_W1C_PORT_CHANGE_QUIRK) {
+				port->cleared_change_bits &= ~PORT_RC;
+				/*
+				 * A733 SuperSpeed ports fail to re-enumerate
+				 * after a hot reset; issue a warm reset.
+				 */
+				if (hcd->speed >= HCD_USB3) {
+					port->cleared_change_bits &= ~PORT_WRC;
+					portsc |= PORT_WR;
+				} else {
+					portsc |= PORT_RESET;
+				}
+			} else {
+				portsc |= PORT_RESET;
+			}
 			xhci_portsc_writel(port, portsc);
 
 			portsc = xhci_portsc_readl(port);
@@ -1487,6 +1534,8 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
 				 hcd->self.busnum, portnum + 1, portsc);
 			break;
 		case USB_PORT_FEAT_BH_PORT_RESET:
+			if (xhci->quirks & XHCI_W1C_PORT_CHANGE_QUIRK)
+				port->cleared_change_bits &= ~PORT_WRC;
 			portsc |= PORT_WR;
 			xhci_portsc_writel(port, portsc);
 			portsc = xhci_portsc_readl(port);
@@ -1667,6 +1716,8 @@ int xhci_hub_status_data(struct usb_hcd *hcd, char *buf)
 		}
 		trace_xhci_hub_status_data(ports[i], temp);
 
+		temp = xhci_w1c_filter_portsc(xhci, ports[i], temp);
+
 		if ((temp & mask) != 0 ||
 			(bus_state->port_c_suspend & 1 << i) ||
 			(ports[i]->resume_timestamp && time_after_eq(
diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
index 6fd595f81a30..a3307135b3ac 100644
--- a/drivers/usb/host/xhci-plat.c
+++ b/drivers/usb/host/xhci-plat.c
@@ -277,6 +277,9 @@ int xhci_plat_probe(struct platform_device *pdev, struct device *sysdev, const s
 		if (device_property_read_bool(tmpdev, "xhci-skip-phy-init-quirk"))
 			xhci->quirks |= XHCI_SKIP_PHY_INIT;
 
+		if (device_property_read_bool(tmpdev, "xhci-w1c-port-change-quirk"))
+			xhci->quirks |= XHCI_W1C_PORT_CHANGE_QUIRK;
+
 		device_property_read_u32(tmpdev, "imod-interval-ns",
 					 &xhci->imod_interval);
 		device_property_read_u16(tmpdev, "num-hc-interrupters",
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index 86a615c6fd2b..70135907e4c0 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1491,6 +1491,7 @@ struct xhci_port {
 	int			slot_id;
 	struct completion	rexit_done;
 	struct completion	u3exit_done;
+	u32			cleared_change_bits;
 };
 
 struct xhci_hub {
@@ -1652,6 +1653,7 @@ struct xhci_hcd {
 #define XHCI_CDNS_SCTX_QUIRK	BIT_ULL(48)
 #define XHCI_ETRON_HOST	BIT_ULL(49)
 #define XHCI_LIMIT_ENDPOINT_INTERVAL_9 BIT_ULL(50)
+#define XHCI_W1C_PORT_CHANGE_QUIRK	BIT_ULL(51)
 
 	unsigned int		num_active_eps;
 	unsigned int		limit_active_eps;
-- 
2.53.0


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

* [PATCH 10/11] arm64: dts: allwinner: sun60i-a733: Add USB 3.0 controller and PHYs
  2026-11-27  7:32 [PATCH 00/11] arm64: dts: allwinner: Add Allwinner A733 USB 3.0 support Alastair D'Silva
                   ` (8 preceding siblings ...)
  2026-11-27  7:32 ` [PATCH 09/11] usb: host: xhci: Add W1C port change quirk for Allwinner A733 Alastair D'Silva
@ 2026-11-27  7:32 ` Alastair D'Silva
  2026-11-27  7:32 ` [PATCH 11/11] arm64: dts: allwinner: sun60i-a733-orangepi-4-pro: Enable USB 3.0 Alastair D'Silva
  2026-11-27  9:56 ` [PATCH 00/11] arm64: dts: allwinner: Add Allwinner A733 USB 3.0 support Andre Przywara
  11 siblings, 0 replies; 14+ messages in thread
From: Alastair D'Silva @ 2026-11-27  7:32 UTC (permalink / raw)
  To: Vinod Koul, Neil Armstrong, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
	Greg Kroah-Hartman, Stephen Boyd, Brian Masney, Jerome Brunet,
	Thinh Nguyen, Mathias Nyman
  Cc: linux-phy, devicetree, linux-arm-kernel, linux-sunxi, linux-usb,
	linux-clk, linux-kernel, Alastair D'Silva

Add dwc3, u2phy, and combophy0 nodes to sun60i-a733.dtsi.

Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
---
 .../arm64/boot/dts/allwinner/sun60i-a733.dtsi | 61 +++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun60i-a733.dtsi b/arch/arm64/boot/dts/allwinner/sun60i-a733.dtsi
index 8ac2fcd11937..6999adfc246c 100644
--- a/arch/arm64/boot/dts/allwinner/sun60i-a733.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun60i-a733.dtsi
@@ -4,6 +4,7 @@
 #include <dt-bindings/clock/allwinner,sun60i-a733-r-ccu.h>
 #include <dt-bindings/clock/sun6i-rtc.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/phy/phy.h>
 #include <dt-bindings/power/allwinner,sun60i-a733-pck-600.h>
 #include <dt-bindings/reset/allwinner,sun60i-a733-ccu.h>
 #include <dt-bindings/reset/allwinner,sun60i-a733-r-ccu.h>
@@ -547,12 +548,72 @@ mmc2: mmc@4022000 {
 			status = "disabled";
 		};
 
+		dwc3: usb@6a00000 {
+			compatible = "allwinner,sun60i-a733-dwc3";
+			reg = <0x06a00000 0x100000>;
+			interrupts = <GIC_SPI 155 IRQ_TYPE_LEVEL_HIGH 0>;
+			clocks = <&ccu CLK_BUS_USB2>,
+				 <&ccu CLK_USB2_MF>,
+				 <&ccu CLK_USB2_SUSPEND>,
+				 <&ccu CLK_AHB_USB_SYS>,
+				 <&ccu CLK_USB2_U3_UTMI>,
+				 <&ccu CLK_USB2_U2_PIPE>,
+				 <&ccu CLK_USB2_SYS>;
+			clock-names = "bus_early", "ref", "suspend",
+				      "ahb", "utmi", "pipe", "sys";
+			assigned-clocks = <&ccu CLK_USB2_SUSPEND>,
+					  <&ccu CLK_USB2_MF>;
+			assigned-clock-parents = <&ccu CLK_SYS_24M>,
+						 <&ccu CLK_SYS_24M>;
+			assigned-clock-rates = <24000000>, <24000000>;
+			resets = <&ccu RST_BUS_USB2>;
+			power-domains = <&pck600 PD_USB2>;
+			phys = <&u2phy>, <&combophy0 PHY_TYPE_USB3>;
+			phy-names = "usb2-phy", "usb3-phy";
+			maximum-speed = "super-speed-plus";
+			phy_type = "utmi";
+			snps,dis_enblslpm_quirk;
+			snps,dis-u1-entry-quirk;
+			snps,dis-u2-entry-quirk;
+			snps,dis_u2_susphy_quirk;
+			snps,dis_u3_susphy_quirk;
+			status = "disabled";
+		};
+
+		u2phy: phy@6b00000 {
+			compatible = "allwinner,sun60i-a733-u2phy";
+			reg = <0x06b00000 0x800>;
+			clocks = <&ccu CLK_BUS_OTG>, <&ccu CLK_AHB_USB_SYS>;
+			clock-names = "bus", "ahb";
+			resets = <&ccu RST_BUS_OTG>;
+			#phy-cells = <0>;
+			status = "disabled";
+		};
+
 		serdes_syscon: syscon@6c00000 {
 			compatible = "allwinner,sun60i-a733-serdes-syscon",
 				     "syscon";
 			reg = <0x06c00000 0x8000>;
 		};
 
+		combophy0: phy@6c80000 {
+			compatible = "allwinner,sun60i-a733-combophy0";
+			reg = <0x06c80000 0x20000>;
+			clocks = <&ccu CLK_SERDES_PHY>,
+				 <&ccu CLK_AHB_SERDES>,
+				 <&ccu CLK_MBUS_SERDES>,
+				 <&rtc CLK_HOSC_SERDES0>;
+			clock-names = "serdes", "ahb", "mbus", "ref";
+			assigned-clocks = <&ccu CLK_SERDES_PHY>;
+			assigned-clock-parents = <&ccu CLK_PLL_PERIPH0_600M>;
+			assigned-clock-rates = <100000000>;
+			resets = <&ccu RST_BUS_SERDES>;
+			power-domains = <&pck600 PD_PCIE>;
+			#phy-cells = <1>;
+			allwinner,serdes-syscon = <&serdes_syscon>;
+			status = "disabled";
+		};
+
 		r_ccu: clock-controller@7010000 {
 			compatible = "allwinner,sun60i-a733-r-ccu";
 			reg = <0x07010000 0x250>;
-- 
2.53.0


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

* [PATCH 11/11] arm64: dts: allwinner: sun60i-a733-orangepi-4-pro: Enable USB 3.0
  2026-11-27  7:32 [PATCH 00/11] arm64: dts: allwinner: Add Allwinner A733 USB 3.0 support Alastair D'Silva
                   ` (9 preceding siblings ...)
  2026-11-27  7:32 ` [PATCH 10/11] arm64: dts: allwinner: sun60i-a733: Add USB 3.0 controller and PHYs Alastair D'Silva
@ 2026-11-27  7:32 ` Alastair D'Silva
  2026-11-27  9:56 ` [PATCH 00/11] arm64: dts: allwinner: Add Allwinner A733 USB 3.0 support Andre Przywara
  11 siblings, 0 replies; 14+ messages in thread
From: Alastair D'Silva @ 2026-11-27  7:32 UTC (permalink / raw)
  To: Vinod Koul, Neil Armstrong, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
	Greg Kroah-Hartman, Stephen Boyd, Brian Masney, Jerome Brunet,
	Thinh Nguyen, Mathias Nyman
  Cc: linux-phy, devicetree, linux-arm-kernel, linux-sunxi, linux-usb,
	linux-clk, linux-kernel, Alastair D'Silva

Enable dwc3, u2phy, combophy0, and VBUS regulator on Orange Pi 4 Pro.

Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
---
 .../allwinner/sun60i-a733-orangepi-4-pro.dts  | 31 +++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun60i-a733-orangepi-4-pro.dts b/arch/arm64/boot/dts/allwinner/sun60i-a733-orangepi-4-pro.dts
index 374287d962a8..0e66e4761454 100644
--- a/arch/arm64/boot/dts/allwinner/sun60i-a733-orangepi-4-pro.dts
+++ b/arch/arm64/boot/dts/allwinner/sun60i-a733-orangepi-4-pro.dts
@@ -21,6 +21,33 @@ aliases {
 	chosen {
 		stdout-path = "serial0:115200n8";
 	};
+
+	reg_serdes1v8: regulator-serdes1v8 {
+		compatible = "regulator-fixed";
+		regulator-name = "serdes1v8";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		regulator-always-on;
+	};
+
+	reg_usb1_vbus: regulator-usb1-vbus {
+		compatible = "regulator-fixed";
+		regulator-name = "usb1-vbus";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		gpios = <&pio 1 7 GPIO_ACTIVE_LOW>; /* PB7 */
+	};
+};
+
+&combophy0 {
+	phy-supply = <&reg_serdes1v8>;
+	status = "okay";
+};
+
+&dwc3 {
+	vbus-supply = <&reg_usb1_vbus>;
+	dr_mode = "host";
+	status = "okay";
 };
 
 &hosc {
@@ -68,6 +95,10 @@ reg_dldo1: dldo1 {
 	};
 };
 
+&u2phy {
+	status = "okay";
+};
+
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_pb_pins>;
-- 
2.53.0


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

* Re: [PATCH 00/11] arm64: dts: allwinner: Add Allwinner A733 USB 3.0 support
  2026-11-27  7:32 [PATCH 00/11] arm64: dts: allwinner: Add Allwinner A733 USB 3.0 support Alastair D'Silva
                   ` (10 preceding siblings ...)
  2026-11-27  7:32 ` [PATCH 11/11] arm64: dts: allwinner: sun60i-a733-orangepi-4-pro: Enable USB 3.0 Alastair D'Silva
@ 2026-11-27  9:56 ` Andre Przywara
  2026-11-27 10:26   ` Alastair D'Silva
  11 siblings, 1 reply; 14+ messages in thread
From: Andre Przywara @ 2026-11-27  9:56 UTC (permalink / raw)
  To: Alastair D'Silva, Vinod Koul, Neil Armstrong, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Greg Kroah-Hartman, Stephen Boyd, Brian Masney,
	Jerome Brunet, Thinh Nguyen, Mathias Nyman
  Cc: linux-phy, devicetree, linux-arm-kernel, linux-sunxi, linux-usb,
	linux-clk, linux-kernel

Hi Alastair,

On 11/27/26 08:32, Alastair D'Silva wrote:
> This series adds USB 3.0 host support for the Allwinner A733 SoC and
> enables it on the Xunlong OrangePi 4 Pro.

I think you should step on the brake for a bit, sending out (AI 
generated?) patches like crazy is not going to make you friends with the 
maintainers and reviewers. At the moment we are trying to get the basic 
A733 DT merged (for v7.5), so anything non-essential has to wait. And 
the list of out-of-tree dependencies below already shows that this is a 
bit early.

So I'd say wait for v7.5-rc1, which is probably going to happen in early 
January, then you have a much saner base, and we have more time for 
reviewing more fancy features.

Oh, and also: please try to look beyond your particular board. It's not 
just the OrangePi 4A that is out there, we have other well documented 
boards as well. Peeking at their schematics should make it easy to add 
the respective USB nodes to their DT.
The OPi 4A is benefiting from work of other people as well, so it would 
be nice to do the same for other boards. It's fine if you can't test it 
there, just mention that and others can test. That has also the 
practical benefit of keeping the dependencies together.

Look at Jernej's H616 HDMI series[1], for instance, he just enables a 
bunch of boards in the final patch.

Cheers,
Andre

[1]
https://lore.kernel.org/linux-sunxi/20261126214433.3562326-1-jernej.skrabec@gmail.com/T/#m8df03e7de13c7152685c921605b000e0a7236bc5

> It adds the USB 2.0 UTMI PHY driver, USB 3.0 mode for ComboPHY0, USB2
> CCU gates, DWC3 glue support, an xHCI W1C port change quirk, and DT
> nodes.
> 
> Verified on the Xunlong OrangePi 4 Pro with a SuperSpeed (5000M) USB
> 3.0 flash drive.
> 
> Prerequisite series:
> - arm64: dts: allwinner: Add Xunlong OrangePi 4 Pro support (v2):
>    https://lore.kernel.org/r/20261127065343.1449675-1-alastair@d-silva.org
> - Add Allwinner A733 (sun60i) PCIe and Combo PHY support:
>    https://lore.kernel.org/r/20261125062948.1234677-1-alastair@d-silva.org
> - Allwinner A733 PCK-600 power domain fix and DT node (included in
>    prerequisite-patch-id below).
> 
> Alastair D'Silva (11):
>    dt-bindings: phy: allwinner,sun60i-a733-u2phy: Add Allwinner A733 USB 2.0 PHY
>    dt-bindings: phy: allwinner,sun60i-a733-combophy: Add combophy0 USB 3.0 support
>    dt-bindings: clock: sun60i-a733: Add USB2 bus and sys clock IDs
>    clk: sunxi-ng: sun60i-a733: Add USB2 bus and sys clocks
>    dt-bindings: usb: allwinner,sun60i-a733-dwc3: Add Allwinner A733 DWC3
>    phy: allwinner: Add Allwinner A733 USB 2.0 PHY driver
>    phy: allwinner: sun60i-combophy: Add USB 3.0 PHY mode support
>    usb: dwc3: Add Allwinner A733 DWC3 support
>    usb: host: xhci: Add W1C port change quirk for Allwinner A733
>    arm64: dts: allwinner: sun60i-a733: Add USB 3.0 controller and PHYs
>    arm64: dts: allwinner: sun60i-a733-orangepi-4-pro: Enable USB 3.0
> 
>   .../phy/allwinner,sun60i-a733-combophy.yaml        |   5 +
>   .../bindings/phy/allwinner,sun60i-a733-u2phy.yaml  |  58 +++
>   .../bindings/usb/allwinner,sun60i-a733-dwc3.yaml   | 103 ++++
>   .../dts/allwinner/sun60i-a733-orangepi-4-pro.dts   |  31 ++
>   arch/arm64/boot/dts/allwinner/sun60i-a733.dtsi     |  61 +++
>   drivers/clk/sunxi-ng/ccu-sun60i-a733.c             |  10 +-
>   drivers/phy/allwinner/Kconfig                      |  17 +-
>   drivers/phy/allwinner/Makefile                     |   1 +
>   drivers/phy/allwinner/phy-sun60i-combophy.c        | 573 ++++++++++++++++++++-
>   drivers/phy/allwinner/phy-sun60i-u2phy.c           | 233 +++++++++
>   drivers/usb/dwc3/core.c                            |  18 +-
>   drivers/usb/dwc3/core.h                            |   8 +
>   drivers/usb/dwc3/dwc3-generic-plat.c               |  15 +-
>   drivers/usb/dwc3/glue.h                            |   6 +
>   drivers/usb/dwc3/host.c                            |  10 +
>   drivers/usb/host/xhci-hub.c                        |  53 +-
>   drivers/usb/host/xhci-plat.c                       |   3 +
>   drivers/usb/host/xhci.h                            |   2 +
>   .../dt-bindings/clock/allwinner,sun60i-a733-ccu.h  |   2 +
>   19 files changed, 1177 insertions(+), 32 deletions(-)
> 
> base-commit: 9437046953b2fb3bf55b36582450ea0267df82a7
> prerequisite-patch-id: 19691099774bd3dc41f56585c03ddefb7bdc6f9c
> prerequisite-patch-id: 85db03df3394cdcb2780a0da122a74b2c1fe220d
> prerequisite-patch-id: a3e883da50bf03e8f522444def66fec7f996ffbe
> prerequisite-patch-id: c6889699a6dc13c336ce4cf4659e21b551e9a9fc
> prerequisite-patch-id: ef2f0344452092edb2221b93c44a3e82cb896a2d
> prerequisite-patch-id: c598480f753e36b7f6230129b864c559b9f185d5
> prerequisite-patch-id: f86b468a896a40f132adfcba885700327dff1bc5
> prerequisite-patch-id: 079d60101e1b9e5425458060314bde3e9cc2fe4c
> prerequisite-patch-id: 090c5ff78d4e2150804aa8d294581cd338b1e971
> prerequisite-patch-id: af0aebcae7c38d58354925119c412178b5821b5e
> prerequisite-patch-id: beb8a098ba14724e316ff243bdf8e00e729243c1
> prerequisite-patch-id: 63342c5ec38e8eb9e55c8c74d3c5a81a630d5f69
> prerequisite-patch-id: 1dc8d70f80674c98b2b15d09556dd27f643b20da
> prerequisite-patch-id: 4555860586ef50f27bf787a23f6ba693e9c3b0d6
> prerequisite-patch-id: 0279f281cd59cf54bceee39b0fa4d0b6a7b87c48
> prerequisite-patch-id: 14424bd8324b6cae2b8c4d6840df0db626d1385f
> prerequisite-patch-id: 7b42728bc8271e5dfd57fffec47a7f5745eff357
> prerequisite-patch-id: 74f5c7d066477024a374a789b3180e841398fb07
> prerequisite-patch-id: 309a5a3ca5b216915907263dea7024263abf1d1c
> prerequisite-patch-id: 55e543b9854c7ae2fa86969233d05ccadd3792e9
> prerequisite-patch-id: cfcad85224e288ec2168e7f245b4a1c63e9a34a7
> prerequisite-patch-id: 18dadb9c1e41141d015422b658b7dd0d153b7d69
> prerequisite-patch-id: 47a863f533ee9ae1589e25618f27a7282a0f8d37
> prerequisite-patch-id: 54181ce00a78f9f69031d3964f14bf800dd98e0f
> prerequisite-patch-id: 5a6d6dac4f6b42edf911fbca2078508e977bdce9
> prerequisite-patch-id: e919d9591e97e3b69fa86625a868583ee74d16db


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

* Re: [PATCH 00/11] arm64: dts: allwinner: Add Allwinner A733 USB 3.0 support
  2026-11-27  9:56 ` [PATCH 00/11] arm64: dts: allwinner: Add Allwinner A733 USB 3.0 support Andre Przywara
@ 2026-11-27 10:26   ` Alastair D'Silva
  0 siblings, 0 replies; 14+ messages in thread
From: Alastair D'Silva @ 2026-11-27 10:26 UTC (permalink / raw)
  To: Andre Przywara, Vinod Koul, Neil Armstrong, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Greg Kroah-Hartman, Stephen Boyd, Brian Masney,
	Jerome Brunet, Thinh Nguyen, Mathias Nyman
  Cc: linux-phy, devicetree, linux-arm-kernel, linux-sunxi, linux-usb,
	linux-clk, linux-kernel


On Fri, 2026-11-27 at 09:56 +0000, Andre Przywara wrote:
> Hi Alastair,
> 
> On 11/27/26 08:32, Alastair D'Silva wrote:
> > This series adds USB 3.0 host support for the Allwinner A733 SoC and
> > enables it on the Xunlong OrangePi 4 Pro.
> 
> I think you should step on the brake for a bit, sending out (AI 
> generated?) patches like crazy is not going to make you friends with the 
> maintainers and reviewers. At the moment we are trying to get the basic 
> A733 DT merged (for v7.5), so anything non-essential has to wait. And 
> the list of out-of-tree dependencies below already shows that this is a 
> bit early.
> 

Ack. It is AI generated, but reviewed, restructured & tested by myself over
the past few months.

It's been sitting around on my drive for a while (I was expecting to enable
U-boot first, and that got tied up with reverse engineering the PMU,
but it seems I got things backwards).

> So I'd say wait for v7.5-rc1, which is probably going to happen in early 
> January, then you have a much saner base, and we have more time for 
> reviewing more fancy features.
> 
> Oh, and also: please try to look beyond your particular board. It's not 
> just the OrangePi 4A that is out there, we have other well documented 
> boards as well. Peeking at their schematics should make it easy to add 
> the respective USB nodes to their DT.
> The OPi 4A is benefiting from work of other people as well, so it would 
> be nice to do the same for other boards. It's fine if you can't test it 
> there, just mention that and others can test. That has also the 
> practical benefit of keeping the dependencies together.

Sure, I was not comfortable with pushing out untested code, but if we can
offload testing to others, I can do that.



Cheers,

-- 
Alastair D'Silva

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

end of thread, other threads:[~2026-11-27 10:27 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-27  7:32 [PATCH 00/11] arm64: dts: allwinner: Add Allwinner A733 USB 3.0 support Alastair D'Silva
2026-11-27  7:32 ` [PATCH 01/11] dt-bindings: phy: allwinner,sun60i-a733-u2phy: Add Allwinner A733 USB 2.0 PHY Alastair D'Silva
2026-11-27  7:32 ` [PATCH 02/11] dt-bindings: phy: allwinner,sun60i-a733-combophy: Add combophy0 USB 3.0 support Alastair D'Silva
2026-11-27  7:32 ` [PATCH 03/11] dt-bindings: clock: sun60i-a733: Add USB2 bus and sys clock IDs Alastair D'Silva
2026-11-27  7:32 ` [PATCH 04/11] clk: sunxi-ng: sun60i-a733: Add USB2 bus and sys clocks Alastair D'Silva
2026-11-27  7:32 ` [PATCH 05/11] dt-bindings: usb: allwinner,sun60i-a733-dwc3: Add Allwinner A733 DWC3 Alastair D'Silva
2026-11-27  7:32 ` [PATCH 06/11] phy: allwinner: Add Allwinner A733 USB 2.0 PHY driver Alastair D'Silva
2026-11-27  7:32 ` [PATCH 07/11] phy: allwinner: sun60i-combophy: Add USB 3.0 PHY mode support Alastair D'Silva
2026-11-27  7:32 ` [PATCH 08/11] usb: dwc3: Add Allwinner A733 DWC3 support Alastair D'Silva
2026-11-27  7:32 ` [PATCH 09/11] usb: host: xhci: Add W1C port change quirk for Allwinner A733 Alastair D'Silva
2026-11-27  7:32 ` [PATCH 10/11] arm64: dts: allwinner: sun60i-a733: Add USB 3.0 controller and PHYs Alastair D'Silva
2026-11-27  7:32 ` [PATCH 11/11] arm64: dts: allwinner: sun60i-a733-orangepi-4-pro: Enable USB 3.0 Alastair D'Silva
2026-11-27  9:56 ` [PATCH 00/11] arm64: dts: allwinner: Add Allwinner A733 USB 3.0 support Andre Przywara
2026-11-27 10:26   ` Alastair D'Silva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®