mtd: spi-nor: Enable DTR octal flash program
PATCH 6/30 mtd: spi-nor: Enable DTR octal flash program
From: Ashok Reddy Soma <[email protected]>
Define a flag SPI_NOR_OCTAL_DTR_PP and if enabled in spi-nor-ids table, enable octal DTR page program in the framework.
Signed-off-by Ashok Reddy Soma <[email protected]>
Signed-off-by Tejas Bhumkar <[email protected]>
--- drivers/mtd/spi/sf_internal.h | 1 + drivers/mtd/spi/spi-nor-core.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/mtd/spi/sf_internal.h +1 -0
@@ -69,6 +69,7 @@ struct flash_info {#define SPI_NOR_HAS_SST26LOCK BIT(15)/* Flash supports lock/unlock via BPR */ #define SPI_NOR_OCTAL_READ BIT(16)/* Flash supports Octal Read */ #define SPI_NOR_OCTAL_DTR_READ BIT(17)/* Flash supports Octal DTR Read */ +#define SPI_NOR_OCTAL_DTR_PP BIT(18)/* Flash supports Octal DTR page program */ };extern const struct flash_info spi_nor_ids[];
drivers/mtd/spi/spi-nor-core.c +2 -1
@@ -3026,7 +3026,8 @@ static int spi_nor_init_params(struct spi_nor *nor,* Since xSPI Page Program opcode is backward compatible with * Legacy SPI, use Legacy SPI opcode there as well. */ -if (CONFIG_IS_ENABLED (SPI_FLASH_DTR_ENABLE )) { +if (CONFIG_IS_ENABLED (SPI_FLASH_DTR_ENABLE ) && info->flags &SPI_NOR_OCTAL_DTR_PP ) { + params->hwcaps.mask |=SNOR_HWCAPS_PP_8_8_8_DTR ;spi_nor_set_pp_settings (¶ms->page_programs[SNOR_CMD_PP_8_8_8_DTR ],SPINOR_OP_PP ,SNOR_PROTO_8_8_8_DTR ); }
Signature · 1 line
2.27.0