Skip to contentSkip to conversation

Additional devices, jedec reset and dc21285 fixes

PATCH Vincent Sanders 2 participants 2 messages Apr 15, 2004 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

OK
Here are a small series of patches (as discussed with dwmwmwmwmwmwmwmwm2 ;-)

The first adds two SST devices to the jedec_probe (they use the SST page writing algor - patch to follow).

The second fixes the DC21285 mapping driver to work on all supported footbridge systems (and yes I have personally tested this)

The third is possibly the most contentious and most interesting...while playing with the various SST and MACRONIX devices on the footbridge systems (second patch) I have discovered the jedec reset sequence...doesnt reset anything but AMD/Intel devices with the short reset sequence! - please see the patch and comment and discuss as required.

As mentioned the SST devices above use a (currently) unimplemented command set - when its clean enough I shall submit the driver for this command set, it currently reads fine but writing seems to have issues (SST seem to have been on a differing planet inventing this one).

Signature · 2 lines
Regards Vincent
http://www.kyllikki.org/
drivers/mtd/chips/jedec_probe.c +20 -0
@@ -100,6 +100,8 @@
 #define M29W040B	0x00E3
 
 /* SST */
+#define SST29EE020	0x0010
+#define SST29LE020	0x0012
 #define SST29EE512	0x005d
 #define SST29LE512	0x003d
 #define SST39LF800	0x2781
@@ -839,6 +841,24 @@
 		}
         }, {
 		mfr_id: MANUFACTURER_SST,
+		dev_id: SST29EE020,
+		name: "SST 29EE020",
+		DevSize: SIZE_256KiB,
+		CmdSet: P_ID_SST_PAGE,
+		NumEraseRegions: 1,
+		regions: {ERASEINFO(0x01000,64),
+		}
+        }, {
+		mfr_id: MANUFACTURER_SST,
+		dev_id: SST29LE020,
+		name: "SST 29LE020",
+		DevSize: SIZE_256KiB,
+		CmdSet: P_ID_SST_PAGE,
+		NumEraseRegions: 1,
+		regions: {ERASEINFO(0x01000,64),
+		}
+        }, {
+		mfr_id: MANUFACTURER_SST,
 		dev_id: SST39LF020,
 		name: "SST 39LF020",
 		DevSize: SIZE_256KiB,
include/linux/mtd/cfi.h +2 -0
@@ -287,8 +287,10 @@
 #define P_ID_AMD_STD 2
 #define P_ID_INTEL_STD 3
 #define P_ID_AMD_EXT 4
+#define P_ID_ST_ADV 32
 #define P_ID_MITSUBISHI_STD 256
 #define P_ID_MITSUBISHI_EXT 257
+#define P_ID_SST_PAGE 258
 #define P_ID_RESERVED 65535
 
 
drivers/mtd/maps/dc21285.c +91 -22

180 lines not on this page · raw message

drivers/mtd/chips/jedec_probe.c +14 -1
@@ -947,7 +967,20 @@
 	struct cfi_private *cfi)
 {
 	/* Reset */
-	cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL);
+
+	/* after checking the datasheets for SST, MACRONIX and ATMEL
+	 * (oh and incidentaly the jedec spec - 3.5.3.3) the reset
+	 * sequence is *supposed* to be 0xaa at 0x5555, 0x55 at
+	 * 0x2aaa, 0xF0 at 0x5555 this will not affect the AMD chips
+	 * as they will ignore the writes and dont care what address
+	 * the F0 is written to */
+	if(cfi->addr_unlock1) {
+		/*printk("reset unlock called %x %x \n",cfi->addr_unlock1,cfi->addr_unlock2);*/
+		cfi_send_gen_cmd(0xaa, cfi->addr_unlock1, base, map, cfi, CFI_DEVICETYPE_X8, NULL);
+		cfi_send_gen_cmd(0x55, cfi->addr_unlock2, base, map, cfi, CFI_DEVICETYPE_X8, NULL);
+	}
+
+	cfi_send_gen_cmd(0xF0, cfi->addr_unlock1, base, map, cfi, cfi->device_type, NULL);
 	/* Some misdesigned intel chips do not respond for 0xF0 for a reset,
 	 * so ensure we're in read mode.  Send both the Intel and the AMD command
 	 * for this.  Intel uses 0xff for this, AMD uses 0xff for NOP, so
#1 lore raw
Quoted 5 lines · Vincent Sanders

OK
Here are a small series of patches (as discussed with dwmwmwmwmwmwmwmwm2 ;-)

The first adds two SST devices to the jedec_probe (they use the SST page writing algor - patch to follow).

You are patching against an old version of jedec_probe.c. It would be good if all of your patches were against something more recent.

Quoted 6 lines

The third is possibly the most contentious and most interesting...while playing with the various SST and MACRONIX devices on the footbridge systems (second patch) I have discovered the jedec reset sequence...doesnt reset anything but AMD/Intel devices with the short reset sequence! - please see the patch and comment and discuss as required.

The patch seems sane - I know that the devices I work with work either way and so the patch shouldn't change anything (I haven't tried it, though). Hmmm - I wonder what Intel parts might do - it's been long enough since I worked with one that I just can't remember. I think it'll work with those, too.

Quoted 4 lines

As mentioned the SST devices above use a (currently) unimplemented command set - when its clean enough I shall submit the driver for this command set, it currently reads fine but writing seems to have issues (SST seem to have been on a differing planet inventing this one).

Not just that one - I have a list of SST chips and bugs as long as my arm that are different than what the rest of the world does. Yuck.

Signature · 2 lines
Thayne Harbaugh
Linux Networx