diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2010-06-24 10:13:31 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2010-06-24 11:41:31 +0200 |
commit | c8363b8f603db301575cf444108554e5485e24a5 (patch) | |
tree | 9bddf9cdab931bb3086994294e9f85b3304464b2 /drivers | |
parent | 57b56a989fb0071382832c9e7263e48057314e6c (diff) | |
download | barebox-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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/usb_ehci_core.c | 18 |
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: |