summaryrefslogtreecommitdiffstats
path: root/src/usr/errl
diff options
context:
space:
mode:
authorJaymes Wilks <mjwilks@us.ibm.com>2018-07-19 12:57:03 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2018-08-13 10:40:27 -0500
commit8b8b8de8870034b121aad1aa1f571bb9e3d2dbc5 (patch)
treee91d5c057b9c4776f96a189511929e39273e1b1c /src/usr/errl
parentce0ea22d0d9d93b1bf1cc491d93f7907c05185dc (diff)
downloadtalos-hostboot-8b8b8de8870034b121aad1aa1f571bb9e3d2dbc5.tar.gz
talos-hostboot-8b8b8de8870034b121aad1aa1f571bb9e3d2dbc5.zip
Implement generic i2c device callouts for FSP
Creates a new type of callout for i2c devices which populates the error log user details section with the address, port, engine, and i2c master of the device being called out. The change only affects the FSP path. Change-Id: I92acc092f105ee21346594f5e3733957e15ad768 RTC:94872 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/63223 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> 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: Nicholas E. Bofferding <bofferdn@us.ibm.com> Reviewed-by: MURULIDHAR NATARAJU <murulidhar@in.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/errl')
-rw-r--r--src/usr/errl/errlentry.C63
-rw-r--r--src/usr/errl/errludcallout.C39
-rw-r--r--src/usr/errl/plugins/errludcallout.H12
3 files changed, 110 insertions, 4 deletions
diff --git a/src/usr/errl/errlentry.C b/src/usr/errl/errlentry.C
index b31ef8b8c..3d183b923 100644
--- a/src/usr/errl/errlentry.C
+++ b/src/usr/errl/errlentry.C
@@ -540,11 +540,11 @@ void ErrlEntry::addHwCallout(const TARGETING::Target *i_target,
#ifdef CONFIG_ERRL_ENTRY_TRACE
TRACFCOMP(g_trac_errl, ENTER_MRK
"addHwCallout(\"MASTER_PROC_SENTINEL\" 0x%x 0x%x 0x%x)",
- i_target, i_priority, i_deconfigState, i_gardErrorType);
+ i_priority, i_deconfigState, i_gardErrorType);
#else
TRACDCOMP(g_trac_errl, ENTER_MRK
"addHwCallout(\"MASTER_PROC_SENTINEL\" 0x%x 0x%x 0x%x)",
- i_target, i_priority, i_deconfigState, i_gardErrorType);
+ i_priority, i_deconfigState, i_gardErrorType);
#endif
//need to override deconfig value to avoid possible deadlocks
@@ -1060,6 +1060,14 @@ void ErrlEntry::setSubSystemIdBasedOnCallouts()
"callout to determine SSID", pData->sensorType);
iv_User.setSubSys(getSubSystem(pData->sensorType));
}
+ else if (pData->type == HWAS::I2C_DEVICE_CALLOUT)
+ {
+ TRACFCOMP(g_trac_errl, INFO_MRK
+ "setting subsystem for type 0x%x "
+ "callout to I2C Device", pData->type);
+
+ iv_User.setSubSys(EPUB_CEC_HDW_I2C_DEVS);
+ }
else
{
TRACFCOMP(g_trac_errl, ERR_MRK
@@ -1809,6 +1817,57 @@ bool ErrlEntry::isSevVisible( void )
return l_vis;
}
+void ErrlEntry::addI2cDeviceCallout(const TARGETING::Target *i_i2cMaster,
+ const uint8_t i_engine,
+ const uint8_t i_port,
+ const uint8_t i_address,
+ const HWAS::callOutPriority i_priority)
+{
+ do {
+
+ if (i_i2cMaster == nullptr ||
+ i_i2cMaster == TARGETING::MASTER_PROCESSOR_CHIP_TARGET_SENTINEL)
+ {
+
+ TRACFCOMP(g_trac_errl, ERR_MRK
+ "addI2cDeviceCallout mistakenly called with %s target. "
+ "Adding high priority callout to the error log.",
+ i_i2cMaster? "MASTER_SENTINEL": "nullptr");
+ addProcedureCallout( HWAS::EPUB_PRC_HB_CODE,
+ HWAS::SRCI_PRIORITY_HIGH);
+ collectTrace(ERRL_COMP_NAME);
+ break;
+ }
+
+ #ifdef CONFIG_ERRL_ENTRY_TRACE
+ TRACFCOMP(g_trac_errl, ENTER_MRK
+ "addI2cDeviceCallout(i2cm=0x%.8x e=0x%x p=0x%x devAddr=0x%x pri=0x%x)",
+ get_huid(i_i2cMaster), i_engine, i_port, i_address, i_priority);
+ #else
+ TRACDCOMP(g_trac_errl, ENTER_MRK
+ "addI2cDeviceCallout(i2cm=0x%.8x e=0x%x p=0x%x devAddr=0x%x pri=0x%x)",
+ get_huid(i_i2cMaster), i_engine, i_port, i_address, i_priority);
+ #endif
+
+ const void* pData = nullptr;
+ uint32_t size = 0;
+ TARGETING::EntityPath* ep = nullptr;
+ getTargData( i_i2cMaster, ep, pData, size );
+
+
+ ErrlUserDetailsCallout(pData, size,
+ i_engine, i_port, i_address, i_priority).addToLog(this);
+
+ if (ep)
+ {
+ delete ep;
+ ep = nullptr;
+ }
+
+ } while (0);
+
+
+} // addI2cDeviceCallout
} // End namespace
diff --git a/src/usr/errl/errludcallout.C b/src/usr/errl/errludcallout.C
index 334d3c9a2..3e8c0b522 100644
--- a/src/usr/errl/errludcallout.C
+++ b/src/usr/errl/errludcallout.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2012,2017 */
+/* Contributors Listed Below - COPYRIGHT 2012,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -227,4 +227,39 @@ ErrlUserDetailsCallout::ErrlUserDetailsCallout(const uint32_t i_sensorID,
TRACDCOMP(g_trac_errl, "Sensor Callout exit");
} // Sensor callout
-}
+//------------------------------------------------------------------------------
+// I2c Device Callout
+ErrlUserDetailsCallout::ErrlUserDetailsCallout(
+ const void *i_pTargData,
+ const uint32_t i_targDataLen,
+ const uint8_t i_engine,
+ const uint8_t i_port,
+ const uint8_t i_address,
+ const HWAS::callOutPriority i_priority)
+{
+ TRACDCOMP(g_trac_errl, "I2c Device Callout");
+
+ assert(i_pTargData != nullptr, "Bug! I2c Device Callout added with null i2c master target");
+
+ // Set up ErrUserDetails instance variables
+ iv_CompId = ERRL_COMP_ID;
+ iv_Version =1;
+ iv_SubSection = ERRL_UDT_CALLOUT;
+
+ uint32_t pDataLength = sizeof(HWAS::callout_ud_t) + i_targDataLen;
+ HWAS::callout_ud_t *pData = reinterpret_cast<HWAS::callout_ud_t *>
+ (reallocUsrBuf(pDataLength));
+
+ pData->type = HWAS::I2C_DEVICE_CALLOUT;
+ pData->engine = i_engine;
+ pData->port = i_port;
+ pData->address = i_address;
+ pData->priority = i_priority;
+
+ memcpy(pData + 1, i_pTargData, i_targDataLen);
+
+ TRACDCOMP(g_trac_errl, "I2c Device Callout exit");
+} // I2c Device Callout
+
+} // namespace ERRORRLOG
+
diff --git a/src/usr/errl/plugins/errludcallout.H b/src/usr/errl/plugins/errludcallout.H
index 147407ccd..4df646c7b 100644
--- a/src/usr/errl/plugins/errludcallout.H
+++ b/src/usr/errl/plugins/errludcallout.H
@@ -219,6 +219,18 @@ case HWAS::_type: i_parser.PrintString( "Bus Type", #_type); break;
break; // BUS_CALLOUT
}
+ case HWAS::I2C_DEVICE_CALLOUT:
+ {
+ i_parser.PrintString( "Callout type", "I2c Device Callout");
+ i_parser.PrintNumber( "Engine","0x%.2x", pData->engine );
+ i_parser.PrintNumber( "Port","0x%.2x", pData->port );
+ i_parser.PrintNumber( "DevAddr","0x%.2x", pData->address );
+
+ uint8_t *l_ptr = reinterpret_cast<uint8_t *>(pData+1);
+ printEntityPath(l_ptr, i_parser, "Target");
+
+ break; // I2C_DEVICE_CALLOUT
+ }
case HWAS::HW_CALLOUT:
{
i_parser.PrintString( "Callout type", "Hardware Callout");
OpenPOWER on IntegriCloud