Skip to content

Commit

Permalink
tty/serial: Add kgdb_nmi driver
Browse files Browse the repository at this point in the history
This special driver makes it possible to temporary use NMI debugger port
as a normal console by issuing 'nmi_console' command (assuming that the
port is attached to KGDB).

Unlike KDB's disable_nmi command, with this driver you are always able
to go back to the debugger using KGDB escape sequence ($3#33).  This is
because this console driver processes the input in NMI context, and thus
is able to intercept the magic sequence.

Note that since the console interprets input and uses polling
communication methods, for things like PPP it is still better to fully
detach debugger port from the KGDB NMI (i.e. disable_nmi), and use raw
console.

Usually, to enter the debugger one have to type the magic sequence, so
initially the kernel will print the following prompt on the NMI debugger
console:

	Type $3#33 to enter the debugger>

For convenience, there is a kgdb_fiq.knock kernel command line option,
when set to 0, this turns the special command to just a return key
press, so the kernel will be printing this:

	Hit <return> to enter the debugger>

This is more convenient for long debugging sessions, although it makes
nmi_console feature somewhat useless.

And for the cases when NMI connected to a dedicated button, the knocking
can be disabled altogether by setting kgdb_fiq.knock to -1.

Suggested-by: Colin Cross <ccross@android.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Acked-by: Alan Cox <alan@linux.intel.com>
Acked-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Anton Vorontsov authored and Greg Kroah-Hartman committed Sep 26, 2012
1 parent 5c8124a commit 0c57dfc
Show file tree
Hide file tree
Showing 5 changed files with 441 additions and 0 deletions.
19 changes: 19 additions & 0 deletions drivers/tty/serial/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,25 @@ config SERIAL_ATMEL_TTYAT

Say Y if you have an external 8250/16C550 UART. If unsure, say N.

config SERIAL_KGDB_NMI
bool "Serial console over KGDB NMI debugger port"
depends on KGDB_SERIAL_CONSOLE
help
This special driver allows you to temporary use NMI debugger port
as a normal console (assuming that the port is attached to KGDB).

Unlike KDB's disable_nmi command, with this driver you are always
able to go back to the debugger using KGDB escape sequence ($3#33).
This is because this console driver processes the input in NMI
context, and thus is able to intercept the magic sequence.

Note that since the console interprets input and uses polling
communication methods, for things like PPP you still must fully
detach debugger port from the KGDB NMI (i.e. disable_nmi), and
use raw console.

If unsure, say N.

config SERIAL_KS8695
bool "Micrel KS8695 (Centaur) serial port support"
depends on ARCH_KS8695
Expand Down
1 change: 1 addition & 0 deletions drivers/tty/serial/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ obj-$(CONFIG_SERIAL_MSM_HS) += msm_serial_hs.o
obj-$(CONFIG_SERIAL_NETX) += netx-serial.o
obj-$(CONFIG_SERIAL_OF_PLATFORM) += of_serial.o
obj-$(CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL) += nwpserial.o
obj-$(CONFIG_SERIAL_KGDB_NMI) += kgdb_nmi.o
obj-$(CONFIG_SERIAL_KS8695) += serial_ks8695.o
obj-$(CONFIG_SERIAL_OMAP) += omap-serial.o
obj-$(CONFIG_SERIAL_ALTERA_UART) += altera_uart.o
Expand Down
Loading

0 comments on commit 0c57dfc

Please sign in to comment.