mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Matthias Kaehlcke <matthias@kaehlcke.net>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] edb93xx: Fix SDRAM precharge
Date: Fri, 26 Feb 2010 08:23:52 +0100	[thread overview]
Message-ID: <20100226072352.GG25271@pengutronix.de> (raw)
In-Reply-To: <20100224190807.GW20201@darwin>

On Wed, Feb 24, 2010 at 08:08:07PM +0100, Matthias Kaehlcke wrote:
> edb93xx SDRAM initialization: Issue a precharge all command before forcing the
> precharge of all SDRAM banks. Write to the SDRAM in order to force a precharge,
> reading causes the edb93xx boards to hang

Ok, applied.

Sascha

> 
> Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net>
> ---
>  board/edb93xx/sdram_cfg.c |   21 +++++++++++++++------
>  1 files changed, 15 insertions(+), 6 deletions(-)
> 
> diff --git a/board/edb93xx/sdram_cfg.c b/board/edb93xx/sdram_cfg.c
> index 25b214b..3d4fe08 100644
> --- a/board/edb93xx/sdram_cfg.c
> +++ b/board/edb93xx/sdram_cfg.c
> @@ -31,9 +31,9 @@
>  		(SDRAM_BASE_ADDR | SDRAM_BANK_SEL_##bank | SDRAM_MODE_REG_VAL))
>  
>  #define PRECHARGE_BANK(bank)		(*(volatile uint32_t *)	\
> -				(SDRAM_BASE_ADDR | SDRAM_BANK_SEL_##bank))
> +		(SDRAM_BASE_ADDR | SDRAM_BANK_SEL_##bank)) = 0
>  
> -static void force_precharge(void);
> +static void precharge_all_banks(void);
>  static void setup_refresh_timer(void);
>  static void program_mode_registers(void);
>  
> @@ -48,7 +48,7 @@ void sdram_cfg(void)
>  
>  	early_udelay(200);
>  
> -	force_precharge();
> +	precharge_all_banks();
>  
>  	setup_refresh_timer();
>  
> @@ -58,13 +58,22 @@ void sdram_cfg(void)
>  	writel(GLCONFIG_CKE, &sdram->glconfig);
>  }
>  
> -static void force_precharge(void)
> +static void precharge_all_banks(void)
>  {
> +	struct sdram_regs *sdram = (struct sdram_regs *)SDRAM_BASE;
> +
> +	/* Issue PRECHARGE ALL commands */
> +	writel(GLCONFIG_INIT | GLCONFIG_CKE, &sdram->glconfig);
> +
>  	/*
> -	 * Errata most EP93xx revisions say that PRECHARGE ALL isn't always
> +	 * Errata of most EP93xx revisions say that PRECHARGE ALL isn't always
>  	 * issued.
>  	 *
> -	 * Do a read from each bank to make sure they're precharged
> +	 *  Cirrus proposes a workaround which consists in performing a read from
> +	 * each bank to force the precharge. This causes some boards to hang.
> +	 * Writing to the SDRAM banks instead of reading has the same
> +	 * side-effect (the SDRAM controller issues the necessary precharges),
> +	 * but is known to work on all supported boards
>  	 */
>  
>  	PRECHARGE_BANK(0);
> -- 
> 1.6.5
> 
> 
> _______________________________________________
> 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:[~2010-02-26  7:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-24 19:08 Matthias Kaehlcke
2010-02-26  7: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=20100226072352.GG25271@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=matthias@kaehlcke.net \
    /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