Re: [RFC PATCH 3/4] usb: dwc3: add quirk to be compatible for AMD NL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Fri, Sep 26, 2014 at 11:18:48PM +0000, Paul Zimmerman wrote:
> > From: Felipe Balbi [mailto:balbi@xxxxxx]
> > Sent: Friday, September 26, 2014 2:40 PM
> > 
> > On Fri, Sep 26, 2014 at 08:57:19PM +0000, Paul Zimmerman wrote:
> > > > > diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
> > > > > index 0fcc0a3..8277065 100644
> > > > > --- a/drivers/usb/dwc3/gadget.c
> > > > > +++ b/drivers/usb/dwc3/gadget.c
> > > > > @@ -2635,6 +2635,7 @@ static irqreturn_t dwc3_interrupt(int irq, void *_dwc)
> > > > >   */
> > > > >  int dwc3_gadget_init(struct dwc3 *dwc)
> > > > >  {
> > > > > +	u32					reg;
> > > > >  	int					ret;
> > > > >
> > > > >  	dwc->ctrl_req = dma_alloc_coherent(dwc->dev, sizeof(*dwc->ctrl_req),
> > > > > @@ -2689,6 +2690,13 @@ int dwc3_gadget_init(struct dwc3 *dwc)
> > > > >  	if (ret)
> > > > >  		goto err4;
> > > > >
> > > > > +	if (dwc->quirks & DWC3_AMD_NL_PLAT) {
> > > > > +		reg = dwc3_readl(dwc->regs, DWC3_DCTL);
> > > > > +		reg |= DWC3_DCTL_LPM_ERRATA(0xf);
> > > >
> > > > weird, why would Synopsys put this here ? It seems like this is only
> > > > useful when LPM Errata is enabled and that's, apparently, a host-side
> > > > thing.
> > > >
> > > > Paul, can you comment ?
> > >
> > > These bits contribute to how the device responds to an LPM transaction
> > > from the host. If DCFG.LPMCap=1, they set the BESL value above which
> > > the core will send a NYET. If DCFG.LPMCap=0, they have no effect. So
> > > it's definitely a device-side thing, but only if the core is configured
> > > with LPM Errata support enabled.
> > 
> > right, and how can SW detect if LPM Errata was enabled ? From the host
> > point of view, we can check bit 20 of xHCI capability register. What
> > about device ? I can't seem to find anything :-s
> 
> I just talked to one of our RTL designers. You're right, there is no
> way to tell from the Device registers alone whether the controller is
> configured with LPM Errata support or not.
> 
> You can tell for sure if it is *not* enabled, by checking GSNPSID, and
> if the version is earlier than 2.40a, the feature wasn't available.

alright, we can use this for something like:

WARN(rev < 2.40a && (flags & LPM_ERRATA || of_property_read_bool("lpm-errata")),
	"LPM Errata not available on dwc3 revisions <= 2.40a\n");

> So for Device-mode only controllers, I guess you will need a DT property
> for this.

right, DT property and platform_data feature flag, or something. I don't
wanna call it a quirk though, although it _is_ an erratum WRT LPM
support. Dunno. Any strong feelings ?

-- 
balbi

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux