aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorVipin Kumar <vipin.kumar@st.com>2012-03-14 02:17:12 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-03-26 19:59:02 -0400
commit467e6e7be2e26fd5bbaabd849717d37de99df8f1 (patch)
treedbb1b570db775fcc35b76e7c010fd0e267aec26b /drivers/mtd
parentb533f8d84f4f0807bf1bcf52017c6a267c8c4405 (diff)
mtd: nand/fsmc: Initialize the badblockbits to 7
Ideally, the block should have 0xff written on the bad block position. Any value other than 0xff implies a bad block. In practical situations, there can be bit flips in the oob area as well which means that a block with 0x7f being read at bad block position may imply a bad block but it is infact only a bit flip in the bad block byte. To resolve this problem, the block is marked as good if number of high bits is greater than or equal to badblockbits (initialized to 7) Signed-off-by: Vipin Kumar <vipin.kumar@st.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/fsmc_nand.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/mtd/nand/fsmc_nand.c b/drivers/mtd/nand/fsmc_nand.c
index 6a0bca17c223..91f5b3404c79 100644
--- a/drivers/mtd/nand/fsmc_nand.c
+++ b/drivers/mtd/nand/fsmc_nand.c
@@ -802,6 +802,7 @@ static int __init fsmc_nand_probe(struct platform_device *pdev)
802 nand->ecc.size = 512; 802 nand->ecc.size = 512;
803 nand->options = pdata->options; 803 nand->options = pdata->options;
804 nand->select_chip = fsmc_select_chip; 804 nand->select_chip = fsmc_select_chip;
805 nand->badblockbits = 7;
805 806
806 if (pdata->width == FSMC_NAND_BW16) 807 if (pdata->width == FSMC_NAND_BW16)
807 nand->options |= NAND_BUSWIDTH_16; 808 nand->options |= NAND_BUSWIDTH_16;