[coreboot-gerrit] Change in coreboot[master]: drivers/spi: [WIP] Implement write protect operation

Rizwan Qureshi (Code Review) gerrit at coreboot.org
Mon Sep 24 15:13:12 CEST 2018


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 at 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 =

-- 
To view, visit https://review.coreboot.org/28725
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I87cef73852ea671ec80741af78844d32c0ed5d3c
Gerrit-Change-Number: 28725
Gerrit-PatchSet: 1
Gerrit-Owner: Rizwan Qureshi <rizwan.qureshi at intel.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180924/c2c73899/attachment.html>


More information about the coreboot-gerrit mailing list