UPSTREAM: 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.

Change-Id: I0fcdc7f4853bf01c1a7318f4384767e9cb252e2c
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>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 5ae585ba3a8bb2336d5cb6e1ef4c80a5ef445409)
This commit is contained in:
Adam Ford 2019-01-02 20:36:52 -06:00 committed by Kever Yang
parent da74824551
commit 0aa53418f3
2 changed files with 7 additions and 0 deletions

View File

@ -1164,6 +1164,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;

View File

@ -202,6 +202,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;
}