Martin Roth has submitted this change and it was merged. ( https://review.coreboot.org/19456 )
Change subject: vboot: Select CONFIG_{TPM,TPM2} only if MOCK_SECDATA is not selected ......................................................................
vboot: Select CONFIG_{TPM,TPM2} only if MOCK_SECDATA is not selected
1. Select CONFIG_{TPM,TPM2} only when MOCK_SECDATA is not selected. 2. Provide tlcl_lib_init for mock TPM case.
BUG=b:37682566 TEST=Verified that when mock TPM is used, CONFIG_TPM is not set anymore in coreboot config.
Change-Id: If3bdd1528e153b164e9d62ee9cbcc4c3666b8b66 Signed-off-by: Furquan Shaikh furquan@chromium.org Reviewed-on: https://review.coreboot.org/19456 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin adurbin@chromium.org Reviewed-by: Julius Werner jwerner@chromium.org --- M src/vboot/Kconfig M src/vboot/secdata_mock.c 2 files changed, 8 insertions(+), 2 deletions(-)
Approvals: Aaron Durbin: Looks good to me, approved Julius Werner: Looks good to me, approved build bot (Jenkins): Verified
diff --git a/src/vboot/Kconfig b/src/vboot/Kconfig index c517323..4ddf3e3 100644 --- a/src/vboot/Kconfig +++ b/src/vboot/Kconfig @@ -17,8 +17,8 @@ config VBOOT bool "Verify firmware with vboot." default n - select TPM if !MAINBOARD_HAS_TPM2 - select TPM2 if MAINBOARD_HAS_TPM2 + select TPM if !MAINBOARD_HAS_TPM2 && !VBOOT_MOCK_SECDATA + select TPM2 if MAINBOARD_HAS_TPM2 && !VBOOT_MOCK_SECDATA select TPM_INIT_FAILURE_IS_FATAL if PC80_SYSTEM && LPC_TPM select SKIP_TPM_STARTUP_ON_NORMAL_BOOT if PC80_SYSTEM && LPC_TPM depends on HAVE_HARD_RESET diff --git a/src/vboot/secdata_mock.c b/src/vboot/secdata_mock.c index b53a196..72ee5b3 100644 --- a/src/vboot/secdata_mock.c +++ b/src/vboot/secdata_mock.c @@ -34,6 +34,7 @@
#include <antirollback.h> #include <stdlib.h> +#include <tpm_lite/tlcl.h> #include <vb2_api.h>
uint32_t tpm_extend_pcr(struct vb2_context *ctx, int pcr, @@ -77,3 +78,8 @@ { return TPM_SUCCESS; } + +uint32_t tlcl_lib_init(void) +{ + return VB2_SUCCESS; +}