aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/fsl_elbc_nand.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c
index 1b06d29dd06b..99dc2be620a6 100644
--- a/drivers/mtd/nand/fsl_elbc_nand.c
+++ b/drivers/mtd/nand/fsl_elbc_nand.c
@@ -116,6 +116,20 @@ static struct nand_ecclayout fsl_elbc_oob_lp_eccm1 = {
116 .oobavail = 48, 116 .oobavail = 48,
117}; 117};
118 118
119/*
120 * fsl_elbc_oob_lp_eccm* specify that LP NAND's OOB free area starts at offset
121 * 1, so we have to adjust bad block pattern. This pattern should be used for
122 * x8 chips only. So far hardware does not support x16 chips anyway.
123 */
124static u8 scan_ff_pattern[] = { 0xff, };
125
126static struct nand_bbt_descr largepage_memorybased = {
127 .options = 0,
128 .offs = 0,
129 .len = 1,
130 .pattern = scan_ff_pattern,
131};
132
119/*=================================*/ 133/*=================================*/
120 134
121/* 135/*
@@ -687,6 +701,7 @@ static int fsl_elbc_chip_init_tail(struct mtd_info *mtd)
687 chip->ecc.layout = (priv->fmr & FMR_ECCM) ? 701 chip->ecc.layout = (priv->fmr & FMR_ECCM) ?
688 &fsl_elbc_oob_lp_eccm1 : 702 &fsl_elbc_oob_lp_eccm1 :
689 &fsl_elbc_oob_lp_eccm0; 703 &fsl_elbc_oob_lp_eccm0;
704 chip->badblock_pattern = &largepage_memorybased;
690 mtd->ecclayout = chip->ecc.layout; 705 mtd->ecclayout = chip->ecc.layout;
691 mtd->oobavail = chip->ecc.layout->oobavail; 706 mtd->oobavail = chip->ecc.layout->oobavail;
692 } 707 }