prepare for the transition to linux 2.6.22 - make it possible to override the kernel...
[openwrt.git] / target / linux / generic-2.6 / patches-2.6.22 / 007-samsung_flash.patch
1 diff -urN linux-2.6.21.1.old/drivers/mtd/chips/cfi_cmdset_0002.c linux-2.6.21.1.dev/drivers/mtd/chips/cfi_cmdset_0002.c
2 --- linux-2.6.21.1.old/drivers/mtd/chips/cfi_cmdset_0002.c      2007-04-27 23:49:26.000000000 +0200
3 +++ linux-2.6.21.1.dev/drivers/mtd/chips/cfi_cmdset_0002.c      2007-05-26 19:30:01.049193968 +0200
4 @@ -51,6 +51,7 @@
5  #define SST49LF040B            0x0050
6  #define SST49LF008A            0x005a
7  #define AT49BV6416             0x00d6
8 +#define MANUFACTURER_SAMSUNG   0x00ec
9  
10  static int cfi_amdstd_read (struct mtd_info *, loff_t, size_t, size_t *, u_char *);
11  static int cfi_amdstd_write_words(struct mtd_info *, loff_t, size_t, size_t *, const u_char *);
12 @@ -294,12 +295,19 @@
13  
14                 if (extp->MajorVersion != '1' ||
15                     (extp->MinorVersion < '0' || extp->MinorVersion > '4')) {
16 -                       printk(KERN_ERR "  Unknown Amd/Fujitsu Extended Query "
17 -                              "version %c.%c.\n",  extp->MajorVersion,
18 -                              extp->MinorVersion);
19 -                       kfree(extp);
20 -                       kfree(mtd);
21 -                       return NULL;
22 +                       if (cfi->mfr == MANUFACTURER_SAMSUNG &&
23 +                           (extp->MajorVersion == '3' && extp->MinorVersion == '3')) {
24 +                           printk(KERN_NOTICE "  Newer Samsung flash detected, "
25 +                                  "should be compatibile with Amd/Fujitsu.\n");
26 +                       }
27 +                       else {
28 +                           printk(KERN_ERR "  Unknown Amd/Fujitsu Extended Query "
29 +                                  "version %c.%c.\n",  extp->MajorVersion,
30 +                                  extp->MinorVersion);
31 +                           kfree(extp);
32 +                           kfree(mtd);
33 +                           return NULL;
34 +                       }
35                 }
36  
37                 /* Install our own private info structure */