ST Flashes and buffer write
Eoghan Doyle
Eoghan.Doyle at trintech.com
Tue Feb 8 11:50:20 EST 2005
Hi,
I have a problem with an ST flash and buffer write. It looks similar to what
as discussed in several threads as far back as Aug 2002, but I cannot find
the solution.
I am using a M28W640 flash. This claims to be an Intel/Sharp Standard flash
supporting buffered write.
But the buffered write it supports is not the same as coded in
cfi_cmdset_0001.c.
It uses a double/quad word write instead of a buffer write.
The Intel buffer write is:
1. Write buffer write command (0xe8)
2. Write the number of words to follow.
3. Write each word.
4. Write the confirm command (0xd0).
5. Check status.
The ST version is: (see the datasheet at
http://www.datasheetarchive.com/datasheet/pdf/46/469684.html)
1. Write double/quad word command (0x30/0x56)
2. Write 2/4 words.
3. Check status.
In the ST case you must check that the addresses are consecutive and that
only bottom bits change.
If you use one of these chips with the MTD you will get EROFS returned from
do_write_buffer.
Currently I am defining FORCE_WORD_WRITE as a work around.
I have attached some debug output below.
The questions I have are:
1. Is there already code to handle this difference, which I have
missed?
2. How can you tell the difference between the 2 write buffer methods
without resorting to tying it to a specific vender/chip?
3. Will this make much of a difference to write speeds?
Thanks for your help,
Eoghan
============================================================
Debug output:
Number of erase regions: 2
Primary Vendor Command Set: 0003 (Intel/Sharp Standard)
Primary Algorithm Table at 0035
Alternative Vendor Command Set: 0000 (None)
No Alternate Algorithm Table
Vcc Minimum: 2.7 V
Vcc Maximum: 3.6 V
Vpp Minimum: b.4 V
Vpp Maximum: c.6 V
Typical byte/word write timeout: 16 µs
Maximum byte/word write timeout: 512 µs
Typical full buffer write timeout: 16 µs
Maximum full buffer write timeout: 512 µs
Typical block erase timeout: 1024 µs
Maximum block erase timeout: 8192 µs
Chip erase not supported
Device size: 0x800000 bytes (8 MiB)
Flash Device Interface description: 0x0001
- x16-only asynchronous interface
Max. bytes in buffer write: 0x8
Number of Erase Block Regions: 2
Erase Region #0: BlockSize 0x2000 bytes, 8 blocks
Erase Region #1: BlockSize 0x10000 bytes, 127 blocks
Feature/Command Support: 0066
- Chip Erase: unsupported
- Suspend Erase: supported
- Suspend Program: supported
- Legacy Lock/Unlock: unsupported
- Queued Erase: unsupported
- Instant block lock: supported
- Protection Bits: supported
- Page-mode read: unsupported
- Synchronous read: unsupported
Supported functions after Suspend: 01
- Program after Erase Suspend: supported
Block Status Register Mask: 0003
- Lock Bit Active: yes
- Valid Bit Active: yes
Vcc Logic Supply Optimum Program/Erase Voltage: 0.0 V
Vpp Programming Supply Optimum Program/Erase Voltage: 0.0 V
Using buffer write method
More information about the linux-mtd
mailing list