public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Adil Hafeez <adilhafeez80@gmail.com>
To: linux-mtd@lists.infradead.org
Subject: Flash erase wait time
Date: Fri, 26 Aug 2005 15:54:22 +0500	[thread overview]
Message-ID: <82e4189c05082603546248689a@mail.gmail.com> (raw)

[-- 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
>

             reply	other threads:[~2005-08-26 10:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-26 10:54 Adil Hafeez [this message]
2005-08-26 11:07 ` Flash erase wait time Thomas Gleixner
2005-08-26 11:12   ` Adil Hafeez

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=82e4189c05082603546248689a@mail.gmail.com \
    --to=adilhafeez80@gmail.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