public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Michael Lee <elecmike2000@yahoo.ca>
To: u-boot@lists.denx.de
Subject: [U-Boot] Read NAND flash error - nand_do_read_ops() function failed with an error code -117
Date: Thu, 26 May 2011 14:17:46 -0700 (PDT)	[thread overview]
Message-ID: <414285.93015.qm@web39301.mail.mud.yahoo.com> (raw)

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

                 reply	other threads:[~2011-05-26 21:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=414285.93015.qm@web39301.mail.mud.yahoo.com \
    --to=elecmike2000@yahoo.ca \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox