summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorAlbert ARIBAUD <albert.u.boot@aribaud.net>2013-05-19 01:48:12 +0000
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2013-05-30 20:23:08 +0200
commit3acb324ff1597d7e2ac6597d18cdb96d49ec8d93 (patch)
tree042d8e1183e2a1aa7cd49a50dc5f8391cee2ec31 /board
parenta19b0dd62d7b8efc658fa1aa685ff5665878f3ee (diff)
downloadu-boot-imx-3acb324ff1597d7e2ac6597d18cdb96d49ec8d93.zip
u-boot-imx-3acb324ff1597d7e2ac6597d18cdb96d49ec8d93.tar.gz
u-boot-imx-3acb324ff1597d7e2ac6597d18cdb96d49ec8d93.tar.bz2
mx31pdk: copy SPL directly, not using relocate_code.
Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net> Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Tested-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'board')
-rw-r--r--board/freescale/mx31pdk/mx31pdk.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/board/freescale/mx31pdk/mx31pdk.c b/board/freescale/mx31pdk/mx31pdk.c
index 49158bd..4f6cfee 100644
--- a/board/freescale/mx31pdk/mx31pdk.c
+++ b/board/freescale/mx31pdk/mx31pdk.c
@@ -39,7 +39,21 @@ DECLARE_GLOBAL_DATA_PTR;
#ifdef CONFIG_SPL_BUILD
void board_init_f(ulong bootflag)
{
- relocate_code(CONFIG_SPL_TEXT_BASE);
+ /*
+ * copy ourselves from where we are running to where we were
+ * linked at. Use ulong pointers as all addresses involved
+ * are 4-byte-aligned.
+ */
+ ulong *start_ptr, *end_ptr, *link_ptr, *run_ptr, *dst;
+ asm volatile ("ldr %0, =_start" : "=r"(start_ptr));
+ asm volatile ("ldr %0, =_end" : "=r"(end_ptr));
+ asm volatile ("ldr %0, =board_init_f" : "=r"(link_ptr));
+ asm volatile ("adr %0, board_init_f" : "=r"(run_ptr));
+ for (dst = start_ptr; dst < end_ptr; dst++)
+ *dst = *(dst+(run_ptr-link_ptr));
+ /*
+ * branch to nand_boot's link-time address.
+ */
asm volatile("ldr pc, =nand_boot");
}
#endif