summaryrefslogtreecommitdiff
path: root/drivers/mtd/spi
diff options
context:
space:
mode:
authorJagannadha Sutradharudu Teki <jaganna@xilinx.com>2013-09-26 13:16:45 +0530
committerJagannadha Sutradharudu Teki <jaganna@xilinx.com>2013-10-07 17:55:44 +0530
commit54024c15668ec5e8c261536e9bbc9d22dd01f3e6 (patch)
tree7a1724f79b20b1487c3c74b14d8655be77ce6084 /drivers/mtd/spi
parent10ca45d005a96e810b5a225b08135fc24da62ee9 (diff)
downloadu-boot-imx-54024c15668ec5e8c261536e9bbc9d22dd01f3e6.zip
u-boot-imx-54024c15668ec5e8c261536e9bbc9d22dd01f3e6.tar.gz
u-boot-imx-54024c15668ec5e8c261536e9bbc9d22dd01f3e6.tar.bz2
sf: probe: Add support to clear flash BP# bits
Few of the flashes(Atmel, Macronix and SST) require to clear BP# bits in flash power ups. So clear these BP# bits at probe time, so-that the flash is ready for user operations. Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
Diffstat (limited to 'drivers/mtd/spi')
-rw-r--r--drivers/mtd/spi/spi_flash_probe.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/mtd/spi/spi_flash_probe.c b/drivers/mtd/spi/spi_flash_probe.c
index 199eab8..4659134 100644
--- a/drivers/mtd/spi/spi_flash_probe.c
+++ b/drivers/mtd/spi/spi_flash_probe.c
@@ -203,6 +203,13 @@ struct spi_flash *spi_flash_validate_ids(struct spi_slave *spi, u8 *idcode)
flash->sector_size = params->sector_size;
flash->size = flash->sector_size * params->nr_sectors;
+ /* Flash powers up read-only, so clear BP# bits */
+#if defined(CONFIG_SPI_FLASH_ATMEL) || \
+ defined(CONFIG_SPI_FLASH_MACRONIX) || \
+ defined(CONFIG_SPI_FLASH_SST)
+ spi_flash_cmd_write_status(flash, 0);
+#endif
+
return flash;
}