Message ID | 20200430021620.25772-2-frank.wang@rock-chips.com |
---|---|
State | New |
Headers | show |
Series | Add Rockchip RK3399 USB3.0 Host support | expand |
On Thu, Apr 30, 2020 at 7:47 AM Frank Wang <frank.wang at rock-chips.com> wrote: > > Add a quirk to clear the GUSB2PHYCFG.ENBLSLPM bit, which controls > whether the PHY receives the suspend signal from the controller. > > Refer to commit ec791d149bca("usb: dwc3: Add dis_enblslpm_quirk") > in Linux Kernel. > > Signed-off-by: Frank Wang <frank.wang at rock-chips.com> > Reviewed-by: Kever Yang <kever.yang at rock-chips.com> > --- > drivers/usb/dwc3/core.c | 6 ++++++ > drivers/usb/dwc3/core.h | 1 + > include/dwc3-uboot.h | 1 + > 3 files changed, 8 insertions(+) > > diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c > index 4ec3f6df6a..a80e7d54aa 100644 > --- a/drivers/usb/dwc3/core.c > +++ b/drivers/usb/dwc3/core.c > @@ -395,6 +395,9 @@ static void dwc3_phy_setup(struct dwc3 *dwc) > if (dwc->dis_u2_susphy_quirk) > reg &= ~DWC3_GUSB2PHYCFG_SUSPHY; > > + if (dwc->dis_enblslpm_quirk) > + reg &= ~DWC3_GUSB2PHYCFG_ENBLSLPM; > + This patch alone seems not building with DWC3 enabled,drivers/usb/dwc3/core.c: In function ?dwc3_phy_setup?: drivers/usb/dwc3/core.c:399:11: error: ?DWC3_GUSB2PHYCFG_ENBLSLPM? undeclared (first use in this function) reg &= ~DWC3_GUSB2PHYCFG_ENBLSLPM; Add this macros to core.h Jagan.
Hi Jagan, On 2020/5/1 14:53, Jagan Teki wrote: > On Thu, Apr 30, 2020 at 7:47 AM Frank Wang <frank.wang at rock-chips.com> wrote: >> Add a quirk to clear the GUSB2PHYCFG.ENBLSLPM bit, which controls >> whether the PHY receives the suspend signal from the controller. >> >> Refer to commit ec791d149bca("usb: dwc3: Add dis_enblslpm_quirk") >> in Linux Kernel. >> >> Signed-off-by: Frank Wang <frank.wang at rock-chips.com> >> Reviewed-by: Kever Yang <kever.yang at rock-chips.com> >> --- >> drivers/usb/dwc3/core.c | 6 ++++++ >> drivers/usb/dwc3/core.h | 1 + >> include/dwc3-uboot.h | 1 + >> 3 files changed, 8 insertions(+) >> >> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c >> index 4ec3f6df6a..a80e7d54aa 100644 >> --- a/drivers/usb/dwc3/core.c >> +++ b/drivers/usb/dwc3/core.c >> @@ -395,6 +395,9 @@ static void dwc3_phy_setup(struct dwc3 *dwc) >> if (dwc->dis_u2_susphy_quirk) >> reg &= ~DWC3_GUSB2PHYCFG_SUSPHY; >> >> + if (dwc->dis_enblslpm_quirk) >> + reg &= ~DWC3_GUSB2PHYCFG_ENBLSLPM; >> + > This patch alone seems not building with DWC3 > enabled,drivers/usb/dwc3/core.c: In function ?dwc3_phy_setup?: > drivers/usb/dwc3/core.c:399:11: error: ?DWC3_GUSB2PHYCFG_ENBLSLPM? > undeclared (first use in this function) > reg &= ~DWC3_GUSB2PHYCFG_ENBLSLPM; > > Add this macros to core.h ACK > Jagan. > > >
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 4ec3f6df6a..a80e7d54aa 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -395,6 +395,9 @@ static void dwc3_phy_setup(struct dwc3 *dwc) if (dwc->dis_u2_susphy_quirk) reg &= ~DWC3_GUSB2PHYCFG_SUSPHY; + if (dwc->dis_enblslpm_quirk) + reg &= ~DWC3_GUSB2PHYCFG_ENBLSLPM; + dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg); mdelay(100); @@ -715,6 +718,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_enblslpm_quirk = dwc3_dev->dis_enblslpm_quirk; dwc->tx_de_emphasis_quirk = dwc3_dev->tx_de_emphasis_quirk; if (dwc3_dev->tx_de_emphasis) @@ -975,6 +979,8 @@ void dwc3_of_parse(struct dwc3 *dwc) "snps,dis_u3_susphy_quirk"); dwc->dis_u2_susphy_quirk = dev_read_bool(dev, "snps,dis_u2_susphy_quirk"); + dwc->dis_enblslpm_quirk = dev_read_bool(dev, + "snps,dis_enblslpm_quirk"); dwc->tx_de_emphasis_quirk = dev_read_bool(dev, "snps,tx_de_emphasis_quirk"); tmp = dev_read_u8_array_ptr(dev, "snps,tx_de_emphasis", 1); diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index 1c08a2c5b6..eabbc30f25 100644 --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h @@ -821,6 +821,7 @@ struct dwc3 { unsigned rx_detect_poll_quirk:1; unsigned dis_u3_susphy_quirk:1; unsigned dis_u2_susphy_quirk:1; + unsigned dis_enblslpm_quirk:1; unsigned tx_de_emphasis_quirk:1; unsigned tx_de_emphasis:2; diff --git a/include/dwc3-uboot.h b/include/dwc3-uboot.h index 3c9e204cf0..fd3f173c37 100644 --- a/include/dwc3-uboot.h +++ b/include/dwc3-uboot.h @@ -32,6 +32,7 @@ struct dwc3_device { unsigned rx_detect_poll_quirk; unsigned dis_u3_susphy_quirk; unsigned dis_u2_susphy_quirk; + unsigned dis_enblslpm_quirk; unsigned tx_de_emphasis_quirk; unsigned tx_de_emphasis; int index;