On Fri, Sep 16, 2016 at 3:28 AM, The Vo <the.vo@seakr.com> wrote:
Hello!

I'm new to yaffs. Is it possible to configure muliple flash block ranges to one yaffs_Device? We have a NAND flash device with 4K blocks. Some of the blocks at various locations are reserved (e.g. 0 - 100, 1024-1124, 2048-2148). We want to creat a file system out of the remaining blocks which is not contiguous. Is it possible to combining the remaining ranges of block into one yafffs_Device? Or is there a different solution to this problem which is to create a single file system out of discontigous blocks on the same device in order to use yaffs for bad block management and wear-leveling over the multiple ranges of blocks.

The definition of a yaffs_device is equivalent to a partition.

One physical device can be split into many yaffs_devices by setting the start_block and end_blocks accordingly.

Yaffs does not directly support gathering non-contiguous blocks together into a a single yaffs_device, but that would  be quite easy to do in the driver.

Two ideas spring to mind:

1) In the driver, tell Yaffs that those reserved blocks are bad blocks. Yaffs will then not use them.

2) Set up the driver to map the block numbers so that they skip over the reserved blocks.
ie.
 when Yaffs asks for block 0, give it block 101 etc.

Regards

Charles