linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 0/5] enable usb support on rk356x
@ 2022-04-08 15:12 Peter Geis
  2022-04-08 15:12 ` [PATCH v5 1/5] dt-bindings: soc: grf: add rk3566-pipe-grf compatible Peter Geis
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Peter Geis @ 2022-04-08 15:12 UTC (permalink / raw)
  Cc: linux-rockchip, heiko, Peter Geis, Rob Herring,
	Krzysztof Kozlowski, Felipe Balbi, devicetree, linux-arm-kernel,
	linux-kernel, linux-usb

Good Morning,

This is my patch series that I have maintained out of tree until the
combophy driver landed.

This has been rebased on v5.18-rc1, several patches in the previous
series already landed and have been dropped.

Patch 1 adds the dt bindings for the grf changes necessary.
Patch 2 adds support to the grf driver to set the rk3566 otg clock
source.
Patch 3 adds the dwc3 nodes to the rk356x device tree includes.
Patch 4 enables the dwc3 nodes on the Quartz64 Model A.
Patch 5 enables the dwc3 nodes on the rk3568-evb.

Please review and apply.

Very Respectfully,
Peter Geis

Changelog:
v5:
- Rebase on v5.18-rc1
- Drop patches already merged
- Collect acks and tested-by

v4:
- Add SoC specific binding, fall back to core.
 
v3:
- Drop the dwc-of-simple method in favor of using dwc core.
- Drop all quirks except snps,dis_u2_susphy_quirk, which is necessary to
  prevent device detection failures in some states.
- Drop the reset-names.

v2:
- Add a dt-bindings fix for grf.yaml
- Unify the reset names.
- Constrain the force usb2 clock dwc3 patch to only supported variants of
the ip.
- Change dwc3-of-simple to support of-match-data.
- Drop the PCLK-PIPE clk.
- Rename the usb nodes to be more friendly.
- Add the rk3568-evb enable patch.

Michael Riesch (1):
  arm64: dts: rockchip: add usb3 support to rk3568-evb1-v10

Peter Geis (4):
  dt-bindings: soc: grf: add rk3566-pipe-grf compatible
  soc: rockchip: set dwc3 clock for rk3566
  arm64: dts: rockchip: add rk356x dwc3 usb3 nodes
  arm64: dts: rockchip: enable dwc3 on quartz64-a

 .../devicetree/bindings/soc/rockchip/grf.yaml |  1 +
 .../boot/dts/rockchip/rk3566-quartz64-a.dts   | 37 +++++++++++++++
 arch/arm64/boot/dts/rockchip/rk3566.dtsi      | 11 +++++
 .../boot/dts/rockchip/rk3568-evb1-v10.dts     | 46 +++++++++++++++++++
 arch/arm64/boot/dts/rockchip/rk3568.dtsi      |  9 ++++
 arch/arm64/boot/dts/rockchip/rk356x.dtsi      | 35 +++++++++++++-
 drivers/soc/rockchip/grf.c                    | 17 +++++++
 7 files changed, 155 insertions(+), 1 deletion(-)

-- 
2.25.1


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

* [PATCH v5 1/5] dt-bindings: soc: grf: add rk3566-pipe-grf compatible
  2022-04-08 15:12 [PATCH v5 0/5] enable usb support on rk356x Peter Geis
@ 2022-04-08 15:12 ` Peter Geis
  2022-04-08 15:12 ` [PATCH v5 2/5] soc: rockchip: set dwc3 clock for rk3566 Peter Geis
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Peter Geis @ 2022-04-08 15:12 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Heiko Stuebner
  Cc: linux-rockchip, Peter Geis, Rob Herring, devicetree,
	linux-arm-kernel, linux-kernel

The rk3566 requires special handling for the dwc3-otg clock in order for
the port to function correctly.
Add a binding for the rk3566-pipe-grf so we can handle setup with the
grf driver.

Signed-off-by: Peter Geis <pgwipeout@gmail.com>
Acked-by: Rob Herring <robh@kernel.org>
---
 Documentation/devicetree/bindings/soc/rockchip/grf.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/soc/rockchip/grf.yaml b/Documentation/devicetree/bindings/soc/rockchip/grf.yaml
index b2ba7bed89b2..3be3cfd52f7b 100644
--- a/Documentation/devicetree/bindings/soc/rockchip/grf.yaml
+++ b/Documentation/devicetree/bindings/soc/rockchip/grf.yaml
@@ -15,6 +15,7 @@ properties:
       - items:
           - enum:
               - rockchip,rk3288-sgrf
+              - rockchip,rk3566-pipe-grf
               - rockchip,rk3568-usb2phy-grf
               - rockchip,rv1108-usbgrf
           - const: syscon
-- 
2.25.1


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

* [PATCH v5 2/5] soc: rockchip: set dwc3 clock for rk3566
  2022-04-08 15:12 [PATCH v5 0/5] enable usb support on rk356x Peter Geis
  2022-04-08 15:12 ` [PATCH v5 1/5] dt-bindings: soc: grf: add rk3566-pipe-grf compatible Peter Geis
@ 2022-04-08 15:12 ` Peter Geis
  2022-04-08 15:12 ` [PATCH v5 3/5] arm64: dts: rockchip: add rk356x dwc3 usb3 nodes Peter Geis
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Peter Geis @ 2022-04-08 15:12 UTC (permalink / raw)
  To: Heiko Stuebner; +Cc: linux-rockchip, Peter Geis, linux-arm-kernel, linux-kernel

The rk3566 dwc3 otg port clock is unavailable at boot, as it defaults to
the combophy as the clock source. As combophy0 doesn't exist on rk3566,
we need to set the clock source to the usb2 phy instead.

Add handling to the grf driver to handle this on boot.

Signed-off-by: Peter Geis <pgwipeout@gmail.com>
---
 drivers/soc/rockchip/grf.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/drivers/soc/rockchip/grf.c b/drivers/soc/rockchip/grf.c
index 494cf2b5bf7b..384461b70684 100644
--- a/drivers/soc/rockchip/grf.c
+++ b/drivers/soc/rockchip/grf.c
@@ -108,6 +108,20 @@ static const struct rockchip_grf_info rk3399_grf __initconst = {
 	.num_values = ARRAY_SIZE(rk3399_defaults),
 };
 
+#define RK3566_GRF_USB3OTG0_CON1	0x0104
+
+static const struct rockchip_grf_value rk3566_defaults[] __initconst = {
+	{ "usb3otg port switch", RK3566_GRF_USB3OTG0_CON1, HIWORD_UPDATE(0, 1, 12) },
+	{ "usb3otg clock switch", RK3566_GRF_USB3OTG0_CON1, HIWORD_UPDATE(1, 1, 7) },
+	{ "usb3otg disable usb3", RK3566_GRF_USB3OTG0_CON1, HIWORD_UPDATE(1, 1, 0) },
+};
+
+static const struct rockchip_grf_info rk3566_pipegrf __initconst = {
+	.values = rk3566_defaults,
+	.num_values = ARRAY_SIZE(rk3566_defaults),
+};
+
+
 static const struct of_device_id rockchip_grf_dt_match[] __initconst = {
 	{
 		.compatible = "rockchip,rk3036-grf",
@@ -130,6 +144,9 @@ static const struct of_device_id rockchip_grf_dt_match[] __initconst = {
 	}, {
 		.compatible = "rockchip,rk3399-grf",
 		.data = (void *)&rk3399_grf,
+	}, {
+		.compatible = "rockchip,rk3566-pipe-grf",
+		.data = (void *)&rk3566_pipegrf,
 	},
 	{ /* sentinel */ },
 };
-- 
2.25.1


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

* [PATCH v5 3/5] arm64: dts: rockchip: add rk356x dwc3 usb3 nodes
  2022-04-08 15:12 [PATCH v5 0/5] enable usb support on rk356x Peter Geis
  2022-04-08 15:12 ` [PATCH v5 1/5] dt-bindings: soc: grf: add rk3566-pipe-grf compatible Peter Geis
  2022-04-08 15:12 ` [PATCH v5 2/5] soc: rockchip: set dwc3 clock for rk3566 Peter Geis
@ 2022-04-08 15:12 ` Peter Geis
  2022-04-08 16:14   ` Aw: " Frank Wunderlich
  2022-04-08 15:12 ` [PATCH v5 4/5] arm64: dts: rockchip: enable dwc3 on quartz64-a Peter Geis
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 12+ messages in thread
From: Peter Geis @ 2022-04-08 15:12 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Heiko Stuebner
  Cc: linux-rockchip, Peter Geis, Frank Wunderlich, devicetree,
	linux-arm-kernel, linux-kernel

Add the dwc3 device nodes to the rk356x device trees.
The rk3566 has one usb2 capable dwc3 otg controller and one usb3 capable
dwc3 host controller.
The rk3568 has one usb3 capable dwc3 otg controller and one usb3 capable
dwc3 host controller.

Signed-off-by: Peter Geis <pgwipeout@gmail.com>
Tested-by: Frank Wunderlich <frank-w@public-files.de>
---
 arch/arm64/boot/dts/rockchip/rk3566.dtsi | 11 ++++++++
 arch/arm64/boot/dts/rockchip/rk3568.dtsi |  9 ++++++
 arch/arm64/boot/dts/rockchip/rk356x.dtsi | 35 +++++++++++++++++++++++-
 3 files changed, 54 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3566.dtsi b/arch/arm64/boot/dts/rockchip/rk3566.dtsi
index 3839eef5e4f7..0b957068ff89 100644
--- a/arch/arm64/boot/dts/rockchip/rk3566.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3566.dtsi
@@ -6,6 +6,10 @@ / {
 	compatible = "rockchip,rk3566";
 };
 
+&pipegrf {
+	compatible = "rockchip,rk3566-pipe-grf", "syscon";
+};
+
 &power {
 	power-domain@RK3568_PD_PIPE {
 		reg = <RK3568_PD_PIPE>;
@@ -18,3 +22,10 @@ power-domain@RK3568_PD_PIPE {
 		#power-domain-cells = <0>;
 	};
 };
+
+&usb_host0_xhci {
+	phys = <&usb2phy0_otg>;
+	phy-names = "usb2-phy";
+	extcon = <&usb2phy0>;
+	maximum-speed = "high-speed";
+};
diff --git a/arch/arm64/boot/dts/rockchip/rk3568.dtsi b/arch/arm64/boot/dts/rockchip/rk3568.dtsi
index 5b0f528d6818..8ba9334f9753 100644
--- a/arch/arm64/boot/dts/rockchip/rk3568.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3568.dtsi
@@ -99,6 +99,10 @@ opp-1992000000 {
 	};
 };
 
+&pipegrf {
+	compatible = "rockchip,rk3568-pipe-grf", "syscon";
+};
+
 &power {
 	power-domain@RK3568_PD_PIPE {
 		reg = <RK3568_PD_PIPE>;
@@ -114,3 +118,8 @@ power-domain@RK3568_PD_PIPE {
 		#power-domain-cells = <0>;
 	};
 };
+
+&usb_host0_xhci {
+	phys = <&usb2phy0_otg>, <&combphy0 PHY_TYPE_USB3>;
+	phy-names = "usb2-phy", "usb3-phy";
+};
diff --git a/arch/arm64/boot/dts/rockchip/rk356x.dtsi b/arch/arm64/boot/dts/rockchip/rk356x.dtsi
index 7cdef800cb3c..ca20d7b91fe5 100644
--- a/arch/arm64/boot/dts/rockchip/rk356x.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk356x.dtsi
@@ -230,6 +230,40 @@ scmi_shmem: sram@0 {
 		};
 	};
 
+	usb_host0_xhci: usb@fcc00000 {
+		compatible = "rockchip,rk3568-dwc3", "snps,dwc3";
+		reg = <0x0 0xfcc00000 0x0 0x400000>;
+		interrupts = <GIC_SPI 169 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&cru CLK_USB3OTG0_REF>, <&cru CLK_USB3OTG0_SUSPEND>,
+			 <&cru ACLK_USB3OTG0>;
+		clock-names = "ref_clk", "suspend_clk",
+			      "bus_clk";
+		dr_mode = "host";
+		phy_type = "utmi_wide";
+		power-domains = <&power RK3568_PD_PIPE>;
+		resets = <&cru SRST_USB3OTG0>;
+		snps,dis_u2_susphy_quirk;
+		status = "disabled";
+	};
+
+	usb_host1_xhci: usb@fd000000 {
+		compatible = "rockchip,rk3568-dwc3", "snps,dwc3";
+		reg = <0x0 0xfd000000 0x0 0x400000>;
+		interrupts = <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&cru CLK_USB3OTG1_REF>, <&cru CLK_USB3OTG1_SUSPEND>,
+			 <&cru ACLK_USB3OTG1>;
+		clock-names = "ref_clk", "suspend_clk",
+			      "bus_clk";
+		dr_mode = "host";
+		phys = <&usb2phy0_host>, <&combphy1 PHY_TYPE_USB3>;
+		phy-names = "usb2-phy", "usb3-phy";
+		phy_type = "utmi_wide";
+		power-domains = <&power RK3568_PD_PIPE>;
+		resets = <&cru SRST_USB3OTG1>;
+		snps,dis_u2_susphy_quirk;
+		status = "disabled";
+	};
+
 	gic: interrupt-controller@fd400000 {
 		compatible = "arm,gic-v3";
 		reg = <0x0 0xfd400000 0 0x10000>, /* GICD */
@@ -297,7 +331,6 @@ pmu_io_domains: io-domains {
 	};
 
 	pipegrf: syscon@fdc50000 {
-		compatible = "rockchip,rk3568-pipe-grf", "syscon";
 		reg = <0x0 0xfdc50000 0x0 0x1000>;
 	};
 
-- 
2.25.1


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

* [PATCH v5 4/5] arm64: dts: rockchip: enable dwc3 on quartz64-a
  2022-04-08 15:12 [PATCH v5 0/5] enable usb support on rk356x Peter Geis
                   ` (2 preceding siblings ...)
  2022-04-08 15:12 ` [PATCH v5 3/5] arm64: dts: rockchip: add rk356x dwc3 usb3 nodes Peter Geis
@ 2022-04-08 15:12 ` Peter Geis
  2022-04-08 15:12 ` [PATCH v5 5/5] arm64: dts: rockchip: add usb3 support to rk3568-evb1-v10 Peter Geis
  2022-04-10 17:12 ` [PATCH v5 0/5] enable usb support on rk356x Heiko Stuebner
  5 siblings, 0 replies; 12+ messages in thread
From: Peter Geis @ 2022-04-08 15:12 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Heiko Stuebner
  Cc: linux-rockchip, Peter Geis, devicetree, linux-arm-kernel, linux-kernel

The quartz64 model a has support for both the dwc3 otg port and the dwc3
host port. Add the otg power supply and dwc3 nodes to the device tree to
enable support for these.

Signed-off-by: Peter Geis <pgwipeout@gmail.com>
---
 .../boot/dts/rockchip/rk3566-quartz64-a.dts   | 37 +++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3566-quartz64-a.dts b/arch/arm64/boot/dts/rockchip/rk3566-quartz64-a.dts
index dd7f4b9b686b..141a433429b5 100644
--- a/arch/arm64/boot/dts/rockchip/rk3566-quartz64-a.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3566-quartz64-a.dts
@@ -151,6 +151,16 @@ vcc5v0_usb20_host: vcc5v0_usb20_host {
 		vin-supply = <&vcc5v0_usb>;
 	};
 
+	vcc5v0_usb20_otg: vcc5v0_usb20_otg {
+		compatible = "regulator-fixed";
+		enable-active-high;
+		gpio = <&gpio4 RK_PB5 GPIO_ACTIVE_HIGH>;
+		regulator-name = "vcc5v0_usb20_otg";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		vin-supply = <&dcdc_boost>;
+	};
+
 	vcc3v3_sd: vcc3v3_sd {
 		compatible = "regulator-fixed";
 		enable-active-low;
@@ -187,6 +197,10 @@ vcc_wl: vcc_wl {
 	};
 };
 
+&combphy1 {
+	status = "okay";
+};
+
 &cpu0 {
 	cpu-supply = <&vdd_cpu>;
 };
@@ -672,6 +686,29 @@ &usb_host1_ohci {
 	status = "okay";
 };
 
+&usb_host0_xhci {
+	status = "okay";
+};
+
+/* usb3 controller is muxed with sata1 */
+&usb_host1_xhci {
+	status = "okay";
+};
+
+&usb2phy0 {
+	status = "okay";
+};
+
+&usb2phy0_host {
+	phy-supply = <&vcc5v0_usb20_host>;
+	status = "okay";
+};
+
+&usb2phy0_otg {
+	phy-supply = <&vcc5v0_usb20_otg>;
+	status = "okay";
+};
+
 &usb2phy1 {
 	status = "okay";
 };
-- 
2.25.1


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

* [PATCH v5 5/5] arm64: dts: rockchip: add usb3 support to rk3568-evb1-v10
  2022-04-08 15:12 [PATCH v5 0/5] enable usb support on rk356x Peter Geis
                   ` (3 preceding siblings ...)
  2022-04-08 15:12 ` [PATCH v5 4/5] arm64: dts: rockchip: enable dwc3 on quartz64-a Peter Geis
@ 2022-04-08 15:12 ` Peter Geis
  2022-04-10 17:12 ` [PATCH v5 0/5] enable usb support on rk356x Heiko Stuebner
  5 siblings, 0 replies; 12+ messages in thread
From: Peter Geis @ 2022-04-08 15:12 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Heiko Stuebner
  Cc: linux-rockchip, Michael Riesch, Sascha Hauer, devicetree,
	linux-arm-kernel, linux-kernel

From: Michael Riesch <michael.riesch@wolfvision.net>

The Rockchip RK3568 EVB1 features one USB 3.0 device-only
(USB 2.0 OTG) port and one USB 3.0 host-only port.
Activate the USB 3.0 controller nodes and phy nodes in the
device tree.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net>
---
 .../boot/dts/rockchip/rk3568-evb1-v10.dts     | 46 +++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3568-evb1-v10.dts b/arch/arm64/boot/dts/rockchip/rk3568-evb1-v10.dts
index a794a0ea5c70..622be8be9813 100644
--- a/arch/arm64/boot/dts/rockchip/rk3568-evb1-v10.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3568-evb1-v10.dts
@@ -103,6 +103,18 @@ vcc5v0_usb_host: vcc5v0-usb-host {
 		vin-supply = <&vcc5v0_usb>;
 	};
 
+	vcc5v0_usb_otg: vcc5v0-usb-otg {
+		compatible = "regulator-fixed";
+		enable-active-high;
+		gpio = <&gpio0 RK_PA5 GPIO_ACTIVE_HIGH>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&vcc5v0_usb_otg_en>;
+		regulator-name = "vcc5v0_usb_otg";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		vin-supply = <&vcc5v0_usb>;
+	};
+
 	vcc3v3_lcd0_n: vcc3v3-lcd0-n {
 		compatible = "regulator-fixed";
 		regulator-name = "vcc3v3_lcd0_n";
@@ -136,6 +148,14 @@ regulator-state-mem {
 	};
 };
 
+&combphy0 {
+	status = "okay";
+};
+
+&combphy1 {
+	status = "okay";
+};
+
 &cpu0 {
 	cpu-supply = <&vdd_cpu>;
 };
@@ -507,6 +527,9 @@ usb {
 		vcc5v0_usb_host_en: vcc5v0_usb_host_en {
 			rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>;
 		};
+		vcc5v0_usb_otg_en: vcc5v0_usb_otg_en {
+			rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
 	};
 };
 
@@ -568,6 +591,11 @@ &usb_host0_ohci {
 	status = "okay";
 };
 
+&usb_host0_xhci {
+	extcon = <&usb2phy0>;
+	status = "okay";
+};
+
 &usb_host1_ehci {
 	status = "okay";
 };
@@ -576,6 +604,24 @@ &usb_host1_ohci {
 	status = "okay";
 };
 
+&usb_host1_xhci {
+	status = "okay";
+};
+
+&usb2phy0 {
+	status = "okay";
+};
+
+&usb2phy0_host {
+	phy-supply = <&vcc5v0_usb_host>;
+	status = "okay";
+};
+
+&usb2phy0_otg {
+	vbus-supply = <&vcc5v0_usb_otg>;
+	status = "okay";
+};
+
 &usb2phy1 {
 	status = "okay";
 };
-- 
2.25.1


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

* Aw: [PATCH v5 3/5] arm64: dts: rockchip: add rk356x dwc3 usb3 nodes
  2022-04-08 15:12 ` [PATCH v5 3/5] arm64: dts: rockchip: add rk356x dwc3 usb3 nodes Peter Geis
@ 2022-04-08 16:14   ` Frank Wunderlich
  2022-04-08 23:39     ` Peter Geis
  0 siblings, 1 reply; 12+ messages in thread
From: Frank Wunderlich @ 2022-04-08 16:14 UTC (permalink / raw)
  To: Peter Geis
  Cc: Rob Herring, Krzysztof Kozlowski, Heiko Stuebner, linux-rockchip,
	Peter Geis, devicetree, linux-arm-kernel, linux-kernel

Hi

seems like usb (2+3) is broken in 5.18-rc1

i see controllers, ports are powered, but no device detection.

maybe anyone else have same behaviour with different board?

regards Frank

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

* Re: [PATCH v5 3/5] arm64: dts: rockchip: add rk356x dwc3 usb3 nodes
  2022-04-08 16:14   ` Aw: " Frank Wunderlich
@ 2022-04-08 23:39     ` Peter Geis
  2022-04-09  7:23       ` Aw: " Frank Wunderlich
  0 siblings, 1 reply; 12+ messages in thread
From: Peter Geis @ 2022-04-08 23:39 UTC (permalink / raw)
  To: Frank Wunderlich
  Cc: Rob Herring, Krzysztof Kozlowski, Heiko Stuebner,
	open list:ARM/Rockchip SoC...,
	devicetree, arm-mail-list, Linux Kernel Mailing List

On Fri, Apr 8, 2022 at 12:14 PM Frank Wunderlich
<frank-w@public-files.de> wrote:
>
> Hi

Good Evening,

>
> seems like usb (2+3) is broken in 5.18-rc1
>
> i see controllers, ports are powered, but no device detection.
>
> maybe anyone else have same behaviour with different board?

Yes, it seems you are correct, there has been a regression with xhci
between v5.17 and v5.18.
I'm bisecting now.

>
> regards Frank

Thanks for reporting it!
Very Respectfully,
Peter Geis

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

* Aw: Re: [PATCH v5 3/5] arm64: dts: rockchip: add rk356x dwc3 usb3 nodes
  2022-04-08 23:39     ` Peter Geis
@ 2022-04-09  7:23       ` Frank Wunderlich
  2022-04-09  7:37         ` Frank Wunderlich
  0 siblings, 1 reply; 12+ messages in thread
From: Frank Wunderlich @ 2022-04-09  7:23 UTC (permalink / raw)
  To: Peter Geis
  Cc: Rob Herring, Krzysztof Kozlowski, Heiko Stuebner,
	open list:ARM/Rockchip SoC...,
	devicetree, arm-mail-list, Linux Kernel Mailing List

Tested on mediatek board (mt7623/bpi-r2) and there xhci is working.
So it is no problem in core/protocol and specific to rockchip xhci driver.

at least i nailed it down to these 2 commits in drivers/usb/dwc3/core.c, without them it works

5114c3ee2487 2022-01-27 usb: dwc3: Calculate REFCLKPER based on reference clock
33fb697ec7e5 2022-01-27 usb: dwc3: Get clocks individually

regards Frank


> Gesendet: Samstag, 09. April 2022 um 01:39 Uhr
> Von: "Peter Geis" <pgwipeout@gmail.com>

> On Fri, Apr 8, 2022 at 12:14 PM Frank Wunderlich
> <frank-w@public-files.de> wrote:

> > seems like usb (2+3) is broken in 5.18-rc1
> >
> > i see controllers, ports are powered, but no device detection.
> >
> > maybe anyone else have same behaviour with different board?
>
> Yes, it seems you are correct, there has been a regression with xhci
> between v5.17 and v5.18.
> I'm bisecting now.


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

* Aw: Re: [PATCH v5 3/5] arm64: dts: rockchip: add rk356x dwc3 usb3 nodes
  2022-04-09  7:23       ` Aw: " Frank Wunderlich
@ 2022-04-09  7:37         ` Frank Wunderlich
  2022-04-09 15:32           ` Peter Geis
  0 siblings, 1 reply; 12+ messages in thread
From: Frank Wunderlich @ 2022-04-09  7:37 UTC (permalink / raw)
  To: Frank Wunderlich
  Cc: Peter Geis, Rob Herring, Krzysztof Kozlowski, Heiko Stuebner,
	open list:ARM/Rockchip SoC...,
	devicetree, arm-mail-list, Linux Kernel Mailing List

Got it,
these Patches require different clock names

ref_clk => ref
bus_clk => bus_early

after renaming usb works on my board

will send an follow-up patch for this series

regards Frank


> Gesendet: Samstag, 09. April 2022 um 09:23 Uhr
> Von: "Frank Wunderlich" <frank-w@public-files.de>
>
> at least i nailed it down to these 2 commits in drivers/usb/dwc3/core.c, without them it works
>
> 5114c3ee2487 2022-01-27 usb: dwc3: Calculate REFCLKPER based on reference clock
> 33fb697ec7e5 2022-01-27 usb: dwc3: Get clocks individually


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

* Re: Re: [PATCH v5 3/5] arm64: dts: rockchip: add rk356x dwc3 usb3 nodes
  2022-04-09  7:37         ` Frank Wunderlich
@ 2022-04-09 15:32           ` Peter Geis
  0 siblings, 0 replies; 12+ messages in thread
From: Peter Geis @ 2022-04-09 15:32 UTC (permalink / raw)
  To: Frank Wunderlich
  Cc: Rob Herring, Krzysztof Kozlowski, Heiko Stuebner,
	open list:ARM/Rockchip SoC...,
	devicetree, arm-mail-list, Linux Kernel Mailing List

On Sat, Apr 9, 2022 at 3:37 AM Frank Wunderlich <frank-w@public-files.de> wrote:
>
> Got it,
> these Patches require different clock names
>
> ref_clk => ref
> bus_clk => bus_early
>
> after renaming usb works on my board
>
> will send an follow-up patch for this series
>
> regards Frank
>
>
> > Gesendet: Samstag, 09. April 2022 um 09:23 Uhr
> > Von: "Frank Wunderlich" <frank-w@public-files.de>
> >
> > at least i nailed it down to these 2 commits in drivers/usb/dwc3/core.c, without them it works
> >
> > 5114c3ee2487 2022-01-27 usb: dwc3: Calculate REFCLKPER based on reference clock
> > 33fb697ec7e5 2022-01-27 usb: dwc3: Get clocks individually
>

I've submitted a fix for the dwc3 issue.
https://patchwork.kernel.org/project/linux-rockchip/patch/20220409152116.3834354-1-pgwipeout@gmail.com/
The offending commit was: 33fb697ec7e5 ("usb: dwc3: Get clocks individually").
It breaks backwards compatibility with rk3328, which follows the
rockchip,dwc3.yaml dt-binding, and thus this series as well.

This fix is standalone and necessary no matter which route we decide
to go with this series (and the rk3328/rk3399 support as well).
With this patch, dwc3 is functional on the rk356x as the series was
submitted, so if we decide to fix everything all at once, that is a
viable option.

For those not following the other conversation, here is the TLDR:
- rockchip,dwc3.yaml has different clock names than snps,dwc3.yaml
- rk3328 and rk356x attach directly to the dwc3 core driver
- rk3399 uses the dwc3-simple driver, which still uses the clk_bulk api.
- commit 33fb697ec7e5 changed to individual clocks, which follow
snps,dwc3.yaml naming
- to correct this beyond my fix patch, we would need to align
rockchip,dwc3.yaml with snps,dwc3.yaml, which means rk3328, rk3399,
and rk356x will move to the snps clock naming scheme.

I think we need Rob Herring to weigh in here, as this is a rather
uncomfortable dt-binding issue.

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

* Re: [PATCH v5 0/5] enable usb support on rk356x
  2022-04-08 15:12 [PATCH v5 0/5] enable usb support on rk356x Peter Geis
                   ` (4 preceding siblings ...)
  2022-04-08 15:12 ` [PATCH v5 5/5] arm64: dts: rockchip: add usb3 support to rk3568-evb1-v10 Peter Geis
@ 2022-04-10 17:12 ` Heiko Stuebner
  5 siblings, 0 replies; 12+ messages in thread
From: Heiko Stuebner @ 2022-04-10 17:12 UTC (permalink / raw)
  To: Peter Geis
  Cc: Heiko Stuebner, linux-arm-kernel, Felipe Balbi, devicetree,
	linux-rockchip, linux-usb, Rob Herring, Krzysztof Kozlowski,
	linux-kernel

On Fri, 8 Apr 2022 11:12:32 -0400, Peter Geis wrote:
> Good Morning,
> 
> This is my patch series that I have maintained out of tree until the
> combophy driver landed.
> 
> This has been rebased on v5.18-rc1, several patches in the previous
> series already landed and have been dropped.
> 
> [...]

Applied, thanks!

[1/5] dt-bindings: soc: grf: add rk3566-pipe-grf compatible
      commit: 2a872dd86eeb349f169df0a204668afa578a94b2
[2/5] soc: rockchip: set dwc3 clock for rk3566
      commit: 5c0bb71138770d85ea840acd379edc6471b867ee
[3/5] arm64: dts: rockchip: add rk356x dwc3 usb3 nodes
      commit: 9f4c480f24e2ce1d464ff9d5f8a249a485acdc7f
[4/5] arm64: dts: rockchip: enable dwc3 on quartz64-a
      commit: e432309ff8bf2a148bbdd4946ca1580c6b5b610c
[5/5] arm64: dts: rockchip: add usb3 support to rk3568-evb1-v10
      commit: d6cfb110b0fdfb4e61ef4e3c3ab89a8f21b4d1b8

Best regards,
-- 
Heiko Stuebner <heiko@sntech.de>

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

end of thread, other threads:[~2022-04-10 17:13 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-08 15:12 [PATCH v5 0/5] enable usb support on rk356x Peter Geis
2022-04-08 15:12 ` [PATCH v5 1/5] dt-bindings: soc: grf: add rk3566-pipe-grf compatible Peter Geis
2022-04-08 15:12 ` [PATCH v5 2/5] soc: rockchip: set dwc3 clock for rk3566 Peter Geis
2022-04-08 15:12 ` [PATCH v5 3/5] arm64: dts: rockchip: add rk356x dwc3 usb3 nodes Peter Geis
2022-04-08 16:14   ` Aw: " Frank Wunderlich
2022-04-08 23:39     ` Peter Geis
2022-04-09  7:23       ` Aw: " Frank Wunderlich
2022-04-09  7:37         ` Frank Wunderlich
2022-04-09 15:32           ` Peter Geis
2022-04-08 15:12 ` [PATCH v5 4/5] arm64: dts: rockchip: enable dwc3 on quartz64-a Peter Geis
2022-04-08 15:12 ` [PATCH v5 5/5] arm64: dts: rockchip: add usb3 support to rk3568-evb1-v10 Peter Geis
2022-04-10 17:12 ` [PATCH v5 0/5] enable usb support on rk356x Heiko Stuebner

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).