[U-Boot] [PATCH 7/8] sf: Use CONFIG_SPI_FLASH_USE_4K_SECTORS

Jagan Teki jteki at openedev.com
Sat Dec 19 15:13:37 CET 2015


Used CONFIG_SPI_FLASH_USE_4K_SECTORS core itself for
usage of 4K_SECTORS.

Cc: Simon Glass <sjg at chromium.org>
Cc: Bin Meng <bmeng.cn at gmail.com>
Cc: Michal Simek <michal.simek at xilinx.com>
Cc: Siva Durga Prasad Paladugu <sivadur at xilinx.com>
Signed-off-by: Jagan Teki <jteki at openedev.com>
---
 drivers/mtd/spi/spi_flash.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index 98c8cfe..72b59fb 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -1378,6 +1378,7 @@ int spi_flash_scan(struct spi_flash *flash)
 		flash->size <<= 1;
 #endif
 
+#ifdef CONFIG_SPI_FLASH_USE_4K_SECTORS
 	/* Compute erase sector and command */
 	if (info->flags & SECT_4K) {
 		flash->erase_cmd = CMD_ERASE_4K;
@@ -1385,7 +1386,9 @@ int spi_flash_scan(struct spi_flash *flash)
 	} else if (info->flags & SECT_4K_PMC) {
 		flash->erase_cmd = CMD_ERASE_4K_PMC;
 		flash->erase_size = 4096;
-	} else {
+	} else
+#endif
+	{
 		flash->erase_cmd = CMD_ERASE_64K;
 		flash->erase_size = flash->sector_size;
 	}
-- 
1.9.1



More information about the U-Boot mailing list