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

Marek Vasut marex at denx.de
Wed Oct 21 09:15:16 CEST 2020


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() ?

> +		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