Skip to content

Commit d7cc532

Browse files
lukasz-czechowskimmind
authored andcommitted
arm64: dts: rockchip: fix internal USB hub instability on RK3399 Puma
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: 2c66fc3 ("arm64: dts: rockchip: add RK3399-Q7 (Puma) SoM") Cc: [email protected] # 6.6 Cc: [email protected] # 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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Heiko Stuebner <[email protected]>
1 parent 1ad4b5a commit d7cc532

File tree

1 file changed

+26
-14
lines changed

1 file changed

+26
-14
lines changed

arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,6 @@
6060
vin-supply = <&vcc5v0_sys>;
6161
};
6262

63-
vcc5v0_host: regulator-vcc5v0-host {
64-
compatible = "regulator-fixed";
65-
gpio = <&gpio4 RK_PA3 GPIO_ACTIVE_LOW>;
66-
pinctrl-names = "default";
67-
pinctrl-0 = <&vcc5v0_host_en>;
68-
regulator-name = "vcc5v0_host";
69-
regulator-always-on;
70-
vin-supply = <&vcc5v0_sys>;
71-
};
72-
7363
vcc5v0_sys: regulator-vcc5v0-sys {
7464
compatible = "regulator-fixed";
7565
regulator-name = "vcc5v0_sys";
@@ -527,10 +517,10 @@
527517
};
528518
};
529519

530-
usb2 {
531-
vcc5v0_host_en: vcc5v0-host-en {
520+
usb {
521+
cy3304_reset: cy3304-reset {
532522
rockchip,pins =
533-
<4 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
523+
<4 RK_PA3 RK_FUNC_GPIO &pcfg_output_high>;
534524
};
535525
};
536526

@@ -597,7 +587,6 @@
597587
};
598588

599589
u2phy1_host: host-port {
600-
phy-supply = <&vcc5v0_host>;
601590
status = "okay";
602591
};
603592
};
@@ -609,6 +598,29 @@
609598
&usbdrd_dwc3_1 {
610599
status = "okay";
611600
dr_mode = "host";
601+
pinctrl-names = "default";
602+
pinctrl-0 = <&cy3304_reset>;
603+
#address-cells = <1>;
604+
#size-cells = <0>;
605+
606+
hub_2_0: hub@1 {
607+
compatible = "usb4b4,6502", "usb4b4,6506";
608+
reg = <1>;
609+
peer-hub = <&hub_3_0>;
610+
reset-gpios = <&gpio4 RK_PA3 GPIO_ACTIVE_HIGH>;
611+
vdd-supply = <&vcc1v2_phy>;
612+
vdd2-supply = <&vcc3v3_sys>;
613+
614+
};
615+
616+
hub_3_0: hub@2 {
617+
compatible = "usb4b4,6500", "usb4b4,6504";
618+
reg = <2>;
619+
peer-hub = <&hub_2_0>;
620+
reset-gpios = <&gpio4 RK_PA3 GPIO_ACTIVE_HIGH>;
621+
vdd-supply = <&vcc1v2_phy>;
622+
vdd2-supply = <&vcc3v3_sys>;
623+
};
612624
};
613625

614626
&usb_host1_ehci {

0 commit comments

Comments
 (0)