mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* USB chipidea patches
@ 2014-01-07 10:18 Sascha Hauer
  2014-01-07 10:18 ` [PATCH 1/4] usb: chipidea i.MX: remove unused pdata->init hook Sascha Hauer
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Sascha Hauer @ 2014-01-07 10:18 UTC (permalink / raw)
  To: barebox

These are some chipidea patches buried in my local repo.

Sascha

----------------------------------------------------------------
Sascha Hauer (4):
      usb: chipidea i.MX: remove unused pdata->init hook
      usb: chipidea i.MX: limit port init to HSIC mode
      usb: chipidea i.MX: always print an error message when ULPI fails
      usb: chipidea i.MX: add some delay after ulpi_setup

 drivers/usb/imx/chipidea-imx.c | 12 ++++++------
 include/usb/chipidea-imx.h     |  1 -
 2 files changed, 6 insertions(+), 7 deletions(-)

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

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

* [PATCH 1/4] usb: chipidea i.MX: remove unused pdata->init hook
  2014-01-07 10:18 USB chipidea patches Sascha Hauer
@ 2014-01-07 10:18 ` Sascha Hauer
  2014-01-07 10:18 ` [PATCH 2/4] usb: chipidea i.MX: limit port init to HSIC mode Sascha Hauer
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Sascha Hauer @ 2014-01-07 10:18 UTC (permalink / raw)
  To: barebox

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/usb/imx/chipidea-imx.c | 5 -----
 include/usb/chipidea-imx.h     | 1 -
 2 files changed, 6 deletions(-)

diff --git a/drivers/usb/imx/chipidea-imx.c b/drivers/usb/imx/chipidea-imx.c
index d8209d1..2f290e1 100644
--- a/drivers/usb/imx/chipidea-imx.c
+++ b/drivers/usb/imx/chipidea-imx.c
@@ -32,7 +32,6 @@ struct imx_chipidea {
 	struct ehci_data data;
 	unsigned long flags;
 	enum imx_usb_mode mode;
-	int (*init)(int port);
 	int portno;
 };
 
@@ -58,9 +57,6 @@ static int imx_chipidea_port_init(void *drvdata)
 	if (ret)
 		dev_err(ci->dev, "misc init failed: %s\n", strerror(-ret));
 
-	if (ci->init)
-		ci->init(ci->portno);
-
 	return ret;
 }
 
@@ -152,7 +148,6 @@ static int imx_chipidea_probe(struct device_d *dev)
 		}
 		ci->portno = dev->id;
 		ci->flags = pdata->flags;
-		ci->init = pdata->init;
 		ci->mode = pdata->mode;
 	}
 
diff --git a/include/usb/chipidea-imx.h b/include/usb/chipidea-imx.h
index 5801cf1..487217c 100644
--- a/include/usb/chipidea-imx.h
+++ b/include/usb/chipidea-imx.h
@@ -42,7 +42,6 @@ enum imx_usb_mode {
 struct imxusb_platformdata {
 	unsigned long flags;
 	enum imx_usb_mode mode;
-	int (*init)(int port);
 };
 
 int imx_usbmisc_port_init(int port, unsigned flags);
-- 
1.8.5.2


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

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

* [PATCH 2/4] usb: chipidea i.MX: limit port init to HSIC mode
  2014-01-07 10:18 USB chipidea patches Sascha Hauer
  2014-01-07 10:18 ` [PATCH 1/4] usb: chipidea i.MX: remove unused pdata->init hook Sascha Hauer
@ 2014-01-07 10:18 ` Sascha Hauer
  2014-01-07 10:18 ` [PATCH 3/4] usb: chipidea i.MX: always print an error message when ULPI fails Sascha Hauer
  2014-01-07 10:18 ` [PATCH 4/4] usb: chipidea i.MX: add some delay after ulpi_setup Sascha Hauer
  3 siblings, 0 replies; 5+ messages in thread
From: Sascha Hauer @ 2014-01-07 10:18 UTC (permalink / raw)
  To: barebox

imx_chipidea_port_init() will be called during startup from
the ehci driver. Calling it before setting up the PORTSC register
is only necessary in HSIC mode.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/usb/imx/chipidea-imx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/imx/chipidea-imx.c b/drivers/usb/imx/chipidea-imx.c
index 2f290e1..c81c10d 100644
--- a/drivers/usb/imx/chipidea-imx.c
+++ b/drivers/usb/imx/chipidea-imx.c
@@ -161,7 +161,8 @@ static int imx_chipidea_probe(struct device_d *dev)
 	ci->data.post_init = imx_chipidea_port_post_init;
 	ci->data.drvdata = ci;
 
-	imx_chipidea_port_init(ci);
+	if ((ci->flags & MXC_EHCI_PORTSC_MASK) == MXC_EHCI_MODE_HSIC)
+		imx_chipidea_port_init(ci);
 
 	portsc = readl(base + 0x184);
 	portsc &= ~MXC_EHCI_PORTSC_MASK;
-- 
1.8.5.2


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

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

* [PATCH 3/4] usb: chipidea i.MX: always print an error message when ULPI fails
  2014-01-07 10:18 USB chipidea patches Sascha Hauer
  2014-01-07 10:18 ` [PATCH 1/4] usb: chipidea i.MX: remove unused pdata->init hook Sascha Hauer
  2014-01-07 10:18 ` [PATCH 2/4] usb: chipidea i.MX: limit port init to HSIC mode Sascha Hauer
@ 2014-01-07 10:18 ` Sascha Hauer
  2014-01-07 10:18 ` [PATCH 4/4] usb: chipidea i.MX: add some delay after ulpi_setup Sascha Hauer
  3 siblings, 0 replies; 5+ messages in thread
From: Sascha Hauer @ 2014-01-07 10:18 UTC (permalink / raw)
  To: barebox

The ULPI code does not print a message when the operation times
out. Add one to the caller so that he gets an idea that something
is going wrong.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/usb/imx/chipidea-imx.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/usb/imx/chipidea-imx.c b/drivers/usb/imx/chipidea-imx.c
index c81c10d..dfaf590 100644
--- a/drivers/usb/imx/chipidea-imx.c
+++ b/drivers/usb/imx/chipidea-imx.c
@@ -44,6 +44,9 @@ static int imx_chipidea_port_init(void *drvdata)
 		dev_dbg(ci->dev, "using ULPI phy\n");
 		if (IS_ENABLED(CONFIG_USB_ULPI)) {
 			ret = ulpi_setup(ci->base + 0x170, 1);
+			if (ret)
+				dev_err(ci->dev, "ULPI setup failed with %s\n",
+						strerror(-ret));
 		} else {
 			dev_err(ci->dev, "no ULPI support available\n");
 			ret = -ENODEV;
-- 
1.8.5.2


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

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

* [PATCH 4/4] usb: chipidea i.MX: add some delay after ulpi_setup
  2014-01-07 10:18 USB chipidea patches Sascha Hauer
                   ` (2 preceding siblings ...)
  2014-01-07 10:18 ` [PATCH 3/4] usb: chipidea i.MX: always print an error message when ULPI fails Sascha Hauer
@ 2014-01-07 10:18 ` Sascha Hauer
  3 siblings, 0 replies; 5+ messages in thread
From: Sascha Hauer @ 2014-01-07 10:18 UTC (permalink / raw)
  To: barebox

On the pcm038 the ULPI phy is found correctly, but after
a power cycle the attached devices are not found. Adding
some delay fixes this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/usb/imx/chipidea-imx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/imx/chipidea-imx.c b/drivers/usb/imx/chipidea-imx.c
index dfaf590..a7ad734 100644
--- a/drivers/usb/imx/chipidea-imx.c
+++ b/drivers/usb/imx/chipidea-imx.c
@@ -47,6 +47,7 @@ static int imx_chipidea_port_init(void *drvdata)
 			if (ret)
 				dev_err(ci->dev, "ULPI setup failed with %s\n",
 						strerror(-ret));
+			mdelay(20);
 		} else {
 			dev_err(ci->dev, "no ULPI support available\n");
 			ret = -ENODEV;
-- 
1.8.5.2


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

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

end of thread, other threads:[~2014-01-07 10:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-07 10:18 USB chipidea patches Sascha Hauer
2014-01-07 10:18 ` [PATCH 1/4] usb: chipidea i.MX: remove unused pdata->init hook Sascha Hauer
2014-01-07 10:18 ` [PATCH 2/4] usb: chipidea i.MX: limit port init to HSIC mode Sascha Hauer
2014-01-07 10:18 ` [PATCH 3/4] usb: chipidea i.MX: always print an error message when ULPI fails Sascha Hauer
2014-01-07 10:18 ` [PATCH 4/4] usb: chipidea i.MX: add some delay after ulpi_setup Sascha Hauer

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