summaryrefslogtreecommitdiffstats
path: root/src/usr/i2c/i2c.C
diff options
context:
space:
mode:
authorJaymes Wilks <mjwilks@us.ibm.com>2018-08-17 11:24:21 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2018-11-12 09:00:37 -0600
commit87adeec286402eb648f14d274382fb8b84351467 (patch)
tree62f3c86906eac47753f862e8147af53a469e5d3f /src/usr/i2c/i2c.C
parentd83a4ee8495c5ad4b823c26b1a09a3c886882494 (diff)
downloadtalos-hostboot-87adeec286402eb648f14d274382fb8b84351467.tar.gz
talos-hostboot-87adeec286402eb648f14d274382fb8b84351467.zip
Support openpower-specific I2C device callouts
This change supports the openpower path for adding I2C device callouts to error logs. The process works as follows: - Create an I2C device lookup table on first use of I2C callout - Use that table to map I2C info to the actual device to callout - Callout any other I2C devices on the bus with lesser priority - If no I2C match found, callout the I2C master instead - If an I2C device was found, callout the I2C master as low Change-Id: Ib7b248ae60e7e834d6165bbdf4bd9b776ea2421b RTC:94872 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/64833 Reviewed-by: Michael Baiocchi <mbaiocch@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: Nicholas E. Bofferding <bofferdn@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-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/i2c.C')
-rwxr-xr-xsrc/usr/i2c/i2c.C99
1 files changed, 45 insertions, 54 deletions
diff --git a/src/usr/i2c/i2c.C b/src/usr/i2c/i2c.C
index 05c3e40ea..9d2e1d620 100755
--- a/src/usr/i2c/i2c.C
+++ b/src/usr/i2c/i2c.C
@@ -4455,53 +4455,7 @@ void addHwCalloutsI2c(errlHndl_t i_err,
assert(i_err != nullptr, "Bug! The supplied error log is nullptr.");
assert(i_target != nullptr, "Bug! The supplied target is nullptr.");
- // Attempt to find a target representing the device that
- // failed to respond, and call it out as the most likely
- // problem. For now, we only support TPM reverse lookup;
- // TODO RTC 94872 will implement generic support for other
- // devices.
-
- // Loop thru TPMs in the system and match physical path,
- // engine, and port to the i2c master
- auto l_devFound = false;
- const auto l_physPath = i_target->getAttr<
- TARGETING::ATTR_PHYS_PATH>();
- TARGETING::TargetHandleList allTpms;
- TARGETING::getAllChips( allTpms, TARGETING::TYPE_TPM, false );
- for(const auto &tpm: allTpms)
- {
- const auto l_tpmInfo = tpm->getAttr<
- TARGETING::ATTR_TPM_INFO>();
-
- if (l_tpmInfo.i2cMasterPath == l_physPath &&
- l_tpmInfo.engine == i_args.engine &&
- l_tpmInfo.port == i_args.port &&
- l_tpmInfo.devAddrLocality0 == i_args.devAddr)
- {
- TRACFCOMP(g_trac_i2c,
- "Unresponsive TPM found: "
- "Engine=%d, masterPort=%d "
- "huid for its i2c master is 0x%.8X",
- l_tpmInfo.engine,
- l_tpmInfo.port,
- TARGETING::get_huid(i_target));
- i_err->addHwCallout(tpm,
- HWAS::SRCI_PRIORITY_HIGH,
- HWAS::NO_DECONFIG,
- HWAS::GARD_NULL);
- l_devFound = true;
- break;
- }
- }
- // For the FSP, non-TPM case add an I2c Device callout.
- // TODO RTC 94872 In a future commit, we will want FSP to handle
- // the TPM case also, but we won't add it here until FSP fully
- // supports the new i2c callout type. The reasoning is that we still need
- // TPMs to be called out as before in the interim. The other i2c devices
- // (that were never called out to begin with) are the only ones being added
- // as the new type, because FSP will treat the new type as unknown until
- // support for the new type is added.
- if (l_devFound == false && INITSERVICE::spBaseServicesEnabled())
+ if (!INITSERVICE::spBaseServicesEnabled())
{
i_err->addI2cDeviceCallout(i_target,
i_args.engine,
@@ -4509,15 +4463,52 @@ void addHwCalloutsI2c(errlHndl_t i_err,
i_args.devAddr,
HWAS::SRCI_PRIORITY_HIGH);
}
+ // For FSP systems which don't yet have special handling for
+ // i2c device callouts we still need to handle the TPM search
+ // to avoid regression back to the "non TPM aware" behavior.
+ else
+ {
+ // Loop thru TPMs in the system and match physical path,
+ // engine, and port to the i2c master
+ auto l_devFound = false;
+ const auto l_physPath = i_target->getAttr<
+ TARGETING::ATTR_PHYS_PATH>();
+ TARGETING::TargetHandleList allTpms;
+ TARGETING::getAllChips( allTpms, TARGETING::TYPE_TPM, false );
+ for(const auto &tpm: allTpms)
+ {
+ const auto l_tpmInfo = tpm->getAttr<
+ TARGETING::ATTR_TPM_INFO>();
- // 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_tpmInfo.i2cMasterPath == l_physPath &&
+ l_tpmInfo.engine == i_args.engine &&
+ l_tpmInfo.port == i_args.port &&
+ l_tpmInfo.devAddrLocality0 == i_args.devAddr)
+ {
+ TRACFCOMP(g_trac_i2c,
+ "Unresponsive TPM found: "
+ "Engine=%d, masterPort=%d "
+ "huid for its i2c master is 0x%.8X",
+ l_tpmInfo.engine,
+ l_tpmInfo.port,
+ TARGETING::get_huid(i_target));
+ i_err->addHwCallout(tpm,
+ 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 );
+ }
}
}; // end namespace I2C
OpenPOWER on IntegriCloud