Skip to content

Commit 9c1b1cc

Browse files
ambarusvarshini-rajendran
authored andcommitted
mtd: spi-nor: core: Introduce SPI_NOR_SOFT_RESET flash_info fixup_flag
The Soft Reset and Rescue Sequence Support is defined in BFPT_DWORD(16) starting with JESD216A. The first version of SFDP, JESD216 (April 2011), defines just the first 9 BFPT DWORDS, thus it does not contain information about the Software Reset and Rescue Support. Since this support can not be discovered by parsing the first SFDP version, introduce a flash_info fixup_flag that will be used either by flashes that define JESD216 (April 2011) or by flashes that do not define SFDP at all. In case a flash defines BFPT_DWORD(16) but with wrong values, one should instead use a post_bfpt() hook and set SNOR_F_SOFT_RESET. Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: Pratyush Yadav <p.yadav@ti.com> Link: https://lore.kernel.org/r/20220209133656.374903-7-tudor.ambarus@microchip.com
1 parent 5e9df83 commit 9c1b1cc

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

drivers/mtd/spi-nor/core.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2891,6 +2891,9 @@ static void spi_nor_init_fixup_flags(struct spi_nor *nor)
28912891

28922892
if (fixup_flags & SPI_NOR_IO_MODE_EN_VOLATILE)
28932893
nor->flags |= SNOR_F_IO_MODE_EN_VOLATILE;
2894+
2895+
if (fixup_flags & SPI_NOR_SOFT_RESET)
2896+
nor->flags |= SNOR_F_SOFT_RESET;
28942897
}
28952898

28962899
/**

drivers/mtd/spi-nor/core.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,8 @@ struct spi_nor_fixups {
495495
* memory size above 128Mib.
496496
* SPI_NOR_IO_MODE_EN_VOLATILE: flash enables the best available I/O mode
497497
* via a volatile bit.
498+
* SPI_NOR_SOFT_RESET: flash supports software reset enable, reset
499+
* sequence.
498500
* @mfr_flags: manufacturer private flags. Used in the manufacturer fixup
499501
* hooks to differentiate support between flashes of the same
500502
* manufacturer.
@@ -537,6 +539,7 @@ struct flash_info {
537539
u8 fixup_flags;
538540
#define SPI_NOR_4B_OPCODES BIT(0)
539541
#define SPI_NOR_IO_MODE_EN_VOLATILE BIT(1)
542+
#define SPI_NOR_SOFT_RESET BIT(2)
540543

541544
u8 mfr_flags;
542545

0 commit comments

Comments
 (0)