[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210604100252.9975-1-michael@walle.cc>
Date: Fri, 4 Jun 2021 12:02:47 +0200
From: Michael Walle <michael@...le.cc>
To: linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org
Cc: Tudor Ambarus <tudor.ambarus@...rochip.com>,
Michael Walle <michael@...le.cc>,
Pratyush Yadav <p.yadav@...com>,
Miquel Raynal <miquel.raynal@...tlin.com>,
Richard Weinberger <richard@....at>,
Vignesh Raghavendra <vigneshr@...com>
Subject: [PATCH v5 0/5] mtd: spi-nor: otp: 4 byte mode fix and erase support
This series is the follow up on the single patch
mtd: spi-nor: implement OTP erase for Winbond and similar flashes
Pratyush Yadav discovered a likely problem with bigger flashes, the address
to access the security registers is either 3 or 4 byte (at least for
winbond flashes).
Changes since v4:
- add new patch to get rid taking the spi lock if length is zero. Please
note, that I didn't squash this into the "Fixes:" patch because it is
unrelated to the actual bug.
- add comment which explains that we could also branch on an error in
spi_nor_mtd_otp_range_is_locked()
- check zero length in spi_nor_mtd_otp_erase() and return early before
taking the lock
Changes since v3:
- new patch to check for read-only OTP regions before writing
- clarify term "security register"
- don't combine lock and erase functions anymore. there are now
more difference than similarities.
Changes since v2:
- fix 3/4 byte mode access
- use spi_nor_erase_sector() by swapping the nor->erase_opcode
- use more consistent wording regarding the security registers
Changes since v1:
- fixed kernel doc
Michael Walle (5):
mtd: spi-nor: otp: fix access to security registers in 4 byte mode
mtd: spi-nor: otp: use more consistent wording
mtd: spi-nor: otp: return -EROFS if region is read-only
mtd: spi-nor: otp: simplify length check
mtd: spi-nor: otp: implement erase for Winbond and similar flashes
drivers/mtd/spi-nor/core.c | 2 +-
drivers/mtd/spi-nor/core.h | 4 +
drivers/mtd/spi-nor/otp.c | 156 +++++++++++++++++++++++++++++++---
drivers/mtd/spi-nor/winbond.c | 1 +
4 files changed, 149 insertions(+), 14 deletions(-)
--
2.20.1
Powered by blists - more mailing lists