Commit d8251108 authored by Shengzhou Liu's avatar Shengzhou Liu Committed by David Woodhouse

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: default avatarShengzhou Liu <Shengzhou.Liu@freescale.com>
Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent 2b00668f
...@@ -671,9 +671,7 @@ static int fsl_elbc_chip_init_tail(struct mtd_info *mtd) ...@@ -671,9 +671,7 @@ static int fsl_elbc_chip_init_tail(struct mtd_info *mtd)
if (chip->pagemask & 0xff000000) if (chip->pagemask & 0xff000000)
al++; al++;
/* add to ECCM mode set in fsl_elbc_init */ priv->fmr |= al << FMR_AL_SHIFT;
priv->fmr |= (12 << FMR_CWTO_SHIFT) | /* Timeout > 12 ms */
(al << FMR_AL_SHIFT);
dev_dbg(priv->dev, "fsl_elbc_init: nand->numchips = %d\n", dev_dbg(priv->dev, "fsl_elbc_init: nand->numchips = %d\n",
chip->numchips); chip->numchips);
...@@ -776,8 +774,10 @@ static int fsl_elbc_chip_init(struct fsl_elbc_mtd *priv) ...@@ -776,8 +774,10 @@ static int fsl_elbc_chip_init(struct fsl_elbc_mtd *priv)
priv->mtd.priv = chip; priv->mtd.priv = chip;
priv->mtd.owner = THIS_MODULE; priv->mtd.owner = THIS_MODULE;
/* Set the ECCM according to the settings in bootloader.*/ /* set timeout to maximum */
priv->fmr = in_be32(&lbc->fmr) & FMR_ECCM; 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 */ /* fill in nand_chip structure */
/* set up function call table */ /* set up function call table */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment