mtd/drivers/mtd/chips cfi_cmdset_0001.c, 1.179, 1.180 cfi_cmdset_0002.c, 1.119, 1.120 cfi_cmdset_0020.c, 1.19, 1.20 cfi_util.c, 1.8, 1.9

tpoynor at infradead.org tpoynor at infradead.org
Wed Jul 20 17:01:17 EDT 2005


Update of /home/cvs/mtd/drivers/mtd/chips
In directory phoenix.infradead.org:/tmp/cvs-serv16629/drivers/mtd/chips

Modified Files:
	cfi_cmdset_0001.c cfi_cmdset_0002.c cfi_cmdset_0020.c 
	cfi_util.c 
Log Message:
[MTD] CHIPS: Recognize Spansion CFI 1.4 chips

Modify Amd/Fujitsu CFI NOR flash primary vendor extension table revision
check to recognize version 1.4.  Verified the existing driver can
handle version 1.4 chips without additional info from 1.4 extended table.

Move the primary vendor extension table revision check from common file
to the 3 CFI chip driver files, since the data structures and revisions
handled by those data structures are specific to the chip driver.

Modify the error message printed when the revision is unknown to be a
KERN_ERR instead of WARNING since this will cause mtd to ignore the chip.


Index: cfi_cmdset_0001.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/chips/cfi_cmdset_0001.c,v
retrieving revision 1.179
retrieving revision 1.180
diff -u -r1.179 -r1.180
--- cfi_cmdset_0001.c	11 Jul 2005 09:37:59 -0000	1.179
+++ cfi_cmdset_0001.c	20 Jul 2005 21:01:13 -0000	1.180
@@ -252,6 +252,15 @@
 	if (!extp)
 		return NULL;
 
+	if (extp->MajorVersion != '1' ||
+	    (extp->MinorVersion < '0' || extp->MinorVersion > '3')) {
+		printk(KERN_ERR "  Unknown Intel/Sharp Extended Query "
+		       "version %c.%c.\n",  extp->MajorVersion,
+		       extp->MinorVersion);
+		kfree(extp);
+		return NULL;
+	}
+
 	/* Do some byteswapping if necessary */
 	extp->FeatureSupport = le32_to_cpu(extp->FeatureSupport);
 	extp->BlkStatusRegMask = le16_to_cpu(extp->BlkStatusRegMask);

Index: cfi_cmdset_0002.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/chips/cfi_cmdset_0002.c,v
retrieving revision 1.119
retrieving revision 1.120
diff -u -r1.119 -r1.120
--- cfi_cmdset_0002.c	11 Jul 2005 09:38:00 -0000	1.119
+++ cfi_cmdset_0002.c	20 Jul 2005 21:01:13 -0000	1.120
@@ -253,6 +253,16 @@
 			return NULL;
 		}
 
+		if (extp->MajorVersion != '1' ||
+		    (extp->MinorVersion < '0' || extp->MinorVersion > '4')) {
+			printk(KERN_ERR "  Unknown Amd/Fujitsu Extended Query "
+			       "version %c.%c.\n",  extp->MajorVersion,
+			       extp->MinorVersion);
+			kfree(extp);
+			kfree(mtd);
+			return NULL;
+		}
+
 		/* Install our own private info structure */
 		cfi->cmdset_priv = extp;	
 

Index: cfi_cmdset_0020.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/chips/cfi_cmdset_0020.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- cfi_cmdset_0020.c	13 Jul 2005 15:52:45 -0000	1.19
+++ cfi_cmdset_0020.c	20 Jul 2005 21:01:14 -0000	1.20
@@ -133,6 +133,15 @@
 		if (!extp)
 			return NULL;
 
+		if (extp->MajorVersion != '1' ||
+		    (extp->MinorVersion < '0' || extp->MinorVersion > '3')) {
+			printk(KERN_ERR "  Unknown ST Microelectronics"
+			       " Extended Query version %c.%c.\n",
+			       extp->MajorVersion, extp->MinorVersion);
+			kfree(extp);
+			return NULL;
+		}
+
 		/* Do some byteswapping if necessary */
 		extp->FeatureSupport = cfi32_to_cpu(extp->FeatureSupport);
 		extp->BlkStatusRegMask = cfi32_to_cpu(extp->BlkStatusRegMask);

Index: cfi_util.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/chips/cfi_util.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- cfi_util.c	14 Dec 2004 19:55:56 -0000	1.8
+++ cfi_util.c	20 Jul 2005 21:01:14 -0000	1.9
@@ -70,15 +70,6 @@
 	local_irq_enable();
 #endif
 
-	if (extp->MajorVersion != '1' || 
-	    (extp->MinorVersion < '0' || extp->MinorVersion > '3')) {
-		printk(KERN_WARNING "  Unknown %s Extended Query "
-		       "version %c.%c.\n",  name, extp->MajorVersion,
-		       extp->MinorVersion);
-		kfree(extp);
-		extp = NULL;
-	}
-
  out:	return extp;
 }
 





More information about the linux-mtd-cvs mailing list