This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to use flash based BBT with YAFFS2 and software ECC - dm365

Hello, I have a question for those successfully using YAFFS2 with a dm365 system.

It appears the use of a flash bad block table is not enabled (in davinci-nand.c) when using .ecc_mode = NAND_ECC_SOFT (which is required when using YAFFS2 filesystem). The same issue is also in u-boot (when you use software ECC, it does not write a flash BBT). This is obviously a problem when bad blocks are discovered dynamically during the normal use of the flash.

So how do you use a flash-based BBT with YAFFS2 and software ECC?

I can try to modify both u-boot and the kernel to do this, but it seems like there must already be a solution for this, so I thought I would ask the community first. Any info regarding this issue would be appreciated. Thanks.

Regards,

-Craig

  • Hello Craig,

    in http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/100/t/7574.aspx?PageIndex=2 

    offers a patchset, that enables the yaffs-functionality even with hardware ECC. On our own DM355 design, I applied them to the kernel and switched back from software to hardware ECC. Until now I didn't run into any trouble, but I did this just yesterday, so there is no big testing involved. But booting with the root file system from yaffs works, you can store data into yaffs, hard resets (switch off power without previous "sync" or "reboot" command") didn't lead to data loss and booting again revealed no problems.


    So I would try this way first, as my efforts to unify the U-Boot BBT layout (with hardware ECC as these code paths satisfy the RBL/UBL needs) and the kernel BBT layout (with software ECC to make yaffs work without Sandeep's patches) led to major headaches. All code paths that differ from the original U-Boot and kernel settings seem to layout flash data and OOB in a different way, so U-Boot and kernel always claimed that the flash blocks written by the other are "bad blocks". :-(

    If you run into any trouble with the approach sketched above, it would be good to report them here, as we could try together to iron them out.

     

    Best regards

    Siegbert