mtd: nand: Expose data interface for ONFI mode 0

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Sat Oct 8 21:59:04 PDT 2016


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=6e1f9708dbf3c50a8da93c1952a01a7a2acb5e66
Commit:     6e1f9708dbf3c50a8da93c1952a01a7a2acb5e66
Parent:     b88730ada99bfe243862add360720a3550b0edbf
Author:     Sascha Hauer <s.hauer at pengutronix.de>
AuthorDate: Thu Sep 15 10:32:49 2016 +0200
Committer:  Boris Brezillon <boris.brezillon at free-electrons.com>
CommitDate: Fri Sep 23 09:35:16 2016 +0200

    mtd: nand: Expose data interface for ONFI mode 0
    
    The nand layer will need ONFI mode 0 to use it as timing mode
    before and right after reset.
    
    Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
    Signed-off-by: Boris Brezillon <boris.brezillon at free-electrons.com>
---
 drivers/mtd/nand/nand_timings.c | 11 +++++++++++
 include/linux/mtd/nand.h        |  2 ++
 2 files changed, 13 insertions(+)

diff --git a/drivers/mtd/nand/nand_timings.c b/drivers/mtd/nand/nand_timings.c
index 7441d68..13a5874 100644
--- a/drivers/mtd/nand/nand_timings.c
+++ b/drivers/mtd/nand/nand_timings.c
@@ -298,3 +298,14 @@ int onfi_init_data_interface(struct nand_chip *chip,
 	return 0;
 }
 EXPORT_SYMBOL(onfi_init_data_interface);
+
+/**
+ * nand_get_default_data_interface - [NAND Interface] Retrieve NAND
+ * data interface for mode 0. This is used as default timing after
+ * reset.
+ */
+const struct nand_data_interface *nand_get_default_data_interface(void)
+{
+	return &onfi_sdr_timings[0];
+}
+EXPORT_SYMBOL(nand_get_default_data_interface);
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 1f34c04..0c9412c 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -1154,6 +1154,8 @@ static inline int jedec_feature(struct nand_chip *chip)
 
 /* get timing characteristics from ONFI timing mode. */
 const struct nand_sdr_timings *onfi_async_timing_mode_to_sdr_timings(int mode);
+/* get data interface from ONFI timing mode 0, used after reset. */
+const struct nand_data_interface *nand_get_default_data_interface(void);
 
 int nand_check_erased_ecc_chunk(void *data, int datalen,
 				void *ecc, int ecclen,



More information about the linux-mtd-cvs mailing list