[PATCH 0/3] Convert fsmc_nand driver to ->exec_op() to retrieve a unique ID

Miquel Raynal miquel.raynal at free-electrons.com
Tue Nov 14 07:46:19 PST 2017


Hi,

A previous work is migrating the NAND framework from ->cmdfunc() and
->cmd_ctrl() to ->exec_op(), a different way to interract between NAND
core and NAND controller drivers.

Retrieving a unique ID from some ONFI NAND chips needs to send a
particular command to the chip. As there is no feedback from
->cmdfunc(), it may or it may not work depending on the controller
driver in use, but the core will not be notified. Using ->exec_op(),
instead, allows the core to know if the command can be handled by the
controller driver. For this reason, only drivers converted to
->exec_op() will benefit from the nand_read_unique_id() function
introduced in this series, as the first patch does it with the
fsmc_nand driver.

About exposing the unique ID in the mtd_info structure, the commit
message will give more details but long story short: it was hard to do
better without doing a deep, time-consuming rework. So I am really open
to suggestions.

Thank you,
Miquèl


Miquel Raynal (3):
  mtd: nand: fsmc: use ->exec_op()
  mtd: nand: add the infrastructure to retrieve the ONFI unique ID
  mtd: nand: add sysfs entry for NAND chip unique ID

 drivers/mtd/mtdcore.c        |  33 +++++-
 drivers/mtd/nand/fsmc_nand.c | 234 ++++++++++++++++++++++++-------------------
 drivers/mtd/nand/nand_base.c | 103 ++++++++++++++++++-
 include/linux/mtd/mtd.h      |   1 +
 include/linux/mtd/rawnand.h  |  19 +++-
 5 files changed, 283 insertions(+), 107 deletions(-)

-- 
2.11.0




More information about the linux-mtd mailing list