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

Ran Shalit ranshalit at gmail.com
Fri Jul 1 23:53:21 CEST 2011


On Fri, Jul 1, 2011 at 1:42 PM, Scott Wood <scottwood at freescale.com> wrote:

> 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
>
>
The high-level Goal is writing&reading data which reside in unaligned
offset with unaligned data.
I hoped that I'll accomplish that by using my own functions which will
call the nand_write_skip_bad & nand_read_skip_bad with some sort
of read-modify-write method, or (other option I thought of) by adding patch
to the nand_write_skip_bad&nand_read_skip_bad  functions, so that they will
handle unaligned offset&data. As I understand doing the second option right
might be more complex.

Ran

Ran


More information about the U-Boot mailing list