summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
Diffstat (limited to 'src/usr')
-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
-rw-r--r--src/usr/hwas/common/hwasCallout.C29
-rw-r--r--src/usr/hwas/hwasPlatCallout.C24
-rwxr-xr-xsrc/usr/i2c/i2c.C18
6 files changed, 180 insertions, 5 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");
diff --git a/src/usr/hwas/common/hwasCallout.C b/src/usr/hwas/common/hwasCallout.C
index 588833572..a7ea7e224 100644
--- a/src/usr/hwas/common/hwasCallout.C
+++ b/src/usr/hwas/common/hwasCallout.C
@@ -242,6 +242,35 @@ void processCallout(errlHndl_t &io_errl,
}
break;
} // PART_CALLOUT
+ case (I2C_DEVICE_CALLOUT):
+ {
+ TARGETING::Target *i2cMaster = nullptr;
+
+ uint8_t * l_targetData = reinterpret_cast<uint8_t *>(pCalloutUD + 1);
+ bool wasErr = retrieveTarget(l_targetData, i2cMaster, io_errl);
+
+ if (!wasErr)
+ {
+ errlHndl_t errl = nullptr;
+
+ // TODO RTC 94872 - Uncomment this later after the FSP team
+ // implements it.
+ //
+ // errlHndl_t errl = platHandleI2cDeviceCallout(
+ // i2cMaster,
+ // pCalloutUD->engine,
+ // pCalloutUD->port,
+ // pCalloutUD->address,
+ // pCalloutUD->priority,
+ // io_errl);
+ if (errl)
+ {
+ HWAS_ERR("processCallout: error from platHandleI2cDeviceCallout");
+ errlCommit(errl, HWAS_COMP_ID);
+ }
+ }
+ break;
+ } // I2C_DEVICE_CALLOUT
default:
{
diff --git a/src/usr/hwas/hwasPlatCallout.C b/src/usr/hwas/hwasPlatCallout.C
index 5c6f8e687..ce1ec18b6 100644
--- a/src/usr/hwas/hwasPlatCallout.C
+++ b/src/usr/hwas/hwasPlatCallout.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2013,2017 */
+/* Contributors Listed Below - COPYRIGHT 2013,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -192,6 +192,28 @@ errlHndl_t platHandleBusCallout(
}
//******************************************************************************
+// platHandleI2cDeviceCallout
+//******************************************************************************
+errlHndl_t platHandleI2cDeviceCallout(
+ TARGETING::Target *i_i2cMaster,
+ uint8_t i_engine,
+ uint8_t i_port,
+ uint8_t i_address,
+ callOutPriority i_priority,
+ errlHndl_t &io_errl)
+{
+ // WARNING:
+ // this hostboot code should not change io_errl, unless the caller of the
+ // processCallouts() function also changes, as today it (errlentry.C) calls
+ // from the errlEntry object
+
+ errlHndl_t errl = nullptr;
+
+ // hostboot does not yet handle or do any action for i2c callouts
+ return errl;
+}
+
+//******************************************************************************
// platHandleClockCallout
//******************************************************************************
errlHndl_t platHandleClockCallout(
diff --git a/src/usr/i2c/i2c.C b/src/usr/i2c/i2c.C
index db93bb2d7..4045ab26c 100755
--- a/src/usr/i2c/i2c.C
+++ b/src/usr/i2c/i2c.C
@@ -56,6 +56,8 @@
#include <i2c/eepromif.H>
#include <i2c/tpmddif.H>
+// TODO RTC 94872 Remove the following include in a future commit
+#include <initservice/initserviceif.H>
// ----------------------------------------------
// Globals
@@ -4442,6 +4444,22 @@ void addHwCalloutsI2c(errlHndl_t i_err,
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())
+ {
+ i_err->addI2cDeviceCallout(i_target,
+ i_args.engine,
+ i_args.port,
+ i_args.devAddr,
+ HWAS::SRCI_PRIORITY_HIGH);
+ }
// Could also be an issue with Processor or its bus
// -- both on the same FRU
OpenPOWER on IntegriCloud