diff options
| author | Robin Getz <robin.getz@analog.com> | 2007-10-09 05:31:46 -0400 |
|---|---|---|
| committer | Bryan Wu <bryan.wu@analog.com> | 2007-10-09 05:31:46 -0400 |
| commit | 337d390b3a9c1ce92a12bdb77b9ae6ded6273b12 (patch) | |
| tree | 2c870e325162c3d1a66390fb6d6db3e92de9e2eb /arch/blackfin/kernel | |
| parent | ce3afa1c043ab3d4125671441a57353d80f5f6f7 (diff) | |
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: Robin Getz <robin.getz@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Diffstat (limited to 'arch/blackfin/kernel')
| -rw-r--r-- | arch/blackfin/kernel/early_printk.c | 61 |
1 files changed, 57 insertions, 4 deletions
diff --git a/arch/blackfin/kernel/early_printk.c b/arch/blackfin/kernel/early_printk.c index 9bf61706694f..6ec518a81113 100644 --- a/arch/blackfin/kernel/early_printk.c +++ b/arch/blackfin/kernel/early_printk.c | |||
| @@ -38,13 +38,13 @@ extern struct console *bfin_earlyserial_init(unsigned int port, | |||
| 38 | 38 | ||
| 39 | static struct console *early_console; | 39 | static struct console *early_console; |
| 40 | 40 | ||
| 41 | /* Default console | 41 | /* Default console */ |
| 42 | * Port n == ttyBFn | ||
| 43 | * cflags == UART output modes | ||
| 44 | */ | ||
| 45 | #define DEFAULT_PORT 0 | 42 | #define DEFAULT_PORT 0 |
| 46 | #define DEFAULT_CFLAG CS8|B57600 | 43 | #define DEFAULT_CFLAG CS8|B57600 |
| 47 | 44 | ||
| 45 | /* Default console for early crashes */ | ||
| 46 | #define DEFAULT_EARLY_PORT "serial,uart0,57600" | ||
| 47 | |||
| 48 | #ifdef CONFIG_SERIAL_CORE | 48 | #ifdef CONFIG_SERIAL_CORE |
| 49 | /* What should get here is "0,57600" */ | 49 | /* What should get here is "0,57600" */ |
| 50 | static struct console * __init earlyserial_init(char *buf) | 50 | static struct console * __init earlyserial_init(char *buf) |
| @@ -158,4 +158,57 @@ int __init setup_early_printk(char *buf) | |||
| 158 | return 0; | 158 | return 0; |
| 159 | } | 159 | } |
| 160 | 160 | ||
| 161 | /* | ||
| 162 | * Set up a temporary Event Vector Table, so if something bad happens before | ||
| 163 | * the kernel is fully started, it doesn't vector off into somewhere we don't | ||
| 164 | * know | ||
| 165 | */ | ||
| 166 | |||
| 167 | asmlinkage void __init init_early_exception_vectors(void) | ||
| 168 | { | ||
| 169 | SSYNC(); | ||
| 170 | |||
| 171 | /* cannot program in software: | ||
| 172 | * evt0 - emulation (jtag) | ||
| 173 | * evt1 - reset | ||
| 174 | */ | ||
| 175 | bfin_write_EVT2(early_trap); | ||
| 176 | bfin_write_EVT3(early_trap); | ||
| 177 | bfin_write_EVT5(early_trap); | ||
| 178 | bfin_write_EVT6(early_trap); | ||
| 179 | bfin_write_EVT7(early_trap); | ||
| 180 | bfin_write_EVT8(early_trap); | ||
| 181 | bfin_write_EVT9(early_trap); | ||
| 182 | bfin_write_EVT10(early_trap); | ||
| 183 | bfin_write_EVT11(early_trap); | ||
| 184 | bfin_write_EVT12(early_trap); | ||
| 185 | bfin_write_EVT13(early_trap); | ||
| 186 | bfin_write_EVT14(early_trap); | ||
| 187 | bfin_write_EVT15(early_trap); | ||
| 188 | CSYNC(); | ||
| 189 | |||
| 190 | /* Set all the return from interupt, exception, NMI to a known place | ||
| 191 | * so if we do a RETI, RETX or RETN by mistake - we go somewhere known | ||
| 192 | * Note - don't change RETS - we are in a subroutine, or | ||
| 193 | * RETE - since it might screw up if emulator is attached | ||
| 194 | */ | ||
| 195 | asm("\tRETI = %0; RETX = %0; RETN = %0;\n" | ||
| 196 | : : "p"(early_trap)); | ||
| 197 | |||
| 198 | } | ||
| 199 | |||
| 200 | asmlinkage void __init early_trap_c(struct pt_regs *fp, void *retaddr) | ||
| 201 | { | ||
| 202 | /* This can happen before the uart is initialized, so initialize | ||
| 203 | * the UART now | ||
| 204 | */ | ||
| 205 | if (likely(early_console == NULL)) | ||
| 206 | setup_early_printk(DEFAULT_EARLY_PORT); | ||
| 207 | |||
| 208 | dump_bfin_regs(fp, retaddr); | ||
| 209 | dump_bfin_trace_buffer(); | ||
| 210 | |||
| 211 | panic("Died early"); | ||
| 212 | } | ||
| 213 | |||
| 161 | early_param("earlyprintk", setup_early_printk); | 214 | early_param("earlyprintk", setup_early_printk); |
