Skip to content

Commit

Permalink
Move init_tpm() as soon as possible after lpc is initialized and meas…
Browse files Browse the repository at this point in the history
…ure bootblock
  • Loading branch information
osresearch committed Aug 15, 2016
1 parent 5c04545 commit 716a732
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/northbridge/intel/sandybridge/romstage.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <device/device.h>
#include <halt.h>
#include <tpm.h>
#include <tpm_lite/tlcl.h>
#include <northbridge/intel/sandybridge/chip.h>
#include "southbridge/intel/bd82x6x/pch.h"
#include <southbridge/intel/common/gpio.h>
Expand Down Expand Up @@ -63,6 +64,18 @@ void mainboard_romstage_entry(unsigned long bist)

pch_enable_lpc();

if (IS_ENABLED(CONFIG_LPC_TPM)) {
// we don't know if we are coming out of a resume
// at this point, but want to setup the tpm ASAP
init_tpm(0);
const void * const bootblock = (const void*) 0xFFFFF800;
const unsigned bootblock_size = 0x800;
tlcl_measure(0, bootblock, bootblock_size);

extern char _romstage, _eromstage;
tlcl_measure(1, &_romstage, &_eromstage - &_romstage);
}

/* Enable GPIOs */
pci_write_config32(PCH_LPC_DEV, GPIO_BASE, DEFAULT_GPIOBASE|1);
pci_write_config8(PCH_LPC_DEV, GPIO_CNTL, 0x10);
Expand Down Expand Up @@ -116,9 +129,5 @@ void mainboard_romstage_entry(unsigned long bist)

northbridge_romstage_finalize(s3resume);

if (IS_ENABLED(CONFIG_LPC_TPM)) {
init_tpm(s3resume);
}

post_code(0x3f);
}

0 comments on commit 716a732

Please sign in to comment.