TPM commands need to be serialized (marshaled) to be sent to the device, and the responses need to be de-serialized (unmarshaled) to be properly interpreted by upper layers.
This layer does not exist in TPM1.2 coreboot implementation, all TPM commands used there were hardcoded as binary arrays. Availability of the marshaling/unmarshaling layer makes it much easier to add new TPM commands to the code.
Command and response structures used in these functions are defined in Parts 2 and 3 of the TCG issued document
Trusted Platform Module Library Family "2.0" Level 00 Revision 01.16 October 30, 2014
BRANCH=none BUG=chrome-os-partner:50645 TEST=with the rest of the patches applied it is possible to successfully initialize firmware and kernel TPM spaces.
Change-Id: I80b3f971e347bb30ea08f820ec3dd27e1656c060
627afc2 tpm2: add marshaling/unmarshaling layer
src/lib/Makefile.inc | 1 +
src/lib/tpm2_marshaling.c | 516 +++++++++++++++++++++++++++++++++++++++++++++
src/lib/tpm2_marshaling.h | 49 +++++
3 files changed, 566 insertions(+)
Upstream: review.coreboot.org