> From: Felipe Balbi [mailto:ba...@ti.com]
> Sent: Friday, September 26, 2014 5:54 PM
> 
> On Fri, Sep 26, 2014 at 11:18:48PM +0000, Paul Zimmerman wrote:
> > > From: Felipe Balbi [mailto:ba...@ti.com]
> > > 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 ?

Well, it's called LPM Errata because the feature was added to the USB
spec as an erratum. It's not an erratum to our controller. But I don't
have any strong feelings about how the driver support is implemented.

-- 
Paul

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to