From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Date: Tue, 12 Feb 2019 15:38:52 -0600 Subject: [U-Boot] [PATCH] MTD: mxs_nand: Fix BCH read timeout error on boards requiring ECC In-Reply-To: References: <20190103023652.8489-1-aford173@gmail.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Sun, 2019-02-10 at 07:48 -0600, Adam Ford wrote: > On Sun, Feb 10, 2019 at 7:30 AM Adam Ford wrote: > > > > On Mon, Feb 4, 2019 at 12:17 PM Tim Harvey wrote: > > > > > > On Wed, Jan 2, 2019 at 6:37 PM Adam Ford wrote: > > > > > > > > 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 > > > > > > > > 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 > > > > > > > > > > Thanks Adam, > > Scott / Stefano, > > I had to use Scott's other -email. > > > Any chance this can get reviewed and/or applied for the next release? > We've got a few people who have their respective tested-by comments. I haven't been involved in U-Boot for a while now. -Scott