Add SECT_4K_PMC for erase 4KiB block on PMC chips.

Cc: Simon Glass <s...@chromium.org>
Cc: Bin Meng <bmeng...@gmail.com>
Cc: Michal Simek <michal.si...@xilinx.com>
Cc: Siva Durga Prasad Paladugu <siva...@xilinx.com>
Signed-off-by: Jagan Teki <jt...@openedev.com>
---
 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 4b3a553..62f419f 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 2b1ea6f..98c8cfe 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

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to