CFI driver & flash banks

Jarkko Lavinen jlavi at iki.fi
Tue Nov 27 07:13:57 EST 2001


Currently there is no concept of banks (planes, or partition regions)
within the CFI driver.  The whole chip has one single state regardless
of what is going on inside various regions in the chip.  With multiple
banks on chips this can lead to erroneous operation and less than
optimal performance.

Structure fi_private contains an array of cñhips of type flchip. The
flchip structure contains the global state of the chip.

What is needed is more fine granularity in chip state control. The
driver should be able to know the state of each bank in the chip
independently of other banks. The driver should be able to read from
another bank while writing or erasing another. The driver should be
able to understand that difference between only one bank changing its
state versus all banks changing their state together.

What kind of state transitions there are?

  - With chip reset, all banks are set to FL_READY (read array).

  - When entering status query, only one bank is put into FL_STATUS state.

  - With programming or erasing, only one bank is set to FL_WRITING or
    FL_ERASING. This requires no other bank is in erasing, programing,
    or in erase suspend. Other banks will be typically in FL_READY or
    FL_STATUS state.

  - When entering erase suspend, the bank returns to read array mode
    but no other bank can start erase or programming. The old state
    FL_ERASING is remembered,

It would make good for JFFS2 performance if writing in one sector
would block only one bank from reads, not the whole chip. The need for
suspending erase would be reduced.

My question is, how to implement this functionality in the CFI driver
in backward compliant way?

Instead of accessing chip->state, should one also be able to access
each banks like state chip->banks[bank].state ?

Or perhaps one should always query the chip state from the chip
itself? How about the old status when doing erase suspend?

Or should the status be a method that would cache the banks' status
and would read the status from the chiu only when crossing the bank
boundary?

Jarkko Lavinen




More information about the linux-mtd mailing list