Skip to content

Commit 1799cd8

Browse files
sudip-mambarus
authored andcommitted
mtd: spi-nor: add SFDP fixups for Quad Page Program
SFDP table of some flash chips do not advertise support of Quad Input Page Program even though it has support. Use flags and add hardware cap for these chips. Signed-off-by: Sudip Mukherjee <[email protected]> [[email protected]: move pp setting in spi_nor_init_default_params] Signed-off-by: Tudor Ambarus <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent a30f53d commit 1799cd8

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

drivers/mtd/spi-nor/core.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2599,6 +2599,12 @@ static void spi_nor_init_default_params(struct spi_nor *nor)
25992599
params->hwcaps.mask |= SNOR_HWCAPS_PP;
26002600
spi_nor_set_pp_settings(&params->page_programs[SNOR_CMD_PP],
26012601
SPINOR_OP_PP, SNOR_PROTO_1_1_1);
2602+
2603+
if (info->flags & SPI_NOR_QUAD_PP) {
2604+
params->hwcaps.mask |= SNOR_HWCAPS_PP_1_1_4;
2605+
spi_nor_set_pp_settings(&params->page_programs[SNOR_CMD_PP_1_1_4],
2606+
SPINOR_OP_PP_1_1_4, SNOR_PROTO_1_1_4);
2607+
}
26022608
}
26032609

26042610
/**

drivers/mtd/spi-nor/core.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,7 @@ struct spi_nor_fixups {
458458
* SPI_NOR_NO_ERASE: no erase command needed.
459459
* NO_CHIP_ERASE: chip does not support chip erase.
460460
* SPI_NOR_NO_FR: can't do fastread.
461+
* SPI_NOR_QUAD_PP: flash supports Quad Input Page Program.
461462
*
462463
* @no_sfdp_flags: flags that indicate support that can be discovered via SFDP.
463464
* Used when SFDP tables are not defined in the flash. These
@@ -507,6 +508,7 @@ struct flash_info {
507508
#define SPI_NOR_NO_ERASE BIT(6)
508509
#define NO_CHIP_ERASE BIT(7)
509510
#define SPI_NOR_NO_FR BIT(8)
511+
#define SPI_NOR_QUAD_PP BIT(9)
510512

511513
u8 no_sfdp_flags;
512514
#define SPI_NOR_SKIP_SFDP BIT(0)

drivers/mtd/spi-nor/issi.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ static const struct flash_info issi_nor_parts[] = {
7373
{ "is25wp256", INFO(0x9d7019, 0, 0, 0)
7474
PARSE_SFDP
7575
FIXUP_FLAGS(SPI_NOR_4B_OPCODES)
76+
FLAGS(SPI_NOR_QUAD_PP)
7677
.fixups = &is25lp256_fixups },
7778

7879
/* PMC */

0 commit comments

Comments
 (0)