public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] Read NAND flash error - nand_do_read_ops() function failed with an error code -117
@ 2011-05-26 21:17 Michael Lee
  0 siblings, 0 replies; only message in thread
From: Michael Lee @ 2011-05-26 21:17 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-05-26 21:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-26 21:17 [U-Boot] Read NAND flash error - nand_do_read_ops() function failed with an error code -117 Michael Lee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox