[Yaffs] Need help replacing yaffs1 by yaffs2

Charles Manning manningc2@actrix.gen.nz
Mon, 13 Dec 2004 11:09:21 +1300


On Saturday 11 December 2004 12:24, Jacob Dall wrote:
> Please, I need some help.
>
> I want to replace yaffs1 direct with yaffs2 direct, but I've some troub=
le.
>
> I've compiled the code with the CFLAGS as defined in the direct/makefil=
e:
> CONFIG_YAFFS_DIRECT, CONFIG_YAFFS_SHORT_NAMES_IN_RAM and
> CONFIG_YAFFS_YAFFS2. I'm a bit in doubt about the last define - is it o=
k
> setting it when one wants to do what I want?
>
> I've completed a low-lewel check of the flash, using my implementation =
of
> the interface functions in direct/yaffs_flashif.c. The test is done by
> writing some well-known values to the data and spare area of each chunk=
,
> reading it back and verifying byte by byte. I do not allow any diffs. I=
t
> runs to perfection - I get no errors at all.
>
> Now, starting up yaffs (of course I did erase all blocks after the
> low-level check was completed), mounting a device and opening, writing =
and
> closing some files, for each file I get some 'ecc error unfixed' notes,=
 and
> a block is marked for retirement. I don't get that, taking into
> consideration that my previous test showed no issues at all.
>
> Digging into the code, I can't seem to locate the spot where data ecc i=
s
> calculated (beyond some code not being active, either by #ifdef 0 or //=
).

In YAFFS2 the ecc tests have been moved out of yaffs_guts to make a bette=
r=20
partitioning of the file system from the NAND and ECC logic.

The ECC is done within the ReadChunkWithTags and WriteChunkWithTags funct=
ions.

If you use 512-byte pages (and yaffs1 mode compatabiliuty mode) then you=20
can use the tags compatability functions. These will call yaffs_ecc.c.

For 2kbyte pages etc, using full-blown yaffs2 mode, the ECC must be done =
in=20
the NAND layer. THis can be done using yaffs_ecc.c

>
> I tend to believe that what I want to achieve is either unsupported or
> untested. Am I right?

It is supported in a more flexible way. It just mean that ECC checking fo=
r 2k=20
pages should be done in the NAND access layer.

>
> Still, I don't get it - where is the data ecc supposed to be calculated=
?