linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: David Daney <ddaney@caviumnetworks.com>
Cc: linux-mips@linux-mips.org
Subject: Re: [PATCH] MIPS: Fix support for Cavium Octeon debugger stub (v2).
Date: Wed, 5 Aug 2009 10:41:04 +0100	[thread overview]
Message-ID: <20090805094104.GA14461@linux-mips.org> (raw)
In-Reply-To: <1246906976-19979-1-git-send-email-ddaney@caviumnetworks.com>

On Mon, Jul 06, 2009 at 12:02:56PM -0700, David Daney wrote:

> The Cavium Octeon bootloader has a debugger stub that requires a
> little help from the target application to break in.
> 
> If configured, when we get an interrupt on the debug uart we wake up
> the debugger.
> 
> Changes from v1: Inline octeon_get_boot_debug_flag so it compiles
>                  without CONFIG_CAVIUM_GDB.
> 
> Signed-off-by: David Daney <ddaney@caviumnetworks.com>
> ---
>  arch/mips/Kconfig.debug               |   10 ++++++
>  arch/mips/cavium-octeon/serial.c      |   53 ++++++++++++++++++++++++++++++++-
>  arch/mips/cavium-octeon/setup.c       |    2 +-
>  arch/mips/include/asm/octeon/octeon.h |    1 -
>  4 files changed, 63 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/mips/Kconfig.debug b/arch/mips/Kconfig.debug
> index 364ca89..f6a0e68 100644
> --- a/arch/mips/Kconfig.debug
> +++ b/arch/mips/Kconfig.debug
> @@ -42,6 +42,16 @@ config SB1XXX_CORELIS
>  	  Select compile flags that produce code that can be processed by the
>  	  Corelis mksym utility and UDB Emulator.
>  
> +config CAVIUM_GDB
> +	bool "Remote GDB debugging using the Cavium Networks Multicore GDB"
> +	depends on DEBUG_KERNEL
> +	depends on CPU_CAVIUM_OCTEON
> +	select DEBUG_INFO
> +	help
> +	  If you say Y here, it will be possible to remotely debug the MIPS
> +	  kernel using the Cavium Networks GDB with extended SMP support.
> +	  This is only useful for kernel hackers. If unsure, say N.
> +
>  config RUNTIME_DEBUG
>  	bool "Enable run-time debugging"
>  	depends on DEBUG_KERNEL
> diff --git a/arch/mips/cavium-octeon/serial.c b/arch/mips/cavium-octeon/serial.c
> index 8240728..2110e68 100644
> --- a/arch/mips/cavium-octeon/serial.c
> +++ b/arch/mips/cavium-octeon/serial.c
> @@ -18,11 +18,60 @@
>  
>  #include <asm/octeon/octeon.h>
>  
> +#if defined(CONFIG_CAVIUM_GDB)
> +
>  #ifdef CONFIG_GDB_CONSOLE
>  #define DEBUG_UART 0
>  #else
>  #define DEBUG_UART 1
>  #endif
> +static irqreturn_t interrupt_debug_char(int cpl, void *dev_id)
> +{
> +	unsigned long lsrval;
> +	unsigned long tmp;
> +
> +	lsrval = cvmx_read_csr(CVMX_MIO_UARTX_LSR(DEBUG_UART));
> +	if (lsrval & 1) {
> +#ifdef CONFIG_KGDB
> +		/*
> +		 * The Cavium EJTAG bootmonitor stub is not compatible
> +		 * with KGDB.  We should never get here.
> +		 */
> +#error Illegal to use both CONFIG_KGDB and CONFIG_CAVIUM_GDB
> +#endif

#error is only acceptable to catch bugs in Kconfig or the code itself.  This
#error however is triggering on .config settings including such generated by
randconfig which is a PITA.  So rather please ensure forbidden .configs
can't be generated.  Alternatively, implement things such that both
config options can co-exist.

  Ralf

      reply	other threads:[~2009-08-05  9:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-06 18:34 [PATCH] MIPS: Fix support for Cavium Octeon debugger stub David Daney
2009-07-06 18:59 ` David Daney
2009-07-06 19:01   ` David Daney
2009-07-06 19:02 ` [PATCH] MIPS: Fix support for Cavium Octeon debugger stub (v2) David Daney
2009-08-05  9:41   ` Ralf Baechle [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090805094104.GA14461@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=ddaney@caviumnetworks.com \
    --cc=linux-mips@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).