mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
mtd: spi-nor: add SFDP fixups for Quad Page Program
[ Upstream commit1799cd8540] 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 <sudip.mukherjee@sifive.com> [tudor.ambarus@microchip.com: move pp setting in spi_nor_init_default_params] Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> Link: https://lore.kernel.org/r/20220920184808.44876-2-sudip.mukherjee@sifive.com Stable-dep-of:9fd0945fe6("mtd: spi-nor: spansion: Enable JFFS2 write buffer for Infineon s28hx SEMPER flash") Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
de26d26f55
commit
897a40dbcf
@@ -2578,6 +2578,12 @@ static void spi_nor_init_default_params(struct spi_nor *nor)
|
|||||||
params->hwcaps.mask |= SNOR_HWCAPS_PP;
|
params->hwcaps.mask |= SNOR_HWCAPS_PP;
|
||||||
spi_nor_set_pp_settings(¶ms->page_programs[SNOR_CMD_PP],
|
spi_nor_set_pp_settings(¶ms->page_programs[SNOR_CMD_PP],
|
||||||
SPINOR_OP_PP, SNOR_PROTO_1_1_1);
|
SPINOR_OP_PP, SNOR_PROTO_1_1_1);
|
||||||
|
|
||||||
|
if (info->flags & SPI_NOR_QUAD_PP) {
|
||||||
|
params->hwcaps.mask |= SNOR_HWCAPS_PP_1_1_4;
|
||||||
|
spi_nor_set_pp_settings(¶ms->page_programs[SNOR_CMD_PP_1_1_4],
|
||||||
|
SPINOR_OP_PP_1_1_4, SNOR_PROTO_1_1_4);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -458,6 +458,7 @@ struct spi_nor_fixups {
|
|||||||
* SPI_NOR_NO_ERASE: no erase command needed.
|
* SPI_NOR_NO_ERASE: no erase command needed.
|
||||||
* 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.
|
||||||
*
|
*
|
||||||
* @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
|
||||||
@@ -507,6 +508,7 @@ struct flash_info {
|
|||||||
#define SPI_NOR_NO_ERASE BIT(6)
|
#define SPI_NOR_NO_ERASE BIT(6)
|
||||||
#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)
|
||||||
|
|
||||||
u8 no_sfdp_flags;
|
u8 no_sfdp_flags;
|
||||||
#define SPI_NOR_SKIP_SFDP BIT(0)
|
#define SPI_NOR_SKIP_SFDP BIT(0)
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ static const struct flash_info issi_nor_parts[] = {
|
|||||||
{ "is25wp256", INFO(0x9d7019, 0, 64 * 1024, 512)
|
{ "is25wp256", INFO(0x9d7019, 0, 64 * 1024, 512)
|
||||||
NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ)
|
NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ)
|
||||||
FIXUP_FLAGS(SPI_NOR_4B_OPCODES)
|
FIXUP_FLAGS(SPI_NOR_4B_OPCODES)
|
||||||
|
FLAGS(SPI_NOR_QUAD_PP)
|
||||||
.fixups = &is25lp256_fixups },
|
.fixups = &is25lp256_fixups },
|
||||||
|
|
||||||
/* PMC */
|
/* PMC */
|
||||||
|
|||||||
Reference in New Issue
Block a user