diff options
author | Oliver Schinagl <oliver@schinagl.nl> | 2011-02-26 12:16:43 (GMT) |
---|---|---|
committer | Oliver Schinagl <oliver@schinagl.nl> | 2011-02-26 12:16:43 (GMT) |
commit | edb45850f53478c7779484105c30f8df0a3a3782 (patch) | |
tree | 26e758b463e03475be4d214aeb17c6517b01a83e /linux-2.4.x/drivers/mtd/chips/cfi_cmdset_0002.c | |
parent | ba6dc76a789f33fc999bbd24fe8af5b856f90085 (diff) | |
download | openipcam-edb45850f53478c7779484105c30f8df0a3a3782.zip openipcam-edb45850f53478c7779484105c30f8df0a3a3782.tar.gz openipcam-edb45850f53478c7779484105c30f8df0a3a3782.tar.bz2 |
2.4.20-uc0 uClinux patch added
Diffstat (limited to 'linux-2.4.x/drivers/mtd/chips/cfi_cmdset_0002.c')
-rw-r--r-- | linux-2.4.x/drivers/mtd/chips/cfi_cmdset_0002.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/linux-2.4.x/drivers/mtd/chips/cfi_cmdset_0002.c b/linux-2.4.x/drivers/mtd/chips/cfi_cmdset_0002.c index 5e4f3fe..0a9c105 100644 --- a/linux-2.4.x/drivers/mtd/chips/cfi_cmdset_0002.c +++ b/linux-2.4.x/drivers/mtd/chips/cfi_cmdset_0002.c @@ -382,7 +382,7 @@ static int do_write_oneword(struct map_info *map, struct flchip *chip, unsigned Last[2] = cfi_read(map, adr); // printk("Last[2] is %x\n", Last[2]); - for (Count = 3; Last[(Count - 1) % 4] != Last[(Count - 2) % 4] && Count < 10000; Count++){ + for (Count = 3; Last[(Count - 1) % 4] != datum && Count < 500000; Count++){ cfi_spin_unlock(chip->mutex); cfi_udelay(10); cfi_spin_lock(chip->mutex); @@ -459,9 +459,11 @@ static int cfi_amdstd_write (struct mtd_info *mtd, loff_t to , size_t len, size_ } /* 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); + if (cfi->fast_prog){ + 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) { |