From: "Christian Gan" <cgan@iders.ca>
To: <manningc2@actrix.gen.nz>, "Nick Bane" <nick@cecomputing.co.uk>,
"Marc Singer" <elf@buici.com>
Cc: <linux-mtd@lists.infradead.org>, <yaffs@toby-churchill.org>
Subject: RE: Interest in DOC and YAFFS?
Date: Tue, 24 Sep 2002 17:46:57 -0500 [thread overview]
Message-ID: <NFBBLPGPLKFIKCCPLALEEECPCEAA.cgan@iders.ca> (raw)
In-Reply-To: <20020924205746.837BF43CF@tiger.actrix.co.nz>
Hello all,
I heard my name being mentioned so I thought to respond :)
Currently I do have an implementation of HW_ECC for nand working. Most of
the structure is already in the NAND mtd. Our NAND is connected through a
custom FPGA that does the ECC for us.
The current breakdown is this:
1. YAFFS calls write_page in the MTD. write_page fills the page and the HW
ECC data in OOB where YAFFS expects it to be (using custom enable_hwecc and
calc_ecc).
2. YAFFS calls write_oob for the tag data, however the ECC bytes are filled
with 0xff so that it doesn't corrupt the ECC already written by the MTD.
i.e. my CalcECC function in YAFFS just writes 0xff.
3. When YAFFS verifies the tag data, the ECC bytes are skipped since YAFFS
will not know what they are supposed to be.
Problems with this is that Steps 1 and 2 need to be combined to once write
call, otherwise we may blow the specs of some NANDs for max writes to OOBs.
Verbose version of things needed to make HW ECC work with YAFFS:
MTD Changes:
============
- the nand_chip struct has a pointer to a function for enable_hwecc, you'll
have to create your own function depending on your system and have the
structure point to it. The mtd calls this function to reset the HW ECC on
the NAND device. So it gets called once in the beginning of a page and
again at the 256 byte mark.
- calculate_ecc has to be changed so that it now reads the registers
containing the calculated ECC in HW.
- the problem with this implementation is that YAFFS needs a NAND MTD that
allows it to write the page and OOB at the same time. Here's a snipped of
email I wrote on the YAFFS mailing list earlier:
"A further problem I have to think about now is the max number of allowable
writes in the OOB. Some NANDs allow for three writes but there are some
who's maxes are speced for two. Which means that in my case:
1 write to OOB by the MTD when writing a page (for HW ECC).
1 write to OOB by YAFFS for tags.
1 write to OOB by YAFFS to mark pages deleted.
= 3 writes
which of course would violate some NAND specs..."
- Finally, the current MTD uses the OOB to write the ECCs and also a "valid
ECC" byte. YAFFS tags has no room for the valid ECC byte in the OOB so I
had to ignore it, which is not exactly ideal. The byte location that the
MTD writes to the OOB for ECC also must be changed (by defining the ecc_pos
in the oob config).
YAFFS Changes:
==============
- Remove any instance where YAFFS tries to read / write ECC. i.e. when
YAFFS writes it's tags, have it write 0xff for the ECC bytes. Don't verify
the ECC in the tag/oob area in VerifyCompare and don't try to correct data
in ReadChunkFromNand.
- I'm working on getting Charles this code so that he can put in a NO_ECC
macro of some sort.
> -----Original Message-----
> From: Charles Manning [mailto:manningc2@actrix.gen.nz]
> Sent: Tuesday, September 24, 2002 3:54 PM
> To: Nick Bane; Marc Singer
> Cc: linux-mtd@lists.infradead.org; yaffs@toby-churchill.org
> Subject: Re: Interest in DOC and YAFFS?
>
>
>
> > > > How this works with DOC I am unclear as I had noticed a
> while back that
> > > > there was hardware assisted ECC. This might get in the way
> of YAFFS ECC
> >
> > but
> >
> > > > maybe this can be circumvented.
> > >
> > > As far as I can tell, the hardware ECC just makes the DOC faster.
> >
> > Umm. It may use some of the oob data area for its own ECC in a YAFFS
> > incompatible way. I am not sure of my ground here, only that you need to
> > check it out.
> >
> > > Also, I think that Microsys has released information about how to use
> > > the hardware ECC.
> >
> > Ok.
>
> Determining, then straightening out, OOB conflicts is essetially what DOC
> support boils down to.
>
> As far as I am aware, the ECC does not actually impact on the
> NAND and works
> something like as follows.
> * As you write bytes to the NAND buffer, an ECC is calculated on
> the side in
> the ASIC.
> * You can then read ASIC registers to determine the ECC.
>
> Essentially you can just ignore the ECC and see raw NAND chips,
> ie the ECC is
> non-intrusive.
>
> Thus, the current YAFFS page programming would change from something like:
>
> * Calculate ecc. + tags and format up OOB (spare)
> * Write data + oob
> * Program page
>
> to:
>
> * Write data
> * Read ECC from ASIC
> * Format up and write oob.
> * Program page
>
> Essentially, the hw ecc saves the ecc calcs - that's all.
>
> Christian Gan has implemented a hw ecc scheme which I think is
> like above in
> YAFFS, so I suspect DOC support might almost be done :-).
>
> -- Charles
>
>
> ------------------------------------------------------------------
> ---------------------
> This mailing list is hosted by Toby Churchill open software
(www.toby-churchill.org).
If mailing list membership is no longer wanted you can remove yourself from
the list by
sending an email to yaffs-request@toby-churchill.org with the text
"unsubscribe"
(without the quotes) as the subject.
next prev parent reply other threads:[~2002-09-24 22:47 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-23 9:20 jffs2 and Doc 2000 eylon eyal
2002-09-24 0:03 ` Interest in DOC and YAFFS? Charles Manning
2002-09-24 3:44 ` Marc Singer
2002-09-24 3:58 ` Interest in DOC and YAFFS? --> YAFFS bootloading Charles Manning
2002-09-24 4:44 ` Marc Singer
2002-09-24 7:53 ` Russ Dill
2002-09-24 16:53 ` Marc Singer
2002-09-24 16:59 ` Russ Dill
2002-09-24 17:14 ` Marc Singer
2002-09-24 17:21 ` Brian J. Fox
2002-09-24 17:30 ` Russ Dill
2002-09-24 18:33 ` Marc Singer
2002-09-24 17:44 ` Kenneth Johansson
2002-09-24 18:37 ` Marc Singer
2002-09-24 18:47 ` Russ Dill
2002-09-24 20:22 ` Marc Singer
2002-09-24 20:41 ` Russ Dill
2002-09-24 7:23 ` Nick Bane
2002-09-24 16:55 ` Marc Singer
2002-09-24 18:23 ` Nick Bane
2002-09-24 20:53 ` Interest in DOC and YAFFS? Charles Manning
2002-09-24 22:46 ` Christian Gan [this message]
2002-09-25 7:33 ` Thomas Gleixner
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=NFBBLPGPLKFIKCCPLALEEECPCEAA.cgan@iders.ca \
--to=cgan@iders.ca \
--cc=elf@buici.com \
--cc=linux-mtd@lists.infradead.org \
--cc=manningc2@actrix.gen.nz \
--cc=nick@cecomputing.co.uk \
--cc=yaffs@toby-churchill.org \
/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