generic-2.6: add kernel 2.6.35 preliminary support (patches)
[librecmc/librecmc.git] / target / linux / generic-2.6 / patches-2.6.35 / 014-samsung_flash
1 --- a/drivers/mtd/chips/cfi_cmdset_0002.c
2 +++ b/drivers/mtd/chips/cfi_cmdset_0002.c
3 @@ -48,6 +48,7 @@
4  #define SST49LF040B            0x0050
5  #define SST49LF008A            0x005a
6  #define AT49BV6416             0x00d6
7 +#define MANUFACTURER_SAMSUNG   0x00ec
8  
9  static int cfi_amdstd_read (struct mtd_info *, loff_t, size_t, size_t *, u_char *);
10  static int cfi_amdstd_write_words(struct mtd_info *, loff_t, size_t, size_t *, const u_char *);
11 @@ -419,12 +420,19 @@ struct mtd_info *cfi_cmdset_0002(struct
12  
13                         if (extp->MajorVersion != '1' ||
14                             (extp->MinorVersion < '0' || extp->MinorVersion > '4')) {
15 -                               printk(KERN_ERR "  Unknown Amd/Fujitsu Extended Query "
16 -                                      "version %c.%c.\n",  extp->MajorVersion,
17 -                                      extp->MinorVersion);
18 -                               kfree(extp);
19 -                               kfree(mtd);
20 -                               return NULL;
21 +                               if (cfi->mfr == MANUFACTURER_SAMSUNG &&
22 +                                   (extp->MajorVersion == '3' && extp->MinorVersion == '3')) {
23 +                                   printk(KERN_NOTICE "  Newer Samsung flash detected, "
24 +                                          "should be compatibile with Amd/Fujitsu.\n");
25 +                               }
26 +                               else {
27 +                                   printk(KERN_ERR "  Unknown Amd/Fujitsu Extended Query "
28 +                                          "version %c.%c.\n",  extp->MajorVersion,
29 +                                          extp->MinorVersion);
30 +                                   kfree(extp);
31 +                                   kfree(mtd);
32 +                                   return NULL;
33 +                               }
34                         }
35  
36                         /* Install our own private info structure */