summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJagannadha Sutradharudu Teki <jaganna@xilinx.com>2013-10-02 19:37:43 +0530
committerJagannadha Sutradharudu Teki <jaganna@xilinx.com>2013-10-07 17:55:45 +0530
commit0f6232801cee4f45dbdb0cec45f71172c9b617ca (patch)
tree075f1204f284977aebdfbbc46e0c973c8ec48768 /drivers
parentf4f51a8ff894d34eb332f0d11f6c73c7bf509848 (diff)
downloadu-boot-imx-0f6232801cee4f45dbdb0cec45f71172c9b617ca.zip
u-boot-imx-0f6232801cee4f45dbdb0cec45f71172c9b617ca.tar.gz
u-boot-imx-0f6232801cee4f45dbdb0cec45f71172c9b617ca.tar.bz2
sf: probe: Add support for flag status polling
From Micron, 512MB onwards, flash requires to poll flag status instead of read status- hence added E_FSR flag on spectific flash parts. Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mtd/spi/spi_flash_probe.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/mtd/spi/spi_flash_probe.c b/drivers/mtd/spi/spi_flash_probe.c
index 9c2e115..8ea6915 100644
--- a/drivers/mtd/spi/spi_flash_probe.c
+++ b/drivers/mtd/spi/spi_flash_probe.c
@@ -94,10 +94,10 @@ static const struct spi_flash_params spi_flash_params_table[] = {
{"N25Q128A", 0x20bb18, 0x0, 64 * 1024, 256, SECT_4K},
{"N25Q256", 0x20ba19, 0x0, 64 * 1024, 512, SECT_4K},
{"N25Q256A", 0x20bb19, 0x0, 64 * 1024, 512, SECT_4K},
- {"N25Q512", 0x20ba20, 0x0, 64 * 1024, 1024, SECT_4K},
- {"N25Q512A", 0x20bb20, 0x0, 64 * 1024, 1024, SECT_4K},
- {"N25Q1024", 0x20ba21, 0x0, 64 * 1024, 2048, SECT_4K},
- {"N25Q1024A", 0x20bb21, 0x0, 64 * 1024, 2048, SECT_4K},
+ {"N25Q512", 0x20ba20, 0x0, 64 * 1024, 1024, E_FSR | SECT_4K},
+ {"N25Q512A", 0x20bb20, 0x0, 64 * 1024, 1024, E_FSR | SECT_4K},
+ {"N25Q1024", 0x20ba21, 0x0, 64 * 1024, 2048, E_FSR | SECT_4K},
+ {"N25Q1024A", 0x20bb21, 0x0, 64 * 1024, 2048, E_FSR | SECT_4K},
#endif
#ifdef CONFIG_SPI_FLASH_SST /* SST */
{"SST25VF040B", 0xbf258d, 0x0, 64 * 1024, 8, SECT_4K | SST_WP},
@@ -187,7 +187,6 @@ struct spi_flash *spi_flash_validate_ids(struct spi_slave *spi, u8 *idcode)
flash->spi = spi;
flash->name = params->name;
- flash->poll_cmd = CMD_READ_STATUS;
/* Assign spi_flash ops */
flash->write = spi_flash_cmd_write_multi;
@@ -215,6 +214,13 @@ struct spi_flash *spi_flash_validate_ids(struct spi_slave *spi, u8 *idcode)
flash->erase_size = flash->sector_size;
}
+ /* Poll cmd seclection */
+ flash->poll_cmd = CMD_READ_STATUS;
+#ifdef CONFIG_SPI_FLASH_STMICRO
+ if (params->flags & E_FSR)
+ flash->poll_cmd = CMD_FLAG_STATUS;
+#endif
+
/* Flash powers up read-only, so clear BP# bits */
#if defined(CONFIG_SPI_FLASH_ATMEL) || \
defined(CONFIG_SPI_FLASH_MACRONIX) || \