[U-Boot] [PATCH 04/16] musb-new: sunxi: add common SUNXI_MUSB_BASE

Jagan Teki jagan at amarulasolutions.com
Tue Dec 12 06:58:19 UTC 2017


MUSB sunxi driver base not always USB0_BASE, on a64
USB0_BASE is USB-OTG-EHCI/OHCI base so add SUNXI_MUSB_BASE
and adjust the proper msub base for all sunxi families.

Signed-off-by: Jagan Teki <jagan at amarulasolutions.com>
---
 arch/arm/include/asm/arch-sunxi/cpu_sun4i.h | 4 ++++
 drivers/usb/musb-new/sunxi.c                | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/arch-sunxi/cpu_sun4i.h b/arch/arm/include/asm/arch-sunxi/cpu_sun4i.h
index 98728f9..2035489 100644
--- a/arch/arm/include/asm/arch-sunxi/cpu_sun4i.h
+++ b/arch/arm/include/asm/arch-sunxi/cpu_sun4i.h
@@ -47,6 +47,7 @@
 #define SUNXI_MMC3_BASE			0x01c12000
 #ifdef CONFIG_SUNXI_GEN_SUN4I
 #define SUNXI_USB0_BASE			0x01c13000
+#define SUNXI_MUSB_BASE			SUNXI_USB0_BASE
 #define SUNXI_USB1_BASE			0x01c14000
 #endif
 #define SUNXI_SS_BASE			0x01c15000
@@ -64,14 +65,17 @@
 #ifdef CONFIG_SUNXI_GEN_SUN6I
 #if defined(CONFIG_MACH_SUNXI_H3_H5) || defined(CONFIG_MACH_SUN50I)
 #define SUNXI_USBPHY_BASE		0x01c19000
+#define SUNXI_MUSB_BASE			SUNXI_USBPHY_BASE
 #define SUNXI_USB0_BASE			0x01c1a000
 #define SUNXI_USB1_BASE			0x01c1b000
 # if defined(CONFIG_MACH_SUNXI_H3_H5)
+#define SUNXI_MUSB_BASE			SUNXI_USB0_BASE
 #define SUNXI_USB2_BASE			0x01c1c000
 #define SUNXI_USB3_BASE			0x01c1d000
 # endif
 #else
 #define SUNXI_USB0_BASE			0x01c19000
+#define SUNXI_MUSB_BASE			SUNXI_USB0_BASE
 #define SUNXI_USB1_BASE			0x01c1a000
 #define SUNXI_USB2_BASE			0x01c1b000
 #endif
diff --git a/drivers/usb/musb-new/sunxi.c b/drivers/usb/musb-new/sunxi.c
index 7ee44ea..2e22497 100644
--- a/drivers/usb/musb-new/sunxi.c
+++ b/drivers/usb/musb-new/sunxi.c
@@ -318,7 +318,7 @@ static int musb_usb_probe(struct udevice *dev)
 
 #ifdef CONFIG_USB_MUSB_HOST
 	host->host = musb_init_controller(&musb_plat, NULL,
-					  (void *)SUNXI_USB0_BASE);
+					  (void *)SUNXI_MUSB_BASE);
 	if (!host->host)
 		return -EIO;
 
@@ -326,7 +326,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, (void *)SUNXI_MUSB_BASE);
 	if (!ret)
 		printf("Allwinner mUSB OTG (Peripheral)\n");
 #endif
-- 
2.7.4



More information about the U-Boot mailing list