mtd: nand: fixup for fmr initialization of Freescale NAND controller

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon Jan 9 13:59:08 EST 2012


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=d8251108e0def5a2f15124a8e6314b14bfa5eb9c
Commit:     d8251108e0def5a2f15124a8e6314b14bfa5eb9c
Parent:     2b00668ff9d91d594a204ff2c3bf940d483e4b5f
Author:     Shengzhou Liu <Shengzhou.Liu at freescale.com>
AuthorDate: Mon Dec 12 17:40:52 2011 +0800
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Mon Jan 9 18:18:44 2012 +0000

    mtd: nand: fixup for fmr initialization of Freescale NAND controller
    
    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(), now we initialize CWTO to maximum timeout value
    and not relying on the setting of bootloader.
    
    Signed-off-by: Shengzhou Liu <Shengzhou.Liu at freescale.com>
    Signed-off-by: Artem Bityutskiy <artem.bityutskiy at linux.intel.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/nand/fsl_elbc_nand.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c
index d29479a..080e603 100644
--- a/drivers/mtd/nand/fsl_elbc_nand.c
+++ b/drivers/mtd/nand/fsl_elbc_nand.c
@@ -671,9 +671,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);
@@ -776,8 +774,10 @@ 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 timeout to maximum */
+	priv->fmr = 15 << FMR_CWTO_SHIFT;
+	if (in_be32(&lbc->bank[priv->bank].or) & OR_FCM_PGS)
+		priv->fmr |= FMR_ECCM;
 
 	/* fill in nand_chip structure */
 	/* set up function call table */



More information about the linux-mtd-cvs mailing list