summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJagan Teki <jteki@openedev.com>2016-08-08 17:23:56 +0530
committerJagan Teki <jagannadh.teki@gmail.com>2016-09-22 01:02:28 +0530
commitde0599284f1e41403ce28120f17d98c41b281767 (patch)
tree409a1b60225c0b898a787a0c3aa366b6249116c4
parentddc2dfbb657de0b168447c6b5818855d34845d44 (diff)
downloadu-boot-imx-de0599284f1e41403ce28120f17d98c41b281767.zip
u-boot-imx-de0599284f1e41403ce28120f17d98c41b281767.tar.gz
u-boot-imx-de0599284f1e41403ce28120f17d98c41b281767.tar.bz2
sf: Add CONFIG_SPI_FLASH_USE_4K_SECTORS in spi_flash
Add CONFIG_SPI_FLASH_USE_4K_SECTORS in spi_flash code from header file. 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> Cc: Vignesh R <vigneshr@ti.com> Cc: Mugunthan V N <mugunthanvnm@ti.com> Signed-off-by: Jagan Teki <jteki@openedev.com>
-rw-r--r--drivers/mtd/spi/sf_internal.h4
-rw-r--r--drivers/mtd/spi/spi_flash.c5
2 files changed, 4 insertions, 5 deletions
diff --git a/drivers/mtd/spi/sf_internal.h b/drivers/mtd/spi/sf_internal.h
index 9eb0b84..1301e48 100644
--- a/drivers/mtd/spi/sf_internal.h
+++ b/drivers/mtd/spi/sf_internal.h
@@ -22,11 +22,7 @@ enum spi_dual_flash {
/* sf param flags */
enum {
-#ifndef CONFIG_SPI_FLASH_USE_4K_SECTORS
- SECT_4K = 0,
-#else
SECT_4K = BIT(0),
-#endif
E_FSR = BIT(1),
SST_WR = BIT(2),
WR_QPP = BIT(3),
diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index 2b2a409..7f6e9ae 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -1155,11 +1155,14 @@ 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 (params->flags & SECT_4K) {
flash->erase_cmd = CMD_ERASE_4K;
flash->erase_size = 4096 << flash->shift;
- } else {
+ } else
+#endif
+ {
flash->erase_cmd = CMD_ERASE_64K;
flash->erase_size = flash->sector_size;
}