mtd: spinand: Add support for IS37SML01G1 (ISSI)

Viallard Anthony viallard at syscom.ch
Thu Oct 29 06:38:17 EDT 2020


Hello folks,

I am working since few days to add the support for the IS37SML01G1 (a serial NAND 104MHZ SPI from ISSI manufacturer) in the linux kernel (v5.4).

I have followed the datasheet of this flash (http://www.issi.com/WW/pdf/37-38SML01G1.pdf) and wrote some lines of code in mtd/nand/spi/.

I am facing 2 problems:
 - I have to write the definition of this flash into mtd/nand/spi/gigadevice.c. Actually, the manufacturer code is the same as gigadevice (0xC8) (cf. Figure 6.13 in the datasheet). I think it will be nice to put the code in a new file (mtd/nand/spi/issi.c) but it needs to modify a little bit the behavior of gigadevice_spinand_detect() function to return 0 even if spinand_match_and_init() does not match the device code instead of a negative code. Do you think it is an acceptable modification ? Or is it better to let the ISSI support in gigadevice.c ?
 - The bad block logic implemented in mtd/nand/spi/core.c does not work with this flash. In spinand_isbad() function, the code checks the first two bytes in the OOB area of the first page to know whether the block is bad. But with this ISSI flash, the bad block marker is only on the first byte and right after this byte, there is an ECC on three bytes. Therefore, as soon as I write the first page of a block, this latest is likely to be detected bad. I think it needs to add new entries in the struct spinand_info to describe how the manufacturer has implemented the marking of defective blocks. What do you think about it ?

Best regards,
Anthony V.




More information about the linux-mtd mailing list