[PATCH v2 0/2] Migrate the GPMI driver to use NAND core timings
miquel.raynal at free-electrons.com
Fri Jan 19 01:25:45 PST 2018
The GPMI NAND controller driver has its own timings logic while the core
also has its own that should be preferred to avoid code duplication.
This series migrates the driver to use the ->setup_data_interface()
hook, preferred way to handle timings negotiation between controllers
and NAND chips.
This driver has stronger requirements in terms of respect of the ONFI
specification than the core has, and last time I post changes to this
section this was raised to me. Hence, the first patch effectively
applies the same requirements to the core. Doing this can slow down
several chips that do not follow entirely the specifications, but
another series is coming to add the possibility for NAND vendors to
flag certain features as "unsupported". See
"mtd: nand: Check ONFI timings have been acked by the chip"
commit log for more details.
Changes since v1:
- Removed inline on non-static gpmi_enable/disable_clk() functions.
- Rewording some lines of the patch.
- Use tREA_max value provided by the core instead of a locally defined
- Check ->conf in gpmi_setup_data_interface() instead of
->onfi_timing_mode_default (use tRC).
- Removed useless copy of hw.timing_mode.
- Moved gpmi_nfc_apply_timings() to ->select_chip().
- Canceled the useless move of one structure.
One comment is not addressed here: using one register for TIMING0/1 and
CTRL1 that is only written in ->apply_timings(). This will be done in a
later patch that will update the way timings are derived.
Miquel Raynal (2):
mtd: nand: Check ONFI timings have been acked by the chip
mtd: nand: gpmi: Support ->setup_data_interface()
drivers/mtd/nand/gpmi-nand/gpmi-lib.c | 275 +++++++++------------------------
drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 43 ++++--
drivers/mtd/nand/gpmi-nand/gpmi-nand.h | 82 +++++-----
drivers/mtd/nand/nand_base.c | 41 ++++-
4 files changed, 183 insertions(+), 258 deletions(-)
More information about the linux-mtd