[MTD] CFI: remove major/minor version check for command set 0x0002

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri Jan 9 09:59:01 EST 2009


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=fefae48bf8caab7d56ee4f8181f06602cf73d29e
Commit:     fefae48bf8caab7d56ee4f8181f06602cf73d29e
Parent:     a808ad3b0d28411e2838117c5b2ae680ae42483c
Author:     Wolfgang Grandegger <wg at grandegger.com>
AuthorDate: Thu Jan 8 19:21:27 2009 +0100
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Fri Jan 9 12:16:28 2009 +0000

    [MTD] CFI: remove major/minor version check for command set 0x0002
    
    The NOR Flash memory K8P2815UQB from Samsung uses the major version
    number '0'. Add a quirk to cope with it.
    
    Signed-off-by: Wolfgang Grandegger <wg at grandegger.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/chips/cfi_cmdset_0002.c |   10 ++++++++++
 include/linux/mtd/cfi.h             |    1 +
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c
index f9c435a..94bb61e 100644
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -322,6 +322,14 @@ static struct cfi_fixup fixup_table[] = {
 };
 
 
+static void cfi_fixup_major_minor(struct cfi_private *cfi,
+				  struct cfi_pri_amdstd *extp)
+{
+	if (cfi->mfr == CFI_MFR_SAMSUNG && cfi->id == 0x257e &&
+	    extp->MajorVersion == '0')
+		extp->MajorVersion = '1';
+}
+
 struct mtd_info *cfi_cmdset_0002(struct map_info *map, int primary)
 {
 	struct cfi_private *cfi = map->fldrv_priv;
@@ -363,6 +371,8 @@ struct mtd_info *cfi_cmdset_0002(struct map_info *map, int primary)
 			return NULL;
 		}
 
+		cfi_fixup_major_minor(cfi, extp);
+
 		if (extp->MajorVersion != '1' ||
 		    (extp->MinorVersion < '0' || extp->MinorVersion > '4')) {
 			printk(KERN_ERR "  Unknown Amd/Fujitsu Extended Query "
diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h
index 00e2b57..88d3d8f 100644
--- a/include/linux/mtd/cfi.h
+++ b/include/linux/mtd/cfi.h
@@ -520,6 +520,7 @@ struct cfi_fixup {
 
 #define CFI_MFR_AMD 0x0001
 #define CFI_MFR_ATMEL 0x001F
+#define CFI_MFR_SAMSUNG 0x00EC
 #define CFI_MFR_ST  0x0020 	/* STMicroelectronics */
 
 void cfi_fixup(struct mtd_info *mtd, struct cfi_fixup* fixups);



More information about the linux-mtd-cvs mailing list