From: Tudor Ambarus <tudor.ambarus@microchip.com>
To: <michael@walle.cc>, <vigneshr@ti.com>, <p.yadav@ti.com>
Cc: <figgyc@figgyc.uk>, <mail@david-bauer.net>,
<linux@rasmusvillemoes.dk>, <esben@geanix.com>,
<knaerzche@gmail.com>, <code@reto-schneider.ch>,
<zhengxunli@mxic.com.tw>, <jaimeliao@mxic.com.tw>,
<heiko.thiery@gmail.com>, <macromorgan@hotmail.com>, <sr@denx.de>,
<miquel.raynal@bootlin.com>, <richard@nod.at>,
<linux-mtd@lists.infradead.org>,
<linux-arm-kernel@lists.infradead.org>,
<nicolas.ferre@microchip.com>,
"Tudor Ambarus" <tudor.ambarus@microchip.com>
Subject: [PATCH v2 35/35] docs: mtd: spi-nor: Add details about how to propose a new flash addition
Date: Tue, 27 Jul 2021 07:52:22 +0300 [thread overview]
Message-ID: <20210727045222.905056-36-tudor.ambarus@microchip.com> (raw)
In-Reply-To: <20210727045222.905056-1-tudor.ambarus@microchip.com>
Add some guideliness on how to propose a new flash addition.
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
Documentation/driver-api/mtd/spi-nor.rst | 65 ++++++++++++++++++++++++
1 file changed, 65 insertions(+)
diff --git a/Documentation/driver-api/mtd/spi-nor.rst b/Documentation/driver-api/mtd/spi-nor.rst
index 4a3adca417fd..ffb8d97a2766 100644
--- a/Documentation/driver-api/mtd/spi-nor.rst
+++ b/Documentation/driver-api/mtd/spi-nor.rst
@@ -66,3 +66,68 @@ when you want to write a new driver for a SPI NOR controller.
Another API is spi_nor_restore(), this is used to restore the status of SPI
flash chip such as addressing mode. Call it whenever detach the driver from
device or reboot the system.
+
+Part IV - How to propose a new flash addition?
+----------------------------------------------
+
+First we have to clarify where the new flash_info entry will reside. Typically
+each manufacturer have their own driver and the new flash will be placed in that
+specific manufacturer driver. There are cases however, where special care has to
+be taken. In case of flash ID collisions between different manufacturers, the
+place to add the new flash is in the manuf-id-collisions.c driver. ID collisions
+between flashes of the same manufacturer should be handled in their own
+manufacturer driver, macronix being an example. There will be a single
+flash_info entry for all the ID collisions of the same ID.
+
+manuf-id-collisions.c is the place to add new flash additions where the
+manufacturer is ignorant enough to not implement the ID continuation scheme
+that is described in the JEP106 JEDEC Standard. One has to dump its flash ID and
+compare it with the flash's manufacturer identification code that is defined in
+the JEP106 JEDEC Standard. If the manufacturer ID is defined in bank two or
+higher and the manufacturer does not implement the ID continuation scheme, then
+it is likely that the flash ID will collide with a manufacturer from bank one or
+with other manufacturer from other bank that does not implement the ID
+continuation scheme as well.
+
+flash_info entries will be added in a first come, first served manner. If there
+are ID collisions, differentiation between flashes will be done at runtime if
+possible. Where runtime differentiation is not possible, new compatibles will be
+introduced, but this will be done as a last resort.
+
+New flash additions that support the SFDP standard should be declared using
+SPI_NOR_PARSE_SFDP. Support that can be discovered when parsing SFDP should not
+be duplicated by explicit flags at flash declaration. All the SFDP flash
+parameters and settings will be discovered when parsing SFDP. There are
+flash_info flags that indicate support that is not SFDP discoverable. These
+flags initialize non SFDP support in the spi_nor_nonsfdp_flags_init() method.
+SPI_NOR_PARSE_SFDP is usually followed by other flash_info flags from the
+aforementioned function. Sometimes manufacturers wrongly define some fields in
+the SFDP tables. If that's the case, SFDP data can be amended with the fixups()
+hooks. It is not common, but if the SFDP tables are entirely wrong, and it does
+not worth the hassle to tweak the SFDP parameters by using the fixups hooks, or
+if the flash does not define the SFDP tables at all, then one can statically
+init the flash with the SPI_NOR_SKIP_SFDP flag and specify the rest of the flash
+capabilities with the flash info flags.
+
+With time we want to convert all flashes to either use SPI_NOR_PARSE_SFDP or
+SPI_NOR_SKIP_SFDP and stop triggering the SFDP parsing with the
+SPI_NOR_{DUAL, QUAD, OCTAL*}_READ flags. There are flashes that support QUAD
+mode but do not support the RDSFDP command, we should avoid issuing unsupported
+commands to flashes where possible. It is unlikely that RDSFDP will cause any
+problems, but still, it's better to avoid it. There are cases however of flash
+ID collisions between flashes that define the SFDP tables and flashes that don't
+(again, macronix). We usually differentiate between the two by issuing the
+RDSFDP command. In such a case one has to declare the SPI_NOR_PARSE_SFDP
+together with all the relevant flags from spi_nor_nonsfdp_flags_init() for the
+SFDP compatible flash, but should also declare the relevant flags that are used
+in the spi_nor_info_init_params() method in order to init support that can't be
+discovered via SFDP for the non-SFDP compatible flash.
+
+Every new flash addition that define the SFDP tables, should hexdump its SFDP
+tables in the patch's comment section below the --- line, so that we can
+reference it in case of ID collisions.
+
+Every flash_info flag declared should be tested. Typically one uses the
+mtd-utils and does an erase, verify erase, write, read back and compare test.
+Locking and other flags that are declared in the flash_info entry and used in
+the spi_nor_nonsfdp_flags_init() should be tested as well.
--
2.25.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2021-07-27 7:09 UTC|newest]
Thread overview: 133+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-27 4:51 [PATCH v2 00/35] mtd: spi-nor: Handle ID collisions and clean params init Tudor Ambarus
2021-07-27 4:51 ` [PATCH v2 01/35] mtd: spi-nor: core: Introduce SPI_NOR_PARSE_SFDP Tudor Ambarus
2021-08-04 8:09 ` Pratyush Yadav
2021-08-23 22:17 ` Michael Walle
2021-07-27 4:51 ` [PATCH v2 02/35] mtd: spi-nor: core: Report correct name in case of ID collisions Tudor Ambarus
2021-08-04 8:23 ` Pratyush Yadav
2021-08-23 22:32 ` Michael Walle
2021-07-27 4:51 ` [PATCH v2 03/35] mtd: spi-nor: macronix: Handle ID collision b/w MX25L3233F and MX25L3205D Tudor Ambarus
2021-08-23 22:42 ` Michael Walle
2021-10-01 8:41 ` Tudor.Ambarus
2021-07-27 4:51 ` [PATCH v2 04/35] mtd: spi-nor: macronix: Handle ID collision b/w MX25L12805D and MX25L12835F Tudor Ambarus
2021-08-23 22:44 ` Michael Walle
2021-07-27 4:51 ` [PATCH v2 05/35] mtd: spi-nor: Introduce Manufacturer ID collisions driver Tudor Ambarus
2021-08-16 18:28 ` Pratyush Yadav
2021-08-23 22:47 ` Michael Walle
2021-10-01 9:16 ` Tudor.Ambarus
2021-10-24 17:44 ` Michael Walle
2021-11-06 9:58 ` Tudor.Ambarus
2021-07-27 4:51 ` [PATCH v2 06/35] mtd: spi-nor: manuf-id-collisions: Add support for xt25f128b Tudor Ambarus
2021-07-27 15:52 ` Chris Morgan
2021-07-28 4:10 ` Tudor.Ambarus
2021-08-16 18:43 ` Pratyush Yadav
2021-10-01 9:26 ` Tudor.Ambarus
2021-07-27 4:51 ` [PATCH v2 07/35] mtd: spi-nor: manuf-id-collisions: Add support for xm25qh64c Tudor Ambarus
2021-08-16 18:45 ` Pratyush Yadav
2021-07-27 4:51 ` [PATCH v2 08/35] mtd: spi-nor: core: Introduce the ate_init() hook Tudor Ambarus
2021-08-16 18:54 ` Pratyush Yadav
2021-09-09 21:40 ` Michael Walle
2021-10-01 9:44 ` Tudor.Ambarus
2021-10-01 9:38 ` Tudor.Ambarus
2021-07-27 4:51 ` [PATCH v2 09/35] mtd: spi-nor: atmel: Use flash late_init() for locking Tudor Ambarus
2021-08-16 19:06 ` Pratyush Yadav
2021-09-09 21:44 ` Michael Walle
2021-10-01 11:40 ` Tudor.Ambarus
2021-10-02 12:58 ` Michael Walle
2021-10-11 6:27 ` Pratyush Yadav
2021-07-27 4:51 ` [PATCH v2 10/35] mtd: spi-nor: sst: " Tudor Ambarus
2021-08-16 19:09 ` Pratyush Yadav
2021-10-01 11:43 ` Tudor.Ambarus
2021-10-01 12:19 ` Pratyush Yadav
2021-09-09 21:52 ` Michael Walle
2021-07-27 4:51 ` [PATCH v2 11/35] mtd: spi-nor: winbond: Use manufacturer late_init() for OTP ops Tudor Ambarus
2021-08-16 19:17 ` Pratyush Yadav
2021-09-09 21:50 ` Michael Walle
2021-10-01 11:58 ` Tudor.Ambarus
2021-10-01 11:54 ` Tudor.Ambarus
2021-10-11 6:54 ` Pratyush Yadav
2021-07-27 4:51 ` [PATCH v2 12/35] mtd: spi-nor: xilinx: Use manufacturer late_init() to set setup method Tudor Ambarus
2021-08-16 19:19 ` Pratyush Yadav
2021-09-09 21:53 ` Michael Walle
2021-07-27 4:52 ` [PATCH v2 13/35] mtd: spi-nor: sst: Use manufacturer late_init() to set _write() Tudor Ambarus
2021-08-16 19:20 ` Pratyush Yadav
2021-09-09 21:54 ` Michael Walle
2021-07-27 4:52 ` [PATCH v2 14/35] mtd: spi-nor: spansion: Use manufacturer late_init() Tudor Ambarus
2021-08-16 19:22 ` Pratyush Yadav
2021-09-09 22:02 ` Michael Walle
2021-10-01 12:14 ` Tudor.Ambarus
2021-10-02 13:14 ` Michael Walle
2021-07-27 4:52 ` [PATCH v2 15/35] mtd: spi-nor: core: Call spi_nor_post_sfdp_fixups() only when SFDP is defined Tudor Ambarus
2021-08-16 19:31 ` Pratyush Yadav
2021-10-01 12:31 ` Tudor.Ambarus
2021-07-27 4:52 ` [PATCH v2 16/35] mtd: spi-nor: core: Mark default_init() as deprecated Tudor Ambarus
2021-08-16 19:36 ` Pratyush Yadav
2021-10-01 14:18 ` Tudor.Ambarus
2021-10-01 17:06 ` Pratyush Yadav
2021-07-27 4:52 ` [PATCH v2 17/35] mtd: spi-nor: Introduce spi_nor_nonsfdp_flags_init() Tudor Ambarus
2021-08-17 10:24 ` Pratyush Yadav
2021-08-17 12:15 ` Tudor.Ambarus
2021-10-22 11:21 ` Michael Walle
2021-10-22 12:10 ` Pratyush Yadav
2021-10-22 12:42 ` Tudor.Ambarus
2021-10-22 12:59 ` Michael Walle
2021-10-22 13:25 ` Tudor.Ambarus
2021-10-24 17:05 ` Michael Walle
2021-10-25 12:18 ` Tudor.Ambarus
2021-07-27 4:52 ` [PATCH v2 18/35] mtd: spi-nor: Get rid of SPI_NOR_4B_OPCODES flag Tudor Ambarus
2021-08-17 12:16 ` Pratyush Yadav
2021-10-04 3:18 ` Tudor.Ambarus
2021-10-19 17:26 ` Pratyush Yadav
2021-10-20 9:55 ` Tudor.Ambarus
2021-10-21 8:44 ` Tudor.Ambarus
2021-10-21 9:30 ` Pratyush Yadav
2021-10-22 11:37 ` Michael Walle
2021-10-22 12:43 ` Tudor.Ambarus
2021-07-27 4:52 ` [PATCH v2 19/35] mtd: spi-nor: Get rid of SPI_NOR_IO_MODE_EN_VOLATILE flag Tudor Ambarus
2021-08-17 12:21 ` Pratyush Yadav
2021-10-04 3:52 ` Tudor.Ambarus
2021-10-11 6:15 ` Pratyush Yadav
2021-07-27 4:52 ` [PATCH v2 20/35] mtd: spi-nor: core: Use container_of to get the pointer to struct spi_nor Tudor Ambarus
2021-07-27 7:08 ` Rasmus Villemoes
2021-10-22 8:00 ` Tudor.Ambarus
2021-08-17 12:23 ` Pratyush Yadav
2021-07-27 4:52 ` [PATCH v2 21/35] mtd: spi-nor: Introduce spi_nor_set_mtd_info() Tudor Ambarus
2021-08-16 7:25 ` Tudor.Ambarus
2021-08-17 16:23 ` Pratyush Yadav
2021-10-22 11:53 ` Michael Walle
2021-07-27 4:52 ` [PATCH v2 22/35] mtd: spi-nor: core: Use common naming scheme for setting mtd_info fields Tudor Ambarus
2021-08-17 16:26 ` Pratyush Yadav
2021-10-22 11:57 ` Michael Walle
2021-10-22 12:51 ` Tudor.Ambarus
2021-10-22 13:08 ` Michael Walle
2021-10-22 13:34 ` Tudor.Ambarus
2021-07-27 4:52 ` [PATCH v2 23/35] mtd: spi-nor: Get rid of nor->page_size Tudor Ambarus
2021-08-17 16:33 ` Pratyush Yadav
2021-10-22 12:01 ` Michael Walle
2021-07-27 4:52 ` [PATCH v2 24/35] mtd: spi-nor: core: Fix spi_nor_flash_parameter otp description Tudor Ambarus
2021-08-17 16:47 ` Pratyush Yadav
2021-10-22 12:07 ` Michael Walle
2021-07-27 4:52 ` [PATCH v2 25/35] mtd: spi-nor: core: Move spi_nor_set_addr_width() in spi_nor_setup() Tudor Ambarus
2021-08-17 16:52 ` Pratyush Yadav
2021-10-22 12:12 ` Michael Walle
2021-10-22 12:36 ` Tudor.Ambarus
2021-07-27 4:52 ` [PATCH v2 26/35] mtd: spi-nor: core: Introduce spi_nor_init_default_params() Tudor Ambarus
2021-08-24 17:30 ` Pratyush Yadav
2021-10-04 4:17 ` Tudor.Ambarus
2021-10-22 12:41 ` Michael Walle
2021-10-22 12:55 ` Tudor.Ambarus
2021-07-27 4:52 ` [PATCH v2 27/35] mtd: spi-nor: core: Init flash params based on SFDP first for new flash additions Tudor Ambarus
2021-08-24 17:51 ` Pratyush Yadav
2021-10-04 5:01 ` Tudor.Ambarus
2021-10-04 11:36 ` Tudor.Ambarus
2021-07-27 4:52 ` [PATCH v2 28/35] mtd: spi-nor: sst: sst26vf064b: Use SPI_NOR_PARSE_SFDP Tudor Ambarus
2021-07-27 4:52 ` [PATCH v2 29/35] mtd: spi-nor: winbond: w25q256jvm: " Tudor Ambarus
2021-07-27 4:52 ` [PATCH v2 30/35] mtd: spi-nor: issi: is25lp256: " Tudor Ambarus
2021-07-27 4:52 ` [PATCH v2 31/35] mtd: spi-nor: spansion: s25fl256s0: Skip SFDP parsing Tudor Ambarus
2021-07-27 4:52 ` [PATCH v2 32/35] mtd: spi-nor: gigadevice: gd25q256: Use SPI_NOR_PARSE_SFDP Tudor Ambarus
2021-07-27 4:52 ` [PATCH v2 33/35] mtd: spi-nor: micron-st: n25q256a: " Tudor Ambarus
2021-07-27 4:52 ` [PATCH v2 34/35] mtd: spi-nor: macronix: mx25l25635e: " Tudor Ambarus
2021-07-27 4:52 ` Tudor Ambarus [this message]
2021-07-27 7:22 ` [PATCH v2 35/35] docs: mtd: spi-nor: Add details about how to propose a new flash addition Michael Walle
2021-07-27 8:09 ` Tudor.Ambarus
2021-07-27 8:49 ` Michael Walle
2021-08-24 17:58 ` Pratyush Yadav
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210727045222.905056-36-tudor.ambarus@microchip.com \
--to=tudor.ambarus@microchip.com \
--cc=code@reto-schneider.ch \
--cc=esben@geanix.com \
--cc=figgyc@figgyc.uk \
--cc=heiko.thiery@gmail.com \
--cc=jaimeliao@mxic.com.tw \
--cc=knaerzche@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mtd@lists.infradead.org \
--cc=linux@rasmusvillemoes.dk \
--cc=macromorgan@hotmail.com \
--cc=mail@david-bauer.net \
--cc=michael@walle.cc \
--cc=miquel.raynal@bootlin.com \
--cc=nicolas.ferre@microchip.com \
--cc=p.yadav@ti.com \
--cc=richard@nod.at \
--cc=sr@denx.de \
--cc=vigneshr@ti.com \
--cc=zhengxunli@mxic.com.tw \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).