summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2015-05-10 14:10:13 +0200
committerSimon Glass <sjg@chromium.org>2015-05-14 18:49:30 -0600
commit71b945267d3e412efe4540a9ee61886f5e1e1e4a (patch)
treebf60b16ecc4f79de94cb0cb1b3f91146d413b690 /drivers/usb
parent4588d61a284aa2306d4b83954a650c066f1f569c (diff)
downloadu-boot-imx-71b945267d3e412efe4540a9ee61886f5e1e1e4a.zip
u-boot-imx-71b945267d3e412efe4540a9ee61886f5e1e1e4a.tar.gz
u-boot-imx-71b945267d3e412efe4540a9ee61886f5e1e1e4a.tar.bz2
usb: Fix handover of full-speed devices from ehci to companion
When after a reset the port status connection bit is still set and the enable bit is not then we're dealing with a full-speed device and should hand it over to the companion controller. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/host/ehci-hcd.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 46d01d4..ce760d0 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -897,11 +897,21 @@ static int ehci_submit_root(struct usb_device *dev, unsigned long pipe,
*/
ret = handshake(status_reg, EHCI_PS_PR, 0,
2 * 1000);
- if (!ret)
- ctrl->portreset |= 1 << port;
- else
+ if (!ret) {
+ reg = ehci_readl(status_reg);
+ if ((reg & (EHCI_PS_PE | EHCI_PS_CS))
+ == EHCI_PS_CS && !ehci_is_TDI()) {
+ debug("port %d full speed --> companion\n", port - 1);
+ reg &= ~EHCI_PS_CLEAR;
+ reg |= EHCI_PS_PO;
+ ehci_writel(status_reg, reg);
+ } else {
+ ctrl->portreset |= 1 << port;
+ }
+ } else {
printf("port(%d) reset error\n",
port - 1);
+ }
}
break;
case USB_PORT_FEAT_TEST: