From: Graeme Russ Date: Thu, 25 Mar 2010 22:22:48 +1100 Subject: [U-Boot] [RFC][PATCH 06/21] [x86] Fix sc520 memory size reporting In-Reply-To: <1269516183-9306-1-git-send-email-graeme.russ@gmail.com> References: <1269516183-9306-1-git-send-email-graeme.russ@gmail.com> Message-ID: <1269516183-9306-7-git-send-email-graeme.russ@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 --- cpu/i386/sc520/sc520_asm.S | 35 +++++++++++++++++------------------ 1 files changed, 17 insertions(+), 18 deletions(-) diff --git a/cpu/i386/sc520/sc520_asm.S b/cpu/i386/sc520/sc520_asm.S index 2042d9b..135f7b4 100644 --- a/cpu/i386/sc520/sc520_asm.S +++ b/cpu/i386/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 -- 1.7.0.2.182.ge007