Commit 4eddee70 authored by Miquel Raynal's avatar Miquel Raynal Committed by Tudor Ambarus

mtd: spi-nor: Add a RWW flag

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.
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/r/20230328154105.448540-7-miquel.raynal@bootlin.comSigned-off-by: default avatarTudor Ambarus <tudor.ambarus@linaro.org>
parent e96d4605
...@@ -2530,6 +2530,9 @@ static void spi_nor_init_flags(struct spi_nor *nor) ...@@ -2530,6 +2530,9 @@ static void spi_nor_init_flags(struct spi_nor *nor)
if (flags & NO_CHIP_ERASE) if (flags & NO_CHIP_ERASE)
nor->flags |= SNOR_F_NO_OP_CHIP_ERASE; nor->flags |= SNOR_F_NO_OP_CHIP_ERASE;
if (flags & SPI_NOR_RWW)
nor->flags |= SNOR_F_RWW;
} }
/** /**
......
...@@ -130,6 +130,7 @@ enum spi_nor_option_flags { ...@@ -130,6 +130,7 @@ enum spi_nor_option_flags {
SNOR_F_IO_MODE_EN_VOLATILE = BIT(11), SNOR_F_IO_MODE_EN_VOLATILE = BIT(11),
SNOR_F_SOFT_RESET = BIT(12), SNOR_F_SOFT_RESET = BIT(12),
SNOR_F_SWP_IS_VOLATILE = BIT(13), SNOR_F_SWP_IS_VOLATILE = BIT(13),
SNOR_F_RWW = BIT(14),
}; };
struct spi_nor_read_command { struct spi_nor_read_command {
...@@ -462,6 +463,7 @@ struct spi_nor_fixups { ...@@ -462,6 +463,7 @@ struct spi_nor_fixups {
* NO_CHIP_ERASE: chip does not support chip erase. * NO_CHIP_ERASE: chip does not support chip erase.
* SPI_NOR_NO_FR: can't do fastread. * SPI_NOR_NO_FR: can't do fastread.
* SPI_NOR_QUAD_PP: flash supports Quad Input Page Program. * SPI_NOR_QUAD_PP: flash supports Quad Input Page Program.
* SPI_NOR_RWW: flash supports reads while write.
* *
* @no_sfdp_flags: flags that indicate support that can be discovered via SFDP. * @no_sfdp_flags: flags that indicate support that can be discovered via SFDP.
* Used when SFDP tables are not defined in the flash. These * Used when SFDP tables are not defined in the flash. These
...@@ -513,6 +515,7 @@ struct flash_info { ...@@ -513,6 +515,7 @@ struct flash_info {
#define NO_CHIP_ERASE BIT(7) #define NO_CHIP_ERASE BIT(7)
#define SPI_NOR_NO_FR BIT(8) #define SPI_NOR_NO_FR BIT(8)
#define SPI_NOR_QUAD_PP BIT(9) #define SPI_NOR_QUAD_PP BIT(9)
#define SPI_NOR_RWW BIT(10)
u8 no_sfdp_flags; u8 no_sfdp_flags;
#define SPI_NOR_SKIP_SFDP BIT(0) #define SPI_NOR_SKIP_SFDP BIT(0)
......
...@@ -25,6 +25,7 @@ static const char *const snor_f_names[] = { ...@@ -25,6 +25,7 @@ static const char *const snor_f_names[] = {
SNOR_F_NAME(IO_MODE_EN_VOLATILE), SNOR_F_NAME(IO_MODE_EN_VOLATILE),
SNOR_F_NAME(SOFT_RESET), SNOR_F_NAME(SOFT_RESET),
SNOR_F_NAME(SWP_IS_VOLATILE), SNOR_F_NAME(SWP_IS_VOLATILE),
SNOR_F_NAME(RWW),
}; };
#undef SNOR_F_NAME #undef SNOR_F_NAME
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment