From 5fae920250af99b41166e4e1997ef99395474d9f Mon Sep 17 00:00:00 2001 From: Vipul Kumar Date: Mon, 27 Nov 2017 11:39:18 +0530 Subject: [PATCH] mtd: spi-nor: Added flags for ISSI 256Mb 1.8v and 3.3v part Added RD_QUAD flag and enabled quad_enable() func for is25lp256d and is25wp256d flash parts. Signed-off-by: Vipul Kumar Signed-off-by: Michal Simek --- drivers/mtd/spi/spi_flash.c | 6 ++++-- drivers/mtd/spi/spi_flash_ids.c | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c index 3ecbce45424..506f6e0e178 100644 --- a/drivers/mtd/spi/spi_flash.c +++ b/drivers/mtd/spi/spi_flash.c @@ -1211,8 +1211,9 @@ static int set_quad_mode(struct spi_flash *flash, const struct spi_flash_info *info) { switch (JEDEC_MFR(info)) { -#ifdef CONFIG_SPI_FLASH_MACRONIX +#if defined(CONFIG_SPI_FLASH_MACRONIX) || defined(CONFIG_SPI_FLASH_ISSI) case SPI_FLASH_CFI_MFR_MACRONIX: + case SPI_FLASH_CFI_MFR_ISSI: return macronix_quad_enable(flash); #endif #if defined(CONFIG_SPI_FLASH_SPANSION) || defined(CONFIG_SPI_FLASH_WINBOND) @@ -1445,7 +1446,8 @@ int spi_flash_scan(struct spi_flash *flash) flash->read_cmd = CMD_READ_QUAD_OUTPUT_FAST; if (((JEDEC_MFR(info) == SPI_FLASH_CFI_MFR_SPANSION) && (info->id[5] == SPI_FLASH_SPANSION_S25FS_FMLY)) || - (JEDEC_MFR(info) == SPI_FLASH_CFI_MFR_ISSI)) + ((JEDEC_MFR(info) == SPI_FLASH_CFI_MFR_ISSI) && + info->flags & RD_QUADIO)) flash->read_cmd = CMD_READ_QUAD_IO_FAST; } else if (spi->mode & SPI_RX_DUAL && info->flags & RD_DUAL) { flash->read_cmd = CMD_READ_DUAL_OUTPUT_FAST; diff --git a/drivers/mtd/spi/spi_flash_ids.c b/drivers/mtd/spi/spi_flash_ids.c index b21c91f3edf..6d04e11d133 100644 --- a/drivers/mtd/spi/spi_flash_ids.c +++ b/drivers/mtd/spi/spi_flash_ids.c @@ -71,6 +71,8 @@ const struct spi_flash_info spi_flash_ids[] = { {"is25lp032", INFO(0x9d6016, 0x0, 64 * 1024, 64, 0) }, {"is25lp064", INFO(0x9d6017, 0x0, 64 * 1024, 128, 0) }, {"is25lp128", INFO(0x9d6018, 0x0, 64 * 1024, 256, 0) }, + {"is25lp256d", INFO(0x9d6019, 0x0, 64 * 1024, 512, RD_QUAD) }, + {"is25wp256d", INFO(0x9d7019, 0x0, 64 * 1024, 512, RD_QUAD) }, #endif #ifdef CONFIG_SPI_FLASH_MACRONIX /* MACRONIX */ {"mx25l2006e", INFO(0xc22012, 0x0, 64 * 1024, 4, 0) }, -- 2.47.3