Skip to content
Snippets Groups Projects
Commit 3acb324f authored by Albert ARIBAUD's avatar Albert ARIBAUD
Browse files

mx31pdk: copy SPL directly, not using relocate_code.

parent a19b0dd6
No related branches found
No related tags found
No related merge requests found
...@@ -39,7 +39,21 @@ DECLARE_GLOBAL_DATA_PTR; ...@@ -39,7 +39,21 @@ DECLARE_GLOBAL_DATA_PTR;
#ifdef CONFIG_SPL_BUILD #ifdef CONFIG_SPL_BUILD
void board_init_f(ulong bootflag) 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"); asm volatile("ldr pc, =nand_boot");
} }
#endif #endif
......
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