Skip to content

mtd: spi-nor: cleanups + block protection support updates

Brian Norris linux-mtd 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest10 patches 13 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10mtd: spi-nor: make implicit <linux/bitops.h> dependency explicitinclude/linux/mtd/spi-nor.h+2 -00 replies
2/10mtd: spi-nor: make bitfield constants more consistentinclude/linux/mtd/spi-nor.h+10 -100 replies
3/10mtd: spi-nor: add SPI NOR manufacturer IDsinclude/linux/mtd/spi-nor.h+15 -06 replies
4/10mtd: spi-nor: use SNOR_MFR_* instead of CFI_MFR_*drivers/mtd/spi-nor/spi-nor.c+11 -120 replies
5/10mtd: spi-nor: fixup kernel-doc for flash lock/unlock function pointersinclude/linux/mtd/spi-nor.h+2 -20 replies
6/10mtd: spi-nor: refactor block protection functionsdrivers/mtd/spi-nor/spi-nor.c+126 -450 replies
7/10mtd: spi-nor: add mtd_is_locked() supportdrivers/mtd/spi-nor/spi-nor.c include/linux/mtd/spi-nor.h+39 -16 replies
8/10mtd: spi-nor: add DUAL_READ for w25q{32,64}dwdrivers/mtd/spi-nor/spi-nor.c+2 -20 replies
9/10mtd: spi-nor: support lock/unlock/is_locked for Winbonddrivers/mtd/spi-nor/spi-nor.c+3 -20 replies
10/10mtd: spi-nor: disable protection for Winbond flash at startupdrivers/mtd/spi-nor/spi-nor.c+4 -30 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/10] mtd: spi-nor: cleanups + block protection support updates

[Note: as this is sent out during the merge window, it's based on the semi-unofficial l2-mtd.git/next branch, which is targeting 4.4, not 4.3]

Hi all,

I've been reviewing various spi-nor drivers as well as working with some Winbond flash to support new locking features. The former helped point out a few more things that could use some improvement, and the latter suggested that we have some glaring oversights in the spi-nor lock/unlock code.

<side note>
Some helpful companion code, for mtd-utils:

http://lists.infradead.org/pipermail/linux-mtd/2015-August/061526.html

This extends the flash_lock tool so that you can more easily test specific ranges, using:

  # flash_lock --lock /dev/mtdX <offset> <block-count>
  # flash_lock --unlock /dev/mtdX <offset> <block-count>
  # flash_lock --islocked /dev/mtdX <offset> <block-count>
</side note>

The first half of this series is fairly self-explanatory. The second might take a bit of thought, as a formulaic approach is a little more subtle than a table-based approach, so I tried to copy the relevant portions distilled from a few datasheets and include comments. Please shout if anything deserves more explanation or looks funny to you.

Highlights:

* clean up spi-nor.h header
* spi-nor now supports MEMISLOCKED
* MEM{LOCK,UNLOCK} support is a little more robust and extendible
* turn on dual/quad read for Winbond w25q{32,64}dw
* enable block protection for Winbond flash

Regards,
Brian

Brian Norris (10):
mtd: spi-nor: make implicit <linux/bitops.h> dependency explicit
mtd: spi-nor: make bitfield constants more consistent
mtd: spi-nor: add SPI NOR manufacturer IDs
mtd: spi-nor: use SNOR_MFR_* instead of CFI_MFR_*
mtd: spi-nor: fixup kernel-doc for flash lock/unlock function pointers
mtd: spi-nor: refactor block protection functions
mtd: spi-nor: add mtd_is_locked() support
mtd: spi-nor: add DUAL_READ for w25q{32,64}dw
mtd: spi-nor: support lock/unlock/is_locked for Winbond
mtd: spi-nor: disable protection for Winbond flash at startup

 drivers/mtd/spi-nor/spi-nor.c | 241 +++++++++++++++++++++++++++++++-----------
 include/linux/mtd/spi-nor.h   |  44 +++++---
 2 files changed, 211 insertions(+), 74 deletions(-)
Signature · 1 line
2.5.0.457.gab17608