public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Steve Sakoman <steve@sakoman.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] fw_setenv broken?
Date: Wed, 17 Nov 2010 14:48:59 -0800	[thread overview]
Message-ID: <1290034139.2927.1192.camel@quadra> (raw)
In-Reply-To: <20101117160802.5bacf545@udp111988uds.am.freescale.net>

On Wed, 2010-11-17 at 16:08 -0600, Scott Wood wrote:
> On Wed, 17 Nov 2010 22:40:49 +0100
> Wolfgang Denk <wd@denx.de> wrote:
> 
> > Dear Steve Sakoman,
> > 
> > In message <AANLkTimrfQ5+AWfdFy_fueTMH=x=xrkaZGNtK8fiSD48@mail.gmail.com> you wrote:
> > >
> > > readenv: offset = 240000
> > > readenv: nand_read failure = -117
> > > *** Warning - readenv() failed, using default environment
> > > 
> > > I then immediately tried to use the nand read command to read the same
> > > block, and it was successful!
> > 
> > Hm... any chance that - for example - your timers are not working
> > correctly before relocation (maybe because they try to write to the
> > not yet available data segment) ? This could cause timeouts or delays
> > to be too short, so the NAND driver is misbehaving?
> 
> The NAND driver only works after relocation.
> 
> It looks like the problem is that -EUCLEAN is a non-fatal error
> (indicates a correctable ECC error).  The code invoked by the "nand
> read" command succeeds if nand_read() returns either 0 or -EUCLEAN, but
> readenv() is missing this check.

OK, we seem to be peeling back the layers of the onion now.

I patched readenv to use the same nand_read_skip_bad function used in
the command line "nand read" tool.  I no longer get the -EUCLEAN errors
when reading the environment after using fw_setenv to write from linux.
Now I get:

*** Warning - bad CRC, using default environment

Checking the data with the "nand read" command line shows that the
changes I made in linux are indeed there, so I suspect that there is
also some mismatch in the CRC computation between the fw tools and the
u-boot code (i.e. I'm pretty sure this error does *not* refer to the
nand CRC)

Steve

  reply	other threads:[~2010-11-17 22:48 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-17 16:30 [U-Boot] fw_setenv broken? Steve Sakoman
2010-11-17 16:56 ` Stefano Babic
2010-11-17 17:39   ` Wolfgang Denk
2010-11-17 17:51     ` Steve Sakoman
2010-11-17 18:13     ` Mike Frysinger
2010-11-17 18:28       ` Wolfgang Denk
2010-11-17 20:05     ` Steve Sakoman
2010-11-17 20:47       ` Wolfgang Denk
2010-11-17 21:29         ` Steve Sakoman
2010-11-17 21:40           ` Wolfgang Denk
2010-11-17 21:55             ` Steve Sakoman
2010-11-17 22:08             ` Scott Wood
2010-11-17 22:48               ` Steve Sakoman [this message]
2010-11-17 23:05                 ` Wolfgang Denk
2010-11-19  0:13               ` Steve Sakoman
2010-11-19  0:20                 ` Scott Wood
2010-11-19  0:33                   ` Steve Sakoman
2010-11-19  5:09                   ` Steve Sakoman

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=1290034139.2927.1192.camel@quadra \
    --to=steve@sakoman.com \
    --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