usb: dwc3: SW WA for USB CV9(TD 9.23) compliance test failure

eUSB2 repeater is unable to block KJKJ pulse during ESE1. This is
resulting into eUSB2 PHY and repeater going out of sync and next
link up in high speed fails. Fix this issue by performing soft
reset of eUSB2 PHY.

Change-Id: I9913fe4cab03b344dea0525f7a72282cd743a915
Signed-off-by: Mayank Rana <quic_mrana@quicinc.com>
This commit is contained in:
Mayank Rana 2022-05-02 15:50:18 -07:00 committed by Wesley Cheng
parent 80f3cc0ceb
commit 85ca34183b

View File

@ -3204,6 +3204,19 @@ static void dwc3_msm_update_imem_pid(struct dwc3 *dwc)
}
}
static void mdwc3_usb2_phy_soft_reset(struct dwc3_msm *mdwc)
{
u32 val;
val = dwc3_msm_read_reg(mdwc->base, DWC3_GUSB2PHYCFG(0));
dwc3_msm_write_reg(mdwc->base, DWC3_GUSB2PHYCFG(0),
val | DWC3_GUSB2PHYCFG_PHYSOFTRST);
udelay(20);
val = dwc3_msm_read_reg(mdwc->base, DWC3_GUSB2PHYCFG(0));
val &= ~DWC3_GUSB2PHYCFG_PHYSOFTRST;
dwc3_msm_write_reg(mdwc->base, DWC3_GUSB2PHYCFG(0), val);
}
void dwc3_msm_notify_event(struct dwc3 *dwc,
enum dwc3_notify_event event, unsigned int value)
{
@ -3234,6 +3247,20 @@ void dwc3_msm_notify_event(struct dwc3 *dwc,
break;
case DWC3_CONTROLLER_CONNDONE_EVENT:
dev_dbg(mdwc->dev, "DWC3_CONTROLLER_CONNDONE_EVENT received\n");
/*
* SW WA for CV9 RESET DEVICE TEST(TD 9.23) compliance failure.
* Visit eUSB2 phy driver for more details.
*/
WARN_ON(mdwc->hs_phy->flags & PHY_HOST_MODE);
if (mdwc->use_eusb2_phy &&
(dwc->gadget->speed >= USB_SPEED_SUPER)) {
usb_phy_notify_connect(mdwc->hs_phy, dwc->gadget->speed);
udelay(20);
/* Perform usb2 phy soft reset as given workaround */
mdwc3_usb2_phy_soft_reset(mdwc);
}
/*
* Add power event if the dbm indicates coming out of L1 by
* interrupt