aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin
diff options
context:
space:
mode:
authorRobin Getz <robin.getz@analog.com>2007-10-09 05:28:36 -0400
committerBryan Wu <bryan.wu@analog.com>2007-10-09 05:28:36 -0400
commitce3afa1c043ab3d4125671441a57353d80f5f6f7 (patch)
treea6d2d85c7380eab7e28a456cef0af2a271f1c32d /arch/blackfin
parent2ebcade590dcf822dcdadcc4f8f68efd3ff2e217 (diff)
Blackfin arch: Enable earlyprintk earlier - so any error after our interrupt tables are set up will print out
Also ensure that the traps_c code doesn't cause a double fault, by sending a signal to a faulting kernel before the memory subsystem is fully initialized, by printing out the error message before sending the signal. Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Diffstat (limited to 'arch/blackfin')
-rw-r--r--arch/blackfin/kernel/setup.c38
-rw-r--r--arch/blackfin/kernel/traps.c8
2 files changed, 25 insertions, 21 deletions
diff --git a/arch/blackfin/kernel/setup.c b/arch/blackfin/kernel/setup.c
index abf34a8dd070..8dcd76e87ed5 100644
--- a/arch/blackfin/kernel/setup.c
+++ b/arch/blackfin/kernel/setup.c
@@ -44,6 +44,7 @@
44#include <asm/blackfin.h> 44#include <asm/blackfin.h>
45#include <asm/cplbinit.h> 45#include <asm/cplbinit.h>
46#include <asm/fixed_code.h> 46#include <asm/fixed_code.h>
47#include <asm/early_printk.h>
47 48
48u16 _bfin_swrst; 49u16 _bfin_swrst;
49 50
@@ -157,8 +158,10 @@ static __init void parse_cmdline_early(char *cmdline_p)
157 1; 158 1;
158 } 159 }
159 } 160 }
161 } else if (!memcmp(to, "earlyprintk=", 12)) {
162 to += 12;
163 setup_early_printk(to);
160 } 164 }
161
162 } 165 }
163 c = *(to++); 166 c = *(to++);
164 if (!c) 167 if (!c)
@@ -177,6 +180,23 @@ void __init setup_arch(char **cmdline_p)
177#ifdef CONFIG_DUMMY_CONSOLE 180#ifdef CONFIG_DUMMY_CONSOLE
178 conswitchp = &dummy_con; 181 conswitchp = &dummy_con;
179#endif 182#endif
183
184#if defined(CONFIG_CMDLINE_BOOL)
185 strncpy(&command_line[0], CONFIG_CMDLINE, sizeof(command_line));
186 command_line[sizeof(command_line) - 1] = 0;
187#endif
188
189 /* Keep a copy of command line */
190 *cmdline_p = &command_line[0];
191 memcpy(boot_command_line, command_line, COMMAND_LINE_SIZE);
192 boot_command_line[COMMAND_LINE_SIZE - 1] = '\0';
193
194 /* setup memory defaults from the user config */
195 physical_mem_end = 0;
196 _ramend = CONFIG_MEM_SIZE * 1024 * 1024;
197
198 parse_cmdline_early(&command_line[0]);
199
180 cclk = get_cclk(); 200 cclk = get_cclk();
181 sclk = get_sclk(); 201 sclk = get_sclk();
182 202
@@ -210,22 +230,6 @@ void __init setup_arch(char **cmdline_p)
210 flash_probe(); 230 flash_probe();
211#endif 231#endif
212 232
213#if defined(CONFIG_CMDLINE_BOOL)
214 strncpy(&command_line[0], CONFIG_CMDLINE, sizeof(command_line));
215 command_line[sizeof(command_line) - 1] = 0;
216#endif
217
218 /* Keep a copy of command line */
219 *cmdline_p = &command_line[0];
220 memcpy(boot_command_line, command_line, COMMAND_LINE_SIZE);
221 boot_command_line[COMMAND_LINE_SIZE - 1] = '\0';
222
223 /* setup memory defaults from the user config */
224 physical_mem_end = 0;
225 _ramend = CONFIG_MEM_SIZE * 1024 * 1024;
226
227 parse_cmdline_early(&command_line[0]);
228
229 if (physical_mem_end == 0) 233 if (physical_mem_end == 0)
230 physical_mem_end = _ramend; 234 physical_mem_end = _ramend;
231 235
diff --git a/arch/blackfin/kernel/traps.c b/arch/blackfin/kernel/traps.c
index ba68eb2ec929..8823e9ade584 100644
--- a/arch/blackfin/kernel/traps.c
+++ b/arch/blackfin/kernel/traps.c
@@ -402,10 +402,6 @@ asmlinkage void trap_c(struct pt_regs *fp)
402 break; 402 break;
403 } 403 }
404 404
405 info.si_signo = sig;
406 info.si_errno = 0;
407 info.si_addr = (void *)fp->pc;
408 force_sig_info(sig, &info, current);
409 if (sig != 0 && sig != SIGTRAP) { 405 if (sig != 0 && sig != SIGTRAP) {
410 unsigned long stack; 406 unsigned long stack;
411 dump_bfin_regs(fp, (void *)fp->retx); 407 dump_bfin_regs(fp, (void *)fp->retx);
@@ -414,6 +410,10 @@ asmlinkage void trap_c(struct pt_regs *fp)
414 if (current->mm == NULL) 410 if (current->mm == NULL)
415 panic("Kernel exception"); 411 panic("Kernel exception");
416 } 412 }
413 info.si_signo = sig;
414 info.si_errno = 0;
415 info.si_addr = (void *)fp->pc;
416 force_sig_info(sig, &info, current);
417 417
418 /* if the address that we are about to return to is not valid, set it 418 /* if the address that we are about to return to is not valid, set it
419 * to a valid address, if we have a current application or panic 419 * to a valid address, if we have a current application or panic