All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] MTD: mxs_nand: Fix BCH read timeout error on boards requiring ECC
@ 2019-01-03  2:36 Adam Ford
  2019-01-03 15:55 ` Stefan Agner
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Adam Ford @ 2019-01-03  2:36 UTC (permalink / raw)
  To: u-boot

The LogicPD board uses a Micron Flash with ECC.  To boot this from
SPL, the ECC needs to be correctly configured or the BCH engine
times out.

Signed-off-by: Adam Ford <aford173@gmail.com>

diff --git a/drivers/mtd/nand/raw/mxs_nand.c b/drivers/mtd/nand/raw/mxs_nand.c
index e3341812a2..2d84bfffe2 100644
--- a/drivers/mtd/nand/raw/mxs_nand.c
+++ b/drivers/mtd/nand/raw/mxs_nand.c
@@ -1163,6 +1163,12 @@ int mxs_nand_init_spl(struct nand_chip *nand)
 
 	nand_info->gpmi_regs = (struct mxs_gpmi_regs *)MXS_GPMI_BASE;
 	nand_info->bch_regs = (struct mxs_bch_regs *)MXS_BCH_BASE;
+
+	if (is_mx6sx() || is_mx7())
+		nand_info->max_ecc_strength_supported = 62;
+	else
+		nand_info->max_ecc_strength_supported = 40;
+
 	err = mxs_nand_alloc_buffers(nand_info);
 	if (err)
 		return err;
diff --git a/drivers/mtd/nand/raw/mxs_nand_spl.c b/drivers/mtd/nand/raw/mxs_nand_spl.c
index c628f3adec..ba85baac60 100644
--- a/drivers/mtd/nand/raw/mxs_nand_spl.c
+++ b/drivers/mtd/nand/raw/mxs_nand_spl.c
@@ -201,6 +201,7 @@ static int mxs_nand_init(void)
 	/* setup flash layout (does not scan as we override that) */
 	mtd->size = nand_chip.chipsize;
 	nand_chip.scan_bbt(mtd);
+	mxs_nand_setup_ecc(mtd);
 
 	return 0;
 }
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-02-16 10:26 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-03  2:36 [U-Boot] [PATCH] MTD: mxs_nand: Fix BCH read timeout error on boards requiring ECC Adam Ford
2019-01-03 15:55 ` Stefan Agner
2019-02-02 13:21   ` Jörg Krause
2019-02-04 18:17 ` Tim Harvey
2019-02-10 13:30   ` Adam Ford
2019-02-10 13:48     ` Adam Ford
2019-02-12 21:38       ` Scott Wood
2019-02-12 21:44         ` Adam Ford
2019-02-12 23:05           ` Tom Rini
2019-02-13  7:42             ` Stefano Babic
2019-02-16 10:26 ` [U-Boot] " sbabic at denx.de

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.