Supporting flash that powers up locked

David Woodhouse dwmw2 at infradead.org
Thu Nov 25 04:36:21 EST 2004


On Wed, 2004-11-24 at 17:15 -0800, Todd Poynor wrote:
> David Woodhouse wrote:
> > We already have a bit to set in the partition flags to show that a
> > partition should be read-only. 
> 
> Yeah I saw that the bit is really an amalgam of 
> MTD_CLEAR_BITS|MTD_SET_BITS that are also involved in other capability 
> combos (MTD_CAP_NANDFLASH, et al) and wasn't sure if there were other 
> side effects of messing with those at runtime.

No, we have it separately for partitions.

> > I'd rather do this with a blacklist of the chips which lock themselves,
> > and have the chip driver automatically unlock it at boot time and
> > suspend time (or automatically as required).
> 
> I did receive some pushback when I previously tried to do something 
> similar, since we'd often be unlocking bootloader firmware and such.

Look at the use of MTD_WRITEABLE in, e.g., solutionengine.c. We already
have a way to prevent accidental access to the bootloader.

When they made the locking automatic instead of remembering the previous
state, the whole point of it changed. It's no longer useful for
protecting bootloaders all by itself; you can't infer anything useful
from the fact that you found the flash locked.

On the new chips of which you speak, all the locking can do is give us a
little more protection against random read/write cycles causing damage
to the contents of the flash. So let's use it for that. Leave the flash
locked at most times, and unlock a sector as we need to use it. 

-- 
dwmw2





More information about the linux-mtd mailing list