From: sbabic at denx.de Date: Sat, 16 Feb 2019 10:26:24 +0000 (UTC) Subject: [U-Boot] MTD: mxs_nand: Fix BCH read timeout error on boards requiring ECC In-Reply-To: <20190103023652.8489-1-aford173@gmail.com> Message-ID: <20190216102719.EF9F7C21E3E@lists.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: u-boot@lists.denx.de > 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 > Acked-by: Stefan Agner > Tested-by: J=C3=B6rg Krause > Acked-by: Tim Harvey > Tested-by: Tim Harvey > diff --git a/drivers/mtd/nand/raw/mxs_nand.c b/drivers/mtd/nand/raw/mxs_n= and.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) > =20 > nand_info->gpmi_regs =3D (struct mxs_gpmi_regs *)MXS_GPMI_BASE; > nand_info->bch_regs =3D (struct mxs_bch_regs *)MXS_BCH_BASE; > + > + if (is_mx6sx() || is_mx7()) > + nand_info->max_ecc_strength_supported =3D 62; > + else > + nand_info->max_ecc_strength_supported =3D 40; > + > err =3D 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/m= xs_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 =3D nand_chip.chipsize; > nand_chip.scan_bbt(mtd); > + mxs_nand_setup_ecc(mtd); > =20 > return 0; > } Applied to u-boot-imx, master, thanks ! Best regards, Stefano Babic --=20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D