]> git.ipfire.org Git - thirdparty/u-boot.git/blobdiff - drivers/usb/dwc3/core.c
usb: dwc3: Add disable u2mac linestate check quirk
[thirdparty/u-boot.git] / drivers / usb / dwc3 / core.c
index 83a0782adce478f2390d1f9a999737aa6140b65c..b399c9bea9913b76bc231b1ea7fa30c38f9c39f2 100644 (file)
@@ -727,6 +727,7 @@ int dwc3_uboot_init(struct dwc3_device *dwc3_dev)
        dwc->dis_u3_susphy_quirk = dwc3_dev->dis_u3_susphy_quirk;
        dwc->dis_u2_susphy_quirk = dwc3_dev->dis_u2_susphy_quirk;
        dwc->dis_del_phy_power_chg_quirk = dwc3_dev->dis_del_phy_power_chg_quirk;
+       dwc->dis_tx_ipgap_linecheck_quirk = dwc3_dev->dis_tx_ipgap_linecheck_quirk;
        dwc->dis_enblslpm_quirk = dwc3_dev->dis_enblslpm_quirk;
        dwc->dis_u2_freeclk_exists_quirk = dwc3_dev->dis_u2_freeclk_exists_quirk;
 
@@ -936,6 +937,8 @@ void dwc3_of_parse(struct dwc3 *dwc)
                                "snps,dis_u2_susphy_quirk");
        dwc->dis_del_phy_power_chg_quirk = dev_read_bool(dev,
                                "snps,dis-del-phy-power-chg-quirk");
+       dwc->dis_tx_ipgap_linecheck_quirk = dev_read_bool(dev,
+                               "snps,dis-tx-ipgap-linecheck-quirk");
        dwc->dis_enblslpm_quirk = dev_read_bool(dev,
                                "snps,dis_enblslpm_quirk");
        dwc->dis_u2_freeclk_exists_quirk = dev_read_bool(dev,
@@ -956,6 +959,7 @@ void dwc3_of_parse(struct dwc3 *dwc)
 int dwc3_init(struct dwc3 *dwc)
 {
        int ret;
+       u32 reg;
 
        dwc3_cache_hwparams(dwc);
 
@@ -977,6 +981,22 @@ int dwc3_init(struct dwc3 *dwc)
                goto event_fail;
        }
 
+       if (dwc->revision >= DWC3_REVISION_250A) {
+               reg = dwc3_readl(dwc->regs, DWC3_GUCTL1);
+
+               /*
+                * Enable hardware control of sending remote wakeup
+                * in HS when the device is in the L1 state.
+                */
+               if (dwc->revision >= DWC3_REVISION_290A)
+                       reg |= DWC3_GUCTL1_DEV_L1_EXIT_BY_HW;
+
+               if (dwc->dis_tx_ipgap_linecheck_quirk)
+                       reg |= DWC3_GUCTL1_TX_IPGAP_LINECHECK_DIS;
+
+               dwc3_writel(dwc->regs, DWC3_GUCTL1, reg);
+       }
+
        ret = dwc3_core_init_mode(dwc);
        if (ret)
                goto mode_fail;