summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--zephyr/drivers/cros_flash/cros_flash_it8xxx2.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/zephyr/drivers/cros_flash/cros_flash_it8xxx2.c b/zephyr/drivers/cros_flash/cros_flash_it8xxx2.c
index 0f2102f401..5b7c04a24a 100644
--- a/zephyr/drivers/cros_flash/cros_flash_it8xxx2.c
+++ b/zephyr/drivers/cros_flash/cros_flash_it8xxx2.c
@@ -232,7 +232,9 @@ static int cros_flash_it8xxx2_protect_now(const struct device *dev, int all)
if (all) {
/* Protect the entire flash */
- flash_write_protection_set(flash_controller, all);
+ flash_protect_banks(0,
+ CONFIG_FLASH_SIZE_BYTES / CONFIG_FLASH_BANK_SIZE,
+ FLASH_WP_EC);
data->all_protected = 1;
} else {
/* Protect the read-only section and persistent state */