summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/spi/sf_internal.h
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@freescale.com>2015-11-05 12:43:41 -0200
committerTom Rini <trini@konsulko.com>2015-11-05 16:47:05 -0500
commit41b358d7a7c9f29eca4a439fba0ae679100a9ad5 (patch)
tree0a0b551ae6184c239233ca92a8368ab4ff3cfab7 /drivers/mtd/spi/sf_internal.h
parent2d2f490dd594a9a3fcf3649f572e910771007962 (diff)
downloadtalos-obmc-uboot-41b358d7a7c9f29eca4a439fba0ae679100a9ad5.tar.gz
talos-obmc-uboot-41b358d7a7c9f29eca4a439fba0ae679100a9ad5.zip
sf: Add SPI protection mechanism from the kernel
Add the SPI NOR protection mechanism from the kernel. This code is based on the work from Brian Norris <computersforpeace@gmail.com> Here is the commit details: "mtd: spi-nor: refactor block protection functions" (sha1: 62593cf40b23b523b9fc9334ca61ba6c595ebb09) Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Jagan Teki <jteki@openedev.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Heiko Schocher <hs@denx.de> Reviewed-by: Jagan Teki <jteki@openedev.com> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Diffstat (limited to 'drivers/mtd/spi/sf_internal.h')
-rw-r--r--drivers/mtd/spi/sf_internal.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/mtd/spi/sf_internal.h b/drivers/mtd/spi/sf_internal.h
index 8a3e5ec3d7..ac493f1f76 100644
--- a/drivers/mtd/spi/sf_internal.h
+++ b/drivers/mtd/spi/sf_internal.h
@@ -105,6 +105,9 @@ enum spi_nor_option_flags {
#define STATUS_QEB_WINSPAN (1 << 1)
#define STATUS_QEB_MXIC (1 << 6)
#define STATUS_PEC (1 << 7)
+#define SR_BP0 BIT(2) /* Block protect 0 */
+#define SR_BP1 BIT(3) /* Block protect 1 */
+#define SR_BP2 BIT(4) /* Block protect 2 */
/* Flash timeout values */
#define SPI_FLASH_PROG_TIMEOUT (2 * CONFIG_SYS_HZ)
OpenPOWER on IntegriCloud