public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] [PATCH] mips: tolerate the MIPS 'CFG_HZ' values in the MHZ range for NAND delays
@ 2008-05-16 18:24 Jason McMullan
  2008-05-19 20:26 ` Scott Wood
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Jason McMullan @ 2008-05-16 18:24 UTC (permalink / raw)
  To: u-boot

Rewrite the nand_wait() FL_ERASING case to handle CFG_HZ values in the
MHZ range. This is needed for mips processors, as the timer's timebase
ticks at CPU clock frequency.

Signed-off-by: Jason McMullan <mcmullan@netapp.com>
---
 drivers/mtd/nand/nand_base.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 2da1d46..ac690ac 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -837,10 +837,17 @@ static int nand_wait(struct mtd_info *mtd, struct nand_chip *this, int state)
 {
 	unsigned long	timeo;
 
+#if CFG_HZ > 100000
+	if (state == FL_ERASING)
+ 		timeo = (CFG_HZ / 1000) * 400;
+	else
+		timeo = (CFG_HZ / 1000) * 20;
+#else
 	if (state == FL_ERASING)
  		timeo = (CFG_HZ * 400) / 1000;
 	else
 		timeo = (CFG_HZ * 20) / 1000;
+#endif
 
 	if ((state == FL_ERASING) && (this->options & NAND_IS_AND))
 		this->cmdfunc(mtd, NAND_CMD_STATUS_MULTI, -1, -1);
-- 
1.5.4.3

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

end of thread, other threads:[~2008-06-11 23:02 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-16 18:24 [U-Boot-Users] [PATCH] mips: tolerate the MIPS 'CFG_HZ' values in the MHZ range for NAND delays Jason McMullan
2008-05-19 20:26 ` Scott Wood
2008-05-19 20:31   ` [U-Boot-Users] [PATCH] mips: tolerate the MIPS 'CFG_HZ' valuesin " McMullan, Jason
2008-05-19 20:36     ` Scott Wood
2008-05-19 20:39   ` [U-Boot-Users] [PATCH] mips: tolerate the MIPS 'CFG_HZ' values in " Wolfgang Denk
2008-05-19 20:43     ` Scott Wood
2008-05-19 20:51       ` Wolfgang Denk
2008-05-19 21:15         ` Scott Wood
2008-06-11 23:02           ` Wolfgang Denk
2008-05-19 20:38 ` Wolfgang Denk
2008-05-20  8:27   ` Haavard Skinnemoen
2008-05-20  8:34     ` Wolfgang Denk
2008-05-20  9:22       ` Haavard Skinnemoen
2008-05-20  9:31         ` Wolfgang Denk
2008-05-19 20:44 ` Alessandro Rubini
2008-05-19 20:53   ` Wolfgang Denk
2008-05-19 21:04     ` Alessandro Rubini
2008-05-19 21:14       ` Wolfgang Denk

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