summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Crowell <dcrowell@us.ibm.com>2019-10-10 14:56:48 -0500
committerWilliam G Hoffa <wghoffa@us.ibm.com>2019-10-21 07:55:36 -0500
commita0207ea107c872b19372646070d8556f985d6861 (patch)
treea70fbd5b51e56508138e9fbf57610cbaed1bbb2a
parent9546b72bc443ccf6b7cedb717759a583bacb9d30 (diff)
downloadtalos-hostboot-a0207ea107c872b19372646070d8556f985d6861.tar.gz
talos-hostboot-a0207ea107c872b19372646070d8556f985d6861.zip
Add attribute to explicitly force OCMB Firmware update behavior
Allow us to override the default behavior (update when versions don't match) via an attribute. The options will be: - Update if versions do not match - Never update - Always update - Do the version check but don't actually update the code Change-Id: I5fdaa3cd2adf4cfb96f7ad7568de5d2c083d276c Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/85180 Reviewed-by: Glenn Miles <milesg@ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Reviewed-by: William G Hoffa <wghoffa@us.ibm.com>
-rw-r--r--src/usr/isteps/expupd/expupd.C35
-rw-r--r--src/usr/targeting/common/xmltohb/attribute_types.xml42
-rw-r--r--src/usr/targeting/common/xmltohb/target_types.xml3
3 files changed, 77 insertions, 3 deletions
diff --git a/src/usr/isteps/expupd/expupd.C b/src/usr/isteps/expupd/expupd.C
index 74231b5a5..3f63ac191 100644
--- a/src/usr/isteps/expupd/expupd.C
+++ b/src/usr/isteps/expupd/expupd.C
@@ -132,6 +132,10 @@ void updateAll(IStepError& o_stepError)
TARGETING::TargetHandleList l_ocmbTargetList;
getAllChips(l_ocmbTargetList, TYPE_OCMB_CHIP);
+ Target* l_pTopLevel = nullptr;
+ targetService().getTopLevelTarget( l_pTopLevel );
+ assert(l_pTopLevel, "expupd::updateAll: no TopLevelTarget");
+
TRACFCOMP(g_trac_expupd, ENTER_MRK
"updateAll: %d ocmb chips found",
l_ocmbTargetList.size());
@@ -144,6 +148,18 @@ void updateAll(IStepError& o_stepError)
break;
}
+ // Check if we have any overrides to force our behavior
+ auto l_forced_behavior =
+ l_pTopLevel->getAttr<TARGETING::ATTR_OCMB_FW_UPDATE_OVERRIDE>();
+
+ // Exit now if told to
+ if( TARGETING::OCMB_FW_UPDATE_BEHAVIOR_PREVENT_UPDATE
+ == l_forced_behavior )
+ {
+ TRACFCOMP(g_trac_expupd, INFO_MRK "Skipping update due to override (PREVENT_UPDATE)");
+ break;
+ }
+
// Read explorer fw image from pnor
PNOR::SectionInfo_t l_pnorSectionInfo;
rawImageInfo_t l_imageInfo;
@@ -269,6 +285,14 @@ void updateAll(IStepError& o_stepError)
"updateAll: SHA512 hash for ocmb[0x%08x]"
" matches SHA512 hash of PNOR image.",
TARGETING::get_huid(l_ocmbTarget));
+
+ // Add every OCMB to the update list if told to
+ if( TARGETING::OCMB_FW_UPDATE_BEHAVIOR_FORCE_UPDATE
+ == l_forced_behavior )
+ {
+ TRACFCOMP(g_trac_expupd, INFO_MRK "Forcing update due to override (FORCE_UPDATE)");
+ l_flashUpdateList.push_back(l_ocmbTarget);
+ }
}
}
@@ -276,6 +300,14 @@ void updateAll(IStepError& o_stepError)
"updateAll: updating flash for %d OCMB chips",
l_flashUpdateList.size());
+ // Exit now if we were asked to only do the check portion
+ if( TARGETING::OCMB_FW_UPDATE_BEHAVIOR_CHECK_BUT_NO_UPDATE
+ == l_forced_behavior )
+ {
+ TRACFCOMP(g_trac_expupd, INFO_MRK "Skipping update due to override (CHECK_BUT_NO_UPDATE)");
+ break;
+ }
+
// update each explorer in the list of chips needing updates
for(const auto & l_ocmb : l_flashUpdateList)
{
@@ -344,9 +376,6 @@ void updateAll(IStepError& o_stepError)
{
TRACFCOMP(g_trac_expupd,
"updateAll: OCMB chip(s) was updated. Requesting reboot...");
- Target* l_pTopLevel = nullptr;
- targetService().getTopLevelTarget( l_pTopLevel );
- assert(l_pTopLevel, "expupd::updateAll: no TopLevelTarget");
auto l_reconfigAttr =
l_pTopLevel->getAttr<TARGETING::ATTR_RECONFIGURE_LOOP>();
l_reconfigAttr |= RECONFIGURE_LOOP_OCMB_FW_UPDATE;
diff --git a/src/usr/targeting/common/xmltohb/attribute_types.xml b/src/usr/targeting/common/xmltohb/attribute_types.xml
index 9b4d6764e..72842c83d 100644
--- a/src/usr/targeting/common/xmltohb/attribute_types.xml
+++ b/src/usr/targeting/common/xmltohb/attribute_types.xml
@@ -5446,6 +5446,48 @@
<no_export/>
</attribute>
+ <enumerationType>
+ <default>DEFAULT_ALL</default>
+ <description>Enumeration for the various OCMB Firmware update behaviors</description>
+ <enumerator>
+ <!-- Compare actual and desired versions, update if they do not match -->
+ <name>CHECK_VERSIONS</name>
+ <value>0</value>
+ </enumerator>
+ <enumerator>
+ <!-- Force an update regardless of the current version in the hardware -->
+ <name>FORCE_UPDATE</name>
+ <value>1</value>
+ </enumerator>
+ <enumerator>
+ <!-- Do not update the firwmare, do not even check the versions -->
+ <name>PREVENT_UPDATE</name>
+ <value>2</value>
+ </enumerator>
+ <enumerator>
+ <!-- Compare actual and desired versions, but do not do any updates -->
+ <name>CHECK_BUT_NO_UPDATE</name>
+ <value>3</value>
+ </enumerator>
+ <id>OCMB_FW_UPDATE_BEHAVIOR</id>
+ </enumerationType>
+
+ <attribute>
+ <description>
+ Force specific behavior for the OCMB Firmware update function.
+ </description>
+ <id>OCMB_FW_UPDATE_OVERRIDE</id>
+ <!-- @fixme-RTC:244420-Should be volatile-zero -->
+ <persistency>volatile</persistency>
+ <readable/>
+ <simpleType>
+ <uint8_t>
+ <!-- Cannot use enumeration directly due to override issue -->
+ <default>2</default>
+ </uint8_t>
+ </simpleType>
+ </attribute>
+
<attribute>
<description>
Physical entity path an OMI's associated OMIC parent target
diff --git a/src/usr/targeting/common/xmltohb/target_types.xml b/src/usr/targeting/common/xmltohb/target_types.xml
index bc0858b5d..737929ab9 100644
--- a/src/usr/targeting/common/xmltohb/target_types.xml
+++ b/src/usr/targeting/common/xmltohb/target_types.xml
@@ -2125,6 +2125,9 @@
<id>NVDIMM_ENCRYPTION_KEYS_FW</id>
</attribute>
<attribute>
+ <id>OCMB_FW_UPDATE_OVERRIDE</id>
+ </attribute>
+ <attribute>
<id>O_EREPAIR_THRESHOLD_FIELD</id>
</attribute>
<attribute>
OpenPOWER on IntegriCloud