[PATCH 2.6.34 1/2] cfi_cmdset_0002.c: Read max timeouts from cfi query data

Markus Niebel list-09_linux_mtd at tqsc.de
Fri Mar 25 03:52:39 EDT 2011


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 at 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));
  	}



More information about the linux-mtd mailing list