diff mbox series

[13/14] mxs_nand: don't check zero count when ECC reading with randomizer

Message ID 20200504140903.23602-14-peng.fan@nxp.com
State New
Headers show
Series mtd: nand: i.MX update | expand

Commit Message

Peng Fan May 4, 2020, 2:09 p.m. UTC
From: Han Xu <han.xu at nxp.com>

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 at nxp.com>
Signed-off-by: Peng Fan <peng.fan at nxp.com>
---
 drivers/mtd/nand/raw/mxs_nand.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Stefano Babic May 11, 2020, 10:18 a.m. UTC | #1
> From: Han Xu <han.xu at nxp.com>
> 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 at nxp.com>
> Signed-off-by: Peng Fan <peng.fan at nxp.com>
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/drivers/mtd/nand/raw/mxs_nand.c b/drivers/mtd/nand/raw/mxs_nand.c
index b6e65c616d..3fd21e51f2 100644
--- a/drivers/mtd/nand/raw/mxs_nand.c
+++ b/drivers/mtd/nand/raw/mxs_nand.c
@@ -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;