X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=direct%2Fyaffscfg2k.c;h=9ca4aeaa0cf3032e68c006d29c0bae2cab6684dd;hb=0a0da938621f6eec378c7b3c173ce815a786759f;hp=e63411ad27f1a94561bf6c99300742bea501f12a;hpb=f67d10d7a5a6d1cc7d1cb6eaada2522873ce5e99;p=yaffs2.git diff --git a/direct/yaffscfg2k.c b/direct/yaffscfg2k.c index e63411a..9ca4aea 100644 --- a/direct/yaffscfg2k.c +++ b/direct/yaffscfg2k.c @@ -1,6 +1,18 @@ /* - * YAFFS: Yet another FFS. A NAND-flash specific file system. - * yaffscfg.c The configuration for the "direct" use of yaffs. + * YAFFS: Yet Another Flash File System. A NAND-flash specific file system. + * + * Copyright (C) 2002-2007 Aleph One Ltd. + * for Toby Churchill Ltd and Brightstar Engineering + * + * Created by Charles Manning + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +/* + * yaffscfg2k.c The configuration for the "direct" use of yaffs. * * This file is intended to be modified to your requirements. * There is no need to redistribute this file. @@ -13,7 +25,19 @@ #include -unsigned yaffs_traceMask = YAFFS_TRACE_SCAN | YAFFS_TRACE_GC | YAFFS_TRACE_GC_DETAIL | YAFFS_TRACE_WRITE | YAFFS_TRACE_ERASE | YAFFS_TRACE_TRACING | YAFFS_TRACE_ALLOCATE; +unsigned yaffs_traceMask = + + YAFFS_TRACE_SCAN | + YAFFS_TRACE_GC | YAFFS_TRACE_GC_DETAIL | + YAFFS_TRACE_WRITE | YAFFS_TRACE_ERASE | + YAFFS_TRACE_TRACING | + YAFFS_TRACE_ALLOCATE | + YAFFS_TRACE_CHECKPOINT | + YAFFS_TRACE_BAD_BLOCKS | +// (~0) | + + 0; + void yaffsfs_SetError(int err) @@ -68,9 +92,9 @@ static yaffsfs_DeviceConfiguration yaffsfs_config[] = { #else { "/", &ramDev}, { "/flash/boot", &bootDev}, - { "/flash/", &flashDev}, + { "/flash/flash", &flashDev}, { "/ram2k", &ram2kDev}, - {(void *)0,(void *)0} + {(void *)0,(void *)0} /* Null entry to terminate list */ #endif }; @@ -84,7 +108,7 @@ int yaffs_StartUp(void) // Set up devices // /ram memset(&ramDev,0,sizeof(ramDev)); - ramDev.nBytesPerChunk = 512; + ramDev.nDataBytesPerChunk = 512; ramDev.nChunksPerBlock = 32; ramDev.nReservedBlocks = 2; // Set this smaller for RAM ramDev.startBlock = 0; // Can use block 0 @@ -99,7 +123,7 @@ int yaffs_StartUp(void) // /boot memset(&bootDev,0,sizeof(bootDev)); - bootDev.nBytesPerChunk = 512; + bootDev.nDataBytesPerChunk = 512; bootDev.nChunksPerBlock = 32; bootDev.nReservedBlocks = 5; bootDev.startBlock = 0; // Can use block 0 @@ -122,13 +146,17 @@ int yaffs_StartUp(void) // 2kpage/64chunk per block/128MB device memset(&flashDev,0,sizeof(flashDev)); - flashDev.nBytesPerChunk = 2048; + flashDev.nDataBytesPerChunk = 2048; flashDev.nChunksPerBlock = 64; flashDev.nReservedBlocks = 5; - flashDev.startBlock = 0; - //flashDev.endBlock = 127; // Last block in 16MB - flashDev.endBlock = yflash_GetNumberOfBlocks()-1; + flashDev.nCheckpointReservedBlocks = 5; + //flashDev.checkpointStartBlock = 1; + //flashDev.checkpointEndBlock = 20; + flashDev.startBlock = 0; + flashDev.endBlock = 200; // Make it smaller + //flashDev.endBlock = yflash_GetNumberOfBlocks()-1; flashDev.isYaffs2 = 1; + flashDev.wideTnodesDisabled=0; flashDev.nShortOpCaches = 10; // Use caches flashDev.genericDevice = (void *) 2; // Used to identify the device in fstat. flashDev.writeChunkWithTagsToNAND = yflash_WriteChunkWithTagsToNAND; @@ -144,7 +172,7 @@ int yaffs_StartUp(void) // 2kpage/64chunk per block/128MB device memset(&ram2kDev,0,sizeof(ram2kDev)); - ram2kDev.nBytesPerChunk = nandemul2k_GetBytesPerChunk(); + ram2kDev.nDataBytesPerChunk = nandemul2k_GetBytesPerChunk(); ram2kDev.nChunksPerBlock = nandemul2k_GetChunksPerBlock(); ram2kDev.nReservedBlocks = 5; ram2kDev.startBlock = 0; // First block after /boot @@ -167,4 +195,8 @@ int yaffs_StartUp(void) +void SetCheckpointReservedBlocks(int n) +{ + flashDev.nCheckpointReservedBlocks = n; +}