summaryrefslogtreecommitdiff
path: root/include/flash.h
diff options
context:
space:
mode:
authorNicolas Boichat <drinkcat@google.com>2017-02-13 17:17:01 +0800
committerchrome-bot <chrome-bot@chromium.org>2017-02-23 19:06:16 -0800
commit83cf8d0a7a3e952da34740b9a1e255eaa64395af (patch)
tree0e14cd038b2b1e49998d8b0ef9fc8fecaee54851 /include/flash.h
parented396c5efbadefaf7b6a7dee64258f063f4b9fd3 (diff)
downloadchrome-ec-83cf8d0a7a3e952da34740b9a1e255eaa64395af.tar.gz
flash: Add EC_FLASH_PROTECT_RW_[AT_BOOT|NOW] flagsstabilize-9313.B
The idea of this flag is to be able to protect/unprotect only the RW portion of the flash. In the (usual) case where ALL=RO+RW, with no other region, this makes no difference compared to the existing EC_FLASH_PROTECT_ALL_* flag, and this flag may not be supported. This is necessary for futher work, where a ROLLBACK region is added, so that RW/ROLLBACK can be protected/unprotected individually. Only support for stm32f0 is added, as this is the target for hammer. BRANCH=none BUG=chrome-os-partner:61671 TEST=build and flash hammer (stm32f072) flashinfo => RO+RW not protected flashwp true; reboot => only RO protected flashwp all; reboot => RO+RW protected flashwp noall; reboot => only RO protected flashwp rw/norw not available TEST=enable CONFIG_FLASH_PROTECT_RW build and flash hammer (stm32f072) flashinfo => RO+RW not protected flashwp true; reboot => only RO protected flashwp all; reboot => RO+RW protected flashwp noall; reboot => only RO protected flashwp rw; reboot => RO+RW protected flashwp norw; reboot => only RO protected TEST=build and flash reef (npcx) flashinfo => RO+RW not protected flashwp true => RO protected flashwp all; flashinfo => all_now displayed reboot => RO protected flashwp rw/norw not available Change-Id: Ica6f499cf2e8a9345b08ef52c915655a983ffe3c Reviewed-on: https://chromium-review.googlesource.com/442265 Commit-Ready: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'include/flash.h')
-rw-r--r--include/flash.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/flash.h b/include/flash.h
index caa6d0b897..548f889e72 100644
--- a/include/flash.h
+++ b/include/flash.h
@@ -26,6 +26,13 @@
#define PSTATE_BANK_COUNT 0
#endif
+/* This enum is useful to identify different regions during verification. */
+enum flash_region {
+ FLASH_REGION_RW = 0,
+ FLASH_REGION_RO,
+ FLASH_REGION_COUNT
+};
+
/*****************************************************************************/
/* Low-level methods, for use by flash_common. */