aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ehci-pci.c
diff options
context:
space:
mode:
authorJason Wessel <jason.wessel@windriver.com>2009-08-20 16:39:54 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-09-23 09:46:38 -0400
commit8d053c79f22462f55c02c8083580730b922cf7b4 (patch)
tree2b29c3219fec7cb622af6ffba69c8eb21650c662 /drivers/usb/host/ehci-pci.c
parent917778267fbe67703ab7d5c6f0b7a05d4c3df485 (diff)
USB: ehci-dbgp,ehci: Allow early or late use of the dbgp device
If the EHCI debug port is initialized and in use, the EHCI host controller driver must follow two rules. 1) If the EHCI host driver issues a controller reset, the debug controller driver re-initialization must get called after the reset is completed. 2) The EHCI host driver should ignore any requests to the physical EHCI debug port when the EHCI debug port is in use. The code to check for the debug port was moved from ehci_pci_reinit() to ehci_pci_setup because it must get called prior to ehci_reset() which will clear the debug port registers. Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: dbrownell@users.sourceforge.net Cc: Ingo Molnar <mingo@elte.hu> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Yinghai Lu <yinghai@kernel.org> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/ehci-pci.c')
-rw-r--r--drivers/usb/host/ehci-pci.c39
1 files changed, 19 insertions, 20 deletions
diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c
index a88ad517ec5..378861b9d79 100644
--- a/drivers/usb/host/ehci-pci.c
+++ b/drivers/usb/host/ehci-pci.c
@@ -27,28 +27,8 @@
27/* called after powerup, by probe or system-pm "wakeup" */ 27/* called after powerup, by probe or system-pm "wakeup" */
28static int ehci_pci_reinit(struct ehci_hcd *ehci, struct pci_dev *pdev) 28static int ehci_pci_reinit(struct ehci_hcd *ehci, struct pci_dev *pdev)
29{ 29{
30 u32 temp;
31 int retval; 30 int retval;
32 31
33 /* optional debug port, normally in the first BAR */
34 temp = pci_find_capability(pdev, 0x0a);
35 if (temp) {
36 pci_read_config_dword(pdev, temp, &temp);
37 temp >>= 16;
38 if ((temp & (3 << 13)) == (1 << 13)) {
39 temp &= 0x1fff;
40 ehci->debug = ehci_to_hcd(ehci)->regs + temp;
41 temp = ehci_readl(ehci, &ehci->debug->control);
42 ehci_info(ehci, "debug port %d%s\n",
43 HCS_DEBUG_PORT(ehci->hcs_params),
44 (temp & DBGP_ENABLED)
45 ? " IN USE"
46 : "");
47 if (!(temp & DBGP_ENABLED))
48 ehci->debug = NULL;
49 }
50 }
51
52 /* we expect static quirk code to handle the "extended capabilities" 32 /* we expect static quirk code to handle the "extended capabilities"
53 * (currently just BIOS handoff) allowed starting with EHCI 0.96 33 * (currently just BIOS handoff) allowed starting with EHCI 0.96
54 */ 34 */
@@ -195,6 +175,25 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
195 break; 175 break;
196 } 176 }
197 177
178 /* optional debug port, normally in the first BAR */
179 temp = pci_find_capability(pdev, 0x0a);
180 if (temp) {
181 pci_read_config_dword(pdev, temp, &temp);
182 temp >>= 16;
183 if ((temp & (3 << 13)) == (1 << 13)) {
184 temp &= 0x1fff;
185 ehci->debug = ehci_to_hcd(ehci)->regs + temp;
186 temp = ehci_readl(ehci, &ehci->debug->control);
187 ehci_info(ehci, "debug port %d%s\n",
188 HCS_DEBUG_PORT(ehci->hcs_params),
189 (temp & DBGP_ENABLED)
190 ? " IN USE"
191 : "");
192 if (!(temp & DBGP_ENABLED))
193 ehci->debug = NULL;
194 }
195 }
196
198 ehci_reset(ehci); 197 ehci_reset(ehci);
199 198
200 /* at least the Genesys GL880S needs fixup here */ 199 /* at least the Genesys GL880S needs fixup here */