Rizwan Qureshi has uploaded this change for review. ( https://review.coreboot.org/28725
Change subject: drivers/spi: [WIP] Implement write protect operation ......................................................................
drivers/spi: [WIP] Implement write protect operation
Implement a write protect operation which can be used as part of a region_device_ops. This operation will protect the region using the SPI FPR.
Change-Id: I87cef73852ea671ec80741af78844d32c0ed5d3c Signed-off-by: Rizwan Qureshi rizwan.qureshi@intel.com --- M src/drivers/spi/boot_device_rw_nommap.c 1 file changed, 6 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/25/28725/1
diff --git a/src/drivers/spi/boot_device_rw_nommap.c b/src/drivers/spi/boot_device_rw_nommap.c index 64d81c5..aadaf4e 100644 --- a/src/drivers/spi/boot_device_rw_nommap.c +++ b/src/drivers/spi/boot_device_rw_nommap.c @@ -50,6 +50,11 @@ return size; }
+static int spi_protect(const struct region *r) +{ + return spi_flash_ctrlr_protect_region(boot_device_spi_flash(), r); +} + static ssize_t spi_eraseat(const struct region_device *rd, size_t offset, size_t size) { @@ -68,6 +73,7 @@ .readat = spi_readat, .writeat = spi_writeat, .eraseat = spi_eraseat, + .protect = spi_protect, };
static const struct region_device spi_rw =