aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/musb-new
diff options
context:
space:
mode:
authorChen-Yu Tsai <wens@csie.org>2017-12-30 20:44:07 +0800
committerMarek Vasut <marex@denx.de>2018-01-10 11:11:05 +0100
commitf4f9896ac310402de0e4f5d2c15a93cb89425aca (patch)
treee61646a2609e26762e6b7f8b2e7804d4a44f4ce1 /drivers/usb/musb-new
parent91f4fb9b89c94838bed41e12c3705c5553662c83 (diff)
downloadu-boot-f4f9896ac310402de0e4f5d2c15a93cb89425aca.zip
u-boot-f4f9896ac310402de0e4f5d2c15a93cb89425aca.tar.gz
u-boot-f4f9896ac310402de0e4f5d2c15a93cb89425aca.tar.bz2
musb: sunxi: Use base address from device tree
Now that the musb sunxi glue driver is completely device model / device tree driven, we should use the base address from the device tree, instead of hard-coding it in the source code. Fixes: 3a61b080acee ("musb: sunxi: switch to the device model") Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Diffstat (limited to 'drivers/usb/musb-new')
-rw-r--r--drivers/usb/musb-new/sunxi.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/usb/musb-new/sunxi.c b/drivers/usb/musb-new/sunxi.c
index 7ee44ea..aedc24b 100644
--- a/drivers/usb/musb-new/sunxi.c
+++ b/drivers/usb/musb-new/sunxi.c
@@ -312,13 +312,16 @@ static int musb_usb_probe(struct udevice *dev)
{
struct musb_host_data *host = dev_get_priv(dev);
struct usb_bus_priv *priv = dev_get_uclass_priv(dev);
+ void *base = dev_read_addr_ptr(dev);
int ret;
+ if (!base)
+ return -EINVAL;
+
priv->desc_before_addr = true;
#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)
return -EIO;
@@ -326,7 +329,7 @@ static int musb_usb_probe(struct udevice *dev)
if (!ret)
printf("Allwinner mUSB OTG (Host)\n");
#else
- ret = musb_register(&musb_plat, NULL, (void *)SUNXI_USB0_BASE);
+ ret = musb_register(&musb_plat, NULL, base);
if (!ret)
printf("Allwinner mUSB OTG (Peripheral)\n");
#endif