From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Date: Wed, 26 Oct 2011 15:26:55 -0500 Subject: [U-Boot] OMAP3 NAND ECC bug report In-Reply-To: References: Message-ID: <4EA86D0F.1040307@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 10/25/2011 02:41 AM, Arno Steffen wrote: > I am feeling to spam the board but found finally the reason for this behaviour. > > nand_read returns with -EUCLEAN in case of correcting errors, and this > will later on reported as BAD NAND, although this error is corrected. > > Correct me if I am wrong. What I did is chaning env_nand.c: > while (amount_loaded < CONFIG_ENV_SIZE && offset < end) { > if (nand_block_isbad(&nand_info[0], offset)) { > offset += blocksize; > } else { > char_ptr = &buf[amount_loaded]; > - if (nand_read(&nand_info[0], offset, &len, char_ptr)) { > - return 1; > + err = nand_read(&nand_info[0], offset, &len, char_ptr); > + if (err) { > + if (err != -EUCLEAN) { // Bad NAND has been corrected, so no problem > + return 1; > + } > } > offset += blocksize; > amount_loaded += len; > } > > > Correct me if I am wrong, but it seems that all platform are suffered, > not just OMAP. > There will be compared a corrected bits before and after correction, > and it send an error message, if bits are corrected (instead of only > if it can not be corrected). What version of U-Boot are you looking at? In readenv(), I see nand_read_skip_bad(), not nand_read(). nand_read_skip_bad() handles -EUCLEAN. -Scott