linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PPC440EPx SDRAM width
@ 2009-04-23 13:36 Steven A. Falco
  2009-04-23 13:45 ` Josh Boyer
  0 siblings, 1 reply; 14+ messages in thread
From: Steven A. Falco @ 2009-04-23 13:36 UTC (permalink / raw)
  To: linuxppc-dev@ozlabs.org

There is an error in the way ibm4xx_denali_fixup_memsize calculates
memory size.  When testing the DDR_REDUC bit, the polarity is
backwards.  A "1" implies 32-bit wide memory while a "0" implies
64-bit wide memory.

For a 32-bit wide system, this bug causes twice the memory to be
reported, leading to boot failure.

Signed-off-by: Steven A. Falco <sfalco@harris.com>
---

Here is a partial log showing what happens in the
ibm4xx_denali_fixup_memsize routine.  This board has
128 Mbytes of RAM in a 32-bit wide configuration, but
the REDUC bug causes the path width to report as "8",
and the memory size to be doubled to 255 MB.  Once I
applied my patch, the memory correctly reported as
127 MB.

max_cs=00000002 max_col=0000000c max_row=0000000e
cs 00000001
path width 00000008
row=0000000d col=0000000a bank=00000004
ibm4xx_denali_fixup_memsize 10000000
Memory <- <0x0 0x0 0xffff000> (255MB)

diff --git a/arch/powerpc/boot/4xx.c b/arch/powerpc/boot/4xx.c
index 5c87843..3595c0a 100644
--- a/arch/powerpc/boot/4xx.c
+++ b/arch/powerpc/boot/4xx.c
@@ -193,9 +193,9 @@ void ibm4xx_denali_fixup_memsize(void)
        val = SDRAM0_READ(DDR0_14);

        if (DDR_GET_VAL(val, DDR_REDUC, DDR_REDUC_SHIFT))
-               dpath = 8; /* 64 bits */
-       else
                dpath = 4; /* 32 bits */
+       else
+               dpath = 8; /* 64 bits */

        /* get address pins (rows) */
        val = SDRAM0_READ(DDR0_42);

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2009-04-24  4:23 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-23 13:36 [PATCH] PPC440EPx SDRAM width Steven A. Falco
2009-04-23 13:45 ` Josh Boyer
2009-04-23 14:05   ` Stefan Roese
2009-04-23 14:40     ` Valentine Barshak
2009-04-23 14:59       ` Josh Boyer
2009-04-23 15:16         ` Valentine Barshak
2009-04-23 16:00           ` Steven A. Falco
2009-04-23 17:12             ` [PATCH] PowerPC: 440EPx/GRx Sequoia/Rainier U-Boot incorrect chipselect number workaround Valentine Barshak
2009-04-23 17:45               ` Steven A. Falco
2009-04-23 20:04                 ` Valentine
2009-04-23 20:07                   ` Josh Boyer
2009-04-23 20:12                     ` Steven A. Falco
2009-04-23 20:55                       ` [PATCH] PowerPC 44x: ibm4xx_denali_fixup_memsize fix Valentine Barshak
2009-04-24  4:23                         ` Stefan Roese

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).