From eeadfb7bf9852f327256b17786796809458118ce Mon Sep 17 00:00:00 2001 From: Mike Baiocchi Date: Wed, 28 Feb 2018 13:01:46 -0600 Subject: Add Reset to TPM's I2C Bus for MPIPLs This commit updates the general I2C reset function to only reset certain engine(s) of the I2C master. This new functionality is then used to reset all of the processor I2C engines that can drive the TPMs on MPIPLs. Change-Id: Ie19e93233b5012b69d59bfc3f485ce2914d665da CQ:SW419116 Backport:release-fips910 Backport:release-fips900 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/54840 CI-Ready: Nicholas E. Bofferding CI-Ready: Marshall J. Wilks CI-Ready: Michael Baiocchi Reviewed-by: Nicholas E. Bofferding Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Reviewed-by: Marshall J. Wilks Tested-by: Jenkins OP HW Tested-by: FSP CI Jenkins Reviewed-by: ILYA SMIRNOV Reviewed-by: Daniel M. Crowell --- src/usr/secureboot/trusted/trustedboot.C | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/usr/secureboot') diff --git a/src/usr/secureboot/trusted/trustedboot.C b/src/usr/secureboot/trusted/trustedboot.C index 0c1e9e974..43ce1f330 100644 --- a/src/usr/secureboot/trusted/trustedboot.C +++ b/src/usr/secureboot/trusted/trustedboot.C @@ -52,6 +52,7 @@ #include #include #include +#include #include "trustedboot.H" #include "trustedTypes.H" #include "trustedbootCmds.H" @@ -274,6 +275,33 @@ void* host_update_master_tpm( void *io_pArgs ) if( hwasState.present && hwasState.functional) { + // If MPIPL do I2C Reset to any processor's I2C engine that is + // driving the TPMs + TARGETING::Target* sys = nullptr; + (void) tS.getTopLevelTarget( sys ); + assert(sys, "host_update_master_tpm() system target is nullptr"); + + if (sys->getAttr()) + { + err = I2C::i2cResetActiveMasters( + I2C::I2C_PROC_HOST, + true, + I2C::i2cEngineToEngineSelect(tpmData.engine)); + + if (nullptr != err) + { + // Commit log and continue + TRACFCOMP(g_trac_trustedboot,ERR_MRK + "host_update_master_tpm(): Committing I2C " + "Reset Fail plid=0x%X but continuing", + err->plid()); + err->collectTrace(TRBOOT_COMP_NAME); + errlCommit(err, TRBOOT_COMP_ID); + err = nullptr; + } + + } + // API call will set TPM init attempted appropriately tpmInitialize(pPrimaryTpm); } -- cgit v1.2.3