From: Alex Waterman <awaterman@dawning.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] RFC: porting u-boot to sequoia based nand booting board
Date: Wed, 18 May 2011 08:49:17 -0400 [thread overview]
Message-ID: <4DD3C04D.9070001@dawning.com> (raw)
In-Reply-To: <20110517163207.08cc2ea6@schlenkerla.am.freescale.net>
Scott,
> Nothing in nand_base.c is used by SPL. SPL has its own code for this,
> which currently just does a readb() (broken on 16-bit?).
Oh you were talking about the bad block function in nand_base.c... That
makes more sense now :). And yeah, I suppose the spl bad block check is
broken. If it does not check the full 16 bits of data then some bad blocks
may be incorrectly read as good.
> It's not really our choice, it's what the manufacturer uses (unless you
> want to get into rewriting the markers before first use...). The one
> chip datasheet I looked at claimed the bad block marker was any value other
> than 0xffff on 16-bit, so checking just one of the bytes would be wrong.
My NAND data sheet says that the bad block mark is 0x000 for x16. However
it says a little before that one should check for any non 0xffff value in the
bad block marker. So it would seem that 16 bit devices should do a 16 bit
check but under normal conditions an 8bit check would probably work...
I looked at the nand_block_bad() function in nand_base.c and it does the
same cpu_to_le16() stuff that nand_read_byte16() does. I wonder if there is
something to that? It seems to me that if its doing an 8 bit check for
0x0000 or 0xffff then it doesn't matter the endianness at all. Maybe that
code is trying to make up for other code incorrectly writing only a single
byte for the bad block marker?
Regards,
Alex
--
Alex Waterman
Computer Engineer
Phone: 215-896-4920
Email: awaterman at dawning.com
prev parent reply other threads:[~2011-05-18 12:49 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-17 13:00 [U-Boot] RFC: porting u-boot to sequoia based nand booting board Alex Waterman
2011-05-17 13:41 ` Stefan Roese
2011-05-17 14:11 ` Alex Waterman
2011-05-17 15:37 ` Stefan Roese
2011-05-17 17:05 ` Scott Wood
2011-05-17 17:49 ` Alex Waterman
2011-05-17 19:20 ` Scott Wood
2011-05-17 21:15 ` Alex Waterman
2011-05-17 21:32 ` Scott Wood
2011-05-18 12:49 ` Alex Waterman [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=4DD3C04D.9070001@dawning.com \
--to=awaterman@dawning.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.