All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/3] spi-nor block protection
@ 2019-03-20  7:16 Jonas Bonn
  2019-03-20  7:16 ` [PATCH v4 1/3] spi-nor: always respect write-protect input Jonas Bonn
                   ` (2 more replies)
  0 siblings, 3 replies; 62+ messages in thread
From: Jonas Bonn @ 2019-03-20  7:16 UTC (permalink / raw)
  To: linux-mtd; +Cc: Jonas Bonn, tudor.ambarus

Changed in v4:
* Send to right mailing list! :)
* Re-add BPNV patch so that the idea does not get lost... undecided what
to do with it, still.

Changed in v3:
* Fix up patch esthetics
* Drop BPNV patch from series

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):
  spi-nor: always respect write-protect input
  spi-nor: s25fl512s supports region locking
  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, 99 insertions(+), 38 deletions(-)

-- 
2.19.1


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

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

end of thread, other threads:[~2019-06-19 18:51 UTC | newest]

Thread overview: 62+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-20  7:16 [PATCH v4 0/3] spi-nor block protection Jonas Bonn
2019-03-20  7:16 ` [PATCH v4 1/3] spi-nor: always respect write-protect input Jonas Bonn
2019-03-20  7:16 ` [PATCH v4 2/3] spi-nor: s25fl512s supports region locking Jonas Bonn
2019-03-20  7:39   ` Tudor.Ambarus
2019-03-21 16:48   ` Tudor.Ambarus
2019-05-07  9:53   ` Geert Uytterhoeven
2019-05-07  9:53     ` Geert Uytterhoeven
2019-05-07 10:42     ` Tudor.Ambarus
2019-05-07 10:42       ` Tudor.Ambarus
2019-05-07 10:50       ` Geert Uytterhoeven
2019-05-07 10:50         ` Geert Uytterhoeven
2019-05-07 11:13         ` Jonas Bonn
2019-05-07 11:13           ` Jonas Bonn
2019-05-07 12:52           ` Geert Uytterhoeven
2019-05-07 12:52             ` Geert Uytterhoeven
2019-05-07 13:15             ` Tudor.Ambarus
2019-05-07 13:15               ` Tudor.Ambarus
2019-05-07 13:18               ` Tudor.Ambarus
2019-05-07 13:18                 ` Tudor.Ambarus
2019-05-07 13:25               ` Tudor.Ambarus
2019-05-07 13:25                 ` Tudor.Ambarus
2019-05-07 14:33                 ` Geert Uytterhoeven
2019-05-07 14:33                   ` Geert Uytterhoeven
2019-05-08 10:44                   ` Tudor.Ambarus
2019-05-08 10:44                     ` Tudor.Ambarus
2019-05-08 13:11                     ` Geert Uytterhoeven
2019-05-08 13:11                       ` Geert Uytterhoeven
2019-05-08 14:23                       ` Tudor.Ambarus
2019-05-08 14:23                         ` Tudor.Ambarus
2019-05-08 17:00                         ` Geert Uytterhoeven
2019-05-08 17:00                           ` Geert Uytterhoeven
2019-05-09  6:55                           ` Tudor.Ambarus
2019-05-09  6:55                             ` Tudor.Ambarus
2019-05-09  9:11                             ` Geert Uytterhoeven
2019-05-09  9:11                               ` Geert Uytterhoeven
2019-05-09 10:31                               ` Tudor.Ambarus
2019-05-09 10:31                                 ` Tudor.Ambarus
2019-05-09 11:12                                 ` Geert Uytterhoeven
2019-05-09 11:12                                   ` Geert Uytterhoeven
2019-05-22 15:49                                   ` Tudor.Ambarus
2019-05-22 15:49                                     ` Tudor.Ambarus
2019-06-10  6:24                                     ` [PATCH] mtd: spi-nor: use 16-bit WRR command when QE is set on spansion flashes Tudor.Ambarus
2019-06-10  6:24                                       ` Tudor.Ambarus
2019-06-10  9:28                                       ` Jonas Bonn
2019-06-10  9:28                                         ` Jonas Bonn
2019-06-11  8:35                                       ` Geert Uytterhoeven
2019-06-11  8:35                                         ` Geert Uytterhoeven
2019-06-19 15:47                                         ` Tudor.Ambarus
2019-06-19 15:47                                           ` Tudor.Ambarus
2019-06-19 17:26                                           ` [PATCH v2 1/2] " Tudor.Ambarus
2019-06-19 17:26                                             ` Tudor.Ambarus
2019-06-19 17:26                                             ` [PATCH v2 2/2] mtd: spi-nor: fix description for int (*flash_is_locked)() Tudor.Ambarus
2019-06-19 17:26                                               ` Tudor.Ambarus
2019-06-19 18:51                                           ` [PATCH] mtd: spi-nor: use 16-bit WRR command when QE is set on spansion flashes Geert Uytterhoeven
2019-06-19 18:51                                             ` Geert Uytterhoeven
2019-06-12 16:46                                       ` Vignesh Raghavendra
2019-06-12 16:46                                         ` Vignesh Raghavendra
2019-05-09 15:57                                 ` [PATCH v4 2/3] spi-nor: s25fl512s supports region locking Vignesh Raghavendra
2019-05-09 15:57                                   ` Vignesh Raghavendra
2019-03-20  7:16 ` [PATCH v4 3/3] spi-nor: allow setting the BPNV (default locked) bit Jonas Bonn
2019-04-02  5:27   ` Vignesh Raghavendra
2019-05-01  4:42     ` [PATCH v5 1/1] spi-nor: allow setting the BPNV (powerup lock) bit Jonas Bonn

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.