Locking is new to the MTD version 2 library (MTDv2). Support for locking is
evident from the datasheet.
For chips that do support block-level write protection, there are two
different implementations: persistent and volatile.
- Persistent write
protection uses flash cells to remember which block is locked.
Just like normal flash cells, these cells can be arbitrarily
locked, but must be unlocked at the same time. Persistent
implementations use the islock(), lock(), and
unlockall() callouts.
- Volatile implementations always default to being completely
locked after every reset. This implementation has the advantage that
blocks can be locked and unlocked at will. These flash chips use the
islock(), lock(), and unlock() callouts.