linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] mtd: spi-nor: support dumping sfdp tables
@ 2021-03-18  9:24 Michael Walle
  2021-03-18  9:24 ` [PATCH 1/2] mtd: spi-nor: sfdp: save a copy of the SFDP data Michael Walle
  2021-03-18  9:24 ` [PATCH 2/2] mtd: spi-nor: add initial sysfs support Michael Walle
  0 siblings, 2 replies; 22+ messages in thread
From: Michael Walle @ 2021-03-18  9:24 UTC (permalink / raw)
  To: linux-kernel, linux-mtd
  Cc: Tudor Ambarus, Pratyush Yadav, Miquel Raynal, Richard Weinberger,
	Vignesh Raghavendra, Michael Walle

Add the possibility to dump the SFDP data of a flash device.

More and more flash devices share the same flash ID and we need per device
fixups. Usually, these fixups differentiate flashes by looking at
differences in the SFDP data. Determining the difference is only possible
if we have the SFDP data for all the flashes which share a flash ID. This
will lay the foundation to dump the whole SFDP data of a flash device.

This is even more important, because some datasheets doesn't even contain
the SFDP data. Fixups for these kind of flashes are nearly impossible to
do.

I envision having a database of all the SFDP data for the flashes we
support and make it a requirement to submit it when a new flash is added.
This might or might not have legal implications. Thus I'd start with having
that database private to the SPI NOR maintainers.

Changes since RFC:
 - Don't read SFDP data after probe. The flash might already be switched to
   8D-8D-8D mode. Instead, cache the SFDP data
 - add two sysfs files: jedec-id and name
 - change the file mode of the sfdp file from 0400 to 0444. There is no
   hardware access anymore.

Michael Walle (2):
  mtd: spi-nor: sfdp: save a copy of the SFDP data
  mtd: spi-nor: add initial sysfs support

 drivers/mtd/spi-nor/Makefile |  2 +-
 drivers/mtd/spi-nor/core.c   |  5 +++
 drivers/mtd/spi-nor/core.h   | 13 ++++++
 drivers/mtd/spi-nor/sfdp.c   | 49 ++++++++++++++++++++
 drivers/mtd/spi-nor/sysfs.c  | 86 ++++++++++++++++++++++++++++++++++++
 include/linux/mtd/spi-nor.h  |  3 ++
 6 files changed, 157 insertions(+), 1 deletion(-)
 create mode 100644 drivers/mtd/spi-nor/sysfs.c

-- 
2.20.1


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

end of thread, other threads:[~2021-04-29 15:46 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-18  9:24 [PATCH 0/2] mtd: spi-nor: support dumping sfdp tables Michael Walle
2021-03-18  9:24 ` [PATCH 1/2] mtd: spi-nor: sfdp: save a copy of the SFDP data Michael Walle
2021-03-22 14:21   ` Pratyush Yadav
2021-03-22 15:32     ` Michael Walle
2021-03-22 15:48       ` Michael Walle
2021-03-22 18:42       ` Pratyush Yadav
2021-03-22 22:31         ` Michael Walle
2021-03-23  9:37           ` Pratyush Yadav
2021-04-05 13:11   ` Tudor.Ambarus
2021-04-05 15:07     ` Michael Walle
2021-04-05 15:42       ` Tudor.Ambarus
2021-04-05 16:03         ` Michael Walle
2021-03-18  9:24 ` [PATCH 2/2] mtd: spi-nor: add initial sysfs support Michael Walle
2021-03-20  4:16   ` Yicong Yang
2021-03-20 19:17     ` Michael Walle
2021-03-22 14:43   ` Pratyush Yadav
2021-03-22 14:57     ` Michael Walle
2021-04-06  7:56   ` Vignesh Raghavendra
2021-04-06  8:47     ` Michael Walle
2021-04-06 11:43       ` Vignesh Raghavendra
2021-04-29 15:37   ` Alexander Williams
2021-04-29 15:46     ` Michael Walle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).