diff options
author | Vadim Bendebury <vbendeb@chromium.org> | 2018-01-08 12:47:29 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-01-11 22:22:46 -0800 |
commit | b31fca4b91f10be84a845222775b67553d63bf4e (patch) | |
tree | 4513a65a3a2452c102a5ffdfadae2f21add334b1 /common/tpm_registers.c | |
parent | 7fbf25c0969c220e49570f67a8c32783ab23273b (diff) | |
download | chrome-ec-b31fca4b91f10be84a845222775b67553d63bf4e.tar.gz |
cr50: pass essential ccd commands through tpm task context
Using and extending the existing framework, move ccd commands
'password, lock, open, and unlock to the same processing path.
The first three commands accept a single parameter, password. It is
required for the password command and optional for unlock and open.
The lock command does not require any parameters.
Wiping the TPM, if necessary, now happens on the same context where
CCD command is executed, i.e. the TPM task context. This is why the
same context TPM reset function needs to be exported and used here.
ccd_open() and ccd_unlock() could be further refactored, this would
require a bit more effort to find appropriate balance between
commonalities and differences.
BRANCH=cr50
BUG=b:62537474
TEST=verified that ccd commands to open, unlock, lock and set and
clear password all work.
Change-Id: I2b9f2b550347b590a55bfaef262a4f050d3f4c1c
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/854709
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'common/tpm_registers.c')
-rw-r--r-- | common/tpm_registers.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/common/tpm_registers.c b/common/tpm_registers.c index 5e73d573c9..fab6616f54 100644 --- a/common/tpm_registers.c +++ b/common/tpm_registers.c @@ -879,6 +879,13 @@ static void tpm_reset_now(int wipe_first) if_start(); } +int tpm_sync_reset(int wipe_first) +{ + tpm_reset_now(wipe_first); + + return wipe_result; +} + void tpm_task(void) { uint32_t evt; |