|
@@ -312,13 +312,16 @@ static int musb_usb_probe(struct udevice *dev)
|
|
{
|
|
{
|
|
struct musb_host_data *host = dev_get_priv(dev);
|
|
struct musb_host_data *host = dev_get_priv(dev);
|
|
struct usb_bus_priv *priv = dev_get_uclass_priv(dev);
|
|
struct usb_bus_priv *priv = dev_get_uclass_priv(dev);
|
|
|
|
+ void *base = dev_read_addr_ptr(dev);
|
|
int ret;
|
|
int ret;
|
|
|
|
|
|
|
|
+ if (!base)
|
|
|
|
+ return -EINVAL;
|
|
|
|
+
|
|
priv->desc_before_addr = true;
|
|
priv->desc_before_addr = true;
|
|
|
|
|
|
#ifdef CONFIG_USB_MUSB_HOST
|
|
#ifdef CONFIG_USB_MUSB_HOST
|
|
- host->host = musb_init_controller(&musb_plat, NULL,
|
|
|
|
- (void *)SUNXI_USB0_BASE);
|
|
|
|
|
|
+ host->host = musb_init_controller(&musb_plat, NULL, base);
|
|
if (!host->host)
|
|
if (!host->host)
|
|
return -EIO;
|
|
return -EIO;
|
|
|
|
|
|
@@ -326,7 +329,7 @@ static int musb_usb_probe(struct udevice *dev)
|
|
if (!ret)
|
|
if (!ret)
|
|
printf("Allwinner mUSB OTG (Host)\n");
|
|
printf("Allwinner mUSB OTG (Host)\n");
|
|
#else
|
|
#else
|
|
- ret = musb_register(&musb_plat, NULL, (void *)SUNXI_USB0_BASE);
|
|
|
|
|
|
+ ret = musb_register(&musb_plat, NULL, base);
|
|
if (!ret)
|
|
if (!ret)
|
|
printf("Allwinner mUSB OTG (Peripheral)\n");
|
|
printf("Allwinner mUSB OTG (Peripheral)\n");
|
|
#endif
|
|
#endif
|