mtd: gpmi: imx6: fix the wrong method for checking ready/busy

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Wed Nov 13 13:59:05 EST 2013


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=7caa4fd29068cccaa7be20914af6d23f261be3eb
Commit:     7caa4fd29068cccaa7be20914af6d23f261be3eb
Parent:     a5370e9ed567e68ac261b28a242832eb09fe8559
Author:     Huang Shijie <b32955 at freescale.com>
AuthorDate: Tue Aug 27 17:29:07 2013 +0800
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Wed Nov 6 23:33:03 2013 -0800

    mtd: gpmi: imx6: fix the wrong method for checking ready/busy
    
    In the imx6, all the ready/busy pins are binding togeter.
    So we should always check the ready/busy pin of the chip 0.
    
    In the other word, when the CS1 is enabled, we should also check the
    ready/busy of chip 0; if we check the ready/busy of chip 1,
    we will get the wrong result.
    
    Signed-off-by: Huang Shijie <b32955 at freescale.com>
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
 drivers/mtd/nand/gpmi-nand/gpmi-lib.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-lib.c b/drivers/mtd/nand/gpmi-nand/gpmi-lib.c
index 7d56d87..aaced29 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-lib.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-lib.c
@@ -1079,6 +1079,13 @@ int gpmi_is_ready(struct gpmi_nand_data *this, unsigned chip)
 		mask = MX23_BM_GPMI_DEBUG_READY0 << chip;
 		reg = readl(r->gpmi_regs + HW_GPMI_DEBUG);
 	} else if (GPMI_IS_MX28(this) || GPMI_IS_MX6Q(this)) {
+		/*
+		 * In the imx6, all the ready/busy pins are bound
+		 * together. So we only need to check chip 0.
+		 */
+		if (GPMI_IS_MX6Q(this))
+			chip = 0;
+
 		/* MX28 shares the same R/B register as MX6Q. */
 		mask = MX28_BF_GPMI_STAT_READY_BUSY(1 << chip);
 		reg = readl(r->gpmi_regs + HW_GPMI_STAT);



More information about the linux-mtd-cvs mailing list