summaryrefslogtreecommitdiffstats
path: root/src/usr/i2c
diff options
context:
space:
mode:
authorMatthew Raybuck <matthew.raybuck@ibm.com>2019-03-13 14:42:09 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2019-03-21 13:26:04 -0500
commit086018c231e7f83f02988a587eeeae887e7f2e98 (patch)
tree87df08188ec903bb6ea1e150b360d17df33603bf /src/usr/i2c
parentb8f4e5009a347a0201fbe09b3701ceeb6edd9bf2 (diff)
downloadtalos-hostboot-086018c231e7f83f02988a587eeeae887e7f2e98.tar.gz
talos-hostboot-086018c231e7f83f02988a587eeeae887e7f2e98.zip
Support UCD for I2C callouts
Adds in the necessary code to have UCDs in the current I2C callout API Change-Id: I505373da5b53c194270bf414f546877f6baee390 RTC:205982 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/73360 Reviewed-by: Michael Baiocchi <mbaiocch@us.ibm.com> Reviewed-by: Ilya Smirnov <ismirno@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/i2c')
-rwxr-xr-xsrc/usr/i2c/i2c.C62
1 files changed, 52 insertions, 10 deletions
diff --git a/src/usr/i2c/i2c.C b/src/usr/i2c/i2c.C
index 0e0c37256..442059877 100755
--- a/src/usr/i2c/i2c.C
+++ b/src/usr/i2c/i2c.C
@@ -5602,8 +5602,8 @@ void addHwCalloutsI2c(errlHndl_t i_err,
TARGETING::Target * i_target,
const misc_args_t & i_args)
{
- assert(i_err != nullptr, "Bug! The supplied error log is nullptr.");
- assert(i_target != nullptr, "Bug! The supplied target is nullptr.");
+ assert(i_err != nullptr, "Error log must not be nullptr");
+ assert(i_target != nullptr, "i2cMaster target must not be nullptr.");
if (!INITSERVICE::spBaseServicesEnabled())
{
@@ -5637,10 +5637,11 @@ void addHwCalloutsI2c(errlHndl_t i_err,
{
TRACFCOMP(g_trac_i2c,
"Unresponsive TPM found: "
- "Engine=%d, masterPort=%d "
+ "Engine=%d, masterPort=%d, address=0x%X "
"huid for its i2c master is 0x%.8X",
l_tpmInfo.engine,
l_tpmInfo.port,
+ l_tpmInfo.devAddrLocality0,
TARGETING::get_huid(i_target));
i_err->addHwCallout(tpm,
HWAS::SRCI_PRIORITY_HIGH,
@@ -5651,13 +5652,54 @@ void addHwCalloutsI2c(errlHndl_t i_err,
}
}
- // Could also be an issue with Processor or its bus
- // -- both on the same FRU
- i_err->addHwCallout( i_target,
- l_devFound? HWAS::SRCI_PRIORITY_MED:
- HWAS::SRCI_PRIORITY_HIGH,
- HWAS::NO_DECONFIG,
- HWAS::GARD_NULL );
+ if (!l_devFound)
+ {
+ // Loop thru the UCDs in the system and match physical path,
+ // engine, and port to the i2c master.
+
+ TARGETING::TargetHandleList allUcds;
+ TARGETING::getAllChips(allUcds,
+ TARGETING::TYPE_POWER_SEQUENCER,
+ false);
+
+ for(const auto &ucd: allUcds)
+ {
+ const auto l_ucdInfo = ucd->
+ getAttr<TARGETING::ATTR_I2C_CONTROL_INFO>();
+
+ if ((l_ucdInfo.i2cMasterPath == l_physPath) &&
+ (l_ucdInfo.engine == i_args.engine) &&
+ (l_ucdInfo.port == i_args.port) &&
+ (l_ucdInfo.devAddr == i_args.devAddr))
+ {
+ TRACFCOMP(g_trac_i2c,
+ "Unresponsive UCD found: "
+ "Engine=%d, masterPort=%d, address=0x%X "
+ "huid for its i2c master is 0x%.8X",
+ l_ucdInfo.engine,
+ l_ucdInfo.port,
+ l_ucdInfo.devAddr,
+ TARGETING::get_huid(i_target));
+
+ i_err->addHwCallout(ucd,
+ HWAS::SRCI_PRIORITY_HIGH,
+ HWAS::NO_DECONFIG,
+ HWAS::GARD_NULL);
+
+ l_devFound = true;
+ break;
+ }
+ }
+ }
+
+ // Could also be an issue with Processor or its bus
+ // -- both on the same FRU
+ i_err->addHwCallout(i_target,
+ l_devFound ?
+ HWAS::SRCI_PRIORITY_MED :
+ HWAS::SRCI_PRIORITY_HIGH,
+ HWAS::NO_DECONFIG,
+ HWAS::GARD_NULL);
}
}
OpenPOWER on IntegriCloud