tpm2: add marshaling/unmarshaling and tlcl support
authorVadim Bendebury <vbendeb@chromium.org>
Tue, 28 Jun 2016 17:27:16 +0000 (10:27 -0700)
committerchrome-bot <chrome-bot@chromium.org>
Fri, 1 Jul 2016 12:16:08 +0000 (05:16 -0700)
commit25589e5a1e07398238b514eb60a543ea8108e278
tree6a4d87b3fc7590d86457a8de50c6b0479b908bc8
parent3c9acf83d516d4de01ecd3e8a7eb9486bb2896f2
tpm2: add marshaling/unmarshaling and tlcl support

The marshaling code is a port of the coreboot patch
https://chromium-review.googlesource.com/353915. The only supported
commands at this time are NV_read and NV_write.

The tlcl layer includes functions necessary to satisfy compilation
requirements of rollback_index.c, functions to lock spaces and clear
TPM are not yet implemented, they just report being invoked.

The missing functions implementation is coming, but even without it it
is possible to boot Chrome OS with firmware and kernel rollback
counters maintained in the TPM NVRAM.

BRANCH=none
BUG=chrome-os-partner:50645
TEST=with depthcharge patches applied kevin/gru boards boot into
     chrome OS with rollback counters read from/written to TPM2

Change-Id: I29fe9069d7c37c33d354f36c93bda15d439bf74f
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/356753
Reviewed-by: Randall Spangler <rspangler@chromium.org>
firmware/include/tpm2_marshaling.h [new file with mode: 0644]
firmware/lib/tpm2_lite/marshaling.c [new file with mode: 0644]
firmware/lib/tpm2_lite/tlcl.c [new file with mode: 0644]