Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8e0f01a7 authored by Mayank Rana's avatar Mayank Rana
Browse files

dwc3: core: Add ssp u3 u0 link state related quirk



USB PHY (qmp super speed phy) is unable to consistently move between
the u3 (p3)/u0(p0) states causing controller and phy link level issues
resulting in device re-enumeration. Fix the issue by forcing qmp phy to
move to P2 state always before moving to P0 from P3 state. Forcing by
phy link state is done by enabling Ux_exit_in_Px (BIT:27) and P3ExSigP2
(BIT:10) of GUSB3PIPECTL register.

Change-Id: I1edd6c77769d3139863413eed82f2b8b98b33d42
Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
parent 218848f9
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -645,6 +645,10 @@ static int dwc3_phy_setup(struct dwc3 *dwc)
	if (dwc->dis_del_phy_power_chg_quirk)
		reg &= ~DWC3_GUSB3PIPECTL_DEPOCHANGE;

	if (dwc->ssp_u3_u0_quirk)
		reg |= (DWC3_GUSB3PIPECTL_UX_EXIT_PX |
			DWC3_GUSB3PIPECTL_P3EXSIGP2);

	dwc3_writel(dwc->regs, DWC3_GUSB3PIPECTL(0), reg);

	reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0));
@@ -1409,6 +1413,8 @@ static void dwc3_get_properties(struct dwc3 *dwc)

	dwc->dis_metastability_quirk = device_property_read_bool(dev,
				"snps,dis_metastability_quirk");
	dwc->ssp_u3_u0_quirk = device_property_read_bool(dev,
				"snps,ssp-u3-u0-quirk");

	device_property_read_u32(dev, "snps,xhci-imod-value",
			&dwc->xhci_imod_value);
+3 −0
Original line number Diff line number Diff line
@@ -324,6 +324,7 @@
#define DWC3_GUSB3PIPECTL_DEP1P2P3_EN	DWC3_GUSB3PIPECTL_DEP1P2P3(1)
#define DWC3_GUSB3PIPECTL_DEPOCHANGE	BIT(18)
#define DWC3_GUSB3PIPECTL_SUSPHY	BIT(17)
#define DWC3_GUSB3PIPECTL_P3EXSIGP2	BIT(10)
#define DWC3_GUSB3PIPECTL_LFPSFILT	BIT(9)
#define DWC3_GUSB3PIPECTL_RX_DETOPOLL	BIT(8)
#define DWC3_GUSB3PIPECTL_TX_DEEPH_MASK	DWC3_GUSB3PIPECTL_TX_DEEPH(3)
@@ -1112,6 +1113,7 @@ struct dwc3_scratchpad_array {
 * 	2	- No de-emphasis
 * 	3	- Reserved
 * @dis_metastability_quirk: set to disable metastability quirk.
 * @ssp_u3_u0_quirk: set to enable ss specific u3 to u0 quirk.
 * @err_evt_seen: previous event in queue was erratic error
 * @in_lpm: indicates if controller is in low power mode (no clocks)
 * @irq: irq number
@@ -1327,6 +1329,7 @@ struct dwc3 {
	unsigned int		vbus_draw;

	unsigned		dis_metastability_quirk:1;
	unsigned		ssp_u3_u0_quirk:1;

	u16			imod_interval;
	u32			xhci_imod_value;