diff options
author | Simon Glass <sjg@chromium.org> | 2018-11-06 15:21:41 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2018-11-20 19:14:22 -0700 |
commit | a58986ca8b53d8c7a441397082f84edc7f47d19f (patch) | |
tree | c9ec3c59244371d8ad9992a2ba332a7b50d33950 /drivers/mtd/spi/sf_internal.h | |
parent | f9d49f92f8cdf04a47704519a63368259595c3a0 (diff) |
sf: Add a method to obtain the block-protect setting
It is useful to obtain the block-protect setting of the SPI flash, so we
know whether it is fully open or (perhaps partially) write-protected. Add
a method for this. Update the sandbox driver to process this operation and
add a test.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/mtd/spi/sf_internal.h')
-rw-r--r-- | drivers/mtd/spi/sf_internal.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/mtd/spi/sf_internal.h b/drivers/mtd/spi/sf_internal.h index 26f5c7c995..46a5044417 100644 --- a/drivers/mtd/spi/sf_internal.h +++ b/drivers/mtd/spi/sf_internal.h @@ -170,6 +170,9 @@ int spi_flash_cmd_write(struct spi_slave *spi, const u8 *cmd, size_t cmd_len, /* Flash erase(sectors) operation, support all possible erase commands */ int spi_flash_cmd_erase_ops(struct spi_flash *flash, u32 offset, size_t len); +/* Get software write-protect value (BP bits) */ +int spi_flash_cmd_get_sw_write_prot(struct spi_flash *flash); + /* Lock stmicro spi flash region */ int stm_lock(struct spi_flash *flash, u32 ofs, size_t len); |