summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/usr/errl/errli2c.C62
-rwxr-xr-xsrc/usr/i2c/i2c.C62
-rw-r--r--src/usr/isteps/ucd/updateUcdFlash.C89
3 files changed, 164 insertions, 49 deletions
diff --git a/src/usr/errl/errli2c.C b/src/usr/errl/errli2c.C
index 92229a65a..b3838a866 100644
--- a/src/usr/errl/errli2c.C
+++ b/src/usr/errl/errli2c.C
@@ -113,6 +113,18 @@ I2cDevInfos::I2cDevInfos()
getDepth(l_tgt)});
}
}
+ // UCD
+ {
+ TARGETING::ATTR_I2C_CONTROL_INFO_type u;
+ if (l_tgt->tryGetAttr<TARGETING::ATTR_I2C_CONTROL_INFO>(u))
+ {
+ // String literal is used for comparison below, must stay sync'd
+ iv_i2cdvs.push_back({u.i2cMasterPath, u.engine, u.port,
+ u.devAddr, 0,
+ EEPROM::INVALID_CHIP_TYPE, l_tgt,
+ getDepth(l_tgt)});
+ }
+ }
}
}
@@ -136,7 +148,8 @@ void handleI2cDeviceCalloutWithinHostboot(
auto l_devFound = false;
- const auto l_i2cmPhysPath = i_i2cMaster->getAttr<TARGETING::ATTR_PHYS_PATH>();
+ const auto l_i2cmPhysPath = i_i2cMaster->
+ getAttr<TARGETING::ATTR_PHYS_PATH>();
// determine default priority to be one below what was passed in, or if
// LOW was passed in, then LOW. Its use is described below.
@@ -156,7 +169,15 @@ void handleI2cDeviceCalloutWithinHostboot(
// try to find a device match in the list of matching infos
for (auto& i2cd : i2cdvs)
{
- TRACDCOMP(g_trac_errl, "handleI2cDeviceCalloutWithinHostboot: chipType %d Engine=%d, Port=%d, addr=0x%X, i2cMasterHuid=0x%X huid=0x%X w/ %d chips ...", i2cd.chipType, i2cd.engine, i2cd.port, i2cd.devAddr, TARGETING::get_huid(tS.toTarget(i2cd.i2cMasterPath)), TARGETING::get_huid(i2cd.tgt), i2cd.chipCount);
+ TRACDCOMP(g_trac_errl, "handleI2cDeviceCalloutWithinHostboot: chipType "
+ "%d Engine=%d, Port=%d, addr=0x%X, "
+ "i2cMasterHuid=0x%X huid=0x%X w/ %d chips",
+ i2cd.chipType,
+ i2cd.engine,
+ i2cd.port,
+ i2cd.devAddr,
+ TARGETING::get_huid(tS.toTarget(i2cd.i2cMasterPath)),
+ TARGETING::get_huid(i2cd.tgt), i2cd.chipCount);
// match the master path, engine and port
if (l_i2cmPhysPath == i2cd.i2cMasterPath &&
@@ -181,7 +202,16 @@ void handleI2cDeviceCalloutWithinHostboot(
l_priority = i_priority; // priority passed in
l_devFound = true;
}
- TRACDCOMP(g_trac_errl, "handleI2cDeviceCalloutWithinHostboot: Match found! Adding part callout for chipType %d Engine=%d, Port=%d, addr=0x%X, i2cMasterHuid=0x%X w/ %d chips", i2cd.chipType, i2cd.engine, i2cd.port, i2cd.devAddr, TARGETING::get_huid(i2cd.tgt), i2cd.chipCount);
+ TRACDCOMP(g_trac_errl, "handleI2cDeviceCalloutWithinHostboot: "
+ "Match found! Adding part callout for chipType %d "
+ "Engine=%d, Port=%d, addr=0x%X, i2cMasterHuid=0x%X "
+ "w/ %d chips",
+ i2cd.chipType,
+ i2cd.engine,
+ i2cd.port,
+ i2cd.devAddr,
+ TARGETING::get_huid(i2cd.tgt),
+ i2cd.chipCount);
// add VPD or SBE part callout depending on chip type
i_errl->addPartCallout(i2cd.tgt,
@@ -209,7 +239,15 @@ void handleI2cDeviceCalloutWithinHostboot(
i2cd.devAddr == matchedBefore.devAddr;
});
- TRACDCOMP(g_trac_errl, "handleI2cDeviceCalloutWithinHostboot: i2cdev chipType=%d Engine=%d, Port=%d, addr=0x%X, i2cHuid=0x%X, i2cd.targetAncestryDepth=%d", i2cd.chipType, i2cd.engine, i2cd.port, i2cd.devAddr, TARGETING::get_huid(i2cd.tgt), i2cd.targetAncestryDepth);
+ TRACDCOMP(g_trac_errl, "handleI2cDeviceCalloutWithinHostboot: "
+ "i2cdev chipType=%d Engine=%d, Port=%d, addr=0x%X, "
+ "i2cHuid=0x%X, i2cd.targetAncestryDepth=%d",
+ i2cd.chipType,
+ i2cd.engine,
+ i2cd.port,
+ i2cd.devAddr,
+ TARGETING::get_huid(i2cd.tgt),
+ i2cd.targetAncestryDepth);
if(dupItr == i2chwcos.end())
{
@@ -221,7 +259,17 @@ void handleI2cDeviceCalloutWithinHostboot(
// dereference the duplicate device from its iterator
auto dupDev = *dupItr;
- TRACDCOMP(g_trac_errl, "handleI2cDeviceCalloutWithinHostboot: dupdev chipType=%d Engine=%d, Port=%d, addr=0x%X, i2cHuid=0x%X, dupDev.targetAncestryDepth=%d", dupDev.chipType, dupDev.engine, dupDev.port, dupDev.devAddr, TARGETING::get_huid(dupDev.tgt), dupDev.targetAncestryDepth);
+ TRACDCOMP(g_trac_errl,
+ "handleI2cDeviceCalloutWithinHostboot: "
+ "dupdev chipType=%d Engine=%d, Port=%d, "
+ "addr=0x%X, i2cHuid=0x%X, "
+ "dupDev.targetAncestryDepth=%d",
+ dupDev.chipType,
+ dupDev.engine,
+ dupDev.port,
+ dupDev.devAddr,
+ TARGETING::get_huid(dupDev.tgt),
+ dupDev.targetAncestryDepth);
// we need to replace it if we found a device with more
// seniority (in other words less depth) than the duplicate
@@ -250,7 +298,9 @@ void handleI2cDeviceCalloutWithinHostboot(
l_priority = i_priority;
l_devFound = true;
}
- TRACDCOMP(g_trac_errl, "handleI2cDeviceCalloutWithinHostboot: Match found! Adding Hw callout for huid 0x%X", TARGETING::get_huid(i2cd.tgt));
+ TRACDCOMP(g_trac_errl, "handleI2cDeviceCalloutWithinHostboot: "
+ "Match found! Adding Hw callout for huid 0x%X",
+ TARGETING::get_huid(i2cd.tgt));
i_errl->addHwCallout(i2cd.tgt,
l_priority,
HWAS::NO_DECONFIG,
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);
}
}
diff --git a/src/usr/isteps/ucd/updateUcdFlash.C b/src/usr/isteps/ucd/updateUcdFlash.C
index ade97d669..4b9baeddb 100644
--- a/src/usr/isteps/ucd/updateUcdFlash.C
+++ b/src/usr/isteps/ucd/updateUcdFlash.C
@@ -83,6 +83,50 @@ private:
TARGETING::I2cControlInfo iv_i2cInfo;
/*
+ * @brief This function creates a new ErrlEntry with the supplied
+ * parameters, adds an I2C callout, a software callout, and
+ * collects traces for UCD_COMP_NAME.
+ *
+ * @param[in] i_sev Log's severity. See errltypes.H for
+ * available values
+ * @param[in] i_modId The module (interface) where this log is
+ * created from.
+ * @param[in] i_reasonCode Bits 00-07: Component Id
+ * Bits 08-15: Reason code
+ * @param[in] i_user1 64 bits of user data which are placed
+ * in the primary SRC. Defaults to zero.
+ * @param[in] i_user2 64 bits of user data which are placed
+ * in the secondary SRC. Defaults to zero.
+ */
+ errlHndl_t ucdError(const ERRORLOG::errlSeverity_t i_sev,
+ const uint8_t i_modId,
+ const uint16_t i_reasonCode,
+ const uint64_t i_user1,
+ const uint64_t i_user2)
+ {
+ errlHndl_t err = nullptr;
+
+ err = new ERRORLOG::ErrlEntry(i_sev,
+ i_modId,
+ i_reasonCode,
+ i_user1,
+ i_user2);
+
+ // Add a callout for the I2C master.
+ err->addI2cDeviceCallout(iv_pI2cMaster,
+ iv_i2cInfo.engine,
+ iv_i2cInfo.port,
+ iv_i2cInfo.devAddr,
+ HWAS::SRCI_PRIORITY_HIGH);
+
+ // Add a callout for hostboot code.
+ err->addProcedureCallout(HWAS::EPUB_PRC_HB_CODE,
+ HWAS::SRCI_PRIORITY_LOW);
+
+ return err;
+ }
+
+ /*
* Delete Copy Constructor
*/
Ucd(const Ucd&) = delete;
@@ -198,7 +242,7 @@ public:
size, DEVICE_ID_MAX_SIZE);
/*@
* @errortype
- * @severity ERRL_SEV_UNRECOVERABLE
+ * @severity ERRL_SEV_PREDICTIVE
* @moduleid UCD_RC::MOD_UCD_INIT
* @reasoncode UCD_RC::RC_DEVICE_READ_UNEXPECTED_SIZE_DEVICE_ID
* @devdesc A device read from the UCD didn't read
@@ -209,23 +253,11 @@ public:
* @userdata1[32:63] Actual read size
* @userdata2 HUID of the UCD
*/
- err = new ERRORLOG::ErrlEntry(
- ERRORLOG::ERRL_SEV_UNRECOVERABLE,
- UCD_RC::MOD_UCD_INIT,
- UCD_RC::RC_DEVICE_READ_UNEXPECTED_SIZE_DEVICE_ID,
- TWO_UINT32_TO_UINT64(DEVICE_ID_MAX_SIZE, size),
- get_huid(iv_pUcd)
- );
-
- err->addI2cDeviceCallout(iv_pI2cMaster,
- iv_i2cInfo.engine,
- iv_i2cInfo.port,
- iv_i2cInfo.devAddr,
- HWAS::SRCI_PRIORITY_HIGH);
-
- err->addProcedureCallout(HWAS::EPUB_PRC_HB_CODE,
- HWAS::SRCI_PRIORITY_LOW);
-
+ err = ucdError(ERRORLOG::ERRL_SEV_PREDICTIVE,
+ UCD_RC::MOD_UCD_INIT,
+ UCD_RC::RC_DEVICE_READ_UNEXPECTED_SIZE_DEVICE_ID,
+ TWO_UINT32_TO_UINT64(DEVICE_ID_MAX_SIZE, size),
+ get_huid(iv_pUcd));
break;
}
@@ -303,7 +335,7 @@ public:
size, MFR_REVISION_MAX_SIZE);
/*@
* @errortype
- * @severity ERRL_SEV_UNRECOVERABLE
+ * @severity ERRL_SEV_PREDICTIVE
* @moduleid UCD_RC::MOD_UCD_INIT
* @reasoncode UCD_RC::RC_DEVICE_READ_UNEXPECTED_SIZE_MFR_REVISION
* @devdesc A device read from the UCD didn't read
@@ -314,21 +346,12 @@ public:
* @userdata1[32:63] Actual read size
* @userdata2 HUID of the UCD
*/
- err = new ERRORLOG::ErrlEntry(
- ERRORLOG::ERRL_SEV_UNRECOVERABLE,
+ err = ucdError(ERRORLOG::ERRL_SEV_PREDICTIVE,
UCD_RC::MOD_UCD_INIT,
UCD_RC::RC_DEVICE_READ_UNEXPECTED_SIZE_MFR_REVISION,
TWO_UINT32_TO_UINT64(MFR_REVISION_MAX_SIZE, size),
get_huid(iv_pUcd));
- err->addI2cDeviceCallout(iv_pI2cMaster,
- iv_i2cInfo.engine,
- iv_i2cInfo.port,
- iv_i2cInfo.devAddr,
- HWAS::SRCI_PRIORITY_HIGH);
-
- err->addProcedureCallout(HWAS::EPUB_PRC_HB_CODE,
- HWAS::SRCI_PRIORITY_LOW);
break;
}
@@ -380,8 +403,8 @@ public:
/*
- * @brief Gets the Device ID for the UCD member of this
- * struct.
+ * @brief Gets the Device ID from the UCD member of this
+ * class.
*
* @return A constant pointer to the device id string.
*
@@ -391,8 +414,8 @@ public:
return iv_deviceId;
}
- /* @brief Will get the MFR Revision for the UCD member
- * of this struct.
+ /* @brief Gets the MFR Revision from the UCD member
+ * of this class.
*
* @return The ASCII MFR revision as a uint16_t.
*/
OpenPOWER on IntegriCloud