diff mbox series

[v4,6/8] mtd: spi-nor: Add a RWW flag

Message ID 20230201113603.293758-7-miquel.raynal@bootlin.com (mailing list archive)
State New, archived
Headers show
Series mtd: spi-nor: read while write support | expand

Commit Message

Miquel Raynal Feb. 1, 2023, 11:36 a.m. UTC
Introduce a new (no SFDP) flag for the feature that we are about to
support: Read While Write. This means, if the chip has several banks and
supports RWW, once a page of data to write has been transferred into the
chip's internal SRAM, another read operation happening on a different
bank can be performed during the tPROG delay.

Adding this new flag involves enlarging the no_sfdp_flags variable to 16
bits.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/spi-nor/core.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Tudor Ambarus March 17, 2023, 3:20 a.m. UTC | #1
Hi, Miquel!

On 2/1/23 11:36, Miquel Raynal wrote:
> Introduce a new (no SFDP) flag for the feature that we are about to
> support: Read While Write. This means, if the chip has several banks and
> supports RWW, once a page of data to write has been transferred into the
> chip's internal SRAM, another read operation happening on a different
> bank can be performed during the tPROG delay.
> 
> Adding this new flag involves enlarging the no_sfdp_flags variable to 16
> bits.
> 

I've just skimmed over jesd216 - f version, and indeed it seems that
reads while write support is not covered by the standard. no_sfdp_flags
is not a good place to add this flag, because there can be flashes that
both support SFDP and RWW support. Please move this flag in info->flags.

BTW, does you flash define SFDP table(s)? You can dump the tables via
sysfs, here's an example:
https://lore.kernel.org/linux-mtd/20230203044853.23513-1-Takahiro.Kuwano@infineon.com/

Cheers,
ta
diff mbox series

Patch

diff --git a/drivers/mtd/spi-nor/core.h b/drivers/mtd/spi-nor/core.h
index 888a08c37d8c..aebd92f4884f 100644
--- a/drivers/mtd/spi-nor/core.h
+++ b/drivers/mtd/spi-nor/core.h
@@ -473,6 +473,7 @@  struct spi_nor_fixups {
  *   SPI_NOR_OCTAL_READ:      flash supports Octal Read.
  *   SPI_NOR_OCTAL_DTR_READ:  flash supports octal DTR Read.
  *   SPI_NOR_OCTAL_DTR_PP:    flash supports Octal DTR Page Program.
+ *   SPI_NOR_RWW:             flash supports reads while write.
  *
  * @fixup_flags:    flags that indicate support that can be discovered via SFDP
  *                  ideally, but can not be discovered for this particular flash
@@ -514,7 +515,7 @@  struct flash_info {
 #define SPI_NOR_NO_FR			BIT(8)
 #define SPI_NOR_QUAD_PP			BIT(9)
 
-	u8 no_sfdp_flags;
+	u16 no_sfdp_flags;
 #define SPI_NOR_SKIP_SFDP		BIT(0)
 #define SECT_4K				BIT(1)
 #define SPI_NOR_DUAL_READ		BIT(3)
@@ -522,6 +523,7 @@  struct flash_info {
 #define SPI_NOR_OCTAL_READ		BIT(5)
 #define SPI_NOR_OCTAL_DTR_READ		BIT(6)
 #define SPI_NOR_OCTAL_DTR_PP		BIT(7)
+#define SPI_NOR_RWW			BIT(8)
 
 	u8 fixup_flags;
 #define SPI_NOR_4B_OPCODES		BIT(0)