From f19fd87e9387282b5abbfdafe46ac272320643d8 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 21 Dec 2009 16:35:48 -0500 Subject: Blackfin: add support for kgdb Signed-off-by: Robin Getz Signed-off-by: Mike Frysinger --- include/asm-blackfin/config.h | 7 +++++++ include/asm-blackfin/deferred.h | 20 ++++++++++++++++++++ include/asm-blackfin/entry.h | 10 ++++++++++ include/asm-blackfin/mach-common/bits/core.h | 3 +++ include/asm-blackfin/signal.h | 1 + include/configs/bfin_adi_common.h | 1 + 6 files changed, 42 insertions(+) create mode 100644 include/asm-blackfin/deferred.h create mode 100644 include/asm-blackfin/signal.h (limited to 'include') diff --git a/include/asm-blackfin/config.h b/include/asm-blackfin/config.h index 0ae838abea..7455685057 100644 --- a/include/asm-blackfin/config.h +++ b/include/asm-blackfin/config.h @@ -66,6 +66,11 @@ # error CONFIG_PLL_BYPASS: Invalid value: must be 0 or 1 #endif +/* If we are using KGDB, make sure we defer exceptions */ +#ifdef CONFIG_CMD_KGDB +# define CONFIG_EXCEPTION_DEFER 1 +#endif + /* Using L1 scratch pad makes sense for everyone by default. */ #ifndef CONFIG_LINUX_CMDLINE_ADDR # define CONFIG_LINUX_CMDLINE_ADDR L1_SRAM_SCRATCH @@ -138,6 +143,8 @@ #endif #ifndef CONFIG_SYS_CBSIZE # define CONFIG_SYS_CBSIZE 1024 +#elif defined(CONFIG_CMD_KGDB) && CONFIG_SYS_CBSIZE < 1024 +# error "kgdb needs cbsize to be >= 1024" #endif #ifndef CONFIG_SYS_BARGSIZE # define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE diff --git a/include/asm-blackfin/deferred.h b/include/asm-blackfin/deferred.h new file mode 100644 index 0000000000..82ceda3e4d --- /dev/null +++ b/include/asm-blackfin/deferred.h @@ -0,0 +1,20 @@ +/* + * U-boot - deferred register layout + * + * Copyright 2004-2009 Analog Devices Inc. + * + * Licensed under the GPL-2 or later. + */ + +#ifndef _BLACKFIN_DEFER_H +#define _BLACKFIN_DEFER_H + +#define deferred_regs_DCPLB_FAULT_ADDR 0 +#define deferred_regs_ICPLB_FAULT_ADDR 1 +#define deferred_regs_retx 2 +#define deferred_regs_SEQSTAT 3 +#define deferred_regs_SYSCFG 4 +#define deferred_regs_IMASK 5 +#define deferred_regs_last 6 + +#endif /* _BLACKFIN_DEFER_H */ diff --git a/include/asm-blackfin/entry.h b/include/asm-blackfin/entry.h index ef74d686af..404144f4f8 100644 --- a/include/asm-blackfin/entry.h +++ b/include/asm-blackfin/entry.h @@ -86,6 +86,11 @@ [--sp] = RETE; [--sp] = SEQSTAT; [--sp] = SYSCFG; +#ifdef CONFIG_CMD_KGDB + p0.l = lo(IPEND) + p0.h = hi(IPEND) + r0 = [p0]; +#endif [--sp] = r0; /* Skip IPEND as well. */ .endm @@ -137,6 +142,11 @@ [--sp] = RETE; [--sp] = SEQSTAT; [--sp] = SYSCFG; +#ifdef CONFIG_CMD_KGDB + p0.l = lo(IPEND) + p0.h = hi(IPEND) + r0 = [p0]; +#endif [--sp] = r0; /* Skip IPEND as well. */ .endm diff --git a/include/asm-blackfin/mach-common/bits/core.h b/include/asm-blackfin/mach-common/bits/core.h index d8cee1032a..6db4f81826 100644 --- a/include/asm-blackfin/mach-common/bits/core.h +++ b/include/asm-blackfin/mach-common/bits/core.h @@ -105,5 +105,8 @@ #define SSSTEP 0x00000001 /* Supervisor Single Step */ #define CCEN 0x00000002 /* Cycle Counter Enable */ #define SNEN 0x00000004 /* Self-Nesting Interrupt Enable */ +#define SYSCFG_SSSTEP_P 0 +#define SYSCFG_CCEN_P 1 +#define SYSCFG_SCEN_P 2 #endif diff --git a/include/asm-blackfin/signal.h b/include/asm-blackfin/signal.h new file mode 100644 index 0000000000..7b1573ce19 --- /dev/null +++ b/include/asm-blackfin/signal.h @@ -0,0 +1 @@ +#include diff --git a/include/configs/bfin_adi_common.h b/include/configs/bfin_adi_common.h index 6a2f1c7aa5..1896cf53d5 100644 --- a/include/configs/bfin_adi_common.h +++ b/include/configs/bfin_adi_common.h @@ -83,6 +83,7 @@ # define CONFIG_CMD_CPLBINFO # define CONFIG_CMD_ELF # define CONFIG_ELF_SIMPLE_LOAD +# define CONFIG_CMD_KGDB # define CONFIG_CMD_REGINFO # define CONFIG_CMD_STRINGS # if defined(__ADSPBF51x__) || defined(__ADSPBF52x__) || defined(__ADSPBF54x__) -- cgit v1.2.1