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] [PATCH - RFC] env_nand.c: fail gracefully if no nand is	present
Date: Mon, 16 Aug 2010 15:33:50 -0700	[thread overview]
Message-ID: <1281998030.2052.39.camel@quadra> (raw)
In-Reply-To: <4C69AF5E.2090608@freescale.com>

On Mon, 2010-08-16 at 16:36 -0500, Scott Wood wrote:
> On 08/16/2010 04:30 PM, Steve Sakoman wrote:
> > Rationale:
> >
> > The upcoming Beagle xM, unlike previous Beagles, has no on-board NAND.
> >
> > I'd like to continue to have a single version of u-boot that works for
> > all version of Beagles.  Therefore I need to have env_nand fail
> > gracefully when it runs on the xM.
> >
> > The patch below does the job, but I am not sure that my method of
> > checking for the existence of nand (nand_info[0].type = 0 when no nand
> > detected) is "correct"?  Any opinions or advice?
> 
> I just applied Mike's patch for this a few days ago:
> http://git.denx.de/?p=u-boot/u-boot-nand-flash.git;a=commitdiff;h=962ad59e25640e586e2bceabf67a628a27f8f508

Thanks Scott!  I'll add that patch to my working branch under the
assumption that it will eventually make its way to mainline.

Steve

> -Scott
> 
> >
> > Steve
> >
> > ---
> >
> > diff --git a/common/env_nand.c b/common/env_nand.c
> > index a15a950..325f112 100644
> > --- a/common/env_nand.c
> > +++ b/common/env_nand.c
> > @@ -268,6 +268,10 @@ int readenv (size_t offset, u_char * buf)
> >
> >   	u_char *char_ptr;
> >
> > +	/* fail if no nand detected */
> > +	if (nand_info[0].type == 0)
> > +		return 1;
> > +
> >   	blocksize = nand_info[0].erasesize;
> >   	len = min(blocksize, CONFIG_ENV_SIZE);
> >
> >
> > _______________________________________________
> > U-Boot mailing list
> > U-Boot at lists.denx.de
> > http://lists.denx.de/mailman/listinfo/u-boot
> >
> 
> 

      reply	other threads:[~2010-08-16 22:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-16 21:30 [U-Boot] [PATCH - RFC] env_nand.c: fail gracefully if no nand is present Steve Sakoman
2010-08-16 21:36 ` Scott Wood
2010-08-16 22:33   ` Steve Sakoman [this message]

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=1281998030.2052.39.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