diff options
author | Steve Lin <stlin@nvidia.com> | 2011-05-24 18:44:11 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2013-09-14 01:13:57 -0700 |
commit | 4ee195b5197341a1ba59b3e3f18c99367d5f2b21 (patch) | |
tree | d96a40061ba7461c8049f8e4b2db04d859d740d5 /drivers | |
parent | 8ba864d37030013b1c2a35aace0cbee9649ccdb0 (diff) |
usb: tegra: fix tegra ehci setup sequence for UTMI/ULPI/HSIC
This is a WAR to fix tegra ehci setup sequence for USB2 UTMI/ULPI/HSIC mode.
- Calling ehci_reset according to proper phy type instead of hard coded value.
- Adding CONFIG_USB_EHCI_TEGRA in the common ehci-hcd code.
Bug 830978, 812716
Original-Change-Id: Ib66acf758792ef4076c5d2ec6a2e5d565389596f
Reviewed-on: http://git-master/r/32664
Tested-by: Szming Lin <stlin@nvidia.com>
Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-by: Suresh Mangipudi <smangipudi@nvidia.com>
Reviewed-by: Michael Hsu <mhsu@nvidia.com>
Tested-by: Michael Hsu <mhsu@nvidia.com>
Reviewed-by: Scott Williams <scwilliams@nvidia.com>
Reviewed-by: Alex Courbot <acourbot@nvidia.com>
Tested-by: Alex Courbot <acourbot@nvidia.com>
Rebase-Id: R09d5a39680a5fa4e39cb29fc32113661b1cccf6d
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/host/ehci-hcd.c | 2 | ||||
-rw-r--r-- | drivers/usb/host/ehci-tegra.c | 18 | ||||
-rw-r--r-- | drivers/usb/host/ehci.h | 2 |
3 files changed, 16 insertions, 6 deletions
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index 3fb6521d0db3..04ec5d7eb264 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c @@ -248,7 +248,9 @@ static int ehci_reset (struct ehci_hcd *ehci) command |= CMD_RESET; dbg_cmd (ehci, "reset", command); +#ifdef CONFIG_USB_EHCI_TEGRA if (!ehci->controller_resets_phy) +#endif ehci_writel(ehci, command, &ehci->regs->command); ehci->rh_state = EHCI_RH_HALTED; ehci->next_statechange = jiffies; diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c index d23a3cf1fefc..c8ba9fc11a81 100644 --- a/drivers/usb/host/ehci-tegra.c +++ b/drivers/usb/host/ehci-tegra.c @@ -379,9 +379,13 @@ static void tegra_ehci_restart(struct usb_hcd *hcd) struct tegra_ehci_hcd *tegra = dev_get_drvdata(hcd->self.controller); unsigned int temp; + ehci->controller_resets_phy = 0; ehci_reset(ehci); tegra_ehci_post_reset(tegra->phy, false); + if (tegra->phy->usb_phy_type == TEGRA_USB_PHY_TYPE_NULL_ULPI) + ehci->controller_resets_phy = 1; + /* setup the frame list and Async q heads */ ehci_writel(ehci, ehci->periodic_dma, &ehci->regs->frame_list); ehci_writel(ehci, (u32)ehci->async->qh_dma, &ehci->regs->async_next); @@ -445,12 +449,14 @@ static int tegra_ehci_setup(struct usb_hcd *hcd) tegra_ehci_post_reset(tegra->phy, false); - /* - * 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; + if (tegra->phy->usb_phy_type == TEGRA_USB_PHY_TYPE_NULL_ULPI) { + /* + * 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; + } return 0; } diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h index ee2899a5a5fb..a7393a9c4a42 100644 --- a/drivers/usb/host/ehci.h +++ b/drivers/usb/host/ehci.h @@ -200,7 +200,9 @@ struct ehci_hcd { /* one per controller */ unsigned has_synopsys_hc_bug:1; /* Synopsys HC */ unsigned frame_index_bug:1; /* MosChip (AKA NetMos) */ unsigned need_oc_pp_cycle:1; /* MPC834X port power */ +#ifdef CONFIG_USB_EHCI_TEGRA unsigned controller_resets_phy:1; +#endif /* required for usb32 quirk */ #define OHCI_CTRL_HCFS (3 << 6) |