Re: [PATCH v4 3/4] usb: ehci: Add new EHCI driver for Broadcom STB SoC's

From: Alan Stern
Date: Wed Apr 29 2020 - 15:08:50 EST


On Wed, 29 Apr 2020, Al Cooper wrote:

> Add a new EHCI driver for Broadcom STB SoC's. A new EHCI driver
> was created instead of adding support to the existing ehci platform
> driver because of the code required to workaround bugs in the EHCI
> controller.
>
> Signed-off-by: Al Cooper <alcooperx@xxxxxxxxx>
> ---

...

> +static int __maybe_unused ehci_brcm_resume(struct device *dev)
> +{
> + struct usb_hcd *hcd = dev_get_drvdata(dev);
> + struct ehci_hcd *ehci = hcd_to_ehci(hcd);
> + struct brcm_priv *priv = hcd_to_ehci_priv(hcd);
> + int err;
> +
> + err = clk_prepare_enable(priv->clk);
> + if (err)
> + return err;
> + /*
> + * SWLINUX-1705: Avoid OUT packet underflows during high memory
> + * bus usage
> + * port_status[0x0f] = Broadcom-proprietary USB_EHCI_INSNREG00
> + * @ 0x90
> + */
> + ehci_writel(ehci, 0x00800040, &ehci->regs->port_status[0x10]);
> + ehci_writel(ehci, 0x00000001, &ehci->regs->port_status[0x12]);
> +
> + ehci_resume(hcd, false);
> + return 0;
> +}

One extra thing that came to my attention recently... Like all other
platform drivers, this has to set the runtime PM status of the
controller at the end of a system resume. See

https://marc.info/?l=linux-usb&m=158773611612885&w=2

for an example.

Alan Stern