mtd: CFI: quirk for PF38F4476.

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri Jun 5 14:59:16 EDT 2009


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=ec2d0d842577854eee18f0dc06bd48fe17189b54
Commit:     ec2d0d842577854eee18f0dc06bd48fe17189b54
Parent:     d6fed9e9fc5eefae5be0ecf222bac7e7496e8e74
Author:     Daniel Ribeiro <drwyrm at gmail.com>
AuthorDate: Sun May 17 08:02:17 2009 -0300
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Fri Jun 5 17:51:07 2009 +0100

    mtd: CFI: quirk for PF38F4476.
    
    This chip reports CFI 1.3, but the CFI PRI is like CFI 1.1. Add a quirk
    to pass probe on this chip.
    
    This patch depends on "MTD: CFI 1.0 and CFI 1.1"
    
    Signed-off-by: Daniel Ribeiro <drwyrm at gmail.com>
    Acked-by: Nicolas Pitre <nico at cam.org>
    Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy at nokia.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/chips/cfi_cmdset_0001.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c
index c240454..e772803 100644
--- a/drivers/mtd/chips/cfi_cmdset_0001.c
+++ b/drivers/mtd/chips/cfi_cmdset_0001.c
@@ -46,6 +46,7 @@
 #define MANUFACTURER_INTEL	0x0089
 #define I82802AB	0x00ad
 #define I82802AC	0x00ac
+#define PF38F4476	0x881c
 #define MANUFACTURER_ST         0x0020
 #define M50LPW080       0x002F
 #define M50FLW080A	0x0080
@@ -315,9 +316,18 @@ static struct cfi_fixup fixup_table[] = {
 	{ 0, 0, NULL, NULL }
 };
 
+static void cfi_fixup_major_minor(struct cfi_private *cfi,
+						struct cfi_pri_intelext *extp)
+{
+	if (cfi->mfr == MANUFACTURER_INTEL &&
+			cfi->id == PF38F4476 && extp->MinorVersion == '3')
+		extp->MinorVersion = '1';
+}
+
 static inline struct cfi_pri_intelext *
 read_pri_intelext(struct map_info *map, __u16 adr)
 {
+	struct cfi_private *cfi = map->fldrv_priv;
 	struct cfi_pri_intelext *extp;
 	unsigned int extp_size = sizeof(*extp);
 
@@ -326,6 +336,8 @@ read_pri_intelext(struct map_info *map, __u16 adr)
 	if (!extp)
 		return NULL;
 
+	cfi_fixup_major_minor(cfi, extp);
+
 	if (extp->MajorVersion != '1' ||
 	    (extp->MinorVersion < '0' || extp->MinorVersion > '5')) {
 		printk(KERN_ERR "  Unknown Intel/Sharp Extended Query "



More information about the linux-mtd-cvs mailing list