Skip to content

Commit

Permalink
drivers/intel/fsp: Fix TPM initialization when vboot is disabled
Browse files Browse the repository at this point in the history
A change introduced by commit fe4983e [1] in order to prevent
re-initialization of the TPM if already set up in verstage
had the wrong logic in the if statement, causing the TPM
to never be initialized if vboot is disabled.

The RESUME_PATH_SAME_AS_BOOT config is enabled by default for
ARCH_X86, resulting in the if statement to always evaluate to
false. Remove that condition from the if statement to allow it
to function as intended.

This patch also enables TPM initialization for FSP 2.0 with
the same conditions.

[1] intel/fsp1_1: Do not re-init TPM in romstage if already setup in verstage
https://review.coreboot.org/#/c/coreboot/+/14106/

Change-Id: Ic43d1aa31a296386c7eab6d997f9b701e9ea0fe5
Signed-off-by: Youness Alaoui <youness.alaoui@puri.sm>
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/23680
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
  • Loading branch information
Youness Alaoui authored and pgeorgi committed Mar 26, 2018
1 parent e415a4c commit 676887d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/drivers/intel/fsp1_1/romstage.c
Expand Up @@ -172,7 +172,6 @@ void romstage_common(struct romstage_params *params)
* in verstage and used to verify romstage.
*/
if (IS_ENABLED(CONFIG_LPC_TPM) &&
!IS_ENABLED(CONFIG_RESUME_PATH_SAME_AS_BOOT) &&
!IS_ENABLED(CONFIG_VBOOT_STARTS_IN_BOOTBLOCK))
init_tpm(params->power_state->prev_sleep_state ==
ACPI_S3);
Expand Down
9 changes: 9 additions & 0 deletions src/drivers/intel/fsp2_0/memory_init.c
Expand Up @@ -31,6 +31,7 @@
#include <string.h>
#include <symbols.h>
#include <timestamp.h>
#include <security/tpm/tis.h>
#include <security/tpm/tss.h>
#include <security/vboot/vboot_common.h>
#include <vb2_api.h>
Expand Down Expand Up @@ -146,6 +147,14 @@ static void do_fsp_post_memory_init(bool s3wake, uint32_t fsp_version)

/* Create romstage handof information */
romstage_handoff_init(s3wake);

/*
* Initialize the TPM, unless the TPM was already initialized
* in verstage and used to verify romstage.
*/
if (IS_ENABLED(CONFIG_LPC_TPM) &&
!IS_ENABLED(CONFIG_VBOOT_STARTS_IN_BOOTBLOCK))
init_tpm(s3wake);
}

static int mrc_cache_verify_tpm_hash(const uint8_t *data, size_t size)
Expand Down

0 comments on commit 676887d

Please sign in to comment.