summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorWealian Liao <whliao@nuvoton.corp-partner.google.com>2021-10-15 16:45:47 +0800
committerCommit Bot <commit-bot@chromium.org>2021-11-03 01:29:43 +0000
commit3e8e219853490156968579a71ce42dffddb05415 (patch)
tree431fcbb0a5218494d51f6b825ec604499a377cea /common
parentfc78be657fbfc913ac5cd2441b566fd7de7b9fda (diff)
downloadchrome-ec-3e8e219853490156968579a71ce42dffddb05415.tar.gz
npcx: flash: Fix physical_get_protect_flags()
Protecting status register by /WP works when SRP0 is enabled. The getting protect flags function should check SRP0 & QE for EC_FLASH_PROTECT_ERROR_INCONSISTENT flag. This CL adds the following: 1. SRP0 & QE bits check for npcx flash. 2. EC_FLASH_PROTECT_ERROR_UNKNOWN flag BUG=none BRANCH=none TEST=Protect a range & don't set the SRP0. Check flag by `flashinfo`. Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com> Change-Id: Iae8645aca7b0d9176e625de3656a35e675df3ef2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3246882 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/flash.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/common/flash.c b/common/flash.c
index c8f58a82af..ec9f50b711 100644
--- a/common/flash.c
+++ b/common/flash.c
@@ -1032,6 +1032,8 @@ static int command_flash_info(int argc, char **argv)
ccputs(" STUCK");
if (flags & EC_FLASH_PROTECT_ERROR_INCONSISTENT)
ccputs(" INCONSISTENT");
+ if (flags & EC_FLASH_PROTECT_ERROR_UNKNOWN)
+ ccputs(" UNKNOWN_ERROR");
#ifdef CONFIG_ROLLBACK
if (flags & EC_FLASH_PROTECT_ROLLBACK_AT_BOOT)
ccputs(" rollback_at_boot");
@@ -1490,6 +1492,7 @@ static enum ec_status flash_command_protect(struct host_cmd_handler_args *args)
EC_FLASH_PROTECT_GPIO_ASSERTED |
EC_FLASH_PROTECT_ERROR_STUCK |
EC_FLASH_PROTECT_ERROR_INCONSISTENT |
+ EC_FLASH_PROTECT_ERROR_UNKNOWN |
crec_flash_physical_get_valid_flags();
r->writable_flags = crec_flash_physical_get_writable_flags(r->flags);