Re: [Yaffs] Structure of YAFFS2 spare OOB area

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Charles Manning
Date:  
To: yaffs
Subject: Re: [Yaffs] Structure of YAFFS2 spare OOB area
On Friday 04 February 2011 12:55:03 Andre Renaud wrote:
> > Anything is possible.
> >
> > Most common would probably be the default layouts defined in
> > drivers/mtd/nand/nand_base.c
> >
> > The yaffs tags will be stored in the area defined in .oobfree
> >
> > eg.
> >  static struct nand_ecclayout nand_oob_64 = {
> >     .eccbytes = 24,
> >     .eccpos = {
> >            40, 41, 42, 43, 44, 45, 46, 47,
> >            48, 49, 50, 51, 52, 53, 54, 55,
> >            56, 57, 58, 59, 60, 61, 62, 63},
> >     .oobfree = {
> >         {.offset = 2,
> >          .length = 38} }
> > };

> >
> > Here
> >
> > bytes 0,1 are the bad block marker (should be 0xff)
> > bytes 2..39 contain the yaffs tags a struct yaffs_packed_tags2
> > bytes 40..63 contain ECC bytes.
>
> I think it is unlikely that is the layout that Eugene has though, as the
> OOB hex dumps he sent:
>
> 19 91 65 5A 15 1C 81 88 9D E2 24 79 C5 84 F5 43
> F3 D9 11 4C AF 1F AE 8A 9E 3E FA CD 51 0A 5F 1D
> 00 00 F2 01 00 00 04 00 00 00 00 08 00 00 DB 2C
> E8 F1 16 5F 5C DB 19 32 00 00 00 00 00 00 00 00
>
> 54 0C 1A 2F 62 DA 6B D1 D6 AC A8 CF 56 CF FA 43
> 09 9F 79 FF A8 CF 56 CF FA 43 09 9F 79 FF 5F 1D
> 00 00 89 01 00 10 0E 01 00 80 88 E6 03 00 D4 B9
> 63 32 71 3C 16 50 60 88 00 00 00 00 00 00 00 00
>
> 0F C8 31 64 71 3C 71 79 3F 72 A8 CF 56 CF FA 43
> 09 9F 79 FF A8 CF 56 CF FA 43 09 9F 79 FF 5F 1D
> 00 00 8A 01 00 30 09 01 00 80 00 00 00 00 3A DD
> 34 66 99 F3 2A DA 2E 48 00 00 00 00 00 00 00 00
>
> Would all be tagged as bad according to that layout. I suspect that
> something else is going on here, because yaffs only uses around 12 bytes
> of OOB doesn't it, along with the bad block marker, and ecc, normally
> you'd expect to see a lot more FF bytes in there.


Yes indeed.

It is also hard to decode this without knowing what is in the chunks.

Turning on yaffs mtd level tracing can help,

One of the easiest ways to figure this out is to start with an erased flash
and add just one file at first, then dump that and have a look at the tags.

-- Charles