]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
sf: Add CONFIG_SPI_FLASH_USE_4K_SECTORS in spi_flash
authorJagan Teki <jteki@openedev.com>
Mon, 8 Aug 2016 11:53:56 +0000 (17:23 +0530)
committerJagan Teki <jagannadh.teki@gmail.com>
Wed, 21 Sep 2016 19:32:28 +0000 (01:02 +0530)
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>
drivers/mtd/spi/sf_internal.h
drivers/mtd/spi/spi_flash.c

index 9eb0b8465190d6ae04786d2d6ec5dcfa32b03753..1301e48f083f604a051ce4729b8d88889864a963 100644 (file)
@@ -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),
index 2b2a40949cf9689c7eae6d3fe66f1f0a998f894a..7f6e9ae23ea83356f4ceee56d91103354bbcfb27 100644 (file)
@@ -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;
        }