diff options
author | Jan Luebbe <jlu@pengutronix.de> | 2012-09-24 10:18:34 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-09-27 19:30:04 +0200 |
commit | faf7b7af6e51a33b88453821d792c89a84f72b1d (patch) | |
tree | bff70e6a71339e4d62e90c23ead1fc351effc89a /arch/arm/boards/panda | |
parent | cc1602604d1654991f3ce02b664178b3e672afe7 (diff) | |
download | barebox-faf7b7af6e51a33b88453821d792c89a84f72b1d.tar.gz barebox-faf7b7af6e51a33b88453821d792c89a84f72b1d.tar.xz |
ARM: give boards control of the reset entry point
On some SoCs (for example AM35xx), the ROM bootloader passes useful
information in r0 when jumping to barebox.
To avoid overwriting this in the generic reset code, we introduce
common_reset as a C function and as an assembler macro. This is then
called form the reset entry point (either in common or in board code).
This patch is based on code by Sascha Hauer <s.hauer@pengutronix.de>.
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/boards/panda')
-rw-r--r-- | arch/arm/boards/panda/lowlevel.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/arm/boards/panda/lowlevel.c b/arch/arm/boards/panda/lowlevel.c index 0b4b199d34..70a96d0276 100644 --- a/arch/arm/boards/panda/lowlevel.c +++ b/arch/arm/boards/panda/lowlevel.c @@ -27,6 +27,7 @@ #include <mach/omap4-clock.h> #include <mach/syslib.h> #include <asm/barebox-arm.h> +#include <asm/barebox-arm-head.h> #define TPS62361_VSEL0_GPIO 7 @@ -77,15 +78,17 @@ static void noinline panda_init_lowlevel(void) board_init_lowlevel_return(); } -void board_init_lowlevel(void) +void reset(void) { u32 r; + common_reset(); + if (get_pc() > 0x80000000) return; r = 0x4030d000; - __asm__ __volatile__("mov sp, %0" : : "r"(r)); + __asm__ __volatile__("mov sp, %0" : : "r"(r)); panda_init_lowlevel(); } |