[U-Boot] Read NAND flash error - nand_do_read_ops() function failed with an error code -117

Michael Lee elecmike2000 at yahoo.ca
Thu May 26 23:17:46 CEST 2011


Hi there,

I am experiencing reading NAND flash failure, that nand_do_read_ops() function 
returns an error -117 (EUCLEAN) in file nand_base.c. 

If I comment out this line and hardcoded to "return 0" like this:

// return  mtd->ecc_stats.corrected - stats.corrected ? -EUCLEAN : 0;
return 0;

Then I am able to read the entire kernel image correctly and boot into linux 
just fine. 

My question is why this function returns an error when there is an software ecc 
correction happened (mtd->ecc_stats.corrected value is changed to be different 
from that in stats.corrected)? Can I keep the hardcoded "return 0" in the 
product?

I added printing out of the values:

400.001 before entering  nand_do_read_ops() len=0x00020000, buff=21000000
500.001 hardcoded to return ok. ecc_stats.corrected=4, stats.corrected=0
400.001 before entering  nand_do_read_ops() len=0x00020000, buff=21020000
500.001 hardcoded to return ok. ecc_stats.corrected=5, stats.corrected=4
400.001 before entering  nand_do_read_ops() len=0x00020000, buff=21040000
500.001 hardcoded to return ok. ecc_stats.corrected=9, stats.corrected=5
400.001 before entering  nand_do_read_ops() len=0x00020000, buff=21060000
500.001 hardcoded to return ok. ecc_stats.corrected=14, stats.corrected=9
( More ....)

This is a customized Atmel AT91SAM9260-EK with NAND flash chip from Micron 
(MT29F1G08ABBHC-ET:B, 1Gbx8bit). 

Here is the nand init code:

int board_nand_init(struct nand_chip *nand)
{
        nand->ecc.mode = NAND_ECC_SOFT;
nand->cmd_ctrl = at91sam9260ek_nand_hwcontrol;
nand->dev_ready = at91sam9260ek_nand_ready;
nand->chip_delay = 20;
return 0;
}

Any help is hight appreciated.

Mike


More information about the U-Boot mailing list