[PATCH 1/1] MTD: Unlocking all Intel flash that is locked on power up

Jared Hulbert jaredeh at gmail.com
Tue Nov 13 12:40:07 EST 2007


> How do you update your bootloader from Linux but protect it from
> possible corruptions otherwise?  By recompiling your kernel?  _That_ is
> nutty.

Okay, okay I get your point.  Yep that is a problem.  But one that the
MTD_STUPID_LOCK can be unset to deal will if the
fixup_use_powerup_lock() is changed to be more intelligent.  Oh that
and the name should be MTD_AUTO_UNLOCK or something like that.

> > If someone want's to implement some complex
> > scheme to prevent errant programs, they can use the userspace tools
> > and readonly flag for that.
>
> Well, actually I just looked and the core already has the code to
> auto-unlock flash when they have the MTD_STUPID_LOCK bit set.
>
> So... if one partition should _not_ be automatically unlocked, it just
> has to put MTD_STUPID_LOCK in its flag_mask.  I'd have prefered if the
> auto-unlock was explicitly enabled instead of its prevention, but
> whatever.

Right, Justin is just extending that functionality which today only
kicks in for one size of one chip family.

So to clarify the disagreement you feel the default behavior should be
to have your writeable partitions default to locked, we feel the
default behavior should be to have your writeable partitions default
to unlocked.  Does that sum it up the core philshopical disagreement
here?

> > The mailinglist gets an awful lot of
> > questions that have pointlessly locked partitions as the core.
>
> I guess it's only a matter of properly flagging flash models that do
> power up locked then.

Actually there is a bit in struct cfi_pri_intelext.FeatureSupport&32
that I _think_ tells us this is one of the flex lock parts that does
the nonvolatile locking.  I'll have to confirm that.  That could be
used in the function fixup_use_powerup_lock() in cfi_cmdset_0001.c to
be more intelligent than just unlocking everything.  Would that be
better?



More information about the linux-mtd mailing list