diff mbox series

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

Message ID 1513061911-30076-5-git-send-email-jagan@amarulasolutions.com
State Deferred
Delegated to: Jagannadha Sutradharudu Teki
Headers show
Series sun50i: a64: add support for axp803, musb | expand

Commit Message

Jagan Teki Dec. 12, 2017, 6:58 a.m. UTC
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@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(-)

Comments

Chen-Yu Tsai Dec. 12, 2017, 7:24 a.m. UTC | #1
On Tue, Dec 12, 2017 at 2:58 PM, Jagan Teki <jagan@amarulasolutions.com> wrote:
> 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@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);

This driver is fully DM enabled. See the patch getting the base address
from the device tree I just sent.

ChenYu

>         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
>
diff mbox series

Patch

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