[U-Boot] [PATCH v5 13/32] sf: probe: Add support to clear flash BP# bits

Jagannadha Sutradharudu Teki jagannadha.sutradharudu-teki at xilinx.com
Wed Oct 2 18:50:23 CEST 2013


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 at xilinx.com>
---
Changes for v5:
        - Added macro for conditional compile
Changes for v4:
        - none
Changes for v3:
        - none
Changes for v2:
	- none

 drivers/mtd/spi/spi_flash_probe.c | 7 +++++++
 1 file changed, 7 insertions(+)

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;
 }
 
-- 
1.8.3




More information about the U-Boot mailing list