
8 Apr
2020
8 Apr
'20
9:25 a.m.
On Wed, Apr 8, 2020 at 11:18 AM Rayagonda Kokatanur rayagonda.kokatanur@broadcom.com wrote:
On Wed, Apr 8, 2020 at 9:56 AM Marek Vasut marex@denx.de wrote:
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 ...
Hi Marek,
uintptr_t is "unsigned long int" , its not pointer. If we make hc_base as a pointer "struct xhci_hccr *" it won't work because of pointer arithmetic during readl and writel. Please let me know if I am missing anything ?
If we make it struct xhci_hccr * then I think we need to type cast in readl and writel function. Please let me know ?
+};
+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);
[...]