]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[MTD] CFI: remove major/minor version check for command set 0x0002
authorWolfgang Grandegger <wg@grandegger.com>
Thu, 8 Jan 2009 18:21:27 +0000 (19:21 +0100)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Fri, 9 Jan 2009 12:16:28 +0000 (12:16 +0000)
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@grandegger.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/chips/cfi_cmdset_0002.c
include/linux/mtd/cfi.h

index f9c435a426708c30d9452349dbc45506681b4176..94bb61e19047764ae06dcf91408946219869fa06 100644 (file)
@@ -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 "
index 00e2b575021f6d8f6ee1fd819cf18137baf3fcd5..88d3d8fbf9f2d502855af56d8d800a52f7b1e129 100644 (file)
@@ -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);