public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: "Jon Burgess" <Jon_Burgess@eur.3com.com>
To: linux-mtd@lists.infradead.org
Subject: [Patch] Fixes to support ST 29W320DB in cfi_cmdset_002
Date: Fri, 19 Jul 2002 16:41:10 +0100	[thread overview]
Message-ID: <80256BFB.00569639.00@notesmta.eur.3com.com> (raw)

[-- 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);
 }
 

                 reply	other threads:[~2002-07-19 15:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=80256BFB.00569639.00@notesmta.eur.3com.com \
    --to=jon_burgess@eur.3com.com \
    --cc=linux-mtd@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox