public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* Flash erase wait time
@ 2005-08-26 10:54 Adil Hafeez
  2005-08-26 11:07 ` Thomas Gleixner
  0 siblings, 1 reply; 3+ messages in thread
From: Adil Hafeez @ 2005-08-26 10:54 UTC (permalink / raw)
  To: linux-mtd

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

Hi,

I am using a custom mips board that includes 8 MB Am29LV641D flash
chip. This chip is 16-bit, has 128 sectors of 64k each.

This flash is memory mapped and starts at address 1c40:0000. I can
read the flash using dd utility. But I cannot erase flash. Erase
operation using 'eraseall' utility doesnt take more than 6 seconds to
finish and erases only first two blocks i.e. 128k. Whereas, full flash
erase from our custom developed flash utlity takes 60 seconds to erase
flash.

Then after hacking into cmd cfi commad set. The erase issue was fixed by 
adding a while loop for checking polarity bit in do_erase_oneblock function.

while (!sectorDone) {
    unsigned volatile short *flash_addr = adr + map->map_priv_1;
    if( (*flash_addr) & 0x0080 )
        sectorDone = 1;
}

Was it really required to double check the polarity bit, or there are
some timeout timer issues with my mips port ?


- Adil

[-- Attachment #2: erase_all_fix.patch --]
[-- Type: application/octet-stream, Size: 664 bytes --]

Index: drivers/mtd/chips/cfi_cmdset_0002.c
===================================================================
RCS file: /home/embedded/linux-2.4.20_palmchip/drivers/mtd/chips/cfi_cmdset_0002.c,v
retrieving revision 1.1
diff -r1.1 cfi_cmdset_0002.c
240c240
<               cfi->fast_prog = 0;
---
>               cfi->fast_prog = 1;
897a898
>
975a977,989
>     {
>     int sectorDone = 0;
>     while (!sectorDone) {
>         unsigned volatile short *flash_addr = adr + map->map_priv_1;
>         if( (*flash_addr) & 0x0080 )  {
>                 sectorDone = 1;
>         }
>         else {
>         }
>
>     }
>     }
>
1125a1140
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-08-26 11:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-26 10:54 Flash erase wait time Adil Hafeez
2005-08-26 11:07 ` Thomas Gleixner
2005-08-26 11:12   ` Adil Hafeez

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