diff options
author | Allen Webb <allenwebb@google.com> | 2018-02-28 15:42:47 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-04-27 12:22:26 -0700 |
commit | 1820ecce31e6a23e5ab79f708f66a8655da6a161 (patch) | |
tree | 9c4f09621ec2282208cfed21de76f8172fc9c888 /board | |
parent | 826a3876b4f3ecd5f73d2320ee1e853a789e6e30 (diff) | |
download | chrome-ec-1820ecce31e6a23e5ab79f708f66a8655da6a161.tar.gz |
Cr50: Add logging functionality to PinWeaver.
In order to be able to recover from the AP and Cr50 getting out of
sync, this logging functionality gives Cr50 a way to track the
state changes of the merkle tree so that the AP can be updated to
the current state as long as it has a recent enough copy.
This involves packing the important information so it can be stored
efficiently on flash, and adding the necessary messages for the
replay.
CQ-DEPEND=CL:895395,CL:929430
BRANCH=none
BUG=chromium:809729, chromium:809745
TEST=cd ~/src/platform/ec && V=1 make run-weaver_ng -j
Change-Id: I40f98de2c8e9706cccb5b922215699f2132fa121
Signed-off-by: Allen Webb <allenwebb@google.com>
Reviewed-on: https://chromium-review.googlesource.com/963773
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Diffstat (limited to 'board')
-rw-r--r-- | board/cr50/pinweaver_tpm_imports.c | 5 | ||||
-rw-r--r-- | board/cr50/tpm2/platform.c | 2 | ||||
-rw-r--r-- | board/host/dcrypto.h | 7 |
3 files changed, 8 insertions, 6 deletions
diff --git a/board/cr50/pinweaver_tpm_imports.c b/board/cr50/pinweaver_tpm_imports.c index eec2284dfd..abc1bed872 100644 --- a/board/cr50/pinweaver_tpm_imports.c +++ b/board/cr50/pinweaver_tpm_imports.c @@ -8,11 +8,6 @@ #include <Global.h> #include <util.h> -uint32_t get_restart_count(void) -{ - return gp.resetCount; -} - void get_storage_seed(void *buf, size_t *len) { *len = MIN(*len, sizeof(gp.SPSeed)); diff --git a/board/cr50/tpm2/platform.c b/board/cr50/tpm2/platform.c index e380d8afe1..3068c903e3 100644 --- a/board/cr50/tpm2/platform.c +++ b/board/cr50/tpm2/platform.c @@ -7,6 +7,7 @@ #include "TPM_Types.h" #include "ccd_config.h" +#include "pinweaver.h" #include "trng.h" #include "util.h" #include "version.h" @@ -64,5 +65,6 @@ void _plat__GetFwVersion(uint32_t *firmwareV1, uint32_t *firmwareV2) void _plat__ResetCallback(void) { + pinweaver_init(); ccd_tpm_reset_callback(); } diff --git a/board/host/dcrypto.h b/board/host/dcrypto.h index f949ef4352..48bde62592 100644 --- a/board/host/dcrypto.h +++ b/board/host/dcrypto.h @@ -4,7 +4,9 @@ */ /* Provides the minimal declarations needed by pinweaver to build on - * CHIP_HOST. + * CHIP_HOST. While it might be preferable to simply use the original dcrypto.h, + * That would require incorporating additional headers / dependencies such as + * cryptoc. */ #ifndef __CROS_EC_DCRYPTO_HOST_H @@ -30,6 +32,9 @@ enum dcrypto_appid { /* This enum value should not exceed 7. */ }; +/* Used as a replacement for declarations in cryptoc that are used by Cr50, but + * add unnecessary complexity to the test code. + */ struct dcrypto_mock_ctx_t { struct HASH_CTX hash; }; |