History log of /drivers/usb/early/ehci-dbgp.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
c430131a02d677aa708f56342c1565edfdacb3c0 03-May-2011 Jan Andersson <jan@gaisler.com> USB: EHCI: Support controllers with big endian capability regs

The two first HC capability registers (CAPLENGTH and HCIVERSION)
are defined as one 8-bit and one 16-bit register. Most HC
implementations have selected to treat these registers as part
of a 32-bit register, giving the same layout for both big and
small endian systems.

This patch adds a new quirk, big_endian_capbase, to support
controllers with big endian register interfaces that treat
HCIVERSION and CAPLENGTH as individual registers.

Signed-off-by: Jan Andersson <jan@gaisler.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/usb/early/ehci-dbgp.c
25985edcedea6396277003854657b5f3cb31a628 31-Mar-2011 Lucas De Marchi <lucas.demarchi@profusion.mobi> Fix common misspellings

Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
/drivers/usb/early/ehci-dbgp.c
ef58d97a30af66b31f6400e49c87b4d64fc1f5bc 10-Jan-2011 Ferenc Wagner <wferi@niif.hu> USB: ehci-dbgp: fix typo in startup message

Signed-off-by: Ferenc Wagner <wferi@niif.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/usb/early/ehci-dbgp.c
4fe1da4ebc18c4c42fa56c228447f68033fce5f0 21-May-2010 Jason Wessel <jason.wessel@windriver.com> echi-dbgp: Add kernel debugger support for the usb debug port

This patch adds the capability to use the usb debug port with the
kernel debugger. It is also still possible to use this functionality
with or without the earlyprintk=dbgpX. It is possible to use the
kgdbwait boot argument to debug very early in the kernel start up code.

There are two ways to use this driver extension with a kernel boot argument.

1) kgdbdbgp=# -- Where # is the number of the usb debug controller

You must use sysrq-g to break into the kernel debugger on another
connection type other than the dbgp.

2) kgdbdbgp=#debugControlNum#,#Seconds#

In this mode, the usb debug port is polled every #Seconds# for
character input. It is possible to use gdb or press control-c to
break into the kernel debugger.

From the implementation perspective there are 3 high level changes.

1) Allow variable retries for the the hardware via dbgp_bulk_read().

The amount of retries for the dbgp_bulk_read() needed to be
variable instead of fixed. We do not want to poll at all when the
kernel is operating in interrupt driven mode. The polling only
occurs if the kernel was booted when specifying some number of
seconds via the kgdbdbgp boot argument (IE kgdbdbgp=0,1). In this
case the loop count is reduced to 1 so as introduce the smallest
amount of latency as possible.

2) Save the bulk IN endpoint address for use by the kgdb code.

3) The addition of the kgdb interface code.

This consisted of adding in a character read function for the dbgp
as well as a polling thread to allow the dbgp to interrupt the
kernel execution. The rest is the typical kgdb I/O api.

CC: Eric Biederman <ebiederm@xmission.com>
CC: Yinghai Lu <yhlu.kernel@gmail.com>
CC: linux-usb@vger.kernel.org
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/usb/early/ehci-dbgp.c
815e173e1d71742f1135fb4d4931e8115a3ca0ef 05-Feb-2010 Jason Wessel <jason.wessel@windriver.com> USB: ehci-dbgp: split PID register updates for IN and OUT pipes

This patch addresses two problems:

1) Bulk reads should always use the DATA0 for the pid, and the write
PID should toggle between DATA0 and DATA1. The fix is using
dbgp_pid_write_update() and dbgp_pid_read_update().

2) The delay loop for waiting for a transaction was not long enough to
always complete the initial handshake inside dbgp_wait_until_done().
After the initial handshake the maximum delay length is never reached.

The combined result of these two changes allows for the removal of the
forced resynchronization where a bulk write was issued with a dummy
data payload only to get the device to start accepting data writes
again.

CC: Eric Biederman <ebiederm@xmission.com>
CC: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/usb/early/ehci-dbgp.c
40b52371be92cf9990de162e4c7b4fd9160150a7 20-Nov-2009 Jan Beulich <JBeulich@novell.com> USB: fix section mismatch in early ehci dbgp

Commit 917778267fbe67703ab7d5c6f0b7a05d4c3df485 removed __init from
ehci_wait_for_port(), but left it in place on ehci_reset_port(), which
is being called from the former function.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Acked-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/usb/early/ehci-dbgp.c
68d2956a810b5c1b8213a1a9f59eacc54d7ce087 20-Aug-2009 Jason Wessel <jason.wessel@windriver.com> USB: ehci-dbgp: errata for EHCI debug/host controller synchronization

On some EHCI debug controllers after the host controller driver is
activated, the debug controller will occasionally fail to submit a
bulk write URB. On controllers that exhibit this behavior a dummy
bulk write must get submitted to resynchronize the device.

The "dummy bulk write" does not get received by the host attached to
the other end of the usb debug device. The usb debug device simply
acknowledges the "dummy bulk write" and returns to a usable state.

The behavior, without this patch is that you see missing text from a
complete kernel boot when using the keep option to the earlyprintk
kernel argument.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
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>
/drivers/usb/early/ehci-dbgp.c
aab2d4086a1876fcff282aa36e2d4a92aa9935c9 20-Aug-2009 Jason Wessel <jason.wessel@windriver.com> USB: ehci-dbgp: errata for EHCI debug controller initialization

On some EHCI usb debug controllers, the EHCI debug device will fail to
be seen after a port reset, after a warm reset. Two options exist to
get the device to initialize correctly.

Option 1 is to unplug and plug in the device.

Option 2 is to use the EHCI port test to get the usb debug device to
start talking again. At that point the debug controller port reset
will succeed.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
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>
CC: dbrownell@users.sourceforge.net
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/usb/early/ehci-dbgp.c
8d053c79f22462f55c02c8083580730b922cf7b4 20-Aug-2009 Jason Wessel <jason.wessel@windriver.com> 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>
/drivers/usb/early/ehci-dbgp.c
917778267fbe67703ab7d5c6f0b7a05d4c3df485 20-Aug-2009 Jason Wessel <jason.wessel@windriver.com> USB: ehci-dbgp: stability improvements and external re-init

This patch implements several changes:

1) Improve the capability to debug the dbgp driver

The dbgp_ehci_status() was added in a number of places to report
the critical ehci registers to diagnose the cause of a failure of
the ehci-dbgp driver.

2) Capability to survive the host controller initialization

The dbgp_external_startup(), dbgp_not_safe, and dbgp_phys_port were
added so as to allow the ehci-dbgp to re-initialize after the ehci
host controller is reset by the standard host controller driver.
This same routine is common for the early startup or
re-initialization.

This resulted in the need to move some of the initialization code
out of the __init section because the ehci driver has the
possibility to be loaded later on as a kernel module.

3) Stability improvements for device initialization

The device enumeration from 0 to 127 has the possibility to fail
the first time after a warm reset on some older EHCI debug
controllers. The enumeration will be tried up to 3 times to
account for this failure case.

The dbg_wait_until_complete() was changed to wait up to 250 ms
before failing which only comes into play during device
initialization. The maximum delay will never get hit during the
course of normal operation of the driver, unless the device got
unplugged or there was a ehci controller failure, in which case the
dbgp device driver will shut itself down.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: dbrownell@users.sourceforge.net
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/usb/early/ehci-dbgp.c
56faf0f98fd53e4a27cec331a3ff6d4aa55b1213 20-Aug-2009 Jason Wessel <jason.wessel@windriver.com> USB: dbgp: EHCI debug controller initialization delays

When using the EHCI host controller as a polled device, a bit more
tolerance is required in terms of delays. On some 3+ghz systems the
cpu loops were faster than the EHCI device mmio and resulted in the
controller failing to initialize.

On at least one first generation EHCI controller when it was not
operating in interrupt mode, it would fail to report a port change
status, but executing the port reset allowed the debug controller to
work correctly anyway. This errata causes a one time 300ms delay in
the boot time, where as the typical delay is 1-5ms for an EHCI
controller that does not have this errata.

The debug printk's were fixed to have the correct state messages, and
there was a conversion from using early_printk to printk to avoid
calling the dbgp driver while debugging the initialization.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
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>
/drivers/usb/early/ehci-dbgp.c
093344e1362cbf9525a5da09a565f357d8102f3b 20-Aug-2009 Jason Wessel <jason.wessel@windriver.com> USB: ehci-dbgp: Execute early BIOS hand off

The PCI quirk code executes a BIOS hand off to obtain full control of
the EHCI host controller, the self contained ehci-dbgp driver must do
the same thing using the early PCI API, else the BIOS can cause a
fatal fault.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: dbrownell@users.sourceforge.net
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/usb/early/ehci-dbgp.c
87a5d15154ae2389251e6ad99216a846b905375c 20-Aug-2009 Jason Wessel <jason.wessel@windriver.com> USB: dbgp: insert cr prior to nl as needed

The rs232 drivers send a carriage return prior to a new line in the
early printk code.

The usb debug driver should do the same because you want to be able to
use the same terminal programs and tools for analysis of early printk
data.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
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>
/drivers/usb/early/ehci-dbgp.c
df6c516900d48df3581b23d37d6516a22ec4f2ca 20-Aug-2009 Jason Wessel <jason.wessel@windriver.com> USB: ehci,dbgp,early_printk: split ehci debug driver from early_printk.c

Move the dbgp early printk driver in advance of refactoring and adding
new code, so the changes to this code are tracked separately from the
move of the code.

The drivers/usb/early directory will be the location of the current
and future early usb code for driving usb devices prior initializing
the standard interrupt driven USB drivers.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
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>
/drivers/usb/early/ehci-dbgp.c