Wrong CFI offset in cfi_cmdset_0001.c

Jared Hulbert jaredeh at gmail.com
Mon Oct 24 21:00:24 EDT 2005


Sorry. It took me longer than it should have to track down a P30 part
and get it on my machine.  Does this work for you?

Is this format ok?

[MTD] CHIPS: fix for P30 cfi parsing

Change to the extended cfi table parsing for Intel NOR flash that uses
the info in the extended table to 'walk' the table rather than using
hard coding for various primary extended query table version numbers.
[From: Jared Hulbert <jaredeh at gmail.com>]

Index: trunk/drivers/mtd/chips/cfi_cmdset_0001.c
===================================================================
--- trunk/drivers/mtd/chips/cfi_cmdset_0001.c	(revision 8)
+++ trunk/drivers/mtd/chips/cfi_cmdset_0001.c	(revision 10)
@@ -285,7 +285,7 @@
 			      sizeof(struct cfi_intelext_otpinfo);

 		/* Burst Read info */
-		extra_size += (extp->MinorVersion < '4') ? 6 : 5;
+		extra_size += (unsigned int)extp->extra[extra_size+1]+2;

 		/* Number of hardware-partitions */
 		extra_size += 1;
@@ -519,7 +519,7 @@
 		       sizeof(struct cfi_intelext_otpinfo);

 		/* Burst Read info */
-		offs += (extp->MinorVersion < '4') ? 6 : 5;
+		offs += (int)extp->extra[offs+1]+2;

 		/* Number of partition regions */
 		numregions = extp->extra[offs];




More information about the linux-mtd mailing list