10 #include <linux/kernel.h>
12 #include <linux/serial_core.h>
14 #include <linux/string.h>
15 #include <linux/reboot.h>
20 #ifdef CONFIG_SERIAL_BFIN
21 extern struct console *bfin_earlyserial_init(
unsigned int port,
24 #ifdef CONFIG_BFIN_JTAG_COMM
25 extern struct console *bfin_jc_early_init(
void);
28 static struct console *early_console;
31 #define DEFAULT_PORT 0
32 #define DEFAULT_CFLAG CS8|B57600
35 #define DEFAULT_EARLY_PORT "serial,uart0,57600"
37 #ifdef CONFIG_SERIAL_CORE
103 #ifdef CONFIG_SERIAL_BFIN
104 return bfin_earlyserial_init(serial_port, cflag);
124 if (early_console !=
NULL)
127 #ifdef CONFIG_SERIAL_BFIN
129 if (!
strncmp(buf,
"serial,uart", 11)) {
131 early_console = earlyserial_init(buf);
135 #ifdef CONFIG_BFIN_JTAG_COMM
137 if (!
strncmp(buf,
"jtag", 4)) {
139 early_console = bfin_jc_early_init();
147 if (
likely(early_console)) {
153 early_console->
index);
178 if (CPUID != bfin_cpuid()) {
179 early_shadow_puts(
"Running on wrong machine type, expected");
181 early_shadow_puts(
", but running on");
183 early_shadow_puts(
"\n");
199 asm(
"\tRETI = %0; RETX = %0; RETN = %0;\n"
213 if (
likely(early_console ==
NULL) && CPUID == bfin_cpuid())
218 early_shadow_puts(
"panic before setup_arch\n");
219 early_shadow_puts(
"IPEND:");
222 early_shadow_puts(
"\nEXCAUSE:");
226 early_shadow_puts(
"\nHWERRCAUSE:");
230 early_shadow_puts(
"\nErr @");
235 #ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON
236 early_shadow_puts(
"\nTrace:");
239 early_shadow_puts(
"\nT :");
241 early_shadow_puts(
"\n S :");
246 early_shadow_puts(
"\nUse bfin-elf-addr2line to determine "
254 if (CPUID == bfin_cpuid()) {
255 early_shadow_puts(
"Trying to restart\n");
259 early_shadow_puts(
"Halting, since it is not safe to restart\n");
261 asm volatile (
"EMUEXCPT; IDLE;\n");