]> git.sur5r.net Git - u-boot/blobdiff - arch/i386/cpu/start.S
Merge branch 'master' of git://git.denx.de/u-boot-mips
[u-boot] / arch / i386 / cpu / start.S
index 95be5a2f9a8bc4430fa39ce92038add40fbd92b7..00313897ce8517da4288e2870a4c97593ed48adb 100644 (file)
@@ -93,24 +93,6 @@ car_init_ret:
        subl    $1b, %ecx
        movl    %ecx, (GD_LOAD_OFF * 4)(%ebp)
 
-       /* size memory */
-       call    dram_init_f
-
-       /* Setup stack in SDRAM */
-       movl    (GD_RAM_SIZE * 4)(%ebp), %esp
-
-       /* Test the stack */
-       pushl   $0
-       popl    %ecx
-       cmpl    $0, %ecx
-       jne     die
-       push    $0x55aa55aa
-       popl    %ecx
-       cmpl    $0x55aa55aa, %ecx
-       jne     die
-
-       wbinvd
-
        /* Set parameter to board_init_f() to boot flags */
        movl    (GD_FLAGS * 4)(%ebp), %eax
 
@@ -118,6 +100,35 @@ car_init_ret:
 
        /* indicate (lack of) progress */
        movw    $0x85, %ax
+       jmp     die
+
+.globl relocate_code
+.type relocate_code, @function
+relocate_code:
+       /*
+        * 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
+        */
+
+       /* Setup stack in RAM */
+       movl    %eax, %esp
+
+       /* Setup call address of in-RAM copy of board_init_r() */
+       movl    $board_init_r, %ebp
+       addl    (GD_RELOC_OFF * 4)(%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
+
 die:   hlt
        jmp     die
        hlt