[PATCH v3 1/1] drivers: usb: host: Add BRCM xHCI driver
Marek Vasut
marex at denx.de
Wed Apr 8 05:41:53 CEST 2020
On 4/8/20 5:35 AM, Rayagonda Kokatanur wrote:
[...]
> +struct brcm_xhci_platdata {
> + unsigned int arcache;
> + unsigned int awcache;
> + uintptr_t hc_base;
This could be struct xhci_hccr * instead , and then you can remove the
cast ...
> +};
> +
> +static int xhci_brcm_probe(struct udevice *dev)
> +{
> + struct brcm_xhci_platdata *plat = dev_get_platdata(dev);
> + struct xhci_hcor *hcor;
> + struct xhci_hccr *hcd;
> + int len, ret = 0;
> +
> + if (!plat) {
> + dev_err(dev, "Can't get xHCI Plat data\n");
> + return -ENOMEM;
> + }
> +
> + hcd = dev_read_addr_ptr(dev);
> + if (!hcd) {
> + dev_err(dev, "Can't get the xHCI register base address\n");
> + return -ENXIO;
> + }
> +
> + plat->hc_base = (uintptr_t)hcd;
... here.
> + len = HC_LENGTH(xhci_readl(&hcd->cr_capbase));
> + hcor = (struct xhci_hcor *)(plat->hc_base + len);
[...]
More information about the U-Boot
mailing list