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

Commit 337d390b authored by Robin Getz's avatar Robin Getz Committed by Bryan Wu
Browse files

Blackfin arch: Print out debug info, as early as possible



Print out debug info, as early as possible - even before the
kernel initializes the interrupt vectors. Now we can print out debug
messages almost anytime during the boot process.

Signed-off-by: default avatarRobin Getz <robin.getz@analog.com>
Signed-off-by: default avatarBryan Wu <bryan.wu@analog.com>
parent ce3afa1c
Loading
Loading
Loading
Loading
+57 −4
Original line number Diff line number Diff line
@@ -38,13 +38,13 @@ extern struct console *bfin_earlyserial_init(unsigned int port,

static struct console *early_console;

/* Default console
 * Port n == ttyBFn
 * cflags == UART output modes
 */
/* Default console */
#define DEFAULT_PORT 0
#define DEFAULT_CFLAG CS8|B57600

/* Default console for early crashes */
#define DEFAULT_EARLY_PORT "serial,uart0,57600"

#ifdef CONFIG_SERIAL_CORE
/* What should get here is "0,57600" */
static struct console * __init earlyserial_init(char *buf)
@@ -158,4 +158,57 @@ int __init setup_early_printk(char *buf)
	return 0;
}

/*
 * Set up a temporary Event Vector Table, so if something bad happens before
 * the kernel is fully started, it doesn't vector off into somewhere we don't
 * know
 */

asmlinkage void __init init_early_exception_vectors(void)
{
	SSYNC();

	/* cannot program in software:
	 * evt0 - emulation (jtag)
	 * evt1 - reset
	 */
	bfin_write_EVT2(early_trap);
	bfin_write_EVT3(early_trap);
	bfin_write_EVT5(early_trap);
	bfin_write_EVT6(early_trap);
	bfin_write_EVT7(early_trap);
	bfin_write_EVT8(early_trap);
	bfin_write_EVT9(early_trap);
	bfin_write_EVT10(early_trap);
	bfin_write_EVT11(early_trap);
	bfin_write_EVT12(early_trap);
	bfin_write_EVT13(early_trap);
	bfin_write_EVT14(early_trap);
	bfin_write_EVT15(early_trap);
	CSYNC();

	/* Set all the return from interupt, exception, NMI to a known place
	 * so if we do a RETI, RETX or RETN by mistake - we go somewhere known
	 * Note - don't change RETS - we are in a subroutine, or
	 * RETE - since it might screw up if emulator is attached
	 */
	asm("\tRETI = %0; RETX = %0; RETN = %0;\n"
		: : "p"(early_trap));

}

asmlinkage void __init early_trap_c(struct pt_regs *fp, void *retaddr)
{
	/* This can happen before the uart is initialized, so initialize
	 * the UART now
	 */
	if (likely(early_console == NULL))
		setup_early_printk(DEFAULT_EARLY_PORT);

	dump_bfin_regs(fp, retaddr);
	dump_bfin_trace_buffer();

	panic("Died early");
}

early_param("earlyprintk", setup_early_printk);
+6 −0
Original line number Diff line number Diff line
@@ -181,6 +181,12 @@ ENTRY(__start)
	fp = sp;
	usp = sp;

#ifdef CONFIG_EARLY_PRINTK
	SP += -12;
	call _init_early_exception_vectors;
	SP += 12;
#endif

	/* Put The Code for PLL Programming and SDRAM Programming in L1 ISRAM */
	call _bf53x_relocate_l1_mem;
#if CONFIG_BFIN_KERNEL_CLOCK
+6 −0
Original line number Diff line number Diff line
@@ -224,6 +224,12 @@ ENTRY(__start)
	fp = sp;
	usp = sp;

#ifdef CONFIG_EARLY_PRINTK
	SP += -12;
	call _init_early_exception_vectors;
	SP += 12;
#endif

	/* Put The Code for PLL Programming and SDRAM Programming in L1 ISRAM */
	call _bf53x_relocate_l1_mem;
#if CONFIG_BFIN_KERNEL_CLOCK
+6 −0
Original line number Diff line number Diff line
@@ -125,6 +125,12 @@ ENTRY(__stext)
	FP = SP;
	USP = SP;

#ifdef CONFIG_EARLY_PRINTK
	SP += -12;
	call _init_early_exception_vectors;
	SP += 12;
#endif

	/* Put The Code for PLL Programming and SDRAM Programming in L1 ISRAM */
	call _bf53x_relocate_l1_mem;
#if CONFIG_BFIN_KERNEL_CLOCK
+6 −0
Original line number Diff line number Diff line
@@ -169,6 +169,12 @@ ENTRY(__start)
	fp = sp;
	usp = sp;

#ifdef CONFIG_EARLY_PRINTK
	SP += -12;
	call _init_early_exception_vectors;
	SP += 12;
#endif

	/* Put The Code for PLL Programming and SDRAM Programming in L1 ISRAM */
	call _bf53x_relocate_l1_mem;
#if CONFIG_BFIN_KERNEL_CLOCK
Loading