diff options
author | Steve Lin <stlin@nvidia.com> | 2011-05-12 16:26:40 -0700 |
---|---|---|
committer | Varun Colbert <vcolbert@nvidia.com> | 2011-05-17 12:04:37 -0700 |
commit | 04c5ca4389c75953fecc52bcfd81032edf9544df (patch) | |
tree | eb6fb1afe6c77d76142b3fb8acb4ffcb29ddf5aa /drivers/usb | |
parent | dbad3b2b9d5c5e766cfe2c7aa5379d13125f245e (diff) |
usb: tegra: fix tegra ehci setup sequence
Fix tegra ehci setup sequence according to EHCI spec.
- move ehci_reset after ehci_halt
- avoid redundant ehci_reset after ehci_run. ehci_reset has a side effect
to cause phy reset for certain phy interface.
Bug 800301
Change-Id: I9a798de1b6361742ce759e44d141673c0bd328b3
Reviewed-on: http://git-master/r/31432
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/host/ehci-hcd.c | 3 | ||||
-rw-r--r-- | drivers/usb/host/ehci-tegra.c | 17 | ||||
-rw-r--r-- | drivers/usb/host/ehci.h | 1 |
3 files changed, 14 insertions, 7 deletions
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index 36ec66bb995e..f590e815df57 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c @@ -259,7 +259,8 @@ static int ehci_reset (struct ehci_hcd *ehci) command |= CMD_RESET; dbg_cmd (ehci, "reset", command); - ehci_writel(ehci, command, &ehci->regs->command); + if (!ehci->controller_resets_phy) + ehci_writel(ehci, command, &ehci->regs->command); ehci_to_hcd(ehci)->state = HC_STATE_HALT; ehci->next_statechange = jiffies; retval = handshake (ehci, &ehci->regs->command, diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c index 92bbe159cf4b..a20725e375c0 100644 --- a/drivers/usb/host/ehci-tegra.c +++ b/drivers/usb/host/ehci-tegra.c @@ -475,12 +475,6 @@ static int tegra_ehci_setup(struct usb_hcd *hcd) #ifndef CONFIG_ARCH_TEGRA_2x_SOC ehci->has_hostpc = 1; #endif - - /* switch to host mode */ - hcd->has_tt = 1; - ehci_reset(ehci); - tegra_ehci_post_reset(tegra->phy); - retval = ehci_halt(ehci); if (retval) return retval; @@ -490,8 +484,19 @@ static int tegra_ehci_setup(struct usb_hcd *hcd) if (retval) return retval; + hcd->has_tt = 1; ehci->sbrn = 0x20; + ehci_reset(ehci); + tegra_ehci_post_reset(tegra->phy); + + /* + * Resetting the controller has the side effect of resetting the PHY. + * So, never reset the controller after the calling + * tegra_ehci_reinit API. + */ + ehci->controller_resets_phy = 1; + ehci_port_power(ehci, 1); return retval; } diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h index 6f62e68e0e6f..530540a4bdd4 100644 --- a/drivers/usb/host/ehci.h +++ b/drivers/usb/host/ehci.h @@ -132,6 +132,7 @@ struct ehci_hcd { /* one per controller */ unsigned need_io_watchdog:1; unsigned broken_periodic:1; unsigned fs_i_thresh:1; /* Intel iso scheduling */ + unsigned controller_resets_phy:1; unsigned port_reset_no_wait:1; /* required for usb32 quirk */ |