[U-Boot] OMAP3 NAND ECC bug report

Scott Wood scottwood at freescale.com
Wed Oct 26 22:26:55 CEST 2011


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



More information about the U-Boot mailing list