[ECOS] FLASH API/driver V2 erase operation

Bart Veer bartv@ecoscentric.com
Wed Oct 14 13:31:00 GMT 2009

>>>>> "Iris" == Iris Lindner <ilindner@logopak.de> writes:


    Iris> As far as I understood the offsets are always added to the
    Iris> actual block address to be erased (addr). But in the chip
    Iris> documentation (we use a Spansion S29GL256P) it says that
    Iris> offsets have to be added to base address of flash range.

That is strange. The current code works on numerous AMD (now Spansion)
and compatible chips without problems. The datasheet will typically
include something like the following, hidden away in a footnote:

  "Address bits AMAX:A16 are don't cares for unlock and command
   cycles, unless SA or PA required. (AMAX is the Highest Address

In other words only the bottom 16 bits of the address are significant
when issuing a command (assuming a 64K block size, the details may
change if the chip supports boot blocks). The top bits are don't care.
This means a command can be issued relative to the start of any block,
not just relative to the start of the device. It also makes life a lot
simpler for banked chips which basically have two or more flash
devices in a single package, allowing one device to be programmed
independently from the other.

It is possible that Spansion have changed the behaviour for the
S29GL256P. Flash manufacturers do have the very annoying habit of
making changes like that for no particularly obvious reason. Changing
the V2 AMD driver would be non-trivial because it would have to start
worrying about banked devices in various places.

    Iris> How could I switch back to the old driver with V2 API?
    Iris> (Enabling "Provide the legacy user API" in eCos config tool
    Iris> seems not being sufficient.)

The target definition would have to specify
CYGPKG_DEVS_FLASH_AMD_AM29XXXXX_V2. The generic flash code should then
adapt to working with a V1 driver instead of a V2 driver. Of course
doing this means that you will lose some of the advantages of the V2
driver, for example flash operations would no longer be


Bart Veer                                   eCos Configuration Architect
eCosCentric Limited    The eCos experts      http://www.ecoscentric.com/
Barnwell House, Barnwell Drive, Cambridge, UK.      Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.

Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

More information about the Ecos-discuss mailing list