aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-blackfin/trace.h
diff options
context:
space:
mode:
authorRobin Getz <robin.getz@analog.com>2007-07-24 23:03:28 -0400
committerBryan Wu <bryan.wu@analog.com>2007-07-24 23:03:28 -0400
commit518039bc24cbb9ce34665814fe120eac50bedd9a (patch)
tree6b089a05025ae224d6636b6dc9d95e7c9e4677eb /include/asm-blackfin/trace.h
parentf16295e7e7f2a2a15876f570f10d6dc8f1f36ab8 (diff)
Blackfin arch: Add ability to expend the hardware trace buffer
Add ability to expend the hardware trace buffer via a configurable software buffer - so you can have lots of history when a crash occurs. The interesting way we do printk in the traps.c confusese the checking script Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Diffstat (limited to 'include/asm-blackfin/trace.h')
-rw-r--r--include/asm-blackfin/trace.h55
1 files changed, 46 insertions, 9 deletions
diff --git a/include/asm-blackfin/trace.h b/include/asm-blackfin/trace.h
index 9c2474c9a589..6313aace9d59 100644
--- a/include/asm-blackfin/trace.h
+++ b/include/asm-blackfin/trace.h
@@ -6,23 +6,46 @@
6#ifndef _BLACKFIN_TRACE_ 6#ifndef _BLACKFIN_TRACE_
7#define _BLACKFIN_TRACE_ 7#define _BLACKFIN_TRACE_
8 8
9/* Normally, we use ON, but you can't turn on software expansion until
10 * interrupts subsystem is ready
11 */
12
13#define BFIN_TRACE_INIT ((CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION << 4) | 0x03)
14#ifdef CONFIG_DEBUG_BFIN_HWTRACE_EXPAND
15#define BFIN_TRACE_ON (BFIN_TRACE_INIT | (CONFIG_DEBUG_BFIN_HWTRACE_EXPAND << 2))
16#else
17#define BFIN_TRACE_ON (BFIN_TRACE_INIT)
18#endif
19
9#ifndef __ASSEMBLY__ 20#ifndef __ASSEMBLY__
21extern unsigned long trace_buff_offset;
22extern unsigned long software_trace_buff[];
23
10/* Trace Macros for C files */ 24/* Trace Macros for C files */
11 25
26#ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON
27
12#define trace_buffer_save(x) \ 28#define trace_buffer_save(x) \
13 do { \ 29 do { \
14 (x) = bfin_read_TBUFCTL(); \ 30 (x) = bfin_read_TBUFCTL(); \
15 bfin_write_TBUFCTL((x) & ~TBUFEN); \ 31 bfin_write_TBUFCTL((x) & ~TBUFEN); \
16 } while (0) 32 } while (0)
17 33
18#define trace_buffer_restore(x) \ 34#define trace_buffer_restore(x) \
19 do { \ 35 do { \
20 bfin_write_TBUFCTL((x)); \ 36 bfin_write_TBUFCTL((x)); \
21 } while (0) 37 } while (0)
38#else /* DEBUG_BFIN_HWTRACE_ON */
39
40#define trace_buffer_save(x)
41#define trace_buffer_restore(x)
42#endif /* CONFIG_DEBUG_BFIN_HWTRACE_ON */
22 43
23#else 44#else
24/* Trace Macros for Assembly files */ 45/* Trace Macros for Assembly files */
25 46
47#ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON
48
26#define TRACE_BUFFER_START(preg, dreg) trace_buffer_start(preg, dreg) 49#define TRACE_BUFFER_START(preg, dreg) trace_buffer_start(preg, dreg)
27#define TRACE_BUFFER_STOP(preg, dreg) trace_buffer_stop(preg, dreg) 50#define TRACE_BUFFER_STOP(preg, dreg) trace_buffer_stop(preg, dreg)
28 51
@@ -32,12 +55,26 @@
32 dreg = 0x1; \ 55 dreg = 0x1; \
33 [preg] = dreg; 56 [preg] = dreg;
34 57
35#define trace_buffer_start(preg, dreg) \ 58#define trace_buffer_start(preg, dreg) \
36 preg.L = LO(TBUFCTL); \ 59 preg.L = LO(TBUFCTL); \
37 preg.H = HI(TBUFCTL); \ 60 preg.H = HI(TBUFCTL); \
38 dreg = 0x13; \ 61 dreg = BFIN_TRACE_ON; \
62 [preg] = dreg;
63
64#define trace_buffer_init(preg, dreg) \
65 preg.L = LO(TBUFCTL); \
66 preg.H = HI(TBUFCTL); \
67 dreg = BFIN_TRACE_INIT; \
39 [preg] = dreg; 68 [preg] = dreg;
40 69
70#else /* CONFIG_DEBUG_BFIN_HWTRACE_ON */
71
72#define trace_buffer_stop(preg, dreg)
73#define trace_buffer_start(preg, dreg)
74#define trace_buffer_init(preg, dreg)
75
76#endif /* CONFIG_DEBUG_BFIN_HWTRACE_ON */
77
41#ifdef CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE 78#ifdef CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE
42# define DEBUG_START_HWTRACE(preg, dreg) trace_buffer_start(preg, dreg) 79# define DEBUG_START_HWTRACE(preg, dreg) trace_buffer_start(preg, dreg)
43# define DEBUG_STOP_HWTRACE(preg, dreg) trace_buffer_stop(preg, dreg) 80# define DEBUG_STOP_HWTRACE(preg, dreg) trace_buffer_stop(preg, dreg)