mxs_nand: don't check zero count when ECC reading with randomizer
authorHan Xu <han.xu@nxp.com>
Mon, 4 May 2020 14:09:02 +0000 (22:09 +0800)
committerStefano Babic <sbabic@denx.de>
Sun, 10 May 2020 18:55:20 +0000 (20:55 +0200)
When enabled randomizer during ECC reading, the controller reported it's
erased page. Checking zero count will cause data get modified to all
0xFF. Stop checking during randomizer to workaround this issue.

Signed-off-by: Han Xu <han.xu@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
drivers/mtd/nand/raw/mxs_nand.c

index b6e65c616d35bacc555c7f232cb51d5090ce1a40..3fd21e51f2a8d986bbb79361e26db51bba174883 100644 (file)
@@ -773,8 +773,9 @@ static int mxs_nand_ecc_read_page(struct mtd_info *mtd, struct nand_chip *nand,
                        continue;
 
                if (status[i] == 0xff) {
-                       if (is_mx6dqp() || is_mx7() ||
-                           is_mx6ul() || is_imx8() || is_imx8m())
+                       if (!nand_info->en_randomizer &&
+                           (is_mx6dqp() || is_mx7() || is_mx6ul() ||
+                            is_imx8() || is_imx8m()))
                                if (readl(&bch_regs->hw_bch_debug1))
                                        flag = 1;
                        continue;