linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: Shengzhou Liu <Shengzhou.Liu@freescale.com>
Cc: linux-mtd@lists.infradead.org, kumar.gala@freescale.com,
	linuxppc-dev@lists.ozlabs.org, dwmw2@infradead.org
Subject: Re: [PATCH 1/2] mtd/nand: fixup for fmr initialization of Freescale NAND controller
Date: Mon, 5 Dec 2011 13:31:46 -0600	[thread overview]
Message-ID: <4EDD1C22.9080801@freescale.com> (raw)
In-Reply-To: <1323082493-22617-1-git-send-email-Shengzhou.Liu@freescale.com>

On 12/05/2011 04:54 AM, Shengzhou Liu wrote:
> There was a bug for fmr initialization, which lead to  fmr was always 0x100
> in fsl_elbc_chip_init() and caused FCM command timeout before calling
> fsl_elbc_chip_init_tail().
> 
> Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
> ---
>  drivers/mtd/nand/fsl_elbc_nand.c |    8 +++-----
>  1 files changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c
> index eedd8ee..742bf73 100644
> --- a/drivers/mtd/nand/fsl_elbc_nand.c
> +++ b/drivers/mtd/nand/fsl_elbc_nand.c
> @@ -659,9 +659,7 @@ static int fsl_elbc_chip_init_tail(struct mtd_info *mtd)
>  	if (chip->pagemask & 0xff000000)
>  		al++;
>  
> -	/* add to ECCM mode set in fsl_elbc_init */
> -	priv->fmr |= (12 << FMR_CWTO_SHIFT) |  /* Timeout > 12 ms */
> -	             (al << FMR_AL_SHIFT);
> +	priv->fmr |= al << FMR_AL_SHIFT;
>  
>  	dev_dbg(priv->dev, "fsl_elbc_init: nand->numchips = %d\n",
>  	        chip->numchips);
> @@ -764,8 +762,8 @@ static int fsl_elbc_chip_init(struct fsl_elbc_mtd *priv)
>  	priv->mtd.priv = chip;
>  	priv->mtd.owner = THIS_MODULE;
>  
> -	/* Set the ECCM according to the settings in bootloader.*/
> -	priv->fmr = in_be32(&lbc->fmr) & FMR_ECCM;
> +	/* Set fmr according to the settings in bootloader.*/
> +	priv->fmr = in_be32(&lbc->fmr);
>  
>  	/* fill in nand_chip structure */
>  	/* set up function call table */

We shouldn't be relying on the bootloader to provide a sane value here
-- the bootloader may not have used/initialized NAND at all.

It's sort of OK for ECCM, since unless you're trying to match an
externally programmed flash, or the bootloader uses the flash, all we
really care about is that the value stay consistent.  The timeout, OTOH,
must not be set too low or things won't work.

We should just set a value that we believe to be high enough for all uses.

-Scott

  parent reply	other threads:[~2011-12-05 19:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-05 10:54 [PATCH 1/2] mtd/nand: fixup for fmr initialization of Freescale NAND controller Shengzhou Liu
2011-12-05 10:54 ` [PATCH 2/2] mtd/nand: Add ONFI support for FSL " Shengzhou Liu
2011-12-05 19:31 ` Scott Wood [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-12-12  9:40 [PATCH 1/2] mtd/nand: fixup for fmr initialization of Freescale " Shengzhou Liu
2011-12-17 14:44 ` Artem Bityutskiy
2011-12-20  6:40   ` Liu Shengzhou-B36685
2011-12-22 10:24     ` Artem Bityutskiy

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=4EDD1C22.9080801@freescale.com \
    --to=scottwood@freescale.com \
    --cc=Shengzhou.Liu@freescale.com \
    --cc=dwmw2@infradead.org \
    --cc=kumar.gala@freescale.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linuxppc-dev@lists.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 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).