aboutsummaryrefslogtreecommitdiff
path: root/drivers/mtd/spi/sf_internal.h
diff options
context:
space:
mode:
authorEugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>2018-04-10 14:40:44 +0300
committerJagan Teki <jagan@amarulasolutions.com>2018-04-19 16:54:01 +0530
commit3d4fed87a5fa3ffedf64ff2811cd95c5ac4503ac (patch)
tree7d07900a93ee8534adc5e4603fb9b4e05818a512 /drivers/mtd/spi/sf_internal.h
parent40df6b3e1882c55dd34b9177a42e21a591d668ee (diff)
mtd: sf: Add support of sst26wf* flash ICs protection ops
sst26wf flash series block protection implementation differs from other SST series, so add specific implementation flash_lock/flash_unlock/flash_is_locked functions for sst26wf flash ICs. Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
Diffstat (limited to 'drivers/mtd/spi/sf_internal.h')
-rw-r--r--drivers/mtd/spi/sf_internal.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/mtd/spi/sf_internal.h b/drivers/mtd/spi/sf_internal.h
index 839cdbe1b0..614a293234 100644
--- a/drivers/mtd/spi/sf_internal.h
+++ b/drivers/mtd/spi/sf_internal.h
@@ -87,6 +87,19 @@ enum spi_nor_option_flags {
/* SST specific */
#ifdef CONFIG_SPI_FLASH_SST
+#define SST26_CMD_READ_BPR 0x72
+#define SST26_CMD_WRITE_BPR 0x42
+
+#define SST26_BPR_8K_NUM 4
+#define SST26_MAX_BPR_REG_LEN (18 + 1)
+#define SST26_BOUND_REG_SIZE ((32 + SST26_BPR_8K_NUM * 8) * SZ_1K)
+
+enum lock_ctl {
+ SST26_CTL_LOCK,
+ SST26_CTL_UNLOCK,
+ SST26_CTL_CHECK
+};
+
# define CMD_SST_BP 0x02 /* Byte Program */
# define CMD_SST_AAI_WP 0xAD /* Auto Address Incr Word Program */