MLK-11555: mtd: nand: i.MX6UL supports bitflip detection
authorHan Xu <b45815@freescale.com>
Tue, 15 Sep 2015 20:50:18 +0000 (15:50 -0500)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:49:20 +0000 (14:49 -0500)
i.MX6UL also has the DEBUG1 register which can be used for bitflip
detection for erased page.

Signed-off-by: Han Xu <b45815@freescale.com>
(cherry picked from commit 8df8d10edc8909e19e60f0cc1dd65c1fe706ab67)

drivers/mtd/nand/gpmi-nand/gpmi-lib.c
drivers/mtd/nand/gpmi-nand/gpmi-nand.c

index a45a3fd..016758b 100644 (file)
@@ -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);
 
index bac0e49..e15b76b 100644 (file)
@@ -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;