From: Jagan Teki Date: Tue, 29 Dec 2015 15:19:52 +0530 Subject: [U-Boot] [PATCH v2 6/8] sf: Add SECT_4K_PMC In-Reply-To: <1451382594-29532-1-git-send-email-jteki@openedev.com> References: <1451382594-29532-1-git-send-email-jteki@openedev.com> Message-ID: <1451382594-29532-7-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 Add SECT_4K_PMC for erase 4KiB block on PMC chips. Cc: Simon Glass Cc: Bin Meng CC: Mugunthan V N Cc: Michal Simek Cc: Siva Durga Prasad Paladugu Signed-off-by: Jagan Teki --- drivers/mtd/spi/sf_internal.h | 1 + drivers/mtd/spi/spi_flash.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/drivers/mtd/spi/sf_internal.h b/drivers/mtd/spi/sf_internal.h index 8eaadd7..75513b0 100644 --- a/drivers/mtd/spi/sf_internal.h +++ b/drivers/mtd/spi/sf_internal.h @@ -67,6 +67,7 @@ enum spi_nor_option_flags { /* Erase commands */ #define CMD_ERASE_4K 0x20 +#define CMD_ERASE_4K_PMC 0xd7 #define CMD_ERASE_32K 0x52 #define CMD_ERASE_CHIP 0xc7 #define CMD_ERASE_64K 0xd8 diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c index 63c53c2..c3113bc 100644 --- a/drivers/mtd/spi/spi_flash.c +++ b/drivers/mtd/spi/spi_flash.c @@ -1382,6 +1382,9 @@ int spi_flash_scan(struct spi_flash *flash) if (info->flags & SECT_4K) { flash->erase_cmd = CMD_ERASE_4K; flash->erase_size = 4096 << flash->shift; + } else if (info->flags & SECT_4K_PMC) { + flash->erase_cmd = CMD_ERASE_4K_PMC; + flash->erase_size = 4096; } else { flash->erase_cmd = CMD_ERASE_64K; flash->erase_size = flash->sector_size; -- 1.9.1