From 10d65b06aebbd857759c278a18c7e9e0ba70ee6c Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Thu, 14 Dec 2017 14:34:47 -0700 Subject: drivers/spi/spi_flash: add flash region protection to controller Provide a spi controller specific protection callback to take advantage of special spi flash controllers that have internal protection registers built into the implementation. It's an optional callback for spi controllers. BUG=b:69614064 Change-Id: Ie50a6ce3bbda32620a25dd26fda1af944940bf28 Signed-off-by: Aaron Durbn Reviewed-on: https://review.coreboot.org/22879 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh --- src/include/spi_flash.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/include/spi_flash.h') diff --git a/src/include/spi_flash.h b/src/include/spi_flash.h index e9ea50c4d2..3a6df9ab1f 100644 --- a/src/include/spi_flash.h +++ b/src/include/spi_flash.h @@ -120,4 +120,9 @@ int chipset_volatile_group_end(const struct spi_flash *flash); * if CONFIG_BOOT_DEVICE_SPI_FLASH is enabled. */ const struct spi_flash *boot_device_spi_flash(void); +/* Protect a region of spi flash using its controller, if available. Returns + * < 0 on error, else 0 on success. */ +int spi_flash_ctrlr_protect_region(const struct spi_flash *flash, + const struct region *region); + #endif /* _SPI_FLASH_H_ */ -- cgit v1.2.3