]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
x86: Don't clobber %ebx
authorGraeme Russ <graeme.russ@gmail.com>
Thu, 7 Oct 2010 09:03:28 +0000 (20:03 +1100)
committerGraeme Russ <graeme.russ@gmail.com>
Thu, 7 Oct 2010 09:03:28 +0000 (20:03 +1100)
%ebx will hold low-level boot flags and must be preserved

arch/i386/cpu/sc520/sc520_asm.S
arch/i386/cpu/start.S

index a18e2c3d0c571ef7e2c848335a0de4b9e2156abd..63c14b7eb0ecec1b6843eb6bdc96c85a9541be2a 100644 (file)
 
 .globl mem_init
 mem_init:
+       /* Preserve Boot Flags */
+       movl    %ebx, %ebp
+
        /* initialize dram controller registers */
        xorw    %ax, %ax
        movl    $DBCTL, %edi
@@ -517,6 +520,8 @@ bad_ram:
        jmp     bad_reint
 
 dram_done:
+       /* Restore Boot Flags */
+       movl    %ebx, %ebp
        jmp     mem_init_ret
 
 #if CONFIG_SYS_SDRAM_ECC_ENABLE
@@ -579,7 +584,7 @@ bank0:      movl    (%edi), %eax
        jz      bank1
        andl    $0x0000007f, %eax
        shll    $22, %eax
-       movl    %eax, %ebx
+       movl    %eax, %edx
 
 bank1: movl    (%edi), %eax
        movl    %eax, %ecx
@@ -587,7 +592,7 @@ bank1:      movl    (%edi), %eax
        jz      bank2
        andl    $0x00007f00, %eax
        shll    $14, %eax
-       movl    %eax, %ebx
+       movl    %eax, %edx
 
 bank2: movl    (%edi), %eax
        movl    %eax, %ecx
@@ -595,7 +600,7 @@ bank2:      movl    (%edi), %eax
        jz      bank3
        andl    $0x007f0000, %eax
        shll    $6, %eax
-       movl    %eax, %ebx
+       movl    %eax, %edx
 
 bank3: movl    (%edi), %eax
        movl    %eax, %ecx
@@ -603,8 +608,8 @@ bank3:      movl    (%edi), %eax
        jz      done
        andl    $0x7f000000, %eax
        shrl    $2, %eax
-       movl    %eax, %ebx
+       movl    %eax, %edx
 
 done:
-       movl    %ebx, %eax
+       movl    %edx, %eax
        jmp     get_mem_size_ret
index 551965f42ecb932ef889025478af0240ffae6dcb..63f733421bc91470a91d84b21819f612e674aea1 100644 (file)
@@ -118,8 +118,8 @@ mem_ok:
        cmpl    $0, %eax
        jne     die
        push    $0x55aa55aa
-       popl    %ebx
-       cmpl    $0x55aa55aa, %ebx
+       popl    %ecx
+       cmpl    $0x55aa55aa, %ecx
        jne     die
 
        wbinvd