Hi,

I've recently been messing with openwrt on an old Netgear DG834GSP v3 with a
Samsung K8D6316UBM flash. It seems to also have a MajorVersion of 0, causing
it not to be recognized as a valid AMD commandset flash.

The patch below has been tested on the aforementioned hardware and works as
expected. While changing cfi_fixup_major_minor() I decided that a switch
would be more suitable for this scenario as it makes adding more chips
affected by this issue easier and especially cleaner. The patch was
generated against kamikaze revision 17652 and the included linux-2.6.30.

Signed-off-by: Alex Hornung <ahorn...@gmail.com>


Cheers,
Alex Hornung

===================================================================

--- drivers/mtd/chips/cfi_cmdset_0002.c 2009-09-20 12:07:12.000000000 -0700
+++ /home/alex/backup-cfi-cmdset-0002.c 2009-09-20 09:07:58.000000000 
+++ -0700
@@ -337,9 +337,14 @@
 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';
+       if (cfi->mfr == CFI_MFR_SAMSUNG && extp->MajorVersion == '0') {
+               switch (cfi->id) {
+                       case 0x257e:
+                       case 0x22e2:
+                               extp->MajorVersion = '1';
+                               break;
+               }
+       }
 }

 struct mtd_info *cfi_cmdset_0002(struct map_info *map, int primary)

_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to