diff options
author | Randall Spangler <rspangler@chromium.org> | 2013-08-07 12:55:44 -0700 |
---|---|---|
committer | ChromeBot <chrome-bot@google.com> | 2013-08-08 13:51:45 -0700 |
commit | 0a93b4b1c139c9c227685dc020f080d274cfc5d3 (patch) | |
tree | 268e1fa4e4f2289f9746c3e578a7c44c23730574 | |
parent | 01630180bb331be647f4062ff02280bd476a9b4d (diff) | |
download | chrome-ec-0a93b4b1c139c9c227685dc020f080d274cfc5d3.tar.gz |
pit: If flash registers are disabled all blocks are protected
This fixes a confusing indication in flashinfo, where the all_now flag
is set but banks aren't shown as protected now.
BUG=chrome-os-partner:20277
BRANCH=pit
TEST=See bug for full test procedure. In short:
1) Enable physical write protect
2) flashwp enable
3) flashwp now
4) flashinfo shows all banks protected now
Change-Id: I489e80f63a33c182629d3a04fd0a9dadfb3914ab
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/64980
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
-rw-r--r-- | chip/stm32/flash-stm32l.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/chip/stm32/flash-stm32l.c b/chip/stm32/flash-stm32l.c index a26d32ea94..11c22dff0c 100644 --- a/chip/stm32/flash-stm32l.c +++ b/chip/stm32/flash-stm32l.c @@ -306,6 +306,13 @@ exit_er: int flash_physical_get_protect(int block) { + /* + * If the entire flash interface is locked, then all blocks are + * protected until reboot. + */ + if (flash_physical_get_protect_flags() & EC_FLASH_PROTECT_ALL_NOW) + return 1; + /* Check the active write protect status */ return STM32_FLASH_WRPR & (1 << block); } |