cr50: vendor command to enable nvmem commits

TPM NVMEM commits are reenabled as soon as the system boots into
Chrome OS. However, sometimes the device does not boot into Chrome OS,
in which case it is necessary to be able to reinstate NVMEM commits
explicitly.

The new vendor command will provide this functionality.

BRANCH=none
BUG=chrome-os-partner:59873
TEST=added code to depthcharge to issue the new vendor command if the
     system falls into recovery mode, verify that commits are
     re-instated once the command is issued.

Change-Id: I3c06b27175751dc2c095911441935eee62ed9c50
Reviewed-on: https://chromium-review.googlesource.com/424064
Commit-Ready: Vadim Bendebury <vbendeb@chromium.org>
Tested-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
Vadim Bendebury
2016-12-27 10:19:40 -08:00
committed by chrome-bot
parent 5659d103a6
commit 02c5bb8392
2 changed files with 12 additions and 0 deletions

View File

@@ -896,3 +896,14 @@ static enum vendor_cmd_rc vc_invalidate_inactive_rw(enum vendor_cmd_cc code,
}
DECLARE_VENDOR_COMMAND(VENDOR_CC_INVALIDATE_INACTIVE_RW,
vc_invalidate_inactive_rw);
static enum vendor_cmd_rc vc_commit_nvmem(enum vendor_cmd_cc code,
void *buf,
size_t input_size,
size_t *response_size)
{
nvmem_enable_commits();
*response_size = 0;
return VENDOR_RC_SUCCESS;
}
DECLARE_VENDOR_COMMAND(VENDOR_CC_COMMIT_NVMEM, vc_commit_nvmem);

View File

@@ -32,6 +32,7 @@ enum vendor_cmd_cc {
VENDOR_CC_SYSINFO = 18,
VENDOR_CC_IMMEDIATE_RESET = 19,
VENDOR_CC_INVALIDATE_INACTIVE_RW = 20,
VENDOR_CC_COMMIT_NVMEM = 21,
LAST_VENDOR_COMMAND = 65535,
};