Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 669b792c authored by Robin Getz's avatar Robin Getz Committed by Bryan Wu
Browse files

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: default avatarRobin Getz <robin.getz@analog.com>
Signed-off-by: default avatarMike Frysinger <michael.frysinger@analog.com>
Signed-off-by: default avatarBryan Wu <bryan.wu@analog.com>
parent 29440a2b
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -194,6 +194,17 @@ void __init setup_arch(char **cmdline_p)
	/* this give a chance to get printk() working before crash. */
#endif

	printk(KERN_INFO "Hardware Trace ");
	if (bfin_read_TBUFCTL() & 0x1 )
		printk("Active ");
	else
		printk("Off ");
	if (bfin_read_TBUFCTL() & 0x2)
		printk("and Enabled\n");
	else
	printk("and Disabled\n");


#if defined(CONFIG_CHR_DEV_FLASH) || defined(CONFIG_BLK_DEV_FLASH)
	/* we need to initialize the Flashrom device here since we might
	 * do things with flash early on in the boot
@@ -397,9 +408,6 @@ void __init setup_arch(char **cmdline_p)
	_bfin_swrst = bfin_read_SWRST();
#endif

	printk(KERN_INFO "Hardware Trace Enabled\n");
	bfin_write_TBUFCTL(0x03);

	/* Copy atomic sequences to their fixed location, and sanity check that
	   these locations are the ones that we advertise to userspace.  */
	memcpy((void *)FIXED_CODE_START, &fixed_code_start,
+1 −10
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@
#include <asm/blackfin.h>
#include <asm/uaccess.h>
#include <asm/irq_handler.h>
#include <asm/trace.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/kallsyms.h>
@@ -131,16 +132,6 @@ static int printk_address(unsigned long address)
	return printk("[<0x%p>]", (void*)address);
}

#define trace_buffer_save(x) \
	do { \
		(x) = bfin_read_TBUFCTL(); \
		bfin_write_TBUFCTL((x) & ~TBUFEN); \
	} while (0)
#define trace_buffer_restore(x) \
	do { \
		bfin_write_TBUFCTL((x));	\
	} while (0)

asmlinkage void trap_c(struct pt_regs *fp)
{
	int j, sig = 0;
+5 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@
#include <linux/linkage.h>
#include <linux/init.h>
#include <asm/blackfin.h>
#include <asm/trace.h>
#if CONFIG_BFIN_KERNEL_CLOCK
#include <asm/mach/mem_init.h>
#endif
@@ -96,6 +97,10 @@ ENTRY(__start)
	M2 = r0;
	M3 = r0;

	trace_buffer_start(p0,r0);
	P0 = R1;
	R0 = R1;

#if CONFIG_DEBUG_KERNEL_START

/*
+6 −0
Original line number Diff line number Diff line
@@ -30,6 +30,8 @@
#include <linux/linkage.h>
#include <linux/init.h>
#include <asm/blackfin.h>
#include <asm/trace.h>

#if CONFIG_BFIN_KERNEL_CLOCK
#include <asm/mach/mem_init.h>
#endif
@@ -93,6 +95,10 @@ ENTRY(__start)
	M2 = r0;
	M3 = r0;

	trace_buffer_start(p0,r0);
	P0 = R1;
	R0 = R1;

	/* Turn off the icache */
	p0.l = (IMEM_CONTROL & 0xFFFF);
	p0.h = (IMEM_CONTROL >> 16);
+5 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@

#include <linux/linkage.h>
#include <asm/blackfin.h>
#include <asm/trace.h>
#if CONFIG_BFIN_KERNEL_CLOCK
#include <asm/mach/mem_init.h>
#endif
@@ -91,6 +92,10 @@ ENTRY(__stext)
	M2 = r0;
	M3 = r0;

	trace_buffer_start(p0,r0);
	P0 = R1;
	R0 = R1;

	/* Turn off the icache */
	p0.l = (IMEM_CONTROL & 0xFFFF);
	p0.h = (IMEM_CONTROL >> 16);
Loading