Used CONFIG_SPI_FLASH_USE_4K_SECTORS core itself for
usage of 4K_SECTORS.

Cc: Simon Glass <s...@chromium.org>
Cc: Bin Meng <bmeng...@gmail.com>
Cc: Michal Simek <michal.si...@xilinx.com>
Cc: Siva Durga Prasad Paladugu <siva...@xilinx.com>
Tested-by: Mugunthan V N <mugunthan...@ti.com>
Tested-by: Jagan Teki <jt...@openedev.com>
Signed-off-by: Jagan Teki <jt...@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 c3113bc..2a7983c 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

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to