@@ -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;
}
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: Mugunthan V N <mugunthanvnm@ti.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(-)