]> git.sur5r.net Git - u-boot/blobdiff - arch/i386/cpu/start.S
x86: Dont clobber %eax after getting memory size
[u-boot] / arch / i386 / cpu / start.S
index cb47ce7faa61807111638a54840cd4b464ebd5ee..66ff4f3e06d08ee1ce411a202a11d45f4ea0888f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *  U-boot - i386 Startup Code
  *
- *  Copyright (c) 2002 Omicron Ceti AB, Daniel Engström <denaiel@omicron.se>
+ *  Copyright (c) 2002 Omicron Ceti AB, Daniel Engstrm <denaiel@omicron.se>
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -79,20 +79,31 @@ _start:
         * to store the return address */
 
        /* Early platform init (setup gpio, etc ) */
-       mov     $early_board_init_ret, %ebp
        jmp     early_board_init
+.globl early_board_init_ret
 early_board_init_ret:
 
        /* size memory */
-       mov     $mem_init_ret, %ebp
        jmp     mem_init
+.globl mem_init_ret
 mem_init_ret:
 
        /* fetch memory size (into %eax) */
-       mov     $get_mem_size_ret, %ebp
        jmp     get_mem_size
+.globl get_mem_size_ret
 get_mem_size_ret:
 
+#if CONFIG_SYS_SDRAM_ECC_ENABLE
+       /* Skip ECC initialization if not starting from cold-reset */
+       movl    %ebx, %ecx
+       andl    $GD_FLG_COLD_BOOT, %ecx
+       jz      init_ecc_ret
+       jmp     init_ecc
+
+.globl init_ecc_ret
+init_ecc_ret:
+#endif
+
        /* Check we have enough memory for stack */
        movl    $CONFIG_SYS_STACK_SIZE, %ecx
        cmpl    %ecx, %eax
@@ -103,18 +114,17 @@ mem_ok:
 
        /* Test the stack */
        pushl   $0
-       popl    %eax
-       cmpl    $0, %eax
-       jne     no_stack
+       popl    %ecx
+       cmpl    $0, %ecx
+       jne     die
        push    $0x55aa55aa
-       popl    %ebx
-       cmpl    $0x55aa55aa, %ebx
+       popl    %ecx
+       cmpl    $0x55aa55aa, %ecx
        jne     die
 
        wbinvd
 
        /* Set the upper memory limit parameter */
-       movl    %esp, %eax
        subl    $CONFIG_SYS_STACK_SIZE, %eax
 
        call    board_init_f    /* Enter, U-boot! */