summaryrefslogtreecommitdiff
path: root/drivers/mtd/nand
diff options
context:
space:
mode:
authorAdam Ford <aford173@gmail.com>2019-01-02 20:36:52 -0600
committerStefano Babic <sbabic@denx.de>2019-02-15 12:36:08 +0100
commit5ae585ba3a8bb2336d5cb6e1ef4c80a5ef445409 (patch)
treeda88da273f69c3a38653bbb3e9a70545489c22aa /drivers/mtd/nand
parentdc619924c7734e14c459cec2fb5afcec27052bea (diff)
MTD: mxs_nand: Fix BCH read timeout error on boards requiring ECC
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> Acked-by: Stefan Agner <stefan.agner@toradex.com> Tested-by: Jörg Krause <joerg.krause@embedded.rocks> Acked-by: Tim Harvey <tharvey@gateworks.com> Tested-by: Tim Harvey <tharvey@gateworks.com>
Diffstat (limited to 'drivers/mtd/nand')
-rw-r--r--drivers/mtd/nand/raw/mxs_nand.c6
-rw-r--r--drivers/mtd/nand/raw/mxs_nand_spl.c1
2 files changed, 7 insertions, 0 deletions
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;
}