linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/5] Fix onboard USB hub instability on RK3399 Puma SoM
@ 2025-04-25 15:18 Lukasz Czechowski
  2025-04-25 15:18 ` [PATCH v2 1/5] usb: misc: onboard_usb_dev: fix support for Cypress HX3 hubs Lukasz Czechowski
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Lukasz Czechowski @ 2025-04-25 15:18 UTC (permalink / raw)
  To: Matthias Kaehlcke, Greg Kroah-Hartman, Benjamin Bara, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner, Klaus Goger
  Cc: linux-usb, linux-kernel, devicetree, linux-arm-kernel,
	linux-rockchip, Lukasz Czechowski, stable, Quentin Schulz

The RK3399 Puma SoM contains the internal Cypress CYUSB3304 USB
hub, that shows instability due to improper reset pin configuration.
Currently reset pin is modeled as a vcc5v0_host regulator, that
might result in too short reset pulse duration.
Starting with the v6.6, the Onboard USB hub driver (later renamed
to Onboard USB dev) contains support for Cypress HX3 hub family.
It can be now used to correctly model the RK3399 Puma SoM hardware.

The first commits in this series fix the onboard USB dev driver to
support all HX3 hub variants, including the CYUSB3304 found in
the RK3399 Puma SoM. 
This allows to introduce fix for internal USB hub instability on
RK3399 Puma, by replacing the vcc5v0_host regulator with
cy3304_reset, used inside the hub node.
Please be aware that the patch that fixes USB hub instability in
arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi can me merged only
after updating the Onboard USB dev driver, otherwise the hub
will not work. 

Two last commits in the series disable unrouted USB controllers
and PHYs on RK3399 Puma SOM and Haikou carrier board, with no
intended functional changes.

This series depends on the patch:
Link:  https://lore.kernel.org/linux-usb/20250418-dt-binding-usb-device-compatibles-v2-1-b3029f14e800@cherry.de/
("dt-bindings: usb: usb-device: relax compatible pattern to a contains")

Signed-off-by: Lukasz Czechowski <lukasz.czechowski@thaumatec.com>
---
Changes in v2:
- Removed additional entries from onboard_dev_match table and
  updated dt-bindings list, as suggested by Krzysztof and Conor.
  Fallback compatible entry in SoM's dtsi file is used instead.
- Added vdd-supply and vdd2-supply entries to onboard hub nodes
  to satisfy bindings checks.
- Changed the default cy3304-reset pin configuration to pcfg_output_high.
- Added dependency to: change-id: 20250415-dt-binding-usb-device-compatibles-188f7b0a81b4
- Link to v1: https://lore.kernel.org/r/20250326-onboard_usb_dev-v1-0-a4b0a5d1b32c@thaumatec.com

---
Lukasz Czechowski (3):
      usb: misc: onboard_usb_dev: fix support for Cypress HX3 hubs
      dt-bindings: usb: cypress,hx3: Add support for all variants
      arm64: dts: rockchip: fix internal USB hub instability on RK3399 Puma

Quentin Schulz (2):
      arm64: dts: rockchip: disable unrouted USB controllers and PHY on RK3399 Puma
      arm64: dts: rockchip: disable unrouted USB controllers and PHY on RK3399 Puma with Haikou

 .../devicetree/bindings/usb/cypress,hx3.yaml       | 19 +++++++--
 .../arm64/boot/dts/rockchip/rk3399-puma-haikou.dts |  8 ----
 arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi      | 48 +++++++++++-----------
 drivers/usb/misc/onboard_usb_dev.c                 | 10 ++++-
 4 files changed, 48 insertions(+), 37 deletions(-)
---
base-commit: 834a4a689699090a406d1662b03affa8b155d025
change-id: 20250326-onboard_usb_dev-a7c063a8a515
prerequisite-change-id: 20250415-dt-binding-usb-device-compatibles-188f7b0a81b4:v2
prerequisite-patch-id: f5b90f95302ac9065fbbe5244cc7845c2a772ab6

Best regards,
-- 
Lukasz Czechowski <lukasz.czechowski@thaumatec.com>


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

* [PATCH v2 1/5] usb: misc: onboard_usb_dev: fix support for Cypress HX3 hubs
  2025-04-25 15:18 [PATCH v2 0/5] Fix onboard USB hub instability on RK3399 Puma SoM Lukasz Czechowski
@ 2025-04-25 15:18 ` Lukasz Czechowski
  2025-05-13 16:12   ` Heiko Stübner
  2025-04-25 15:18 ` [PATCH v2 2/5] dt-bindings: usb: cypress,hx3: Add support for all variants Lukasz Czechowski
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 12+ messages in thread
From: Lukasz Czechowski @ 2025-04-25 15:18 UTC (permalink / raw)
  To: Matthias Kaehlcke, Greg Kroah-Hartman, Benjamin Bara, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner, Klaus Goger
  Cc: linux-usb, linux-kernel, devicetree, linux-arm-kernel,
	linux-rockchip, Lukasz Czechowski, stable

The Cypress HX3 USB3.0 hubs use different PID values depending
on the product variant. The comment in compatibles table is
misleading, as the currently used PIDs (0x6504 and 0x6506 for
USB 3.0 and USB 2.0, respectively) are defaults for the CYUSB331x,
while CYUSB330x and CYUSB332x variants use different values.
Based on the datasheet [1], update the compatible usb devices table
to handle different types of the hub.
The change also includes vendor mode PIDs, which are used by the
hub in I2C Master boot mode, if connected EEPROM contains invalid
signature or is blank. This allows to correctly boot the hub even
if the EEPROM will have broken content.
Number of vcc supplies and timing requirements are the same for all
HX variants, so the platform driver's match table does not have to
be extended.

[1] https://www.infineon.com/dgdl/Infineon-HX3_USB_3_0_Hub_Consumer_Industrial-DataSheet-v22_00-EN.pdf?fileId=8ac78c8c7d0d8da4017d0ecb53f644b8
    Table 9. PID Values

Fixes: b43cd82a1a40 ("usb: misc: onboard-hub: add support for Cypress HX3 USB 3.0 family")
Cc: stable@vger.kernel.org
Signed-off-by: Lukasz Czechowski <lukasz.czechowski@thaumatec.com>
---
 drivers/usb/misc/onboard_usb_dev.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/misc/onboard_usb_dev.c b/drivers/usb/misc/onboard_usb_dev.c
index 75ac3c6aa92d0d925bb9488d1e6295548446bf98..f5372dfa241a9cee09fea95fd14b72727a149b2e 100644
--- a/drivers/usb/misc/onboard_usb_dev.c
+++ b/drivers/usb/misc/onboard_usb_dev.c
@@ -569,8 +569,14 @@ static void onboard_dev_usbdev_disconnect(struct usb_device *udev)
 }
 
 static const struct usb_device_id onboard_dev_id_table[] = {
-	{ USB_DEVICE(VENDOR_ID_CYPRESS, 0x6504) }, /* CYUSB33{0,1,2}x/CYUSB230x 3.0 HUB */
-	{ USB_DEVICE(VENDOR_ID_CYPRESS, 0x6506) }, /* CYUSB33{0,1,2}x/CYUSB230x 2.0 HUB */
+	{ USB_DEVICE(VENDOR_ID_CYPRESS, 0x6500) }, /* CYUSB330x 3.0 HUB */
+	{ USB_DEVICE(VENDOR_ID_CYPRESS, 0x6502) }, /* CYUSB330x 2.0 HUB */
+	{ USB_DEVICE(VENDOR_ID_CYPRESS, 0x6503) }, /* CYUSB33{0,1}x 2.0 HUB, Vendor Mode */
+	{ USB_DEVICE(VENDOR_ID_CYPRESS, 0x6504) }, /* CYUSB331x 3.0 HUB */
+	{ USB_DEVICE(VENDOR_ID_CYPRESS, 0x6506) }, /* CYUSB331x 2.0 HUB */
+	{ USB_DEVICE(VENDOR_ID_CYPRESS, 0x6507) }, /* CYUSB332x 2.0 HUB, Vendor Mode */
+	{ USB_DEVICE(VENDOR_ID_CYPRESS, 0x6508) }, /* CYUSB332x 3.0 HUB */
+	{ USB_DEVICE(VENDOR_ID_CYPRESS, 0x650a) }, /* CYUSB332x 2.0 HUB */
 	{ USB_DEVICE(VENDOR_ID_CYPRESS, 0x6570) }, /* CY7C6563x 2.0 HUB */
 	{ USB_DEVICE(VENDOR_ID_GENESYS, 0x0608) }, /* Genesys Logic GL850G USB 2.0 HUB */
 	{ USB_DEVICE(VENDOR_ID_GENESYS, 0x0610) }, /* Genesys Logic GL852G USB 2.0 HUB */

-- 
2.43.0


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

* [PATCH v2 2/5] dt-bindings: usb: cypress,hx3: Add support for all variants
  2025-04-25 15:18 [PATCH v2 0/5] Fix onboard USB hub instability on RK3399 Puma SoM Lukasz Czechowski
  2025-04-25 15:18 ` [PATCH v2 1/5] usb: misc: onboard_usb_dev: fix support for Cypress HX3 hubs Lukasz Czechowski
@ 2025-04-25 15:18 ` Lukasz Czechowski
  2025-05-09 18:38   ` Rob Herring (Arm)
  2025-05-15 11:43   ` Heiko Stübner
  2025-04-25 15:18 ` [PATCH v2 3/5] arm64: dts: rockchip: fix internal USB hub instability on RK3399 Puma Lukasz Czechowski
                   ` (3 subsequent siblings)
  5 siblings, 2 replies; 12+ messages in thread
From: Lukasz Czechowski @ 2025-04-25 15:18 UTC (permalink / raw)
  To: Matthias Kaehlcke, Greg Kroah-Hartman, Benjamin Bara, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner, Klaus Goger
  Cc: linux-usb, linux-kernel, devicetree, linux-arm-kernel,
	linux-rockchip, Lukasz Czechowski, stable

The Cypress HX3 hubs use different default PID value depending
on the variant. Update compatibles list.
Becasuse all hub variants use the same driver data, allow the
dt node to have two compatibles: leftmost which matches the HW
exactly, and the second one as fallback.

Fixes: 1eca51f58a10 ("dt-bindings: usb: Add binding for Cypress HX3 USB 3.0 family")
Cc: stable@vger.kernel.org # 6.6
Cc: stable@vger.kernel.org # Backport of the patch ("dt-bindings: usb: usb-device: relax compatible pattern to a contains") from list: https://lore.kernel.org/linux-usb/20250418-dt-binding-usb-device-compatibles-v2-1-b3029f14e800@cherry.de/
Cc: stable@vger.kernel.org # Backport of the patch in this series fixing product ID in onboard_dev_id_table in drivers/usb/misc/onboard_usb_dev.c driver
Signed-off-by: Lukasz Czechowski <lukasz.czechowski@thaumatec.com>
---
 .../devicetree/bindings/usb/cypress,hx3.yaml          | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/usb/cypress,hx3.yaml b/Documentation/devicetree/bindings/usb/cypress,hx3.yaml
index 1033b7a4b8f953424cc3d31d561992c17f3594b2..d6eac1213228d2acb50ebc959d1ff15134c5a91c 100644
--- a/Documentation/devicetree/bindings/usb/cypress,hx3.yaml
+++ b/Documentation/devicetree/bindings/usb/cypress,hx3.yaml
@@ -14,9 +14,22 @@ allOf:
 
 properties:
   compatible:
-    enum:
-      - usb4b4,6504
-      - usb4b4,6506
+    oneOf:
+      - enum:
+          - usb4b4,6504
+          - usb4b4,6506
+      - items:
+          - enum:
+              - usb4b4,6500
+              - usb4b4,6508
+          - const: usb4b4,6504
+      - items:
+          - enum:
+              - usb4b4,6502
+              - usb4b4,6503
+              - usb4b4,6507
+              - usb4b4,650a
+          - const: usb4b4,6506
 
   reg: true
 

-- 
2.43.0


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

* [PATCH v2 3/5] arm64: dts: rockchip: fix internal USB hub instability on RK3399 Puma
  2025-04-25 15:18 [PATCH v2 0/5] Fix onboard USB hub instability on RK3399 Puma SoM Lukasz Czechowski
  2025-04-25 15:18 ` [PATCH v2 1/5] usb: misc: onboard_usb_dev: fix support for Cypress HX3 hubs Lukasz Czechowski
  2025-04-25 15:18 ` [PATCH v2 2/5] dt-bindings: usb: cypress,hx3: Add support for all variants Lukasz Czechowski
@ 2025-04-25 15:18 ` Lukasz Czechowski
  2025-04-25 15:18 ` [PATCH v2 4/5] arm64: dts: rockchip: disable unrouted USB controllers and PHY " Lukasz Czechowski
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Lukasz Czechowski @ 2025-04-25 15:18 UTC (permalink / raw)
  To: Matthias Kaehlcke, Greg Kroah-Hartman, Benjamin Bara, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner, Klaus Goger
  Cc: linux-usb, linux-kernel, devicetree, linux-arm-kernel,
	linux-rockchip, Lukasz Czechowski, stable

Currently, the onboard Cypress CYUSB3304 USB hub is not defined in
the device tree, and hub reset pin is provided as vcc5v0_host
regulator to usb phy. This causes instability issues, as a result
of improper reset duration.

The fixed regulator device requests the GPIO during probe in its
inactive state (except if regulator-boot-on property is set, in
which case it is requested in the active state). Considering gpio
is GPIO_ACTIVE_LOW for Puma, it means it’s driving it high. Then
the regulator gets enabled (because regulator-always-on property),
which drives it to its active state, meaning driving it low.

The Cypress CYUSB3304 USB hub actually requires the reset to be
asserted for at least 5 ms, which we cannot guarantee right now
since there's no delay in the current config, meaning the hub may
sometimes work or not. We could add delay as offered by
fixed-regulator but let's rather fix this by using the proper way
to model onboard USB hubs.

Define hub_2_0 and hub_3_0 nodes, as the onboard Cypress hub
consist of two 'logical' hubs, for USB2.0 and USB3.0.
Use the 'reset-gpios' property of hub to assign reset pin instead
of using regulator. Rename the vcc5v0_host regulator to
cy3304_reset to be more meaningful. Pin is configured to
output-high by default, which sets the hub in reset state
during pin controller initialization. This allows to avoid double
enumeration of devices in case the bootloader has setup the USB
hub before the kernel.
The vdd-supply and vdd2-supply properties in hub nodes are
added to provide correct dt-bindings, although power supplies are
always enabled based on HW design.

Fixes: 2c66fc34e945 ("arm64: dts: rockchip: add RK3399-Q7 (Puma) SoM")
Cc: stable@vger.kernel.org # 6.6
Cc: stable@vger.kernel.org # Backport of the patch in this series fixing product ID in onboard_dev_id_table in drivers/usb/misc/onboard_usb_dev.c driver
Signed-off-by: Lukasz Czechowski <lukasz.czechowski@thaumatec.com>
---
 arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi | 40 +++++++++++++++++----------
 1 file changed, 26 insertions(+), 14 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
index 995b30a7aae01a0326e9f80d6be930f227968539..dd5a9bca26d1d221607e73071685d5774330d760 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
@@ -60,16 +60,6 @@ vcc3v3_sys: regulator-vcc3v3-sys {
 		vin-supply = <&vcc5v0_sys>;
 	};
 
-	vcc5v0_host: regulator-vcc5v0-host {
-		compatible = "regulator-fixed";
-		gpio = <&gpio4 RK_PA3 GPIO_ACTIVE_LOW>;
-		pinctrl-names = "default";
-		pinctrl-0 = <&vcc5v0_host_en>;
-		regulator-name = "vcc5v0_host";
-		regulator-always-on;
-		vin-supply = <&vcc5v0_sys>;
-	};
-
 	vcc5v0_sys: regulator-vcc5v0-sys {
 		compatible = "regulator-fixed";
 		regulator-name = "vcc5v0_sys";
@@ -521,10 +511,10 @@ pmic_int_l: pmic-int-l {
 		};
 	};
 
-	usb2 {
-		vcc5v0_host_en: vcc5v0-host-en {
+	usb {
+		cy3304_reset: cy3304-reset {
 			rockchip,pins =
-			  <4 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
+			  <4 RK_PA3 RK_FUNC_GPIO &pcfg_output_high>;
 		};
 	};
 
@@ -591,7 +581,6 @@ u2phy1_otg: otg-port {
 	};
 
 	u2phy1_host: host-port {
-		phy-supply = <&vcc5v0_host>;
 		status = "okay";
 	};
 };
@@ -603,6 +592,29 @@ &usbdrd3_1 {
 &usbdrd_dwc3_1 {
 	status = "okay";
 	dr_mode = "host";
+	pinctrl-names = "default";
+	pinctrl-0 = <&cy3304_reset>;
+	#address-cells = <1>;
+	#size-cells = <0>;
+
+	hub_2_0: hub@1 {
+		compatible = "usb4b4,6502", "usb4b4,6506";
+		reg = <1>;
+		peer-hub = <&hub_3_0>;
+		reset-gpios = <&gpio4 RK_PA3 GPIO_ACTIVE_HIGH>;
+		vdd-supply = <&vcc1v2_phy>;
+		vdd2-supply = <&vcc3v3_sys>;
+
+	};
+
+	hub_3_0: hub@2 {
+		compatible = "usb4b4,6500", "usb4b4,6504";
+		reg = <2>;
+		peer-hub = <&hub_2_0>;
+		reset-gpios = <&gpio4 RK_PA3 GPIO_ACTIVE_HIGH>;
+		vdd-supply = <&vcc1v2_phy>;
+		vdd2-supply = <&vcc3v3_sys>;
+	};
 };
 
 &usb_host1_ehci {

-- 
2.43.0


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

* [PATCH v2 4/5] arm64: dts: rockchip: disable unrouted USB controllers and PHY on RK3399 Puma
  2025-04-25 15:18 [PATCH v2 0/5] Fix onboard USB hub instability on RK3399 Puma SoM Lukasz Czechowski
                   ` (2 preceding siblings ...)
  2025-04-25 15:18 ` [PATCH v2 3/5] arm64: dts: rockchip: fix internal USB hub instability on RK3399 Puma Lukasz Czechowski
@ 2025-04-25 15:18 ` Lukasz Czechowski
  2025-04-25 15:18 ` [PATCH v2 5/5] arm64: dts: rockchip: disable unrouted USB controllers and PHY on RK3399 Puma with Haikou Lukasz Czechowski
  2025-05-15 12:50 ` (subset) [PATCH v2 0/5] Fix onboard USB hub instability on RK3399 Puma SoM Heiko Stuebner
  5 siblings, 0 replies; 12+ messages in thread
From: Lukasz Czechowski @ 2025-04-25 15:18 UTC (permalink / raw)
  To: Matthias Kaehlcke, Greg Kroah-Hartman, Benjamin Bara, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner, Klaus Goger
  Cc: linux-usb, linux-kernel, devicetree, linux-arm-kernel,
	linux-rockchip, Lukasz Czechowski, Quentin Schulz

From: Quentin Schulz <quentin.schulz@cherry.de>

The u2phy1_host port is the part of the USB PHY1 (namely the
HOST1_DP/DM lanes) which routes directly to the USB2.0 HOST
controller[1]. The other lanes of the PHY are routed to the USB3.0 OTG
controller (dwc3), which we do use.

The HOST1_DP/DM lanes aren't routed on RK3399 Puma so let's simply
disable the USB2.0 controllers and associated part in USB2.0 PHY.

No intended functional change.

[1] https://rockchip.fr/Rockchip%20RK3399%20TRM%20V1.3%20Part2.pdf
    Chapter 2 USB2.0 PHY
Fixes: 2c66fc34e945 ("arm64: dts: rockchip: add RK3399-Q7 (Puma) SoM")
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Signed-off-by: Lukasz Czechowski <lukasz.czechowski@thaumatec.com>
---
 arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
index dd5a9bca26d1d221607e73071685d5774330d760..5c1162e2f34f9c9786da1f774dffa71adda23dbc 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
@@ -579,10 +579,6 @@ &u2phy1 {
 	u2phy1_otg: otg-port {
 		status = "okay";
 	};
-
-	u2phy1_host: host-port {
-		status = "okay";
-	};
 };
 
 &usbdrd3_1 {
@@ -616,11 +612,3 @@ hub_3_0: hub@2 {
 		vdd2-supply = <&vcc3v3_sys>;
 	};
 };
-
-&usb_host1_ehci {
-	status = "okay";
-};
-
-&usb_host1_ohci {
-	status = "okay";
-};

-- 
2.43.0


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

* [PATCH v2 5/5] arm64: dts: rockchip: disable unrouted USB controllers and PHY on RK3399 Puma with Haikou
  2025-04-25 15:18 [PATCH v2 0/5] Fix onboard USB hub instability on RK3399 Puma SoM Lukasz Czechowski
                   ` (3 preceding siblings ...)
  2025-04-25 15:18 ` [PATCH v2 4/5] arm64: dts: rockchip: disable unrouted USB controllers and PHY " Lukasz Czechowski
@ 2025-04-25 15:18 ` Lukasz Czechowski
  2025-05-15 12:50 ` (subset) [PATCH v2 0/5] Fix onboard USB hub instability on RK3399 Puma SoM Heiko Stuebner
  5 siblings, 0 replies; 12+ messages in thread
From: Lukasz Czechowski @ 2025-04-25 15:18 UTC (permalink / raw)
  To: Matthias Kaehlcke, Greg Kroah-Hartman, Benjamin Bara, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner, Klaus Goger
  Cc: linux-usb, linux-kernel, devicetree, linux-arm-kernel,
	linux-rockchip, Lukasz Czechowski, Quentin Schulz

From: Quentin Schulz <quentin.schulz@cherry.de>

The u2phy0_host port is the part of the USB PHY0 (namely the
HOST0_DP/DM lanes) which routes directly to the USB2.0 HOST
controller[1]. The other lanes of the PHY are routed to the USB3.0 OTG
controller (dwc3), which we do use.

The HOST0_DP/DM lanes aren't routed on RK3399 Puma so let's simply
disable the USB2.0 controllers.

USB3 OTG has been known to be unstable on RK3399 Puma Haikou for a
while, one of the recurring issues being that only USB2 is detected and
not USB3 in host mode. Reading the justification above and seeing that
we are keeping u2phy0_host in the Haikou carrierboard DTS probably may
have bothered you since it should be changed to u2phy0_otg. The issue is
that if it's switched to that, USB OTG on Haikou is entirely broken. I
have checked the routing in the Gerber file, the lanes are going to the
expected ball pins (that is, NOT HOST0_DP/DM).
u2phy0_host is for sure the wrong part of the PHY to use, but it's the
only one that works at the moment for that board so keep it until we
figure out what exactly is broken.

No intended functional change.

[1] https://rockchip.fr/Rockchip%20RK3399%20TRM%20V1.3%20Part2.pdf
    Chapter 2 USB2.0 PHY
Fixes: 2c66fc34e945 ("arm64: dts: rockchip: add RK3399-Q7 (Puma) SoM")
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Signed-off-by: Lukasz Czechowski <lukasz.czechowski@thaumatec.com>
---
 arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts b/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts
index 947bbd62a6b09ce55320d0889ee8cf50ca59dfd4..93cefacc7a01ec8f9716de828077b3395a5e7696 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts
@@ -292,14 +292,6 @@ &uart2 {
 	status = "okay";
 };
 
-&usb_host0_ehci {
-	status = "okay";
-};
-
-&usb_host0_ohci {
-	status = "okay";
-};
-
 &vopb {
 	status = "okay";
 };

-- 
2.43.0


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

* Re: [PATCH v2 2/5] dt-bindings: usb: cypress,hx3: Add support for all variants
  2025-04-25 15:18 ` [PATCH v2 2/5] dt-bindings: usb: cypress,hx3: Add support for all variants Lukasz Czechowski
@ 2025-05-09 18:38   ` Rob Herring (Arm)
  2025-05-15 11:43   ` Heiko Stübner
  1 sibling, 0 replies; 12+ messages in thread
From: Rob Herring (Arm) @ 2025-05-09 18:38 UTC (permalink / raw)
  To: Lukasz Czechowski
  Cc: Benjamin Bara, linux-rockchip, stable, linux-arm-kernel,
	Krzysztof Kozlowski, Heiko Stuebner, linux-usb, devicetree,
	Klaus Goger, Matthias Kaehlcke, Conor Dooley, Greg Kroah-Hartman,
	linux-kernel


On Fri, 25 Apr 2025 17:18:07 +0200, Lukasz Czechowski wrote:
> The Cypress HX3 hubs use different default PID value depending
> on the variant. Update compatibles list.
> Becasuse all hub variants use the same driver data, allow the
> dt node to have two compatibles: leftmost which matches the HW
> exactly, and the second one as fallback.
> 
> Fixes: 1eca51f58a10 ("dt-bindings: usb: Add binding for Cypress HX3 USB 3.0 family")
> Cc: stable@vger.kernel.org # 6.6
> Cc: stable@vger.kernel.org # Backport of the patch ("dt-bindings: usb: usb-device: relax compatible pattern to a contains") from list: https://lore.kernel.org/linux-usb/20250418-dt-binding-usb-device-compatibles-v2-1-b3029f14e800@cherry.de/
> Cc: stable@vger.kernel.org # Backport of the patch in this series fixing product ID in onboard_dev_id_table in drivers/usb/misc/onboard_usb_dev.c driver
> Signed-off-by: Lukasz Czechowski <lukasz.czechowski@thaumatec.com>
> ---
>  .../devicetree/bindings/usb/cypress,hx3.yaml          | 19 ++++++++++++++++---
>  1 file changed, 16 insertions(+), 3 deletions(-)
> 

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>


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

* Re: [PATCH v2 1/5] usb: misc: onboard_usb_dev: fix support for Cypress HX3 hubs
  2025-04-25 15:18 ` [PATCH v2 1/5] usb: misc: onboard_usb_dev: fix support for Cypress HX3 hubs Lukasz Czechowski
@ 2025-05-13 16:12   ` Heiko Stübner
  0 siblings, 0 replies; 12+ messages in thread
From: Heiko Stübner @ 2025-05-13 16:12 UTC (permalink / raw)
  To: Matthias Kaehlcke, Greg Kroah-Hartman, Benjamin Bara, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Klaus Goger, Lukasz Czechowski
  Cc: linux-usb, linux-kernel, devicetree, linux-arm-kernel,
	linux-rockchip, Lukasz Czechowski, stable

Am Freitag, 25. April 2025, 17:18:06 Mitteleuropäische Sommerzeit schrieb Lukasz Czechowski:
> The Cypress HX3 USB3.0 hubs use different PID values depending
> on the product variant. The comment in compatibles table is
> misleading, as the currently used PIDs (0x6504 and 0x6506 for
> USB 3.0 and USB 2.0, respectively) are defaults for the CYUSB331x,
> while CYUSB330x and CYUSB332x variants use different values.
> Based on the datasheet [1], update the compatible usb devices table
> to handle different types of the hub.
> The change also includes vendor mode PIDs, which are used by the
> hub in I2C Master boot mode, if connected EEPROM contains invalid
> signature or is blank. This allows to correctly boot the hub even
> if the EEPROM will have broken content.
> Number of vcc supplies and timing requirements are the same for all
> HX variants, so the platform driver's match table does not have to
> be extended.
> 
> [1] https://www.infineon.com/dgdl/Infineon-HX3_USB_3_0_Hub_Consumer_Industrial-DataSheet-v22_00-EN.pdf?fileId=8ac78c8c7d0d8da4017d0ecb53f644b8
>     Table 9. PID Values
> 
> Fixes: b43cd82a1a40 ("usb: misc: onboard-hub: add support for Cypress HX3 USB 3.0 family")
> Cc: stable@vger.kernel.org
> Signed-off-by: Lukasz Czechowski <lukasz.czechowski@thaumatec.com>

Reviewed-by: Heiko Stuebner <heiko@sntech.de>

@GregKH: I'd assume you pick patches 1+2 (dt-binding + driver) and I pick the
Rockchip arm64-dts patches afterwards, after the first two look good to you?

Thanks a lot
Heiko

> ---
>  drivers/usb/misc/onboard_usb_dev.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/misc/onboard_usb_dev.c b/drivers/usb/misc/onboard_usb_dev.c
> index 75ac3c6aa92d0d925bb9488d1e6295548446bf98..f5372dfa241a9cee09fea95fd14b72727a149b2e 100644
> --- a/drivers/usb/misc/onboard_usb_dev.c
> +++ b/drivers/usb/misc/onboard_usb_dev.c
> @@ -569,8 +569,14 @@ static void onboard_dev_usbdev_disconnect(struct usb_device *udev)
>  }
>  
>  static const struct usb_device_id onboard_dev_id_table[] = {
> -	{ USB_DEVICE(VENDOR_ID_CYPRESS, 0x6504) }, /* CYUSB33{0,1,2}x/CYUSB230x 3.0 HUB */
> -	{ USB_DEVICE(VENDOR_ID_CYPRESS, 0x6506) }, /* CYUSB33{0,1,2}x/CYUSB230x 2.0 HUB */
> +	{ USB_DEVICE(VENDOR_ID_CYPRESS, 0x6500) }, /* CYUSB330x 3.0 HUB */
> +	{ USB_DEVICE(VENDOR_ID_CYPRESS, 0x6502) }, /* CYUSB330x 2.0 HUB */
> +	{ USB_DEVICE(VENDOR_ID_CYPRESS, 0x6503) }, /* CYUSB33{0,1}x 2.0 HUB, Vendor Mode */
> +	{ USB_DEVICE(VENDOR_ID_CYPRESS, 0x6504) }, /* CYUSB331x 3.0 HUB */
> +	{ USB_DEVICE(VENDOR_ID_CYPRESS, 0x6506) }, /* CYUSB331x 2.0 HUB */
> +	{ USB_DEVICE(VENDOR_ID_CYPRESS, 0x6507) }, /* CYUSB332x 2.0 HUB, Vendor Mode */
> +	{ USB_DEVICE(VENDOR_ID_CYPRESS, 0x6508) }, /* CYUSB332x 3.0 HUB */
> +	{ USB_DEVICE(VENDOR_ID_CYPRESS, 0x650a) }, /* CYUSB332x 2.0 HUB */
>  	{ USB_DEVICE(VENDOR_ID_CYPRESS, 0x6570) }, /* CY7C6563x 2.0 HUB */
>  	{ USB_DEVICE(VENDOR_ID_GENESYS, 0x0608) }, /* Genesys Logic GL850G USB 2.0 HUB */
>  	{ USB_DEVICE(VENDOR_ID_GENESYS, 0x0610) }, /* Genesys Logic GL852G USB 2.0 HUB */
> 
> 





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

* Re: [PATCH v2 2/5] dt-bindings: usb: cypress,hx3: Add support for all variants
  2025-04-25 15:18 ` [PATCH v2 2/5] dt-bindings: usb: cypress,hx3: Add support for all variants Lukasz Czechowski
  2025-05-09 18:38   ` Rob Herring (Arm)
@ 2025-05-15 11:43   ` Heiko Stübner
  2025-05-15 11:49     ` Greg Kroah-Hartman
  1 sibling, 1 reply; 12+ messages in thread
From: Heiko Stübner @ 2025-05-15 11:43 UTC (permalink / raw)
  To: Matthias Kaehlcke, Greg Kroah-Hartman, Benjamin Bara, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Klaus Goger, Lukasz Czechowski
  Cc: linux-usb, linux-kernel, devicetree, linux-arm-kernel,
	linux-rockchip, Lukasz Czechowski, stable

Am Freitag, 25. April 2025, 17:18:07 Mitteleuropäische Sommerzeit schrieb Lukasz Czechowski:
> The Cypress HX3 hubs use different default PID value depending
> on the variant. Update compatibles list.
> Becasuse all hub variants use the same driver data, allow the
> dt node to have two compatibles: leftmost which matches the HW
> exactly, and the second one as fallback.
> 
> Fixes: 1eca51f58a10 ("dt-bindings: usb: Add binding for Cypress HX3 USB 3.0 family")
> Cc: stable@vger.kernel.org # 6.6
> Cc: stable@vger.kernel.org # Backport of the patch ("dt-bindings: usb: usb-device: relax compatible pattern to a contains") from list: https://lore.kernel.org/linux-usb/20250418-dt-binding-usb-device-compatibles-v2-1-b3029f14e800@cherry.de/
> Cc: stable@vger.kernel.org # Backport of the patch in this series fixing product ID in onboard_dev_id_table in drivers/usb/misc/onboard_usb_dev.c driver
> Signed-off-by: Lukasz Czechowski <lukasz.czechowski@thaumatec.com>

Looking at linux-next, it seems like patch1 of this series was applied [0].
The general convention would be for the binding (this patch) also going
through a driver tree.

I guess I _could_ apply it together with the board-level patches, but
for that would need an Ack from Greg .

@Greg, do you want to merge this patch ?


Thanks a lot
Heiko



[0] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=9f657a92805cfc98e11cf5da9e8f4e02ecff2260

> ---
>  .../devicetree/bindings/usb/cypress,hx3.yaml          | 19 ++++++++++++++++---
>  1 file changed, 16 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/usb/cypress,hx3.yaml b/Documentation/devicetree/bindings/usb/cypress,hx3.yaml
> index 1033b7a4b8f953424cc3d31d561992c17f3594b2..d6eac1213228d2acb50ebc959d1ff15134c5a91c 100644
> --- a/Documentation/devicetree/bindings/usb/cypress,hx3.yaml
> +++ b/Documentation/devicetree/bindings/usb/cypress,hx3.yaml
> @@ -14,9 +14,22 @@ allOf:
>  
>  properties:
>    compatible:
> -    enum:
> -      - usb4b4,6504
> -      - usb4b4,6506
> +    oneOf:
> +      - enum:
> +          - usb4b4,6504
> +          - usb4b4,6506
> +      - items:
> +          - enum:
> +              - usb4b4,6500
> +              - usb4b4,6508
> +          - const: usb4b4,6504
> +      - items:
> +          - enum:
> +              - usb4b4,6502
> +              - usb4b4,6503
> +              - usb4b4,6507
> +              - usb4b4,650a
> +          - const: usb4b4,6506
>  
>    reg: true
>  
> 
> 





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

* Re: [PATCH v2 2/5] dt-bindings: usb: cypress,hx3: Add support for all variants
  2025-05-15 11:43   ` Heiko Stübner
@ 2025-05-15 11:49     ` Greg Kroah-Hartman
  2025-05-15 12:42       ` Heiko Stübner
  0 siblings, 1 reply; 12+ messages in thread
From: Greg Kroah-Hartman @ 2025-05-15 11:49 UTC (permalink / raw)
  To: Heiko Stübner
  Cc: Matthias Kaehlcke, Benjamin Bara, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Klaus Goger, Lukasz Czechowski,
	linux-usb, linux-kernel, devicetree, linux-arm-kernel,
	linux-rockchip, stable

On Thu, May 15, 2025 at 01:43:59PM +0200, Heiko Stübner wrote:
> Am Freitag, 25. April 2025, 17:18:07 Mitteleuropäische Sommerzeit schrieb Lukasz Czechowski:
> > The Cypress HX3 hubs use different default PID value depending
> > on the variant. Update compatibles list.
> > Becasuse all hub variants use the same driver data, allow the
> > dt node to have two compatibles: leftmost which matches the HW
> > exactly, and the second one as fallback.
> > 
> > Fixes: 1eca51f58a10 ("dt-bindings: usb: Add binding for Cypress HX3 USB 3.0 family")
> > Cc: stable@vger.kernel.org # 6.6
> > Cc: stable@vger.kernel.org # Backport of the patch ("dt-bindings: usb: usb-device: relax compatible pattern to a contains") from list: https://lore.kernel.org/linux-usb/20250418-dt-binding-usb-device-compatibles-v2-1-b3029f14e800@cherry.de/
> > Cc: stable@vger.kernel.org # Backport of the patch in this series fixing product ID in onboard_dev_id_table in drivers/usb/misc/onboard_usb_dev.c driver
> > Signed-off-by: Lukasz Czechowski <lukasz.czechowski@thaumatec.com>
> 
> Looking at linux-next, it seems like patch1 of this series was applied [0].

It is in 6.15-rc6, not "just" linux-next

> The general convention would be for the binding (this patch) also going
> through a driver tree.
> 
> I guess I _could_ apply it together with the board-level patches, but
> for that would need an Ack from Greg .
> 
> @Greg, do you want to merge this patch ?

I thought a new series was going to be sent for some reason, which would
make this a lot easier.  But if you want to just take this one now,
that's fine with me as it's not in my queue.

thanks,

greg k-h

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

* Re: [PATCH v2 2/5] dt-bindings: usb: cypress,hx3: Add support for all variants
  2025-05-15 11:49     ` Greg Kroah-Hartman
@ 2025-05-15 12:42       ` Heiko Stübner
  0 siblings, 0 replies; 12+ messages in thread
From: Heiko Stübner @ 2025-05-15 12:42 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Matthias Kaehlcke, Benjamin Bara, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Klaus Goger, Lukasz Czechowski,
	linux-usb, linux-kernel, devicetree, linux-arm-kernel,
	linux-rockchip, stable

Am Donnerstag, 15. Mai 2025, 13:49:19 Mitteleuropäische Sommerzeit schrieb Greg Kroah-Hartman:
> On Thu, May 15, 2025 at 01:43:59PM +0200, Heiko Stübner wrote:
> > Am Freitag, 25. April 2025, 17:18:07 Mitteleuropäische Sommerzeit schrieb Lukasz Czechowski:
> > > The Cypress HX3 hubs use different default PID value depending
> > > on the variant. Update compatibles list.
> > > Becasuse all hub variants use the same driver data, allow the
> > > dt node to have two compatibles: leftmost which matches the HW
> > > exactly, and the second one as fallback.
> > > 
> > > Fixes: 1eca51f58a10 ("dt-bindings: usb: Add binding for Cypress HX3 USB 3.0 family")
> > > Cc: stable@vger.kernel.org # 6.6
> > > Cc: stable@vger.kernel.org # Backport of the patch ("dt-bindings: usb: usb-device: relax compatible pattern to a contains") from list: https://lore.kernel.org/linux-usb/20250418-dt-binding-usb-device-compatibles-v2-1-b3029f14e800@cherry.de/
> > > Cc: stable@vger.kernel.org # Backport of the patch in this series fixing product ID in onboard_dev_id_table in drivers/usb/misc/onboard_usb_dev.c driver
> > > Signed-off-by: Lukasz Czechowski <lukasz.czechowski@thaumatec.com>
> > 
> > Looking at linux-next, it seems like patch1 of this series was applied [0].
> 
> It is in 6.15-rc6, not "just" linux-next

yeah, I mainly used linux-next to see if a part of this series was applied
anywhere :-) . Because neither my inbox nor the list archives seem to have
gotten any form of "patch applied" mail.


> > The general convention would be for the binding (this patch) also going
> > through a driver tree.
> > 
> > I guess I _could_ apply it together with the board-level patches, but
> > for that would need an Ack from Greg .
> > 
> > @Greg, do you want to merge this patch ?
> 
> I thought a new series was going to be sent for some reason, which would
> make this a lot easier.  But if you want to just take this one now,
> that's fine with me as it's not in my queue.

As we're close to -rc7 now, I assume the chance is low of someone
needing this before 6.16-rc1, so thanks for the blessing, I'll do that :-) .

Heiko



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

* Re: (subset) [PATCH v2 0/5] Fix onboard USB hub instability on RK3399 Puma SoM
  2025-04-25 15:18 [PATCH v2 0/5] Fix onboard USB hub instability on RK3399 Puma SoM Lukasz Czechowski
                   ` (4 preceding siblings ...)
  2025-04-25 15:18 ` [PATCH v2 5/5] arm64: dts: rockchip: disable unrouted USB controllers and PHY on RK3399 Puma with Haikou Lukasz Czechowski
@ 2025-05-15 12:50 ` Heiko Stuebner
  5 siblings, 0 replies; 12+ messages in thread
From: Heiko Stuebner @ 2025-05-15 12:50 UTC (permalink / raw)
  To: Matthias Kaehlcke, Greg Kroah-Hartman, Benjamin Bara, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Klaus Goger, Lukasz Czechowski
  Cc: Heiko Stuebner, linux-usb, linux-kernel, devicetree,
	linux-arm-kernel, linux-rockchip, stable, Quentin Schulz


On Fri, 25 Apr 2025 17:18:05 +0200, Lukasz Czechowski wrote:
> The RK3399 Puma SoM contains the internal Cypress CYUSB3304 USB
> hub, that shows instability due to improper reset pin configuration.
> Currently reset pin is modeled as a vcc5v0_host regulator, that
> might result in too short reset pulse duration.
> Starting with the v6.6, the Onboard USB hub driver (later renamed
> to Onboard USB dev) contains support for Cypress HX3 hub family.
> It can be now used to correctly model the RK3399 Puma SoM hardware.
> 
> [...]

Applied, thanks!

[2/5] dt-bindings: usb: cypress,hx3: Add support for all variants
      commit: 1ad4b5a7de16806afc1aeaf012337e62af04e001
[3/5] arm64: dts: rockchip: fix internal USB hub instability on RK3399 Puma
      commit: d7cc532df95f7f159e40595440e4e4b99481457b
[4/5] arm64: dts: rockchip: disable unrouted USB controllers and PHY on RK3399 Puma
      commit: 3373af1d76bacd054b37f3e10266dd335ce425f8
[5/5] arm64: dts: rockchip: disable unrouted USB controllers and PHY on RK3399 Puma with Haikou
      commit: febd8c6ab52c683b447fe22fc740918c86feae43

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

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

end of thread, other threads:[~2025-05-15 12:51 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-25 15:18 [PATCH v2 0/5] Fix onboard USB hub instability on RK3399 Puma SoM Lukasz Czechowski
2025-04-25 15:18 ` [PATCH v2 1/5] usb: misc: onboard_usb_dev: fix support for Cypress HX3 hubs Lukasz Czechowski
2025-05-13 16:12   ` Heiko Stübner
2025-04-25 15:18 ` [PATCH v2 2/5] dt-bindings: usb: cypress,hx3: Add support for all variants Lukasz Czechowski
2025-05-09 18:38   ` Rob Herring (Arm)
2025-05-15 11:43   ` Heiko Stübner
2025-05-15 11:49     ` Greg Kroah-Hartman
2025-05-15 12:42       ` Heiko Stübner
2025-04-25 15:18 ` [PATCH v2 3/5] arm64: dts: rockchip: fix internal USB hub instability on RK3399 Puma Lukasz Czechowski
2025-04-25 15:18 ` [PATCH v2 4/5] arm64: dts: rockchip: disable unrouted USB controllers and PHY " Lukasz Czechowski
2025-04-25 15:18 ` [PATCH v2 5/5] arm64: dts: rockchip: disable unrouted USB controllers and PHY on RK3399 Puma with Haikou Lukasz Czechowski
2025-05-15 12:50 ` (subset) [PATCH v2 0/5] Fix onboard USB hub instability on RK3399 Puma SoM 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).