[PATCH v3] mtd: m25p80: Calculate flash block protect bits based on number of sectors
Marek Vasut
marex at denx.de
Wed Apr 16 16:22:20 PDT 2014
On Wednesday, April 16, 2014 at 02:37:13 PM, Austin Boyle wrote:
> This patch generalises the calculation of block protect bits based on the
> number of sectors and implements the _is_locked function.
>
> Existing calculation of block protect bits only works for devices with 64
> sectors or more. This new logic is applicable to the STmicro devices:
> m25p10, p20, p40, p80, p16, pe16, p32, p64, p128.
> Note devices with >64 sectors only allow the protected region to be
> specified to a resolution of 1/64th of the total size (such as m25p64).
>
> New return codes for ioctl(MEMISLOCKED) have been added to
> uapi/mtd/mtd-abi.h because the _is_locked function can query a region
> which is partially unlocked.
>
> Added flag to m25p_ids table to indicate if flash protection is supported.
>
> Added n_sectors and sector_size to m25p flash structure so it can be used
> in block protect bit calculation.
>
> From: Austin Boyle <boyle.austin at gmail.com>
> Signed-off-by: Austin Boyle <boyle.austin at gmail.com>
Acked-by: Marek Vasut <marex at denx.de>
Thanks!
Best regards,
Marek Vasut
More information about the linux-mtd
mailing list