Add ability to build vboot firmware for TPM2 support
authorVadim Bendebury <vbendeb@chromium.org>
Tue, 28 Jun 2016 16:46:14 +0000 (09:46 -0700)
committerchrome-bot <chrome-bot@chromium.org>
Fri, 1 Jul 2016 12:16:01 +0000 (05:16 -0700)
TPM2 will have to use a different tlcl layer, the configuration option
will be provided by depthcharge at build time.

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

Change-Id: I0694741f5317da2c3268ee9edfdf29caff2fc26c
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/356750
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Makefile

index 2538137..2d29bfd 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -182,6 +182,10 @@ CFLAGS += -DUSE_MTD
 LDLIBS += -lmtdutils
 endif
 
+ifneq (${TPM2_MODE},)
+CFLAGS += -DTPM2_MODE
+endif
+
 # NOTE: We don't use these files but they are useful for other packages to
 # query about required compiling/linking flags.
 PC_IN_FILES = vboot_host.pc.in
@@ -384,8 +388,15 @@ BDBLIB_SRCS = \
 # Support real TPM unless BIOS sets MOCK_TPM
 ifeq (${MOCK_TPM},)
 VBINIT_SRCS += \
-       firmware/lib/rollback_index.c \
+       firmware/lib/rollback_index.c
+ifeq (${TPM2_MODE},)
+VBINIT_SRCS += \
        firmware/lib/tpm_lite/tlcl.c
+else
+VBINIT_SRCS += \
+       firmware/lib/tpm2_lite/tlcl.c \
+       firmware/lib/tpm2_lite/marshaling.c
+endif
 
 VBSF_SRCS += \
        firmware/lib/tpm_bootmode.c