usb: dwc3: add dis-u1u2-quirk to reject enter U1 and U2
The DWC3 with Innosilicon USB 3.0 PHY on Rockchip platforms
(e.g. rk3328, rk1808) has problem to exit to U0 state from
U1 or U2 state when DWC3 work as peripheral mode. This patch
adds a quirk to reject transition to U1 and U2 state to
workaround this issue.
Refer to commit aaa5c055cc06 ("usb: dwc3: add dis-u1u2-quirk to
reject enter U1 and U2") in Rockchip Linux Kernel-4.4 .
Change-Id: I1f4176caab3ccdc31ba7eb06684267833bf804db
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
This commit is contained in:
parent
7ce213e781
commit
9c946fbb24
|
|
@ -723,6 +723,7 @@ int dwc3_uboot_init(struct dwc3_device *dwc3_dev)
|
|||
dwc->rx_detect_poll_quirk = dwc3_dev->rx_detect_poll_quirk;
|
||||
dwc->dis_u3_susphy_quirk = dwc3_dev->dis_u3_susphy_quirk;
|
||||
dwc->dis_u2_susphy_quirk = dwc3_dev->dis_u2_susphy_quirk;
|
||||
dwc->dis_u1u2_quirk = dwc3_dev->dis_u2_susphy_quirk;
|
||||
|
||||
dwc->tx_de_emphasis_quirk = dwc3_dev->tx_de_emphasis_quirk;
|
||||
if (dwc3_dev->tx_de_emphasis)
|
||||
|
|
|
|||
|
|
@ -701,6 +701,7 @@ struct dwc3_scratchpad_array {
|
|||
* @rx_detect_poll_quirk: set if we enable rx_detect to polling lfps quirk
|
||||
* @dis_u3_susphy_quirk: set if we disable usb3 suspend phy
|
||||
* @dis_u2_susphy_quirk: set if we disable usb2 suspend phy
|
||||
* @dis_u1u2_quirk: set if we reject transition to U1 or U2 state
|
||||
* @tx_de_emphasis_quirk: set if we enable Tx de-emphasis quirk
|
||||
* @tx_de_emphasis: Tx de-emphasis value
|
||||
* 0 - -6dB de-emphasis
|
||||
|
|
@ -826,6 +827,7 @@ struct dwc3 {
|
|||
unsigned rx_detect_poll_quirk:1;
|
||||
unsigned dis_u3_susphy_quirk:1;
|
||||
unsigned dis_u2_susphy_quirk:1;
|
||||
unsigned dis_u1u2_quirk:1;
|
||||
|
||||
unsigned tx_de_emphasis_quirk:1;
|
||||
unsigned tx_de_emphasis:2;
|
||||
|
|
|
|||
|
|
@ -417,7 +417,7 @@ static int dwc3_ep0_handle_feature(struct dwc3 *dwc,
|
|||
return -EINVAL;
|
||||
|
||||
reg = dwc3_readl(dwc->regs, DWC3_DCTL);
|
||||
if (set)
|
||||
if (set && !dwc->dis_u1u2_quirk)
|
||||
reg |= DWC3_DCTL_INITU1ENA;
|
||||
else
|
||||
reg &= ~DWC3_DCTL_INITU1ENA;
|
||||
|
|
@ -431,7 +431,7 @@ static int dwc3_ep0_handle_feature(struct dwc3 *dwc,
|
|||
return -EINVAL;
|
||||
|
||||
reg = dwc3_readl(dwc->regs, DWC3_DCTL);
|
||||
if (set)
|
||||
if (set && !dwc->dis_u1u2_quirk)
|
||||
reg |= DWC3_DCTL_INITU2ENA;
|
||||
else
|
||||
reg &= ~DWC3_DCTL_INITU2ENA;
|
||||
|
|
@ -568,7 +568,10 @@ static int dwc3_ep0_set_config(struct dwc3 *dwc, struct usb_ctrlrequest *ctrl)
|
|||
* nothing is pending from application.
|
||||
*/
|
||||
reg = dwc3_readl(dwc->regs, DWC3_DCTL);
|
||||
reg |= (DWC3_DCTL_ACCEPTU1ENA | DWC3_DCTL_ACCEPTU2ENA);
|
||||
if (dwc->dis_u1u2_quirk)
|
||||
reg &= ~(DWC3_DCTL_ACCEPTU1ENA | DWC3_DCTL_ACCEPTU2ENA);
|
||||
else
|
||||
reg |= (DWC3_DCTL_ACCEPTU1ENA | DWC3_DCTL_ACCEPTU2ENA);
|
||||
dwc3_writel(dwc->regs, DWC3_DCTL, reg);
|
||||
|
||||
dwc->resize_fifos = true;
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ struct dwc3_device {
|
|||
unsigned rx_detect_poll_quirk;
|
||||
unsigned dis_u3_susphy_quirk;
|
||||
unsigned dis_u2_susphy_quirk;
|
||||
unsigned dis_u1u2_quirk;
|
||||
unsigned tx_de_emphasis_quirk;
|
||||
unsigned tx_de_emphasis;
|
||||
unsigned usb2_phyif_utmi_width;
|
||||
|
|
|
|||
Loading…
Reference in New Issue