From patchwork Thu Mar 26 11:42:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 244321 List-Id: U-Boot discussion From: rasmus.villemoes at prevas.dk (Rasmus Villemoes) Date: Thu, 26 Mar 2020 12:42:54 +0100 Subject: [PATCH 0/3] mtd: spi-nor: add support for locking on Macronix nor flashes Message-ID: <20200326114257.1782-1-rasmus.villemoes@prevas.dk> Here's an attempt at implementing locking support for Macronix flashes. I've tested that it works on the chip used on our boards, and reading data sheets for various other Macronix chips suggest they behave in the same way. I'm still not entirely sure about the best way to hook up these functions in spi_nor_scan. Also, I'm ignoring the UI/UX issue of automatically setting a OTP bit without some "force" or "yes, I'm sure" opt-in - maybe I'm simply overthinking it and it's not a problem in practice (at least for our use case at hand, we will use bottom protect, so we can't really shoot ourselves in the foot). Rasmus Villemoes (3): mtd: spi-nor: don't guard stm_*lock* family by preprocessor conditionals mtd: spi-nor: add support for locking on Macronix nor flashes mtd: spi-nor: set SPI_NOR_HAS_LOCK for Macronix mx25l3205d drivers/mtd/spi/spi-nor-core.c | 268 ++++++++++++++++++++++++++++----- drivers/mtd/spi/spi-nor-ids.c | 2 +- include/linux/mtd/spi-nor.h | 3 + 3 files changed, 236 insertions(+), 37 deletions(-)