public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] [PATCH] NAND: Change nand_wait_ready() to not call nand_wait()
@ 2008-01-05 15:54 Stefan Roese
  2008-01-05 16:15 ` [U-Boot-Users] NAND driver updates Stefan Roese
  0 siblings, 1 reply; 14+ messages in thread
From: Stefan Roese @ 2008-01-05 15:54 UTC (permalink / raw)
  To: u-boot

This patch changes nand_wait_ready() to not just call nand_wait(),
since this will send a new command to the NAND chip. We just want to
wait for the chip to become ready here.

Signed-off-by: Stefan Roese <sr@denx.de>
---
William & Stig, could you please review this patch and test it on your
platforms?

Thanks.

 drivers/mtd/nand/nand_base.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 5a8196e..6c5c794 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -489,7 +489,16 @@ EXPORT_SYMBOL_GPL(nand_wait_ready);
 void nand_wait_ready(struct mtd_info *mtd)
 {
 	struct nand_chip *chip = mtd->priv;
-	nand_wait(mtd, chip);
+	u32 timeo = (CFG_HZ * 20) / 1000;
+
+	reset_timer();
+
+	/* wait until command is processed or timeout occures */
+	while (get_timer(0) < timeo) {
+		if (chip->dev_ready)
+			if (chip->dev_ready(mtd))
+				break;
+	}
 }
 #endif
 
-- 
1.5.4.rc2

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2008-01-16 13:45 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-05 15:54 [U-Boot-Users] [PATCH] NAND: Change nand_wait_ready() to not call nand_wait() Stefan Roese
2008-01-05 16:15 ` [U-Boot-Users] NAND driver updates Stefan Roese
2008-01-08 10:05   ` Matthias Fuchs
2008-01-08 22:06   ` ksi at koi8.net
2008-01-13  7:24     ` Dirk Behme
2008-01-13  8:14       ` ksi at koi8.net
2008-01-09 23:03   ` Matthias Fuchs
2008-01-10  5:45     ` Stefan Roese
2008-01-10 17:46       ` Stefan Roese
2008-01-15  8:49   ` Stefan Roese
2008-01-15 12:34     ` Matthias Fuchs
2008-01-15 12:48       ` Stig A. Olsen
2008-01-15 17:56     ` ksi at koi8.net
2008-01-16 13:45     ` Stefan Roese

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox