public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 2.6.34 1/2] cfi_cmdset_0002.c: Read max timeouts from cfi query data
@ 2011-03-25  7:52 Markus Niebel
  2011-04-01  7:31 ` Artem Bityutskiy
  0 siblings, 1 reply; 2+ messages in thread
From: Markus Niebel @ 2011-03-25  7:52 UTC (permalink / raw)
  To: linux-mtd

The max timeouts are coded in the electronic flash data sheet (CFI query
data). Read the timeouts and store them in the chips structure table.

Signed-off-by: Markus Niebel <markus.niebel@tqs.de>
---

  drivers/mtd/chips/cfi_cmdset_0002.c |   21 +++++++++++++++++++++
  1 files changed, 21 insertions(+), 0 deletions(-)


diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c 
b/drivers/mtd/chips/cfi_cmdset_0002.c
index 38c47b0..1eb8bfa 100644
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -429,6 +429,27 @@ struct mtd_info *cfi_cmdset_0002(struct map_info 
*map, int primary)
  		cfi->chips[i].word_write_time = 1<<cfi->cfiq->WordWriteTimeoutTyp;
  		cfi->chips[i].buffer_write_time = 1<<cfi->cfiq->BufWriteTimeoutTyp;
  		cfi->chips[i].erase_time = 1<<cfi->cfiq->BlockEraseTimeoutTyp;
+
+		/* FIXME: use also max times, verify if valid */
+		cfi->chips[i].word_write_time_max =
+				(1<<(cfi->cfiq->WordWriteTimeoutTyp)) *
+				(1<<(cfi->cfiq->WordWriteTimeoutMax));
+		cfi->chips[i].buffer_write_time_max =
+				(1<<(cfi->cfiq->BufWriteTimeoutTyp)) *
+				(1<<(cfi->cfiq->BufWriteTimeoutMax));
+		cfi->chips[i].erase_time_max =
+				(1<<(cfi->cfiq->BlockEraseTimeoutTyp)) *
+				(1<<(cfi->cfiq->BlockEraseTimeoutMax));
+
+		printk(KERN_INFO "MTD: %s erase time %u / %u ms\n", __func__,
+			cfi->chips[i].erase_time, cfi->chips[i].erase_time_max);
+		printk(KERN_INFO "MTD: %s word time %u / %u us\n", __func__,
+			cfi->chips[i].word_write_time,
+			cfi->chips[i].word_write_time_max);
+		printk(KERN_INFO "MTD: %s buffer time %u / %u us\n", __func__,
+			cfi->chips[i].buffer_write_time,
+			cfi->chips[i].buffer_write_time_max);
+
  		cfi->chips[i].ref_point_counter = 0;
  		init_waitqueue_head(&(cfi->chips[i].wq));
  	}

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

end of thread, other threads:[~2011-04-01  7:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-25  7:52 [PATCH 2.6.34 1/2] cfi_cmdset_0002.c: Read max timeouts from cfi query data Markus Niebel
2011-04-01  7:31 ` Artem Bityutskiy

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