summaryrefslogtreecommitdiff
path: root/src/drivers/mrc_cache
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers/mrc_cache')
-rw-r--r--src/drivers/mrc_cache/mrc_cache.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/drivers/mrc_cache/mrc_cache.c b/src/drivers/mrc_cache/mrc_cache.c
index 4dd0dbc434..84bbdb05b3 100644
--- a/src/drivers/mrc_cache/mrc_cache.c
+++ b/src/drivers/mrc_cache/mrc_cache.c
@@ -456,13 +456,15 @@ static int nvm_is_write_protected(void)
/* Apply protection to a range of flash */
static int nvm_protect(const struct region *r)
{
+ const struct spi_flash *flash = boot_device_spi_flash();
+
if (!IS_ENABLED(CONFIG_MRC_SETTINGS_PROTECT))
return 0;
if (!IS_ENABLED(CONFIG_BOOT_DEVICE_SPI_FLASH))
return 0;
- return spi_flash_ctrlr_protect_region(boot_device_spi_flash(), r);
+ return spi_flash_ctrlr_protect_region(flash, r, WRITE_PROTECT);
}
/* Protect mrc region with a Protected Range Register */