All of lore.kernel.org
 help / color / mirror / Atom feed
From: Valentine <vbarshak@ru.mvista.com>
To: Mikhail Zolotaryov <lebon@lebon.org.ua>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH] PowerPC 440EPx/GRx fix memory size calculation
Date: Wed, 11 Mar 2009 04:40:12 +0300	[thread overview]
Message-ID: <49B7167C.9000004@ru.mvista.com> (raw)
In-Reply-To: <49B6D427.5050600@lebon.org.ua>

Mikhail Zolotaryov wrote:
> Valentine Barshak wrote:
>> According to the AMCC 440EPX/GRX user manual,
>> the Chip Select width is always fixed at 1 bit no matter
>> what is actually read from register DDR_10.
>
> Well, from my point of view original kernel code is correct in this part.
>
> Adding one bit into memory address means multiplying memory size by 2 
> i.e. cs=2. The question is: is Chip Select bit used in memory address. 
> ChipSelect input of memory chip enables or disabled it, so if we have 
> only one BankSel installed/connected (DDR0_10[22:23] is 01 or 10) 
> there's no need to use Chip Select bit in an address. On the contrary, 
> if both BankSel lines are connected (DDR0_10[22:23] is 11), to let 
> memory controller know which memory rank to use, Chip Select bit is 
> added into memory address. (and yes, if DDR0_10[22:23] is 00 - no 
> ranks installed, memory size is 0, cs=0)
Yes, you could phrase it that way. According to the PPC440EPx manual, 
the total memory size is calculated based on the following formula:
memsize = cs * (1 << (col+row)) * bank * dpath;
So, if both chipselects are used, we add an extra bit to the memory 
address to distinguish between these chipselects.
There's nothing wrong with this part of the code.
The problem is that the controller is hardwired to use only one 
chipselect, even if both are enabled in the DDR0_10 on PPC440EPx/GRx 
processors.
So, the patch provides a workaround to always use single cs for 
440EPx/GRx (use predefined value instead of reading DDR0_10).
>
> Original kernel code use exactly the same logic as I described above. 
> Please suggest if it's wrong.
Thanks,
Valentine.

  reply	other threads:[~2009-03-11  2:15 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-09 16:21 [PATCH] powerpc 4xx: DDR0_14[REDUC] decoded incorrectly Mikhail Zolotaryov
2009-03-09 16:21 ` Mikhail Zolotaryov
2009-03-09 17:12 ` Josh Boyer
2009-03-09 17:12   ` Josh Boyer
2009-03-09 21:17   ` Mikhail Zolotaryov
2009-03-09 21:17     ` Mikhail Zolotaryov
2009-03-10 19:50     ` [PATCH] PowerPC 440EPx/GRx fix memory size calculation Valentine Barshak
2009-03-10 20:57       ` Mikhail Zolotaryov
2009-03-11  1:40         ` Valentine [this message]
2009-03-11  2:26           ` Benjamin Herrenschmidt
2009-03-11  8:24             ` Mikhail Zolotaryov
2009-03-11  8:29           ` Mikhail Zolotaryov
2009-03-11 10:37       ` Josh Boyer
2009-03-11 19:06         ` Valentine Barshak
2009-03-11 21:57           ` Josh Boyer
2009-03-11 22:08             ` Valentine
2009-03-11 23:07               ` Josh Boyer
2009-03-12  6:02           ` Stefan Roese
2009-03-12  7:32             ` Benjamin Herrenschmidt
2009-03-12  8:05               ` Stefan Roese
2009-03-12  8:12                 ` Benjamin Herrenschmidt
2009-03-12  8:24                   ` Stefan Roese
2009-03-12  8:45                     ` Mikhail Zolotaryov
2009-03-12 10:45                     ` Josh Boyer
2009-03-12 11:02                       ` Stefan Roese
2009-03-13 23:01             ` Feng Kan

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=49B7167C.9000004@ru.mvista.com \
    --to=vbarshak@ru.mvista.com \
    --cc=lebon@lebon.org.ua \
    --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.