All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Steven A. Falco" <sfalco@harris.com>
To: "linuxppc-dev@ozlabs.org" <linuxppc-dev@ozlabs.org>
Subject: [PATCH] PPC440EPx SDRAM width
Date: Thu, 23 Apr 2009 09:36:12 -0400	[thread overview]
Message-ID: <49F06ECC.7030904@harris.com> (raw)

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);

             reply	other threads:[~2009-04-23 13:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-23 13:36 Steven A. Falco [this message]
2009-04-23 13:45 ` [PATCH] PPC440EPx SDRAM width 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49F06ECC.7030904@harris.com \
    --to=sfalco@harris.com \
    --cc=linuxppc-dev@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.