MLK-11720: mtd: gpmi: change the erase threshold for mx6qp,mx6ul and mx7d
authorHan Xu <b45815@freescale.com>
Fri, 9 Oct 2015 16:19:01 +0000 (11:19 -0500)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:49:21 +0000 (14:49 -0500)
The erase threshold should be set to ecc_strength for these platforms.

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

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

index 1eea711..b8a753b 100644 (file)
@@ -326,9 +326,9 @@ int bch_set_geometry(struct gpmi_nand_data *this)
                        | BF_BCH_FLASH0LAYOUT1_DATAN_SIZE(blockn_size, this),
                        r->bch_regs + HW_BCH_FLASH0LAYOUT1);
 
-       /* Set erase threshold to gf/2 for mx6ul, mx6qp and mx7 */
+       /* Set erase threshold to ecc strength 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),
+               writel(BF_BCH_MODE_ERASE_THRESHOLD(ecc_strength),
                        r->bch_regs + HW_BCH_MODE);
 
        /* Set *all* chip selects to use layout 0. */