From: Han Xu Date: Tue, 15 Sep 2015 20:50:18 +0000 (-0500) Subject: MLK-11555: mtd: nand: i.MX6UL supports bitflip detection X-Git-Tag: C0P2-H0.0--20200415~3990 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=ee6fba2a8d1a27a43f0f6a53edbfb510c1c8636b;p=linux.git MLK-11555: mtd: nand: i.MX6UL supports bitflip detection i.MX6UL also has the DEBUG1 register which can be used for bitflip detection for erased page. Signed-off-by: Han Xu (cherry picked from commit 8df8d10edc8909e19e60f0cc1dd65c1fe706ab67) --- diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-lib.c b/drivers/mtd/nand/gpmi-nand/gpmi-lib.c index a45a3fd2bafe..016758b87948 100644 --- a/drivers/mtd/nand/gpmi-nand/gpmi-lib.c +++ b/drivers/mtd/nand/gpmi-nand/gpmi-lib.c @@ -303,8 +303,8 @@ int bch_set_geometry(struct gpmi_nand_data *this) | BF_BCH_FLASH0LAYOUT1_DATAN_SIZE(block_size, this), r->bch_regs + HW_BCH_FLASH0LAYOUT1); - /* Set erase threshold to gf/2 for mx6qp and mx7 */ - if (GPMI_IS_MX6QP(this) || GPMI_IS_MX7(this)) + /* Set erase threshold to gf/2 for mx6ul, mx6qp and mx7 */ + if (GPMI_IS_MX6QP(this) || GPMI_IS_MX7(this) || GPMI_IS_MX6UL(this)) writel(BF_BCH_MODE_ERASE_THRESHOLD(gf_len/2), r->bch_regs + HW_BCH_MODE); diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c index bac0e497655f..e15b76b66e83 100644 --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c @@ -1117,7 +1117,8 @@ static int gpmi_ecc_read_page(struct mtd_info *mtd, struct nand_chip *chip, continue; if (*status == STATUS_ERASED) { - if (GPMI_IS_MX6QP(this) || GPMI_IS_MX7(this)) + if (GPMI_IS_MX6QP(this) || GPMI_IS_MX7(this) || + GPMI_IS_MX6UL(this)) if (readl(bch_regs + HW_BCH_DEBUG1)) flag = 1; continue;