Skip to content

Commit 33e05f0

Browse files
wuliangfengrkhuangtao
authored andcommitted
CHROMIUM: phy: rockchip-typec: enable usb3 host after pipe ready
If we power off the SoC LOGIC rail in S3, we can find that the Type-C PHY can't initialize correctly after system resume with error log looked like this: phy phy-ff800000.phy.9: phy poweron failed --> -110 dwc3 fe900000.dwc3: failed to initialize core dwc3: probe of fe900000.dwc3 failed with error -110 It's because that the field of usb3tousb2 in GRF_USB3PHY0/1_CON0 is reset to 1 after power off the SoC LOGIC, which means that the pipe interface is blocked between Tpye-C PHY and usb3 controller. And after system resume, the rockchip_usb3_phy_power_on() will call the tcphy_cfg_usb3_to_usb2_only() to clear the usb3tousb2 bit and enable the usb3 host again. If we clear the usb3tousb2 bit before pipe ready, it may cause waiting for pipe ready timeout. Note that the RK3399 TRM suggests that we should keep the whole usb3 controller in reset for the duration of the Type-C PHY initialization. However, it's hard to assert the reset in the current framework of reset. And according to the TRM, it doesn't require that we should clear the usb3tousb2 bit before pipe ready. So let's enable the usb3 host after pipe ready to avoid the Type-C PHY initialization failure. BUG=b:62644399, chromium:783464 TEST=run suspend_stess_test on Scarlet, usb device can work after resume Change-Id: Ie597cbe35568c390460aa2fdbad0e66c6104c8d2 Reviewed-on: https://chromium-review.googlesource.com/896908 Commit-Ready: Brian Norris <briannorris@chromium.org> Tested-by: Brian Norris <briannorris@chromium.org> Reviewed-by: Brian Norris <briannorris@chromium.org> Signed-off-by: William Wu <william.wu@rock-chips.com>
1 parent fd186f2 commit 33e05f0

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

drivers/phy/rockchip/phy-rockchip-typec.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -877,6 +877,9 @@ static int _rockchip_usb3_phy_power_on(struct rockchip_typec_phy *tcphy)
877877
regmap_read(tcphy->grf_regs, reg->offset, &val);
878878
if (!(val & BIT(reg->enable_bit))) {
879879
tcphy->mode |= new_mode & (MODE_DFP_USB | MODE_UFP_USB);
880+
881+
/* enable usb3 host */
882+
tcphy_cfg_usb3_to_usb2_only(tcphy, false);
880883
goto unlock_ret;
881884
}
882885
usleep_range(10, 20);

0 commit comments

Comments
 (0)