]> asedeno.scripts.mit.edu Git - linux.git/commit
mtd: nand: add ->exec_op() implementation
authorMiquel Raynal <miquel.raynal@free-electrons.com>
Thu, 9 Nov 2017 13:16:45 +0000 (14:16 +0100)
committerBoris Brezillon <boris.brezillon@free-electrons.com>
Sat, 16 Dec 2017 13:40:26 +0000 (14:40 +0100)
commit8878b126df769831cb2fa4088c3806538e8305f5
treeb9cbde16d859c3f34f17b5b85e8af855810d8885
parent707d81545dbc3d3ee4ae093fc600831eb97302e7
mtd: nand: add ->exec_op() implementation

Introduce a new interface to instruct NAND controllers to send specific
NAND operations. The new interface takes the form of a single method
called ->exec_op(). This method is designed to replace ->cmd_ctrl(),
->cmdfunc() and ->read/write_byte/word/buf() hooks.

->exec_op() is passed a set of instructions describing the operation
to execute. Each instruction has a type (ADDR, CMD, DATA, WAITRDY)
and delay. The delay is here to help simple controllers wait enough
time between each instruction, advanced controllers with integrated
timings control can ignore these delays.

Controllers that natively support complex operations (operations
formed of several instructions) can use the NAND op parser
infrastructure. This infrastructure allows controller drivers to
describe the sequence of instructions they support (called
nand_op_pattern) and a hook for each of these supported sequences. The
core then tries to find the best match for a given NAND operation, and
calls the associated hook.

Various other helpers are also added to ease NAND controller drivers
writing.

This new interface should ease support of vendor specific operations
in that NAND manufacturer drivers now have a way to check if the
controller they are connected to supports a specific operation, and
complain or refuse to probe the NAND chip when that's not the case.

Suggested-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Miquel Raynal <miquel.raynal@free-electrons.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
drivers/mtd/nand/nand_base.c
drivers/mtd/nand/nand_hynix.c
include/linux/mtd/rawnand.h