All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] spi-nor block protection
@ 2019-01-29 22:07 Jonas Bonn
  2019-01-29 22:07 ` [PATCH v2 1/3] mtd: spi-nor: always respect write-protect input Jonas Bonn
                   ` (3 more replies)
  0 siblings, 4 replies; 24+ messages in thread
From: Jonas Bonn @ 2019-01-29 22:07 UTC (permalink / raw)
  To: linux-mtd; +Cc: Jonas Bonn

Changed in v2:
* Provide the below cover letter
* Rebase patches so they apply cleanly on linux-next


In order to make device that's effectively read-only except to an
authorized user we need:

i)  Some way of defaulting block-protection to on when device is first
powered
ii)  Some way of controlling the write-protect signal so that the BP
(block protect) bits can't be changed

Some SPI flashes support the BPNV configuration register bit:  block
protect non-volatile.  When this bit is set, the block protection bits
BP0, BP1, and BP2 default to 1, effectively causing the flash memory to
becomes read-only at power on.  If we can set this bit, we solve problem
i) above.

Controlling the write-protect input is a matter for something external
to the flash itself.  Unfortunately, the WP# signal is only honoured if
the status register bit SRWD (status register write disable) is set.  If
we can have this bit always set, then we solve problem ii) above.

This short patch series provides the above bits, allowing for the
creation of a device that's effectively read-only to any actor who isn't
able to control the WP# signal.

Jonas Bonn (3):
  mtd: spi-nor: always respect write-protect input
  mtd: spi-nor: s25fl512s supports region locking
  mtd: spi-nor: allow setting the BPNV (default locked) bit

 drivers/mtd/mtdchar.c         |   6 ++
 drivers/mtd/mtdcore.c         |   8 +++
 drivers/mtd/spi-nor/spi-nor.c | 119 ++++++++++++++++++++++------------
 include/linux/mtd/mtd.h       |   2 +
 include/linux/mtd/spi-nor.h   |   1 +
 include/uapi/mtd/mtd-abi.h    |   1 +
 6 files changed, 97 insertions(+), 40 deletions(-)

-- 
2.19.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2019-04-27  6:23 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-29 22:07 [PATCH v2 0/3] spi-nor block protection Jonas Bonn
2019-01-29 22:07 ` [PATCH v2 1/3] mtd: spi-nor: always respect write-protect input Jonas Bonn
2019-03-10  9:58   ` Tudor.Ambarus
2019-03-10 10:42     ` Jonas Bonn
2019-03-11 14:05       ` Tudor.Ambarus
2019-03-11 20:14         ` Yong Qin
2019-03-12  9:29           ` Tudor.Ambarus
2019-03-12 19:27             ` Yong Qin
2019-03-19  6:59               ` Tudor.Ambarus
2019-03-19  7:13                 ` Jonas Bonn
2019-03-20  6:33                   ` Tudor.Ambarus
2019-03-20  7:06                     ` Jonas Bonn
2019-03-20  7:33                       ` Tudor.Ambarus
2019-03-20  7:39                         ` Jonas Bonn
2019-03-20 18:56                           ` Yong Qin
2019-03-20 21:05                             ` Jonas Bonn
2019-04-02  7:12                               ` Tudor.Ambarus
2019-04-27  6:23                                 ` [PATCH v3 1/1] " Jonas Bonn
2019-01-29 22:07 ` [PATCH v2 2/3] mtd: spi-nor: s25fl512s supports region locking Jonas Bonn
2019-03-19 16:30   ` Tudor.Ambarus
2019-01-29 22:07 ` [PATCH v2 3/3] mtd: spi-nor: allow setting the BPNV (default locked) bit Jonas Bonn
2019-03-10 10:06   ` Tudor.Ambarus
2019-02-14  9:21 ` [PATCH v2 0/3] spi-nor block protection Jonas Bonn
2019-02-14  9:33   ` Tudor.Ambarus

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.