mtd: nand: fsmc: add support for SDR timings
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sat, 29 Apr 2017 08:52:35 +0000 (10:52 +0200)
committerBoris Brezillon <boris.brezillon@free-electrons.com>
Mon, 15 May 2017 11:11:50 +0000 (13:11 +0200)
commitd9fb0795718333e36f7e472d7d81b7b8efe347c8
tree34b72840d55dfc6cee1d4bb09d06c90191ebb8db
parent6335b509b2b6fbe4cbeaef739434b40b8018df82
mtd: nand: fsmc: add support for SDR timings

Until now, the fsmc_nand driver was either using controller timings
specified in the Device Tree (through FSMC specific DT properties) or
alternatively default/fallback timings.

This commit implements support to use the timings advertised by the NAND
chip itself, by implementing the ->setup_data_interface() hook. To
preserve backward compatibility, if timings are specified in the Device
Tree, we use the timings from the Device Tree (and don't implement
->setup_data_interface).

Many thanks to Boris Brezillon for coming up with the logic to convert
the NAND chip timings into the timings expected by the FSMC controller.

Also, since the timings are now not only coming from the DT, the message
warning that default timings will be used is removed.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
drivers/mtd/nand/fsmc_nand.c