summaryrefslogtreecommitdiff
path: root/drivers/mtd/spi/stmicro.c
diff options
context:
space:
mode:
authorJagannadha Sutradharudu Teki <jaganna@xilinx.com>2013-06-21 15:56:30 +0530
committerJagannadha Sutradharudu Teki <jaganna@xilinx.com>2013-06-23 22:02:51 +0530
commit615a1561673a9a1b863f905d40f084f36edb9022 (patch)
tree76c2bd6819b12b69877c25ef8aaa34f26dba0f30 /drivers/mtd/spi/stmicro.c
parentba549de6c53663e534a20741f9ec917fb6526830 (diff)
downloadu-boot-imx-615a1561673a9a1b863f905d40f084f36edb9022.zip
u-boot-imx-615a1561673a9a1b863f905d40f084f36edb9022.tar.gz
u-boot-imx-615a1561673a9a1b863f905d40f084f36edb9022.tar.bz2
sf: Add flag status register polling support
Flag status register polling is required for micron 512Mb flash devices onwards, for performing erase/program operations. Like polling for WIP(Write-In-Progress) bit in read status register, spi_flash_cmd_wait_ready will poll for PEC(Program-Erase-Control) bit in flag status register. Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/mtd/spi/stmicro.c')
-rw-r--r--drivers/mtd/spi/stmicro.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/mtd/spi/stmicro.c b/drivers/mtd/spi/stmicro.c
index ef4b911..7e41ee1 100644
--- a/drivers/mtd/spi/stmicro.c
+++ b/drivers/mtd/spi/stmicro.c
@@ -210,5 +210,9 @@ struct spi_flash *spi_flash_probe_stmicro(struct spi_slave *spi, u8 * idcode)
flash->sector_size = 256 * params->pages_per_sector;
flash->size = flash->sector_size * params->nr_sectors;
+ /* for >= 512MiB flashes, use flag status instead of read_status */
+ if (flash->size >= 0x4000000)
+ flash->poll_cmd = CMD_FLAG_STATUS;
+
return flash;
}