mtd: spi-nor: sst: Add support for Global Unlock on sst26vf
authorTudor Ambarus <tudor.ambarus@microchip.com>
Thu, 21 Jan 2021 11:05:46 +0000 (13:05 +0200)
committerTudor Ambarus <tudor.ambarus@microchip.com>
Fri, 5 Feb 2021 13:24:59 +0000 (15:24 +0200)
commit75386810d3a61f4bb9e180774291454f7235b8b3
tree66e21332f91193ea23426d9c87e857930b3c68e7
parenta7a5acba0e06b8f9923faa1a726f0ac1380b719a
mtd: spi-nor: sst: Add support for Global Unlock on sst26vf

Even if sst26vf shares the SPINOR_OP_GBULK opcode with
Macronix (ex. MX25U12835F) and Winbound (ex. W25Q128FV),
it has its own Individual Block Protection scheme, which
is also capable to read-lock individual parameter blocks.
Thus the sst26vf's Individual Block Protection scheme will
reside in the sst.c manufacturer driver.

Add support to unlock the entire flash memory. The device
is write-protected by default after a power-on reset cycle
(volatile software protection), in order to avoid inadvertent
writes during power-up. Could do an erase, write, read back,
and compare when MTD_SPI_NOR_SWP_DISABLE_ON_VOLATILE=y.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Reviewed-by: Michael Walle <michael@walle.cc>
Link: https://lore.kernel.org/r/20210121110546.382633-2-tudor.ambarus@microchip.com
drivers/mtd/spi-nor/core.c
drivers/mtd/spi-nor/core.h
drivers/mtd/spi-nor/sst.c