diff options
author | Michael Walle <michael@walle.cc> | 2021-03-03 21:18:19 +0100 |
---|---|---|
committer | Miquel Raynal <miquel.raynal@bootlin.com> | 2021-03-28 19:24:54 +0200 |
commit | e3c1f1c92d6ede3cfa09d6a103d3d1c1ef645e35 (patch) | |
tree | 3349a378304c85ffac78c3c2de03c6824ba23c95 /include/linux/mtd | |
parent | 1e97743fd180981bef5f01402342bb54bf1c6366 (diff) | |
download | linux-stable-e3c1f1c92d6ede3cfa09d6a103d3d1c1ef645e35.tar.gz linux-stable-e3c1f1c92d6ede3cfa09d6a103d3d1c1ef645e35.tar.bz2 linux-stable-e3c1f1c92d6ede3cfa09d6a103d3d1c1ef645e35.zip |
mtd: add OTP (one-time-programmable) erase ioctl
This may sound like a contradiction but some SPI-NOR flashes really
support erasing their OTP region until it is finally locked. Having the
possibility to erase an OTP region might come in handy during
development.
The ioctl argument follows the OTPLOCK style.
Signed-off-by: Michael Walle <michael@walle.cc>
Acked-by: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20210303201819.2752-1-michael@walle.cc
Diffstat (limited to 'include/linux/mtd')
-rw-r--r-- | include/linux/mtd/mtd.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index ceabc2cae8a4..4aac200ca8b5 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h @@ -337,6 +337,8 @@ struct mtd_info { size_t len, size_t *retlen, u_char *buf); int (*_lock_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len); + int (*_erase_user_prot_reg) (struct mtd_info *mtd, loff_t from, + size_t len); int (*_writev) (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to, size_t *retlen); void (*_sync) (struct mtd_info *mtd); @@ -518,6 +520,7 @@ int mtd_read_user_prot_reg(struct mtd_info *mtd, loff_t from, size_t len, int mtd_write_user_prot_reg(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, u_char *buf); int mtd_lock_user_prot_reg(struct mtd_info *mtd, loff_t from, size_t len); +int mtd_erase_user_prot_reg(struct mtd_info *mtd, loff_t from, size_t len); int mtd_writev(struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to, size_t *retlen); |