[PATCH] [MTD] devices/mtd_dataflash: Add SW sector protection support

Mike Frysinger vapier.adi at gmail.com
Wed Feb 25 13:50:14 EST 2009


On Wed, Feb 25, 2009 at 07:17, Mike McTernan wrote:
> From: Michael McTernan <mmcternan at airvana.com>
>
> The Atmel AT45DBxxxD serial DataFlash parts allow software protection of
> specific device sectors.  This is detailed in section 8, "Sector
> Protection" of the data sheets available on their site (e.g.
> http://www.atmel.com/dyn/resources/prod_documents/doc3597.pdf).
>
> This patch expands the device probe tables to include sector geometry
> information, and issues the "enable sector protection command" after a
> compatible part is found and the build is configured with
> CONFIG_MTD_DATAFLASH_SWPROT.  The lock() and unlock() functions are then
> implemented to allow manipulation of the "sector protection register" in
> the device such that program/erase operations can be selectively allowed
> or blocked.  Note that this register is subject to a limit of 10,000
> erase/program cycles according to the datasheet.
>
> Devices ship with erase/program access allowed for the whole device by
> default, and operation of the driver is unchanged if
> CONFIG_MTD_DATAFLASH_SWPROT is not set.  It should not therefore cause a
> problem for existing devices to enable this option.
>
> This has been tested with the AT45DB321d, but the probe tables updated
> from data sheets such that it should work with the following parts:
>
>  AT45DB011D
>  AT45DB021D
>  AT45DB041D
>  AT45DB081D
>  AT45DB161D
>  AT45DB321D
>  AT45DB642D

Ulf Samuelsson seems to be big on dataflash stuff, and maybe David
Brownell can find some time to check this out ...

in case you guys havent seen this e-mail, here's the archive:
http://lists.infradead.org/pipermail/linux-mtd/2009-February/024692.html

> This is probably a one-off patch, so I've included it here rather than
> setting up a git tree.  Apologies for that.

you dont need to setup a git tree for people to pull from.  you can
clone one and use the regular git stuff one off:
git commit -a -s ......
git format-patch HEAD^
git send-email 0001-......
git reset --hard HEAD^

so now your repo again matches the one you cloned.  (yes, i know you
can get into creating local branches and blah blah but people not
familiar with git like to operate in this "classical" mode which is
more akin to svn).

since you seem to be using the Blackfin svn trunk, you can get the
same tree but via git here:
http://blackfin.uclinux.org/git/?p=readonly-mirrors/linux-kernel.git;a=summary

this would also fix the word-wrapping issues in this patch ...
-mike



More information about the linux-mtd mailing list