summaryrefslogtreecommitdiffstats
path: root/src/usr/errl
diff options
context:
space:
mode:
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