diff options
author | Scott <scollyer@chromium.org> | 2017-02-07 13:17:08 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-02-08 16:24:42 -0800 |
commit | 2838114b1957b8b2546df79bb5ff36fe1a40fe47 (patch) | |
tree | 36e23822fcf532d2f67ae9588d1cca4855e611bd /common | |
parent | e7cfdd8c926c4812e43a6fee1d1809f718cb3495 (diff) | |
download | chrome-ec-2838114b1957b8b2546df79bb5ff36fe1a40fe47.tar.gz |
commom: enable commits prior to checking for valid nvmem partitions
If both nvmem partitions are corrupted, then nvmem_reinitialize() will be
called and commits must be enabled prior to this so that
nvmem_release_cache() succeeds.
BRANCH=none
BUG=chrome-os-partner:62531
TEST=On Reef after a successful boot, corrupt nvmem partitions using
the following console commands:
flasherase 0x7d000 0x3000
flasherase 0x3d000 0x3000
Then reboot via H1 console and verified via the console that the nvmem
partitions were reconfigured.
nvmem_find_partition:302 partiton 0 verification FAILED
nvmem_find_partition:302 partiton 1 verification FAILED
[0.025928 nvmem_find_partition: No Valid Partition found, will
reinitialize!]
[0.127752 Active Nvmem partition set to 1]
Then verfied that TPM was functional and the system booted booted into
the kernel. Without this CL this set of actions would always result in
going in to recovery mode due to TPM failure.
Change-Id: If1691b179e19cb37f0fc6ba893219dd8c02f2cf5
Signed-off-by: Scott <scollyer@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/439368
Commit-Ready: Scott Collyer <scollyer@chromium.org>
Tested-by: Scott Collyer <scollyer@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/nvmem.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/common/nvmem.c b/common/nvmem.c index 2f7d37923c..e0f0ab558b 100644 --- a/common/nvmem.c +++ b/common/nvmem.c @@ -408,6 +408,11 @@ int nvmem_init(void) nvmem_error_state = EC_SUCCESS; nvmem_write_error = 0; + /* + * Default policy is to allow all commits. This ensures reinitialization + * succeeds to bootstrap the nvmem area. + */ + commits_enabled = 1; ret = nvmem_find_partition(); if (ret != EC_SUCCESS) { @@ -418,7 +423,6 @@ int nvmem_init(void) } CPRINTS("Active Nvmem partition set to %d", nvmem_act_partition); - commits_enabled = 1; return EC_SUCCESS; } |