memory: omap-gpmc: Add GPMC-NAND ops to get writebufferempty status

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon May 23 21:59:03 PDT 2016


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=512d73d1c64f15da9cdcdcdfba3cd8db0d4d94cc
Commit:     512d73d1c64f15da9cdcdcdfba3cd8db0d4d94cc
Parent:     f47fcad63f6847ea677c6c7030f30fd6438e0052
Author:     Roger Quadros <rogerq at ti.com>
AuthorDate: Wed Aug 5 13:34:50 2015 +0300
Committer:  Roger Quadros <rogerq at ti.com>
CommitDate: Fri Apr 15 11:51:57 2016 +0300

    memory: omap-gpmc: Add GPMC-NAND ops to get writebufferempty status
    
    This is needed by OMAP NAND driver to poll the empty status
    of the writebuffer.
    
    Signed-off-by: Roger Quadros <rogerq at ti.com>
    Acked-by: Tony Lindgren <tony at atomide.com>
---
 drivers/memory/omap-gpmc.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c
index 0b62afd..90dfba5 100644
--- a/drivers/memory/omap-gpmc.c
+++ b/drivers/memory/omap-gpmc.c
@@ -81,6 +81,8 @@
 
 #define GPMC_CONFIG_LIMITEDADDRESS		BIT(1)
 
+#define GPMC_STATUS_EMPTYWRITEBUFFERSTATUS	BIT(0)
+
 #define	GPMC_CONFIG2_CSEXTRADELAY		BIT(7)
 #define	GPMC_CONFIG3_ADVEXTRADELAY		BIT(7)
 #define	GPMC_CONFIG4_OEEXTRADELAY		BIT(7)
@@ -1118,7 +1120,17 @@ void gpmc_update_nand_reg(struct gpmc_nand_regs *reg, int cs)
 	}
 }
 
-static struct gpmc_nand_ops nand_ops;
+static bool gpmc_nand_writebuffer_empty(void)
+{
+	if (gpmc_read_reg(GPMC_STATUS) & GPMC_STATUS_EMPTYWRITEBUFFERSTATUS)
+		return true;
+
+	return false;
+}
+
+static struct gpmc_nand_ops nand_ops = {
+	.nand_writebuffer_empty = gpmc_nand_writebuffer_empty,
+};
 
 /**
  * gpmc_omap_get_nand_ops - Get the GPMC NAND interface



More information about the linux-mtd-cvs mailing list