summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraeme Russ <graeme.russ@gmail.com>2010-04-24 00:05:40 +1000
committerWolfgang Denk <wd@denx.de>2010-05-06 00:14:32 +0200
commit4dba333b3c7b34073b0439cc942877f98403632c (patch)
treee5f7ce600d759849421403e94bf0c407817bc48a
parent9e08efcfee22570bb3a9ea384bf4d60b378f6092 (diff)
downloadu-boot-imx-4dba333b3c7b34073b0439cc942877f98403632c.zip
u-boot-imx-4dba333b3c7b34073b0439cc942877f98403632c.tar.gz
u-boot-imx-4dba333b3c7b34073b0439cc942877f98403632c.tar.bz2
x86: Fix sc520 memory size reporting
There is an error in how the assembler version of the sc520 memory size reporting code works. As a result, it will only ever report at most the size of one bank of RAM Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
-rw-r--r--arch/i386/cpu/sc520/sc520_asm.S35
1 files changed, 17 insertions, 18 deletions
diff --git a/arch/i386/cpu/sc520/sc520_asm.S b/arch/i386/cpu/sc520/sc520_asm.S
index 2042d9b..135f7b4 100644
--- a/arch/i386/cpu/sc520/sc520_asm.S
+++ b/arch/i386/cpu/sc520/sc520_asm.S
@@ -503,38 +503,37 @@ dram_done:
movl $DRCBENDADR, %edi /* DRAM ending address register */
- movl (%edi), %eax
- movl %eax, %ecx
- andl $0x80000000, %ecx
- jz bank2
- andl $0x7f000000, %eax
- shrl $2, %eax
- movl %eax, %ebx
-
-bank2: movl (%edi), %eax
+bank0: movl (%edi), %eax
movl %eax, %ecx
- andl $0x00800000, %ecx
+ andl $0x00000080, %ecx
jz bank1
- andl $0x007f0000, %eax
- shll $6, %eax
+ andl $0x0000007f, %eax
+ shll $22, %eax
movl %eax, %ebx
bank1: movl (%edi), %eax
movl %eax, %ecx
andl $0x00008000, %ecx
- jz bank0
+ jz bank2
andl $0x00007f00, %eax
shll $14, %eax
movl %eax, %ebx
-bank0: movl (%edi), %eax
+bank2: movl (%edi), %eax
movl %eax, %ecx
- andl $0x00000080, %ecx
- jz done
- andl $0x0000007f, %eax
- shll $22, %eax
+ andl $0x00800000, %ecx
+ jz bank3
+ andl $0x007f0000, %eax
+ shll $6, %eax
movl %eax, %ebx
+bank3: movl (%edi), %eax
+ movl %eax, %ecx
+ andl $0x80000000, %ecx
+ jz done
+ andl $0x7f000000, %eax
+ shrl $2, %eax
+ movl %eax, %ebx
done:
movl %ebx, %eax