From 627afc2685a19ff633483c6fb465523dd2d0ecd1 Mon Sep 17 00:00:00 2001 From: Vadim Bendebury Date: Sun, 19 Jun 2016 12:13:18 -0700 Subject: tpm2: add marshaling/unmarshaling layer 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 Signed-off-by: Martin Roth Original-Commit-Id: 0782d9d452efb732e85d1503fccfcb4bf9f69a68 Original-Change-Id: I202276ef9a43c28b5f304f901ac5b91048878b76 Original-Signed-off-by: Vadim Bendebury Original-Reviewed-on: https://chromium-review.googlesource.com/353915 Original-Reviewed-by: Bill Richardson Original-Reviewed-by: Darren Krahn Reviewed-on: https://review.coreboot.org/15570 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh Reviewed-by: Philipp Deppenwiese --- src/lib/Makefile.inc | 1 + 1 file changed, 1 insertion(+) (limited to 'src/lib/Makefile.inc') diff --git a/src/lib/Makefile.inc b/src/lib/Makefile.inc index fe8ec0ac8e..5a8f77f844 100644 --- a/src/lib/Makefile.inc +++ b/src/lib/Makefile.inc @@ -55,6 +55,7 @@ ifeq ($(MOCK_TPM),1) libverstage-y += mocked_tlcl.c else libverstage-$(CONFIG_TPM) += tlcl.c +libverstage-$(CONFIG_TPM2) += tpm2_marshaling.c libverstage-$(CONFIG_TPM2) += tpm2_tlcl.c endif -- cgit v1.2.3