[U-Boot] [PATCH 6/8] sf: Add SECT_4K_PMC

Jagan Teki jteki at openedev.com
Sat Dec 19 15:13:36 CET 2015


Add SECT_4K_PMC for erase 4KiB block on PMC chips.

Cc: Simon Glass <sjg at chromium.org>
Cc: Bin Meng <bmeng.cn at gmail.com>
Cc: Michal Simek <michal.simek at xilinx.com>
Cc: Siva Durga Prasad Paladugu <sivadur at xilinx.com>
Signed-off-by: Jagan Teki <jteki at 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



More information about the U-Boot mailing list