From: Jagan Teki Date: Thu, 31 Dec 2015 14:52:02 +0530 Subject: [U-Boot] [PATCH v3 07/10] sf: Use CONFIG_SPI_FLASH_USE_4K_SECTORS In-Reply-To: <1451553724-1098-1-git-send-email-jteki@openedev.com> References: <1451553724-1098-1-git-send-email-jteki@openedev.com> Message-ID: <1451553724-1098-8-git-send-email-jteki@openedev.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Used CONFIG_SPI_FLASH_USE_4K_SECTORS core itself for usage of 4K_SECTORS. Cc: Simon Glass Cc: Bin Meng Cc: Michal Simek Cc: Siva Durga Prasad Paladugu Tested-by: Mugunthan V N Tested-by: Jagan Teki Signed-off-by: Jagan Teki --- 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