[PATCH 1/7] usb: dwc3: Add frame length adjustment quirk

Ran Wang ran.wang_1 at nxp.com
Wed Oct 21 09:20:48 CEST 2020


Hi Marek,

On Wednesday, October 21, 2020 3:15 PM, Marek Vasut wrote:
> 
> On 10/21/20 8:25 AM, Ran Wang wrote:
> 
> [...]
> 
> > +static void dwc3_frame_length_adjustment(struct dwc3 *dwc, u32 val) {
> > +	u32 reg;
> > +	u32 dft;
> > +
> > +	reg = dwc3_readl(dwc->regs, DWC3_GFLADJ);
> > +	dft = reg & DWC3_GFLADJ_30MHZ_MASK;
> > +	if (dft != val) {
> 
> Is there a point to this test or could this entire function be turned into
> clrsetbits_le32() ?

I think the purpose is avoiding unnecessary write to GFLADJ to reduce potential impact on HW logic, especially counter/timer related.

Regards,
Ran

> > +		reg &= ~DWC3_GFLADJ_30MHZ_MASK;
> > +		reg |= DWC3_GFLADJ_30MHZ_SDBND_SEL | val;
> > +		dwc3_writel(dwc->regs, DWC3_GFLADJ, reg);
> > +	}
> > +}
> 
> [...]


More information about the U-Boot mailing list