summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/include/usr/targeting/common/utilFilter.H15
-rw-r--r--src/usr/hwas/common/hwas.C9
-rw-r--r--src/usr/isteps/istep21/call_update_ucd_flash.C46
-rw-r--r--src/usr/targeting/common/utilFilter.C17
-rw-r--r--src/usr/targeting/common/xmltohb/attribute_types.xml24
-rw-r--r--src/usr/targeting/common/xmltohb/target_types.xml8
6 files changed, 106 insertions, 13 deletions
diff --git a/src/include/usr/targeting/common/utilFilter.H b/src/include/usr/targeting/common/utilFilter.H
index b54c5f8ac..2f7360b44 100644
--- a/src/include/usr/targeting/common/utilFilter.H
+++ b/src/include/usr/targeting/common/utilFilter.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2012,2018 */
+/* Contributors Listed Below - COPYRIGHT 2012,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -135,6 +135,19 @@ void getChipletResources(TARGETING::TargetHandleList & o_vector,
void getAllChips(TARGETING::TargetHandleList & o_vector,
TYPE i_type, bool i_functional = true );
+/**
+ * @brief Populate the output target handle list with ASIC target handles based
+ * on the requested type and functional state.
+ *
+ * @parm[out] o_asics Reference to a vector holding target pointers
+ * @parm[in] i_asicType The type of the ASIC targets to be obtained
+ * @parm[in] i_functional Set to true to return only functional targets
+ *
+ * @return N/A
+ */
+void getAllAsics(TARGETING::TargetHandleList& o_asics,
+ TYPE i_asicType,
+ bool i_functional = true);
/**
* @brief Populate the o_vector with target chiplet pointers based on the
diff --git a/src/usr/hwas/common/hwas.C b/src/usr/hwas/common/hwas.C
index eaeaef5a5..5dd7240de 100644
--- a/src/usr/hwas/common/hwas.C
+++ b/src/usr/hwas/common/hwas.C
@@ -647,8 +647,10 @@ errlHndl_t discoverTargets()
{
// TODO:RTC:151617 Need to find a better way
// to initialize the target
- if((target->getAttr<ATTR_TYPE>() == TYPE_SP) ||
- (target->getAttr<ATTR_TYPE>() == TYPE_BMC))
+ TARGETING::ATTR_INIT_TO_AVAILABLE_type initToAvailable = false;
+ if( (target->tryGetAttr<TARGETING::ATTR_INIT_TO_AVAILABLE>(
+ initToAvailable))
+ && (initToAvailable))
{
HwasState hwasState = target->getAttr<ATTR_HWAS_STATE>();
hwasState.deconfiguredByEid = 0;
@@ -657,7 +659,8 @@ errlHndl_t discoverTargets()
hwasState.functional = true;
hwasState.dumpfunctional = false;
target->setAttr<ATTR_HWAS_STATE>(hwasState);
- }else
+ }
+ else
{
HwasState hwasState = target->getAttr<ATTR_HWAS_STATE>();
hwasState.deconfiguredByEid = 0;
diff --git a/src/usr/isteps/istep21/call_update_ucd_flash.C b/src/usr/isteps/istep21/call_update_ucd_flash.C
index 78b59653f..b2fb9e75d 100644
--- a/src/usr/isteps/istep21/call_update_ucd_flash.C
+++ b/src/usr/isteps/istep21/call_update_ucd_flash.C
@@ -33,6 +33,8 @@
#include <initservice/isteps_trace.H>
#include <isteps/ucd/updateUcdFlash.H>
#include <secureboot/trustedbootif.H>
+#include <targeting/common/commontargeting.H>
+#include <targeting/common/utilFilter.H>
#include "call_update_ucd_flash.H"
namespace POWER_SEQUENCER
@@ -56,8 +58,16 @@ void call_update_ucd_flash(void)
// Update UCD flash images, if needed
if (INITSERVICE::spBaseServicesEnabled())
{
- // @TODO RTC 201991
- // break early if no UCD devices
+ TARGETING::TargetHandleList powerSequencers;
+ TARGETING::getAllAsics(powerSequencers,
+ TARGETING::TYPE_POWER_SEQUENCER,true);
+ if(powerSequencers.empty())
+ {
+ // Continue if no functional power sequencers. On MPIPL,
+ // previously bad power sequencers will be ignored, and
+ // Hostboot will not generate new errors.
+ break;
+ }
// Load the UCD flash binary via the MCL in load only mode
MCL::MasterContainerLidMgr mclManager(true);
@@ -71,12 +81,7 @@ void call_update_ucd_flash(void)
// Make sure TPM queue is flushed before doing any I2C operations
TRUSTEDBOOT::flushTpmQueue();
- // @TODO RTC 201990 add flash update algorithm and make trace TRACDBIN
- // call into:
- //
- // errlHndl_t updateUcdFlash(
- // TARGETING::Target* i_pUcd,
- // const void* i_pFlashImage);
+ // Dump some LID info
for(const auto& lid : info.lidIds)
{
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,"LID ID=0x%08X, "
@@ -85,6 +90,31 @@ void call_update_ucd_flash(void)
TRACFBIN(ISTEPS_TRACE::g_trac_isteps_trace,"LID",lid.vAddr,64);
}
+ // Update every power sequencer's data flash
+ for(auto powerSequencer : powerSequencers)
+ {
+ do {
+
+ const auto i2cInfo =
+ powerSequencer->getAttr<TARGETING::ATTR_I2C_CONTROL_INFO>();
+ const auto model = powerSequencer->getAttr<TARGETING::ATTR_MODEL>();
+
+ TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, INFO_MRK
+ "Found functional power sequencer: HUID = 0x%08X, "
+ "Model = 0x%08X, e/p/a = %d/%d/0x%02X",
+ TARGETING::get_huid(powerSequencer),
+ model,
+ i2cInfo.engine, i2cInfo.port, i2cInfo.devAddr);
+
+ // @TODO RTC 201990 add flash update algorithm
+ //
+ // errlHndl_t updateUcdFlash(
+ // TARGETING::Target* i_pUcd,
+ // const void* i_pFlashImage);
+
+ } while(0);
+ }
+
// Destructor automatically unloads the UCD flash binary
}
diff --git a/src/usr/targeting/common/utilFilter.C b/src/usr/targeting/common/utilFilter.C
index 7f2c02074..a58762ff0 100644
--- a/src/usr/targeting/common/utilFilter.C
+++ b/src/usr/targeting/common/utilFilter.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2012,2018 */
+/* Contributors Listed Below - COPYRIGHT 2012,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -220,6 +220,21 @@ void getAllChips( TARGETING::TargetHandleList & o_vector,
}
}
+void getAllAsics(
+ TARGETING::TargetHandleList& o_asics,
+ const TYPE i_asicType,
+ const bool i_functional)
+{
+ if (i_functional)
+ {
+ _getClassResources(o_asics, CLASS_ASIC, i_asicType,
+ UTIL_FILTER_FUNCTIONAL);
+ }
+ else
+ {
+ _getClassResources(o_asics, CLASS_ASIC, i_asicType, UTIL_FILTER_ALL);
+ }
+}
void getAllLogicalCards( TARGETING::TargetHandleList & o_vector,
TYPE i_cardType,
diff --git a/src/usr/targeting/common/xmltohb/attribute_types.xml b/src/usr/targeting/common/xmltohb/attribute_types.xml
index 269cb08eb..4e672e518 100644
--- a/src/usr/targeting/common/xmltohb/attribute_types.xml
+++ b/src/usr/targeting/common/xmltohb/attribute_types.xml
@@ -2684,6 +2684,30 @@
</attribute>
<attribute>
+ <description>
+ Controls whether target discovery code should assume the target is
+ initially present, functional, and powered on (even though later
+ operations may change this). Commonly used to avoid having to do presence
+ detect on certain targets.
+ 0x00: Do not assume target is initially available
+ 0x01: Assume target is initially available
+ </description>
+ <id>INIT_TO_AVAILABLE</id>
+ <persistency>non-volatile</persistency>
+ <readable/>
+ <simpleType>
+ <uint8_t>
+ <default>0x00</default>
+ </uint8_t>
+ </simpleType>
+ <no_export/>
+ <range>
+ <min>0</min>
+ <max>1</max>
+ </range>
+ </attribute>
+
+ <attribute>
<description>Base Address of Interrupt Presenter</description>
<id>INTP_BASE_ADDR</id>
<persistency>volatile-zeroed</persistency>
diff --git a/src/usr/targeting/common/xmltohb/target_types.xml b/src/usr/targeting/common/xmltohb/target_types.xml
index 465103bce..e8820f5e9 100644
--- a/src/usr/targeting/common/xmltohb/target_types.xml
+++ b/src/usr/targeting/common/xmltohb/target_types.xml
@@ -1133,6 +1133,10 @@
<id>I2C_CONTROL_INFO</id>
</attribute>
<attribute>
+ <id>INIT_TO_AVAILABLE</id>
+ <default>1</default>
+ </attribute>
+ <attribute>
<id>TYPE</id>
<default>POWER_SEQUENCER</default>
</attribute>
@@ -1380,6 +1384,10 @@
<id>CLASS</id>
</attribute>
<attribute>
+ <id>INIT_TO_AVAILABLE</id>
+ <default>1</default>
+ </attribute>
+ <attribute>
<default>SP</default>
<id>TYPE</id>
</attribute>
OpenPOWER on IntegriCloud