summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2010-06-24 10:13:31 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2010-06-24 11:41:31 +0200
commitc8363b8f603db301575cf444108554e5485e24a5 (patch)
tree9bddf9cdab931bb3086994294e9f85b3304464b2
parent57b56a989fb0071382832c9e7263e48057314e6c (diff)
downloadbarebox-c8363b8f603db301575cf444108554e5485e24a5.tar.gz
barebox-c8363b8f603db301575cf444108554e5485e24a5.tar.xz
ehci: Handle hub port reset properly
This has been copied from the U-Boot ehci driver. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--drivers/usb/usb_ehci_core.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/usb/usb_ehci_core.c b/drivers/usb/usb_ehci_core.c
index f3611cda2f..c5d4da3f6c 100644
--- a/drivers/usb/usb_ehci_core.c
+++ b/drivers/usb/usb_ehci_core.c
@@ -676,6 +676,8 @@ ehci_submit_root(struct usb_device *dev, unsigned long pipe, void *buffer,
ehci_writel(status_reg, reg);
break;
} else {
+ int ret;
+
reg |= EHCI_PS_PR;
reg &= ~EHCI_PS_PE;
ehci_writel(status_reg, reg);
@@ -686,6 +688,22 @@ ehci_submit_root(struct usb_device *dev, unsigned long pipe, void *buffer,
*/
wait_ms(50);
ehci->portreset |= 1 << le16_to_cpu(req->index);
+ /* terminate the reset */
+ ehci_writel(status_reg, reg & ~EHCI_PS_PR);
+ /*
+ * A host controller must terminate the reset
+ * and stabilize the state of the port within
+ * 2 milliseconds
+ */
+ ret = handshake(status_reg, EHCI_PS_PR, 0,
+ 2 * 1000);
+ if (!ret)
+ ehci->portreset |=
+ 1 << le16_to_cpu(req->index);
+ else
+ printf("port(%d) reset error\n",
+ le16_to_cpu(req->index) - 1);
+
}
break;
default: