mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] usb: chipidea-imx: Fix usb initialization
@ 2013-03-05 17:11 Alexander Shiyan
  2013-03-10 23:17 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Shiyan @ 2013-03-05 17:11 UTC (permalink / raw)
  To: barebox

This patch fix chipidea-imx usb initialization.
"imx_chipidea_port_init" was moved before PORTSC setup in the
commit "USB i.MX chipidea: implement post init support". This
change breaks usb function with ULPI. Patch moves port initialization
back after PORTSC setup, so it works again.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 drivers/usb/imx/chipidea-imx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/imx/chipidea-imx.c b/drivers/usb/imx/chipidea-imx.c
index 483484e..1570f90 100644
--- a/drivers/usb/imx/chipidea-imx.c
+++ b/drivers/usb/imx/chipidea-imx.c
@@ -73,13 +73,13 @@ static int imx_chipidea_probe(struct device_d *dev)
 	data.post_init = imx_chipidea_port_post_init;
 	data.drvdata = dev;
 
-	imx_chipidea_port_init(dev);
-
 	portsc = readl(base + 0x184);
 	portsc &= ~MXC_EHCI_PORTSC_MASK;
 	portsc |= pdata->flags & MXC_EHCI_PORTSC_MASK;
 	writel(portsc, base + 0x184);
 
+	imx_chipidea_port_init(dev);
+
 	if ((pdata->flags & MXC_EHCI_PORTSC_MASK) == MXC_EHCI_MODE_ULPI) {
 		dev_dbg(dev, "using ULPI phy\n");
 		if (IS_ENABLED(CONFIG_USB_ULPI)) {
-- 
1.7.12.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] usb: chipidea-imx: Fix usb initialization
  2013-03-05 17:11 [PATCH] usb: chipidea-imx: Fix usb initialization Alexander Shiyan
@ 2013-03-10 23:17 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2013-03-10 23:17 UTC (permalink / raw)
  To: Alexander Shiyan; +Cc: barebox

On Tue, Mar 05, 2013 at 09:11:08PM +0400, Alexander Shiyan wrote:
> This patch fix chipidea-imx usb initialization.
> "imx_chipidea_port_init" was moved before PORTSC setup in the
> commit "USB i.MX chipidea: implement post init support". This
> change breaks usb function with ULPI. Patch moves port initialization
> back after PORTSC setup, so it works again.

On which board are you working? The pcm038? This currently works for me
;)

> 
> Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
> ---
>  drivers/usb/imx/chipidea-imx.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/imx/chipidea-imx.c b/drivers/usb/imx/chipidea-imx.c
> index 483484e..1570f90 100644
> --- a/drivers/usb/imx/chipidea-imx.c
> +++ b/drivers/usb/imx/chipidea-imx.c
> @@ -73,13 +73,13 @@ static int imx_chipidea_probe(struct device_d *dev)
>  	data.post_init = imx_chipidea_port_post_init;
>  	data.drvdata = dev;
>  
> -	imx_chipidea_port_init(dev);
> -
>  	portsc = readl(base + 0x184);
>  	portsc &= ~MXC_EHCI_PORTSC_MASK;
>  	portsc |= pdata->flags & MXC_EHCI_PORTSC_MASK;
>  	writel(portsc, base + 0x184);
>  
> +	imx_chipidea_port_init(dev);
> +

Damn. I moved this to the current place also while working on ULPI, it
was the Efika MX Smartbook in this case. I would have to check if this
still works with this patch applied. I wish I'd know how to do this
setup correctly. This was a source of initialization order shuffeling in
the Kernel already.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-03-10 23:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-05 17:11 [PATCH] usb: chipidea-imx: Fix usb initialization Alexander Shiyan
2013-03-10 23:17 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox