
Used CONFIG_SPI_FLASH_USE_4K_SECTORS core itself for usage of 4K_SECTORS.
Cc: Simon Glass sjg@chromium.org Cc: Bin Meng bmeng.cn@gmail.com Cc: Michal Simek michal.simek@xilinx.com Cc: Siva Durga Prasad Paladugu sivadur@xilinx.com Signed-off-by: Jagan Teki jteki@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; }