summaryrefslogtreecommitdiffstats
path: root/src/usr/i2c/i2c.C
diff options
context:
space:
mode:
authorMike Baiocchi <mbaiocch@us.ibm.com>2018-02-28 13:01:46 -0600
committerDaniel M. Crowell <dcrowell@us.ibm.com>2018-03-01 09:51:04 -0500
commiteeadfb7bf9852f327256b17786796809458118ce (patch)
tree4bbfb138279bc5f6b43e32e36a9b7394de1e0e68 /src/usr/i2c/i2c.C
parenta8b0039d4e3af6fb2a7cbc82b328fa73e14dbc30 (diff)
downloadblackbird-hostboot-eeadfb7bf9852f327256b17786796809458118ce.tar.gz
blackbird-hostboot-eeadfb7bf9852f327256b17786796809458118ce.zip
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 <bofferdn@us.ibm.com> CI-Ready: Marshall J. Wilks <mjwilks@us.ibm.com> CI-Ready: Michael Baiocchi <mbaiocch@us.ibm.com> Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Reviewed-by: Marshall J. Wilks <mjwilks@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: ILYA SMIRNOV <ismirno@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/i2c/i2c.C')
-rwxr-xr-xsrc/usr/i2c/i2c.C38
1 files changed, 26 insertions, 12 deletions
diff --git a/src/usr/i2c/i2c.C b/src/usr/i2c/i2c.C
index 95074f82d..3aed2eb02 100755
--- a/src/usr/i2c/i2c.C
+++ b/src/usr/i2c/i2c.C
@@ -3179,7 +3179,8 @@ enum i2cProcessOperation
errlHndl_t i2cProcessActiveMasters ( i2cProcessType i_processType,
i2cProcessOperation i_processOperation,
uint64_t i_busSpeed,
- bool i_functional )
+ bool i_functional,
+ i2cEngineSelect i_engineSelect )
{
errlHndl_t err = NULL;
bool error_found = false;
@@ -3193,9 +3194,10 @@ errlHndl_t i2cProcessActiveMasters ( i2cProcessType i_processType,
TARGETING::ATTR_I2C_BUS_SPEED_ARRAY_type speed_array;
TRACFCOMP( g_trac_i2c,
- ENTER_MRK"i2cProcessActiveMasters(): Type=0x%X, "
- "Operation=%d Bus Speed=%d Functional=%d",
- i_processType, i_processOperation, i_busSpeed, i_functional );
+ ENTER_MRK"i2cProcessActiveMasters(): Type=0x%X "
+ "Operation=%d Bus Speed=%d Functional=%d engineSelect=0x%.2X",
+ i_processType, i_processOperation, i_busSpeed, i_functional,
+ i_engineSelect );
do
{
@@ -3357,7 +3359,7 @@ errlHndl_t i2cProcessActiveMasters ( i2cProcessType i_processType,
}
}
- for( size_t engine = 0;
+ for( uint8_t engine = 0;
engine < I2C_BUS_ATTR_MAX_ENGINE;
engine++ )
{
@@ -3373,8 +3375,7 @@ errlHndl_t i2cProcessActiveMasters ( i2cProcessType i_processType,
continue;
}
- // Never touch engine 0 for Host -- the SBE owns
- // it
+ // Never touch engine 0 for Host -- the SBE owns it
if ( ( engine == 0 ) &&
(io_args.switches.useHostI2C == 1) )
{
@@ -3383,6 +3384,16 @@ errlHndl_t i2cProcessActiveMasters ( i2cProcessType i_processType,
continue;
}
+ // Only operate on selected engines
+ if ( ! ( i2cEngineToEngineSelect(engine) & i_engineSelect ) )
+ {
+ TRACFCOMP( g_trac_i2c,INFO_MRK
+ "Skipping engine %d because i_engineSelect=0x%.2X",
+ engine, i_engineSelect );
+ continue;
+ }
+
+
// Look for any device on this engine based on speed_array
bool skip = true;
size_t l_numPorts = I2C_BUS_ATTR_MAX_PORT;
@@ -3647,19 +3658,21 @@ errlHndl_t i2cProcessActiveMasters ( i2cProcessType i_processType,
* Set bus speed from the MRW value.
*/
errlHndl_t i2cResetActiveMasters ( i2cProcessType i_resetType,
- bool i_functional )
+ bool i_functional,
+ i2cEngineSelect i_engineSelect )
{
errlHndl_t err = NULL;
TRACFCOMP( g_trac_i2c,
ENTER_MRK"i2cResetActiveMasters(): i2cProcessType=0x%X, "
- "i_functional=%d",
- i_resetType, i_functional );
+ "i_functional=%d, i_engineSelect=0x%.2X",
+ i_resetType, i_functional, i_engineSelect );
err = i2cProcessActiveMasters (i_resetType, // select engines
I2C_OP_RESET, // reset engines
I2C_BUS_SPEED_FROM_MRW,
- i_functional);
+ i_functional,
+ i_engineSelect);
TRACFCOMP( g_trac_i2c,
EXIT_MRK"i2cResetActiveMasters(): err rc=0x%X, plid=0x%X",
@@ -3686,7 +3699,8 @@ errlHndl_t i2cSetupActiveMasters ( i2cProcessType i_setupType,
err = i2cProcessActiveMasters (i_setupType, // select engines
I2C_OP_SETUP, // setup engines
I2C_BUS_SPEED_400KHZ,
- i_functional);
+ i_functional,
+ I2C_ENGINE_SELECT_ALL);
TRACFCOMP( g_trac_i2c,
EXIT_MRK"i2cSetupActiveMasters(): err rc=0x%X, plid=0x%X",
OpenPOWER on IntegriCloud