From faf7b7af6e51a33b88453821d792c89a84f72b1d Mon Sep 17 00:00:00 2001 From: Jan Luebbe Date: Mon, 24 Sep 2012 10:18:34 +0200 Subject: 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 . Signed-off-by: Jan Luebbe Signed-off-by: Sascha Hauer --- arch/arm/boards/panda/lowlevel.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'arch/arm/boards/panda') 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 #include #include +#include #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(); } -- cgit v1.2.3