mtd/drivers/mtd/chips cfi_cmdset_0002.c,1.95,1.96
cfi_probe.c,1.73,1.74
dvrabel at infradead.org
dvrabel at infradead.org
Tue Feb 17 11:43:44 EST 2004
Update of /home/cvs/mtd/drivers/mtd/chips
In directory phoenix.infradead.org:/tmp/cvs-serv29879/drivers/mtd/chips
Modified Files:
cfi_cmdset_0002.c cfi_probe.c
Log Message:
Removed the (broken and disabled) "fast programming" (unlock bypass) support
for CFI commmand set 0002 (AMD/Fujitsu) chips.
Index: cfi_cmdset_0002.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/chips/cfi_cmdset_0002.c,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -r1.95 -r1.96
--- cfi_cmdset_0002.c 17 Feb 2004 15:42:12 -0000 1.95
+++ cfi_cmdset_0002.c 17 Feb 2004 16:43:41 -0000 1.96
@@ -348,14 +348,6 @@
goto setup_err;
break;
}
- if (cfi->fast_prog) {
- /* In cfi_amdstd_write_words() we frob the protection stuff
- without paying any attention to the state machine.
- This upsets in-progress erases. So we turn this flag
- off for now till the code gets fixed. */
- printk(KERN_NOTICE "cfi_cmdset_0002: Disabling fast programming due to code brokenness.\n");
- cfi->fast_prog = 0;
- }
/* FIXME: erase-suspend-program is broken. See
http://lists.infradead.org/pipermail/linux-mtd/2003-December/009001.html */
printk(KERN_NOTICE "cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.\n");
@@ -751,7 +743,7 @@
}
-static int do_write_oneword(struct map_info *map, struct flchip *chip, unsigned long adr, cfi_word datum, int fast)
+static int do_write_oneword(struct map_info *map, struct flchip *chip, unsigned long adr, cfi_word datum)
{
struct cfi_private *cfi = map->fldrv_priv;
unsigned long timeo = jiffies + HZ;
@@ -794,21 +786,17 @@
}
ENABLE_VPP(map);
- if (fast) { /* Unlock bypass */
- cfi_send_gen_cmd(0xA0, 0, chip->start, map, cfi, cfi->device_type, NULL);
- } else {
- /*
- * The CFI_DEVICETYPE_X8 argument is needed even when
- * cfi->device_type != CFI_DEVICETYPE_X8. The addresses for
- * command sequences don't scale even when the device is
- * wider. This is the case for many of the cfi_send_gen_cmd()
- * below. I'm not sure, however, why some use
- * cfi->device_type.
- */
- cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start, map, cfi, CFI_DEVICETYPE_X8, NULL);
- cfi_send_gen_cmd(0x55, cfi->addr_unlock2, chip->start, map, cfi, CFI_DEVICETYPE_X8, NULL);
- cfi_send_gen_cmd(0xA0, cfi->addr_unlock1, chip->start, map, cfi, CFI_DEVICETYPE_X8, NULL);
- }
+ /*
+ * The CFI_DEVICETYPE_X8 argument is needed even when
+ * cfi->device_type != CFI_DEVICETYPE_X8. The addresses for
+ * command sequences don't scale even when the device is
+ * wider. This is the case for many of the cfi_send_gen_cmd()
+ * below. I'm not sure, however, why some use
+ * cfi->device_type.
+ */
+ cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start, map, cfi, CFI_DEVICETYPE_X8, NULL);
+ cfi_send_gen_cmd(0x55, cfi->addr_unlock2, chip->start, map, cfi, CFI_DEVICETYPE_X8, NULL);
+ cfi_send_gen_cmd(0xA0, cfi->addr_unlock1, chip->start, map, cfi, CFI_DEVICETYPE_X8, NULL);
cfi_write(map, datum, adr);
chip->state = FL_WRITING;
@@ -942,7 +930,7 @@
}
ret = do_write_oneword(map, &cfi->chips[chipnum],
- bus_ofs, datum, 0);
+ bus_ofs, datum);
if (ret)
return ret;
@@ -958,13 +946,6 @@
}
}
- if (cfi->fast_prog) {
- /* Go into unlock bypass mode */
- cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chipstart, map, cfi, CFI_DEVICETYPE_X8, NULL);
- cfi_send_gen_cmd(0x55, cfi->addr_unlock2, chipstart, map, cfi, CFI_DEVICETYPE_X8, NULL);
- cfi_send_gen_cmd(0x20, cfi->addr_unlock1, chipstart, map, cfi, CFI_DEVICETYPE_X8, NULL);
- }
-
/* We are now aligned, write as much as possible */
while(len >= CFIDEV_BUSWIDTH) {
cfi_word datum;
@@ -985,15 +966,9 @@
return -EINVAL;
}
ret = do_write_oneword(map, &cfi->chips[chipnum],
- ofs, datum, cfi->fast_prog);
- if (ret) {
- if (cfi->fast_prog){
- /* Get out of unlock bypass mode */
- cfi_send_gen_cmd(0x90, 0, chipstart, map, cfi, cfi->device_type, NULL);
- cfi_send_gen_cmd(0x00, 0, chipstart, map, cfi, cfi->device_type, NULL);
- }
+ ofs, datum);
+ if (ret)
return ret;
- }
ofs += CFIDEV_BUSWIDTH;
buf += CFIDEV_BUSWIDTH;
@@ -1001,32 +976,14 @@
len -= CFIDEV_BUSWIDTH;
if (ofs >> cfi->chipshift) {
- if (cfi->fast_prog){
- /* Get out of unlock bypass mode */
- cfi_send_gen_cmd(0x90, 0, chipstart, map, cfi, cfi->device_type, NULL);
- cfi_send_gen_cmd(0x00, 0, chipstart, map, cfi, cfi->device_type, NULL);
- }
-
chipnum ++;
ofs = 0;
if (chipnum == cfi->numchips)
return 0;
chipstart = cfi->chips[chipnum].start;
- if (cfi->fast_prog){
- /* Go into unlock bypass mode for next set of chips */
- cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chipstart, map, cfi, CFI_DEVICETYPE_X8, NULL);
- cfi_send_gen_cmd(0x55, cfi->addr_unlock2, chipstart, map, cfi, CFI_DEVICETYPE_X8, NULL);
- cfi_send_gen_cmd(0x20, cfi->addr_unlock1, chipstart, map, cfi, CFI_DEVICETYPE_X8, NULL);
- }
}
}
- if (cfi->fast_prog){
- /* Get out of unlock bypass mode */
- cfi_send_gen_cmd(0x90, 0, chipstart, map, cfi, cfi->device_type, NULL);
- cfi_send_gen_cmd(0x00, 0, chipstart, map, cfi, cfi->device_type, NULL);
- }
-
/* Write the trailing bytes if any */
if (len & (CFIDEV_BUSWIDTH-1)) {
int i = 0, n = 0;
@@ -1076,7 +1033,7 @@
}
ret = do_write_oneword(map, &cfi->chips[chipnum],
- ofs, datum, 0);
+ ofs, datum);
if (ret)
return ret;
Index: cfi_probe.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/chips/cfi_probe.c,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -r1.73 -r1.74
--- cfi_probe.c 8 Nov 2003 00:51:21 -0000 1.73
+++ cfi_probe.c 17 Feb 2004 16:43:41 -0000 1.74
@@ -150,7 +150,6 @@
memset(cfi->cfiq,0,sizeof(struct cfi_ident));
cfi->cfi_mode = CFI_MODE_CFI;
- cfi->fast_prog=1; /* CFI supports fast programming */
/* Read the CFI info structure */
for (i=0; i<(sizeof(struct cfi_ident) + num_erase_regions * 4); i++) {
More information about the linux-mtd-cvs
mailing list