NAND/OneNAND/SPI NAND bad block management

Kamil Debski Kamil.Debski at imgtec.com
Thu Jun 11 08:57:00 PDT 2015


Hi,

I am currently working on the SPI NAND framework. I noticed that there was quite a lot of discussion on this topic. 

It seems that the necessary task to do first is to make some modification to the bad block management. It is necessary to separate it from the NAND core, as the same bad block handling would be used by the SPI NAND core. 

My question regarding this is following. OneNAND core also needs BBM and implements it on its own. The design of BBM in OneNAND core is very similar to NAND core - there are also two files onenand_base.c and onenand_bbt.c.  The latter was actually derived from nand_bbt.c. I am pretty sure OneNAND would be also benefit from using a generic BBM. I did not find OneNAND mentioned in the previous discussion about separating bad block management from the NAND core [1]. Was there any reason why it was left out, or was it just overlooked?

The file include/linux/mtd/bbm.h contains the struct bbm_info, which seems as a good place to store the parameters and state of the BBM. I am not sure about creating a new struct nand_bbt for that reason; especially that struct bbm_info is already used by the OneNAND core.  I would go for embedding a struct bbm_info * in struct mtd_info, such that it wouldn't be necessary to create wrappers.

I am working on the patches and should send them out soon. I am quite new to mtd, so I am sure you'll have quite a few comments on this topic and the patches :)

Best wishes,
Kamil Debski

[1] http://lists.infradead.org/pipermail/linux-mtd/2015-January/057639.html

Other useful links:
- previous attempt at the SPI NAND framework by Ezequiel Garcia
http://lists.infradead.org/pipermail/linux-mtd/2014-December/056763.html
- successive attempt at the SPI NAND framework by Peter Pan
http://lists.infradead.org/pipermail/linux-mtd/2015-January/057223.html




More information about the linux-mtd mailing list