[Patch] Fixes to support ST 29W320DB in cfi_cmdset_002

Jon Burgess Jon_Burgess at eur.3com.com
Fri Jul 19 11:41:10 EDT 2002



We have an embedded Linux product which uses an ST 29W320DB flash part. To get
this to work we needed to make the changes below to the driver.

- Turned off the AMD_BOOTLOC_BUG fix. This chip matches the bug test criteria in
the code which was then swapping the sectors. This chip does not suffer from
this bug so it it doesn't work with the bug fix enabled. It would be a good idea
to make the bug test criteria test against a specific list of vendor &
deviceid's which chips require the bug fix the current check is too broad.
Unfortunately the present fix does not provide enough information to create this
list.

- Added a 3-byte reset sequence in addition to the normal 1-byte command. The
documentation for the chip suggests that the 1-byte command should work, but the
chip gets left in the id-mode after the probe. Hopefully this extra reset should
not cause problems for any other devices.

     Jon Burgess

--- drivers/mtd/chips/cfi_cmdset_0002.c~      Tue Nov  6 07:56:00 2001
+++ drivers/mtd/chips/cfi_cmdset_0002.c  Wed Jul 17 13:51:48 2002
@@ -26,7 +26,8 @@
 #include <linux/mtd/map.h>
 #include <linux/mtd/cfi.h>

-#define AMD_BOOTLOC_BUG
+/* This bug work around doesn't seem necessary and breaks ST 29W320DB */
+#undef AMD_BOOTLOC_BUG

 static int cfi_amdstd_read (struct mtd_info *, loff_t, size_t, size_t *, u_char
 *);
 static int cfi_amdstd_write(struct mtd_info *, loff_t, size_t, size_t *, const
u_char *);
@@ -137,7 +138,12 @@
     map->fldrv = &cfi_amdstd_chipdrv;
     MOD_INC_USE_COUNT;

+    /* Short reset command */
     cfi_send_gen_cmd(0xf0, 0x55, base, map, cfi, cfi->device_type, NULL);
+    /* Longer reset command - ST 29W320DB flash device seems to require this */
+    cfi_send_gen_cmd(0xaa, 0x555, base, map, cfi, cfi->device_type, NULL);
+    cfi_send_gen_cmd(0x55, 0x2aa, base, map, cfi, cfi->device_type, NULL);
+    cfi_send_gen_cmd(0xf0, 0x555, base, map, cfi, cfi->device_type, NULL);
     return cfi_amdstd_setup(map);
 }


(See attached file: cfi-sst.patch)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cfi-sst.patch
Type: application/octet-stream
Size: 1034 bytes
Desc: not available
Url : http://lists.infradead.org/pipermail/linux-mtd/attachments/20020719/238a0d90/attachment.obj 


More information about the linux-mtd mailing list