[U-Boot] Q: NAND read/write: unaligned offset

Scott Wood scottwood at freescale.com
Fri Jul 1 22:42:26 CEST 2011


On Fri, 1 Jul 2011 13:29:41 -0700
Ran Shalit <ranshalit at gmail.com> wrote:

> I might be missing something...
>  When using nand_write_skip_bad, the aligned offset refers to page (not
> sector or block), so if as I understand , I can read from the start of
> page the whole relevant data, then modify only the parts which is changed,

That's not the same thing as just filling in the parts you're not writing
with 0xFFs, but still it's not safe unless you erase the block.  Even if the
main portion of the page doesn't contain any bits that go from 0 to 1, and
you've got the data to calculate the proper new ECC, the ECC itself will
probably have bits going from 0 to 1.

Plus, some chips may not take writing 0xFFs as a no-op -- see the
recent patches to support skipping pages with all 0xFFs on write.

> and then write it again, but the writing is not for the entire block: I will
> use the  nand_write_skip_bad given offset of  the start of page, and length
> will be the unaligned length for the whole data being written (which is part
> of the entire block).

If you're going to keep things page-aligned but just not block-aligned,
you'll be OK as far as ECC and such goes, but you're on your own for making
sure you've accounted for any previous bad blocks that were supposed to be
skipped.

What is the high-level goal you're trying to accomplish?

-Scott



More information about the U-Boot mailing list