summaryrefslogtreecommitdiff
path: root/common/flash.c
diff options
context:
space:
mode:
authorVic Yang <victoryang@chromium.org>2014-10-14 10:05:43 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-10-15 23:56:27 +0000
commitf8fd63f135b5922900ceeb345857070e814f8877 (patch)
treed93f66806f14465810b263e30d49a3e610430acf /common/flash.c
parent847eb1ec44aa43c761799b522b0449bdfc31269a (diff)
downloadchrome-ec-f8fd63f135b5922900ceeb345857070e814f8877.tar.gz
Fix incorrect valid and writable flash flags
The valid and writable flags the EC sends back to the AP are incorrect. They are a little bit different on differnt chips, so let's move it to flash physical layer. This is not any causing problem, but we should fix this. BUG=chrome-os-partner:32745 TEST=make buildall BRANCH=samus Change-Id: Ibcda5ae770f5ea02cde094490997a5bc447df88f Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/222661 Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'common/flash.c')
-rw-r--r--common/flash.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/common/flash.c b/common/flash.c
index 15af5cd1e8..b6001751d5 100644
--- a/common/flash.c
+++ b/common/flash.c
@@ -624,23 +624,9 @@ static int flash_command_protect(struct host_cmd_handler_args *args)
r->valid_flags =
EC_FLASH_PROTECT_GPIO_ASSERTED |
EC_FLASH_PROTECT_ERROR_STUCK |
- EC_FLASH_PROTECT_RO_AT_BOOT |
- EC_FLASH_PROTECT_RO_NOW |
- EC_FLASH_PROTECT_ALL_NOW |
- EC_FLASH_PROTECT_ERROR_INCONSISTENT;
- r->writable_flags = 0;
-
- /* If RO protection isn't enabled, its at-boot state can be changed. */
- if (!(r->flags & EC_FLASH_PROTECT_RO_NOW))
- r->writable_flags |= EC_FLASH_PROTECT_RO_AT_BOOT;
-
- /*
- * If entire flash isn't protected at this boot, it can be enabled if
- * the WP GPIO is asserted.
- */
- if (!(r->flags & EC_FLASH_PROTECT_ALL_NOW) &&
- (r->flags & EC_FLASH_PROTECT_GPIO_ASSERTED))
- r->writable_flags |= EC_FLASH_PROTECT_ALL_NOW;
+ EC_FLASH_PROTECT_ERROR_INCONSISTENT |
+ flash_physical_get_valid_flags();
+ r->writable_flags = flash_physical_get_writable_flags(r->flags);
args->response_size = sizeof(*r);