mtd: rawnand: vf610_nfc: make use of ->exec_op()
authorStefan Agner <stefan@agner.ch>
Fri, 9 Mar 2018 14:50:36 +0000 (15:50 +0100)
committerBoris Brezillon <boris.brezillon@bootlin.com>
Sat, 17 Mar 2018 14:35:31 +0000 (15:35 +0100)
commit1cbe30b0ddc7afa3009dbe10f1c3d34f5adbef3f
treebce8afc1beb670a2dbe0480678905f495a6ab9e2
parent828814e6a4cf2337be7cfde0b35b60a13cbc1ee7
mtd: rawnand: vf610_nfc: make use of ->exec_op()

This reworks the driver to make use of ->exec_op() callback. The
command sequencer of the VF610 NFC aligns well with the new ops
interface.

The operations are translated to a NFC command code while filling
the necessary registers. Instead of using the special status and
read ID command codes (which require to read status/ID from
special registers instead of the regular data area) the driver
now now uses the main data buffer for all commands. This
simplifies the driver as no special casing is needed.

For control data (status byte, id bytes and parameter page) the
driver needs to reverse byte order for little endian CPUs since
the controller seems to store the bytes in big endian order in
the data buffer.

The current state seems to pass MTD tests on a Colibri VF61.

Signed-off-by: Stefan Agner <stefan@agner.ch>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
drivers/mtd/nand/raw/vf610_nfc.c