mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Renaud Barbier <renaud.barbier@ge.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] ppc: mpc85xx: fix memory size calculation
Date: Fri, 14 Feb 2014 21:23:20 +0100	[thread overview]
Message-ID: <20140214202319.GF17250@pengutronix.de> (raw)
In-Reply-To: <1392307374-22298-1-git-send-email-renaud.barbier@ge.com>

On Thu, Feb 13, 2014 at 04:02:54PM +0000, Renaud Barbier wrote:
> Fix the chip select configuration register offset increment and summing
> of bank size so that, for chip select index greater than 0, barebox can
> determine the total memory size from enabled banks.
> 
> Signed-off-by: Renaud Barbier <renaud.barbier@ge.com>

Applied, thanks

Sascha

> ---
>  arch/ppc/mach-mpc85xx/cpu.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/ppc/mach-mpc85xx/cpu.c b/arch/ppc/mach-mpc85xx/cpu.c
> index 17a1c4c..e5c01fc 100644
> --- a/arch/ppc/mach-mpc85xx/cpu.c
> +++ b/arch/ppc/mach-mpc85xx/cpu.c
> @@ -68,14 +68,14 @@ phys_size_t fsl_get_effective_memsize(void)
>  	sdram_size = 0;
> 
>  	for (ix = 0; ix < CFG_CHIP_SELECTS_PER_CTRL; ix++) {
> -		if (in_be32(regs + DDR_OFF(CS0_CONFIG) + (ix * 8)) &
> +		if (in_be32(regs + DDR_OFF(CS0_CONFIG) + (ix * 4)) &
>  				SDRAM_CFG_MEM_EN) {
>  			reg = in_be32(regs + DDR_OFF(CS0_BNDS) + (ix * 8));
>  			/* start address */
>  			san = (reg & 0x0fff00000) >>  16;
>  			/* end address   */
>  			ean = (reg & 0x00000fff);
> -			sdram_size =  ((ean - san + 1) << 24);
> +			sdram_size += ((ean - san + 1) << 24);
>  		}
>  	}
> 
> --
> 1.7.1
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2014-02-14 20:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-13 16:02 Renaud Barbier
2014-02-14 20:23 ` Sascha Hauer [this message]

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=20140214202319.GF17250@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=renaud.barbier@ge.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox