diff options
author | Graeme Russ <graeme.russ@gmail.com> | 2012-01-01 15:06:39 +1100 |
---|---|---|
committer | Graeme Russ <graeme.russ@gmail.com> | 2012-01-04 22:17:20 +1100 |
commit | f48dd6fc6cc9fdf15408e98132dc5575a31026cf (patch) | |
tree | 2fe660cd6af72843d0798497a5f1bbb8c813b9ff /arch/x86/cpu | |
parent | 74bfbe1ba5ba99adccdc26dc4adbfb9221849310 (diff) | |
download | u-boot-f48dd6fc6cc9fdf15408e98132dc5575a31026cf.zip u-boot-f48dd6fc6cc9fdf15408e98132dc5575a31026cf.tar.gz u-boot-f48dd6fc6cc9fdf15408e98132dc5575a31026cf.tar.bz2 |
x86: Simplify Flash-to-RAM code execution transition
Move the relocation offset calculation out of assembler and into C. This
also paves the way for the upcoming init sequence simplification by adding
the board_init_f_r flash to RAM transitional function
--
Changes for v2:
- Added commit message
- Minor adjustment to new stack address comment
Diffstat (limited to 'arch/x86/cpu')
-rw-r--r-- | arch/x86/cpu/start.S | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/arch/x86/cpu/start.S b/arch/x86/cpu/start.S index 6027f54..69a9b2c 100644 --- a/arch/x86/cpu/start.S +++ b/arch/x86/cpu/start.S @@ -96,32 +96,22 @@ car_init_ret: movw $0x85, %ax jmp die -.globl relocate_code -.type relocate_code, @function -relocate_code: +.globl board_init_f_r_trampoline +.type board_init_f_r_trampoline, @function +board_init_f_r_trampoline: /* * SDRAM has been initialised, U-Boot code has been copied into * RAM, BSS has been cleared and relocation adjustments have been * made. It is now time to jump into the in-RAM copy of U-Boot * - * %eax = Address of top of stack - * %edx = Address of Global Data - * %ecx = Base address of in-RAM copy of U-Boot + * %eax = Address of top of new stack */ /* Setup stack in RAM */ movl %eax, %esp - /* Setup call address of in-RAM copy of board_init_r() */ - movl $board_init_r, %ebp - addl (GENERATED_GD_RELOC_OFF)(%edx), %ebp - - /* Setup parameters to board_init_r() */ - movl %edx, %eax - movl %ecx, %edx - - /* Jump to in-RAM copy of board_init_r() */ - call *%ebp + /* Re-enter U-Boot by calling board_init_f_r */ + call board_init_f_r die: hlt |