summaryrefslogtreecommitdiffstats
path: root/src/usr/isteps
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 /src/usr/isteps
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>
Diffstat (limited to 'src/usr/isteps')
-rw-r--r--src/usr/isteps/expupd/expupd.C35
1 files changed, 32 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;
OpenPOWER on IntegriCloud