Skip to content
Snippets Groups Projects
Commit b1e9435b authored by Mike Frysinger's avatar Mike Frysinger
Browse files

Blackfin: pass RETX to Linux


Make sure we save the value of RETX at power on and then pass it on to the
kernel so that it can nicely debug a "double-fault-caused-a-reset" crash.

Signed-off-by: default avatarMike Frysinger <vapier@gentoo.org>
parent b5eba3fa
No related branches found
No related tags found
No related merge requests found
...@@ -14,11 +14,14 @@ ...@@ -14,11 +14,14 @@
#include <asm/blackfin.h> #include <asm/blackfin.h>
#include <asm/cplb.h> #include <asm/cplb.h>
#include <asm/mach-common/bits/core.h> #include <asm/mach-common/bits/core.h>
#include <asm/mach-common/bits/ebiu.h>
#include <asm/mach-common/bits/trace.h> #include <asm/mach-common/bits/trace.h>
#include "cpu.h" #include "cpu.h"
#include "serial.h" #include "serial.h"
ulong bfin_poweron_retx;
__attribute__ ((__noreturn__)) __attribute__ ((__noreturn__))
void cpu_init_f(ulong bootflag, ulong loaded_from_ldr) void cpu_init_f(ulong bootflag, ulong loaded_from_ldr)
{ {
...@@ -48,6 +51,9 @@ void cpu_init_f(ulong bootflag, ulong loaded_from_ldr) ...@@ -48,6 +51,9 @@ void cpu_init_f(ulong bootflag, ulong loaded_from_ldr)
bfin_write_EBIU_AMGCTL(CONFIG_EBIU_AMGCTL_VAL); bfin_write_EBIU_AMGCTL(CONFIG_EBIU_AMGCTL_VAL);
#endif #endif
/* Save RETX so we can pass it while booting Linux */
bfin_poweron_retx = bootflag;
#ifdef CONFIG_DEBUG_DUMP #ifdef CONFIG_DEBUG_DUMP
/* Turn on hardware trace buffer */ /* Turn on hardware trace buffer */
bfin_write_TBUFCTL(TBUFPWR | TBUFEN); bfin_write_TBUFCTL(TBUFPWR | TBUFEN);
......
...@@ -31,6 +31,8 @@ static char *make_command_line(void) ...@@ -31,6 +31,8 @@ static char *make_command_line(void)
return dest; return dest;
} }
extern ulong bfin_poweron_retx;
int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images) int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
{ {
int (*appl) (char *cmdline); int (*appl) (char *cmdline);
...@@ -49,7 +51,12 @@ int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images) ...@@ -49,7 +51,12 @@ int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
cmdline = make_command_line(); cmdline = make_command_line();
icache_disable(); icache_disable();
dcache_disable(); dcache_disable();
(*appl) (cmdline); asm __volatile__(
"RETX = %[retx];"
"CALL (%0);"
:
: "p"(appl), "q0"(cmdline), [retx] "d"(bfin_poweron_retx)
);
/* does not return */ /* does not return */
return 1; return 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment