aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/early
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/early
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/early')
-rw-r--r--drivers/usb/early/ehci-dbgp.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/usb/early/ehci-dbgp.c b/drivers/usb/early/ehci-dbgp.c
index 06e05ea17871..b88cb65b64e0 100644
--- a/drivers/usb/early/ehci-dbgp.c
+++ b/drivers/usb/early/ehci-dbgp.c
@@ -933,3 +933,26 @@ struct console early_dbgp_console = {
933 .flags = CON_PRINTBUFFER, 933 .flags = CON_PRINTBUFFER,
934 .index = -1, 934 .index = -1,
935}; 935};
936
937int dbgp_reset_prep(void)
938{
939 u32 ctrl;
940
941 dbgp_not_safe = 1;
942 if (!ehci_debug)
943 return 0;
944
945 if (early_dbgp_console.index != -1 &&
946 !(early_dbgp_console.flags & CON_BOOT))
947 return 1;
948 /* This means the console is not initialized, or should get
949 * shutdown so as to allow for reuse of the usb device, which
950 * means it is time to shutdown the usb debug port. */
951 ctrl = readl(&ehci_debug->control);
952 if (ctrl & DBGP_ENABLED) {
953 ctrl &= ~(DBGP_CLAIM);
954 writel(ctrl, &ehci_debug->control);
955 }
956 return 0;
957}
958EXPORT_SYMBOL_GPL(dbgp_reset_prep);