@@ -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
@@ -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;
Add SECT_4K_PMC for erase 4KiB block on PMC chips. 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/sf_internal.h | 1 + drivers/mtd/spi/spi_flash.c | 3 +++ 2 files changed, 4 insertions(+)