X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=direct%2Fyaffs_norif1.c;h=06bea3dc7218b2aa5be273faa7185bd0400ed410;hp=c9534ac4c6a52e2dbe5171217bb5c44dd6dfcc27;hb=021066ab1ea323a40804c87d82246e03e029eca9;hpb=49942b13d7cfbdba72c18de0f37d16d81b4372a8 diff --git a/direct/yaffs_norif1.c b/direct/yaffs_norif1.c index c9534ac..06bea3d 100644 --- a/direct/yaffs_norif1.c +++ b/direct/yaffs_norif1.c @@ -35,7 +35,7 @@ * */ -const char *yaffs_norif1_c_version = "$Id: yaffs_norif1.c,v 1.1 2008-11-07 00:34:47 charles Exp $"; +const char *yaffs_norif1_c_version = "$Id: yaffs_norif1.c,v 1.4 2009-01-09 02:54:14 charles Exp $"; #include "yaffs_norif1.h" @@ -58,7 +58,7 @@ const char *yaffs_norif1_c_version = "$Id: yaffs_norif1.c,v 1.1 2008-11-07 00:34 #define FORMAT_VALUE 0x1234 #define DATA_BYTES_PER_CHUNK 1024 -#define BLOCKS_IN_DEVICE (32*1024/256) +#define BLOCKS_IN_DEVICE (8*1024/256) #define YNOR_PREMARKER (0xF6) @@ -219,11 +219,14 @@ int ynorif1_ReadChunkFromNAND(yaffs_Device *dev,int chunkInNAND, __u8 *data, yaf { ynorif1_FlashRead32(spareAddr,(__u32 *)spare,16/ 4); - /* If the page status is 0xF then it was written properly + /* If the page status is YNOR_POSTMARKER then it was written properly * so change that to 0xFF so that the rest of yaffs is happy. */ if(spare->pageStatus == YNOR_POSTMARKER) spare->pageStatus = 0xFF; + else if(spare->pageStatus != 0xff && + (spare->pageStatus | YNOR_PREMARKER) != 0xff) + spare->pageStatus = YNOR_PREMARKER; }