[PATCH 1/7] usb: ehci-mx6: Add powerup_fixup implementation
Marek Vasut
marex at denx.de
Mon Jun 29 04:21:38 CEST 2020
On 6/29/20 4:13 AM, Peng Fan wrote:
[...]
> +static void ehci_mx6_powerup_fixup(struct ehci_ctrl *ctrl, uint32_t *status_reg,
> + uint32_t *reg)
> +{
> + u32 result;
> + int usec = 2000;
> +
> + mdelay(50);
> +
> + do {
> + result = ehci_readl(status_reg);
> + udelay(5);
> + if (!(result & EHCI_PS_PR))
> + break;
> + usec--;
> + } while (usec > 0);
> +
> + *reg = ehci_readl(status_reg);
> +}
Please use wait_for_bit*() . Also, is the 50 mS delay upfront required
or can this be wait_for_bit with 60000 uS timeout ?
More information about the U-Boot
mailing list