From mboxrd@z Thu Jan 1 00:00:00 1970 From: Victor Gallardo Date: Thu, 20 Aug 2009 23:30:45 -0700 (PDT) Subject: [U-Boot] NAND ECC Error with wrong SMC ording bug In-Reply-To: References: <19081.57584.173693.798535@cargo.ozlabs.ibm.com> <4A8C87E6.6070702@amcc.com> <20090820003851.1a532444@lappy.seanm.ca> <200908200701.21076.sr@denx.de> <20090820153644.631dbd7b@lappy.seanm.ca> Message-ID: <587603.70189.qm@web39805.mail.mud.yahoo.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Vimal, > > With the current ndfc code, the error correction gets the bits wrong. > > Switching it back to the original way and the correction is correct. > > > > diff --git a/drivers/mtd/nand/ndfc.c b/drivers/mtd/nand/ndfc.c > > index 89bf85a..497e175 100644 > > --- a/drivers/mtd/nand/ndfc.c > > +++ b/drivers/mtd/nand/ndfc.c > > @@ -101,9 +101,8 @@ static int ndfc_calculate_ecc(struct mtd_info *mtd, > > > > ? ? ? ?wmb(); > > ? ? ? ?ecc = in_be32(ndfc->ndfcbase + NDFC_ECC); > > - ? ? ? /* The NDFC uses Smart Media (SMC) bytes order */ > > - ? ? ? ecc_code[0] = p[2]; > > - ? ? ? ecc_code[1] = p[1]; > > + ? ? ? ecc_code[0] = p[1]; > > + ? ? ? ecc_code[1] = p[2]; > > ? ? ? ?ecc_code[2] = p[3]; > > > > ? ? ? ?return 0; > > > > Does anybody see a problem with my method of reproducing the bug? This > > bug is deadly for our customers. I don't want to make the change unless > > it is absolutely necessary.. > > Just one question: did you enabled MTD_NAND_ECC_SMC in configs? Yes, it was set. Best Regards, Victor Gallardo