summaryrefslogtreecommitdiff
path: root/arch/x86/cpu/start.S
diff options
context:
space:
mode:
authorGraeme Russ <graeme.russ@gmail.com>2012-01-21 01:22:48 +1100
committerGraeme Russ <graeme.russ@gmail.com>2012-01-21 01:22:48 +1100
commitafd855d534de22aa625cb12aa9aa45e459f7de99 (patch)
tree5eb4f33e50967654d92e62c296e12de478b1c8bc /arch/x86/cpu/start.S
parent137703b811502dfea364650fb3e17f20b4c21333 (diff)
parenta1d57b7aba85abc787675952b40c550bf3a595f8 (diff)
downloadu-boot-imx-afd855d534de22aa625cb12aa9aa45e459f7de99.zip
u-boot-imx-afd855d534de22aa625cb12aa9aa45e459f7de99.tar.gz
u-boot-imx-afd855d534de22aa625cb12aa9aa45e459f7de99.tar.bz2
Merge branch 'staging'
Diffstat (limited to 'arch/x86/cpu/start.S')
-rw-r--r--arch/x86/cpu/start.S33
1 files changed, 15 insertions, 18 deletions
diff --git a/arch/x86/cpu/start.S b/arch/x86/cpu/start.S
index f87633b..ee0dabe 100644
--- a/arch/x86/cpu/start.S
+++ b/arch/x86/cpu/start.S
@@ -29,8 +29,9 @@
#include <config.h>
#include <version.h>
#include <asm/global_data.h>
+#include <asm/processor.h>
#include <asm/processor-flags.h>
-#include <generated/asm-offsets.h>
+#include <generated/generic-asm-offsets.h>
.section .text
.code32
@@ -58,7 +59,7 @@ _start:
/* This is the 32-bit cold-reset entry point */
/* Load the segement registes to match the gdt loaded in start16.S */
- movl $0x18, %eax
+ movl $(X86_GDT_ENTRY_32BIT_DS * X86_GDT_ENTRY_SIZE), %eax
movw %ax, %fs
movw %ax, %ds
movw %ax, %gs
@@ -84,6 +85,12 @@ car_init_ret:
*/
movl $CONFIG_SYS_INIT_SP_ADDR, %esp
+ /* Initialise the Global Data Pointer */
+ movl $CONFIG_SYS_INIT_GD_ADDR, %eax
+ movl %eax, %edx
+ addl $GENERATED_GBL_DATA_SIZE, %edx
+ call init_gd;
+
/* Set parameter to board_init_f() to boot flags */
xorl %eax, %eax
movw %bx, %ax
@@ -95,32 +102,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