aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/kernel
diff options
context:
space:
mode:
authorRobin Getz <robin.getz@analog.com>2007-06-21 04:34:08 -0400
committerBryan Wu <bryan.wu@analog.com>2007-06-21 04:34:08 -0400
commit669b792c77bbc30e9f4d9c95dbc918dc348c49c2 (patch)
tree2d8403e9e3cf998eda8465a322261d45e24cd26a /arch/blackfin/kernel
parent29440a2b4cd37e32dfe0fa60ef1665775b24dab1 (diff)
Blackfin arch: Clean up trace buffer handling, No major functional changes.
Turns on trace earlier, so crashes at kernel start should print out a trace, making things easier to debug. Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <michael.frysinger@analog.com> Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Diffstat (limited to 'arch/blackfin/kernel')
-rw-r--r--arch/blackfin/kernel/setup.c14
-rw-r--r--arch/blackfin/kernel/traps.c11
2 files changed, 12 insertions, 13 deletions
diff --git a/arch/blackfin/kernel/setup.c b/arch/blackfin/kernel/setup.c
index 07c1cfdc958e..a86bf6545781 100644
--- a/arch/blackfin/kernel/setup.c
+++ b/arch/blackfin/kernel/setup.c
@@ -194,6 +194,17 @@ void __init setup_arch(char **cmdline_p)
194 /* this give a chance to get printk() working before crash. */ 194 /* this give a chance to get printk() working before crash. */
195#endif 195#endif
196 196
197 printk(KERN_INFO "Hardware Trace ");
198 if (bfin_read_TBUFCTL() & 0x1 )
199 printk("Active ");
200 else
201 printk("Off ");
202 if (bfin_read_TBUFCTL() & 0x2)
203 printk("and Enabled\n");
204 else
205 printk("and Disabled\n");
206
207
197#if defined(CONFIG_CHR_DEV_FLASH) || defined(CONFIG_BLK_DEV_FLASH) 208#if defined(CONFIG_CHR_DEV_FLASH) || defined(CONFIG_BLK_DEV_FLASH)
198 /* we need to initialize the Flashrom device here since we might 209 /* we need to initialize the Flashrom device here since we might
199 * do things with flash early on in the boot 210 * do things with flash early on in the boot
@@ -397,9 +408,6 @@ void __init setup_arch(char **cmdline_p)
397 _bfin_swrst = bfin_read_SWRST(); 408 _bfin_swrst = bfin_read_SWRST();
398#endif 409#endif
399 410
400 printk(KERN_INFO "Hardware Trace Enabled\n");
401 bfin_write_TBUFCTL(0x03);
402
403 /* Copy atomic sequences to their fixed location, and sanity check that 411 /* Copy atomic sequences to their fixed location, and sanity check that
404 these locations are the ones that we advertise to userspace. */ 412 these locations are the ones that we advertise to userspace. */
405 memcpy((void *)FIXED_CODE_START, &fixed_code_start, 413 memcpy((void *)FIXED_CODE_START, &fixed_code_start,
diff --git a/arch/blackfin/kernel/traps.c b/arch/blackfin/kernel/traps.c
index 56058b0b6d4a..a58d0f50be20 100644
--- a/arch/blackfin/kernel/traps.c
+++ b/arch/blackfin/kernel/traps.c
@@ -33,6 +33,7 @@
33#include <asm/blackfin.h> 33#include <asm/blackfin.h>
34#include <asm/uaccess.h> 34#include <asm/uaccess.h>
35#include <asm/irq_handler.h> 35#include <asm/irq_handler.h>
36#include <asm/trace.h>
36#include <linux/interrupt.h> 37#include <linux/interrupt.h>
37#include <linux/module.h> 38#include <linux/module.h>
38#include <linux/kallsyms.h> 39#include <linux/kallsyms.h>
@@ -131,16 +132,6 @@ static int printk_address(unsigned long address)
131 return printk("[<0x%p>]", (void*)address); 132 return printk("[<0x%p>]", (void*)address);
132} 133}
133 134
134#define trace_buffer_save(x) \
135 do { \
136 (x) = bfin_read_TBUFCTL(); \
137 bfin_write_TBUFCTL((x) & ~TBUFEN); \
138 } while (0)
139#define trace_buffer_restore(x) \
140 do { \
141 bfin_write_TBUFCTL((x)); \
142 } while (0)
143
144asmlinkage void trap_c(struct pt_regs *fp) 135asmlinkage void trap_c(struct pt_regs *fp)
145{ 136{
146 int j, sig = 0; 137 int j, sig = 0;