public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [Patch] Fixes to support ST 29W320DB in cfi_cmdset_002
@ 2002-07-19 15:41 Jon Burgess
  0 siblings, 0 replies; only message in thread
From: Jon Burgess @ 2002-07-19 15:41 UTC (permalink / raw)
  To: linux-mtd

[-- Attachment #1: Type: text/plain, Size: 2008 bytes --]



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)

[-- Attachment #2: cfi-sst.patch --]
[-- Type: application/octet-stream, Size: 1034 bytes --]

--- linux/drivers/mtd/chips/cfi_cmdset_0002.c~	Tue Nov  6 07:56:00 2001
+++ linux/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);
 }
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-07-19 15:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-19 15:41 [Patch] Fixes to support ST 29W320DB in cfi_cmdset_002 Jon Burgess

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox