[Yaffs] Question about Using Spare Area of NAND Flash in YAF…

Top Page
Attachments:
Message as email
+ (text/plain)
+ (text/html)
Delete this message
Reply to this message
Author: rong shawn
Date:  
To: yaffs
Subject: [Yaffs] Question about Using Spare Area of NAND Flash in YAFFS2
Hello all,

When I traced code of function *yaffs_scan()* in YAFFS2 source code:

----------------------------------------------------------------

yaffs_Scan -> yaffs_QueryInitialBlockState -> nandmtd2_QueryNANDBlock ->
nandmtd2_ReadChunkWithTagsFromNAND

----------------------------------------------------------------

In function *nandmtd2_ReadChunkWithTagsFromNAND()*, it writes:

----------------------------------------------------------------

       yaffs_PackedTags2 pt;


       ……


       if(tags)


              retval =
mtd->read_oob(mtd,addr,mtd->oobsize,&dummy,dev->spareBuffer);


       ……


       memcpy(&pt,dev->spareBuffer,sizeof(pt));
----------------------------------------------------------------



Value of "sizeof(pt)" is 32Bytes. So I have 2 questions:

1.       Do the forhead 32B data stored in spare area of each page of NAND
Device can 1-1 map to member variables of structure yaffs_PackedTags2?


2.       For small page NAND Device, there are *ONLY* 16B for spare area,
how could execute


memcpy(&pt,dev->spareBuffer,sizeof(pt));

for them?
Does YAFFS2 can only support Large-Page NAND?

Thanks!