Due to updates to the Device Tree (migrating to onboard USB hub nodes instead of (badly) hacking things with a gpio regulator that doesn't actually work properly), we now need to enable the onboard USB hub driver in U-Boot.
This anticipates upcoming breakage when 6.16 DT will be merged into U-Boot's dts/upstream.
The series can be applied as is before v6.16 DT is merged or only the defconfig changes after 6.16 DT has been merged.
The last two patches are simply to avoid probing devices that aren't actually routed on RK3399 Puma, which is nice to have but doesn't fix anything.
Note that this depends on the following series: https://lore.kernel.org/u-boot/20250722-usb_onboard_hub_cypress_hx3-v4-0-91c...
Signed-off-by: Quentin Schulz quentin.schulz@cherry.de --- Lukasz Czechowski (2): dt-bindings: usb: cypress,hx3: Add support for all variants arm64: dts: rockchip: fix internal USB hub instability on RK3399 Puma
Quentin Schulz (4): configs: puma-rk3399: enable onboard USB hub support dt-bindings: usb: usb-device: relax compatible pattern to a contains 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
configs/puma-rk3399_defconfig | 1 + dts/upstream/Bindings/usb/cypress,hx3.yaml | 19 +++++++-- dts/upstream/Bindings/usb/usb-device.yaml | 3 +- .../src/arm64/rockchip/rk3399-puma-haikou.dts | 8 ---- dts/upstream/src/arm64/rockchip/rk3399-puma.dtsi | 48 +++++++++++----------- 5 files changed, 43 insertions(+), 36 deletions(-) --- base-commit: 5a8dd2e0c848135b5c96af291aa96e79acc923ec change-id: 20250730-puma-usb-cypress-2d2957024424 prerequisite-change-id: 20250425-usb_onboard_hub_cypress_hx3-2831983f1ede:v4 prerequisite-patch-id: 515a13b22600d40716e9c36d16b084086ce7d474 prerequisite-patch-id: 9f8a11bd6c66e976c51dc0f0bc3292183f9403f3 prerequisite-patch-id: 45ef5b9422333db5fcd23d95b6570b320635c49b prerequisite-patch-id: 19092f1c3db746292401b8513807439c87ea9589 prerequisite-patch-id: fced7578d40069c5fe83d97aa42476015cf9cbda
Best regards,
From: Lukasz Czechowski lukasz.czechowski@thaumatec.com
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... 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 Reviewed-by: "Rob Herring (Arm)" robh@kernel.org Link: https://lore.kernel.org/r/20250425-onboard_usb_dev-v2-2-4a76a474a010@thaumat... [taken with Greg's blessing] Signed-off-by: Heiko Stuebner heiko@sntech.de
[ upstream commit: 1ad4b5a7de16806afc1aeaf012337e62af04e001 ]
(cherry picked from commit 53aacaed0ad140b017c803d9777473c6c62f5352) --- dts/upstream/Bindings/usb/cypress,hx3.yaml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/dts/upstream/Bindings/usb/cypress,hx3.yaml b/dts/upstream/Bindings/usb/cypress,hx3.yaml index 1033b7a4b8f953424cc3d31d561992c17f3594b2..d6eac1213228d2acb50ebc959d1ff15134c5a91c 100644 --- a/dts/upstream/Bindings/usb/cypress,hx3.yaml +++ b/dts/upstream/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
From: Lukasz Czechowski lukasz.czechowski@thaumatec.com
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 Link: https://lore.kernel.org/r/20250425-onboard_usb_dev-v2-3-4a76a474a010@thaumat... Signed-off-by: Heiko Stuebner heiko@sntech.de
[ upstream commit: d7cc532df95f7f159e40595440e4e4b99481457b ]
(cherry picked from commit 0fe42d171081426ab119ca5c0eb130e5f3a9a805) --- dts/upstream/src/arm64/rockchip/rk3399-puma.dtsi | 40 +++++++++++++++--------- 1 file changed, 26 insertions(+), 14 deletions(-)
diff --git a/dts/upstream/src/arm64/rockchip/rk3399-puma.dtsi b/dts/upstream/src/arm64/rockchip/rk3399-puma.dtsi index e00fbaa8acc1685af46495c0dfc9bdac7e6e991c..314d9dfdba5732c574283271fdb1e8f8ed5405ca 100644 --- a/dts/upstream/src/arm64/rockchip/rk3399-puma.dtsi +++ b/dts/upstream/src/arm64/rockchip/rk3399-puma.dtsi @@ -60,16 +60,6 @@ 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"; @@ -527,10 +517,10 @@ }; };
- 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>; }; };
@@ -597,7 +587,6 @@ };
u2phy1_host: host-port { - phy-supply = <&vcc5v0_host>; status = "okay"; }; }; @@ -609,6 +598,29 @@ &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 {
On Wed, 30 Jul 2025 13:10:16 +0200, Quentin Schulz wrote:
Due to updates to the Device Tree (migrating to onboard USB hub nodes instead of (badly) hacking things with a gpio regulator that doesn't actually work properly), we now need to enable the onboard USB hub driver in U-Boot.
This anticipates upcoming breakage when 6.16 DT will be merged into U-Boot's dts/upstream.
[...]
Applied to u-boot/master, thanks!
[1/6] configs: puma-rk3399: enable onboard USB hub support commit: 7810d079adfa7bc7b73085896d3a00d736b5cafb [2/6] dt-bindings: usb: usb-device: relax compatible pattern to a contains commit: 7c0491ccc6a772a13b326b76a47cb6b3cc5e3f7f [3/6] dt-bindings: usb: cypress,hx3: Add support for all variants commit: c419fd81349efaf4301c3b6e66ee12d500738105 [4/6] arm64: dts: rockchip: fix internal USB hub instability on RK3399 Puma commit: 6dd61725a2207c0ac3a01138ed34fd73af2e9dde [5/6] arm64: dts: rockchip: disable unrouted USB controllers and PHY on RK3399 Puma commit: d0681cf0c8cde4dcf98d02912d5f0ef2ec786c9e [6/6] arm64: dts: rockchip: disable unrouted USB controllers and PHY on RK3399 Puma with Haikou commit: e12e9320a39cd26368aecd8961ec11c7526ff1c3
linux-stable-mirror@lists.linaro.org