From c2d7ef51d731fd34ec2c5db0d9dc7501ad069484 Mon Sep 17 00:00:00 2001 From: James Hogan Date: Thu, 29 Jan 2015 11:14:14 +0000 Subject: ttyFDC: Implement KGDB IO operations. Implement KGDB IO operations for MIPS Fast Debug Channel (FDC). This can be enabled via Kconfig, which also allows the channel number to be chosen. The magic sysrq hack is implemented in the TTY driver, detecting just ^C for the KGDB channel, and ^O followed by a letter for the FDC console channel. The KGDB operations are reasonably efficient thanks to the flush callback, with a 4 byte buffer being used in both directions to allow up to 4 bytes to be encoded per FDC word. Reading of data for KGDB will discard any data received on other channels, which clearly isn't ideal, but given that there is a single FIFO shared between channels we can't do much better. Signed-off-by: James Hogan Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: Jason Wessel Cc: linux-mips@linux-mips.org Cc: kgdb-bugreport@lists.sourceforge.net Cc: linux-kernel@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/9147/ Signed-off-by: Ralf Baechle --- drivers/tty/Kconfig | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'drivers/tty/Kconfig') diff --git a/drivers/tty/Kconfig b/drivers/tty/Kconfig index e0c18e5b7057..c01f45095877 100644 --- a/drivers/tty/Kconfig +++ b/drivers/tty/Kconfig @@ -450,4 +450,20 @@ config MIPS_EJTAG_FDC_EARLYCON If unsure, say N. +config MIPS_EJTAG_FDC_KGDB + bool "Use KGDB over an FDC channel" + depends on MIPS_EJTAG_FDC_TTY && KGDB + default y + help + This enables the use of KGDB over an FDC channel, allowing KGDB to be + used remotely or when a serial port isn't available. + +config MIPS_EJTAG_FDC_KGDB_CHAN + int "KGDB FDC channel" + depends on MIPS_EJTAG_FDC_KGDB + range 2 15 + default 3 + help + FDC channel number to use for KGDB. + endif # TTY -- cgit v1.2.3