summaryrefslogtreecommitdiffstats
path: root/src/usr/secureboot/trusted/trustedboot.C
diff options
context:
space:
mode:
authorChris Engel <cjengel@us.ibm.com>2017-02-03 15:41:11 -0600
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-03-08 09:42:10 -0500
commit3dbcf1450853dc138e136b7db1f46e19f2e3ed3c (patch)
tree96dcfe3cfa5822685e166e4e9d8c4507f254c20f /src/usr/secureboot/trusted/trustedboot.C
parent6f2a36c73cfbc18d0d6bf86a45c63014fe12fd1d (diff)
downloadtalos-hostboot-3dbcf1450853dc138e136b7db1f46e19f2e3ed3c.tar.gz
talos-hostboot-3dbcf1450853dc138e136b7db1f46e19f2e3ed3c.zip
Add TPM device driver support for DRTM PCR reset sequence
Change-Id: Ief02e10fc85d09b837e20dfb529186e2da4269fd Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/35935 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Reviewed-by: Michael Baiocchi <mbaiocch@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/secureboot/trusted/trustedboot.C')
-rw-r--r--src/usr/secureboot/trusted/trustedboot.C32
1 files changed, 31 insertions, 1 deletions
diff --git a/src/usr/secureboot/trusted/trustedboot.C b/src/usr/secureboot/trusted/trustedboot.C
index dba6e1ba1..b12654748 100644
--- a/src/usr/secureboot/trusted/trustedboot.C
+++ b/src/usr/secureboot/trusted/trustedboot.C
@@ -48,6 +48,7 @@
#include <initservice/initserviceif.H>
#include <ipmi/ipmisensor.H>
#include <config.h>
+#include <devicefw/driverif.H>
#include <i2c/tpmddif.H>
#include "trustedboot.H"
#include "trustedTypes.H"
@@ -261,6 +262,8 @@ void* host_update_master_tpm( void *io_pArgs )
systemTpms.tpm[TPM_MASTER_INDEX].available &&
NULL == systemTpms.tpm[TPM_MASTER_INDEX].logMgr)
{
+ /// @todo RTC:145689 For DRTM we locate the previous SRTM log and reuse
+ /// And we must allocate a DRTM log to be used
systemTpms.tpm[TPM_MASTER_INDEX].logMgr = new TpmLogMgr;
err = TpmLogMgr_initialize(
systemTpms.tpm[TPM_MASTER_INDEX].logMgr);
@@ -413,7 +416,11 @@ void tpmInitialize(TRUSTEDBOOT::TpmTarget & io_target)
// For a DRTM we need to reset PCRs 17-22
if (drtmMpipl)
{
- /// @TODO RTC 167667 Implement PCR reset
+ err = tpmDrtmReset(io_target);
+ if (NULL != err)
+ {
+ break;
+ }
}
#endif
@@ -1241,4 +1248,27 @@ bool isTpmRequired()
}
+#ifdef CONFIG_DRTM
+errlHndl_t tpmDrtmReset(TpmTarget& io_target)
+{
+ errlHndl_t err = nullptr;
+
+ // Send to the TPM
+ size_t len = 0;
+ err = deviceRead(io_target.tpmTarget,
+ nullptr,
+ len,
+ DEVICE_TPM_ADDRESS(TPMDD::TPM_OP_DRTMRESET,
+ 0,
+ TPM_LOCALITY_4));
+
+ if (NULL == err)
+ {
+ /// @todo RTC: 145689 reset the dynamic tpm log
+ }
+
+ return err;
+}
+#endif
+
} // end TRUSTEDBOOT
OpenPOWER on IntegriCloud