diff options
author | Nicolas Boichat <drinkcat@google.com> | 2017-02-13 17:17:01 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-02-23 19:06:16 -0800 |
commit | 83cf8d0a7a3e952da34740b9a1e255eaa64395af (patch) | |
tree | 0e14cd038b2b1e49998d8b0ef9fc8fecaee54851 /util/ectool.c | |
parent | ed396c5efbadefaf7b6a7dee64258f063f4b9fd3 (diff) | |
download | chrome-ec-stabilize-9313.B.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 'util/ectool.c')
-rw-r--r-- | util/ectool.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/util/ectool.c b/util/ectool.c index cb90d1af51..f2bf6662ce 100644 --- a/util/ectool.c +++ b/util/ectool.c @@ -907,10 +907,14 @@ static void print_flash_protect_flags(const char *desc, uint32_t flags) printf(" wp_gpio_asserted"); if (flags & EC_FLASH_PROTECT_RO_AT_BOOT) printf(" ro_at_boot"); + if (flags & EC_FLASH_PROTECT_RW_AT_BOOT) + printf(" rw_at_boot"); if (flags & EC_FLASH_PROTECT_ALL_AT_BOOT) printf(" all_at_boot"); if (flags & EC_FLASH_PROTECT_RO_NOW) printf(" ro_now"); + if (flags & EC_FLASH_PROTECT_RW_NOW) + printf(" rw_now"); if (flags & EC_FLASH_PROTECT_ALL_NOW) printf(" all_now"); if (flags & EC_FLASH_PROTECT_ERROR_STUCK) |