summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthew Raybuck <matthew.raybuck@ibm.com>2019-08-30 16:47:34 -0500
committerDaniel M Crowell <dcrowell@us.ibm.com>2019-09-11 21:28:28 -0500
commitd329c59bc1cfa04669b828af30be473011fa1ec4 (patch)
tree2c6de870c2f8b05369a498c405f61bdb684c93fa /src
parentaf5c391af95810fc7cf9414c73652c8f643a84aa (diff)
downloadtalos-hostboot-d329c59bc1cfa04669b828af30be473011fa1ec4.tar.gz
talos-hostboot-d329c59bc1cfa04669b828af30be473011fa1ec4.zip
BPM Updates: Move NVDIMM controller reset and final fw check to end of update
Change-Id: I54832f6197e620885b1506b47af248132173eba4 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/83480 Tested-by: Jenkins Server <pfd-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> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Daniel M Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r--src/usr/isteps/nvdimm/bpm_update.C158
1 files changed, 83 insertions, 75 deletions
diff --git a/src/usr/isteps/nvdimm/bpm_update.C b/src/usr/isteps/nvdimm/bpm_update.C
index 0395991b6..b817efb6e 100644
--- a/src/usr/isteps/nvdimm/bpm_update.C
+++ b/src/usr/isteps/nvdimm/bpm_update.C
@@ -1016,9 +1016,91 @@ errlHndl_t Bpm::runUpdate(BpmFirmwareLidImage i_fwImage,
}
}
-
} while(0);
+ // Reset controller and unlock encryption if necessary
+ errlHndl_t exitErrl = nvdimmResetController(iv_nvdimm);
+ if (exitErrl != nullptr)
+ {
+ TRACFCOMP(g_trac_bpm, ERR_MRK"Bpm::runUpdate() "
+ "Couldn't reset NVDIMM controller.");
+ handleMultipleErrors(errl, exitErrl);
+ }
+
+ // If the update was successful then we must wait for 15 seconds before
+ // polling the status of the BPM since it has to finish updating its
+ // firmware and resetting.
+ TRACFCOMP(g_trac_bpm, "Bpm::runUpdate(): "
+ "Wait for the BPM to finish update and reset procedure, "
+ "sleep for 15 seconds");
+ longSleep(15);
+
+ // Poll SCAP_STATUS register for BPM state before we check final
+ // firmware version.
+ exitErrl = verifyGoodBpmState();
+ if (exitErrl != nullptr)
+ {
+ TRACFCOMP(g_trac_bpm, ERR_MRK"Bpm::runUpdate(): "
+ "Could not verify that BPM was present and enabled!");
+ handleMultipleErrors(errl, exitErrl);
+ }
+
+ uint16_t bpmFwVersion = INVALID_VERSION;
+ exitErrl = getFwVersion(bpmFwVersion);
+ if (exitErrl != nullptr)
+ {
+ TRACFCOMP(g_trac_bpm, ERR_MRK"Bpm::runUpdate(): "
+ "Could not determine firmware version on the BPM");
+ handleMultipleErrors(errl, exitErrl);
+ }
+
+ TRACFCOMP(g_trac_bpm, INFO_MRK"Bpm::runUpdate(): "
+ "Firmware version on the BPM 0x%.4X, "
+ "Firmware version of image 0x%.4X.",
+ bpmFwVersion, i_fwImage.getVersion());
+
+ if (i_fwImage.getVersion() == bpmFwVersion)
+ {
+ TRACFCOMP(g_trac_bpm, INFO_MRK"Bpm::runUpdate(): "
+ "Firmware version on the BPM matches the version in the "
+ "image. Firmware Update Successful.");
+ iv_attemptAnotherUpdate = false;
+ }
+ else
+ {
+ // Attempt another update if one hasn't already been attempted.
+ setAttemptAnotherUpdate();
+ TRACFCOMP(g_trac_bpm, ERR_MRK"Bpm::runUpdate(): "
+ "Version on BPM didn't match image. %s ",
+ iv_attemptAnotherUpdate ?
+ "Attempt another update..."
+ : "Attempts to update the BPM have failed.");
+ if (iv_attemptAnotherUpdate == false)
+ {
+ /*@
+ * @errortype
+ * @severity ERRORLOG::ERRL_SEV_UNRECOVERABLE
+ * @moduleid BPM_RC::BPM_RUN_FW_UPDATES
+ * @reasoncode BPM_RC::BPM_VERSION_MISMATCH
+ * @userdata1[00:31] Version on the BPM
+ * @userdata1[32:63] Version of the flash image
+ * @userdata2 NVDIMM Target HUID associated with this BPM
+ * @devdesc The version on the BPM didn't match the
+ * version in the flash image.
+ * @custdesc A problem occurred during IPL of the system.
+ */
+ exitErrl = new ERRORLOG::ErrlEntry(
+ ERRORLOG::ERRL_SEV_UNRECOVERABLE,
+ BPM_RC::BPM_RUN_FW_UPDATES,
+ BPM_RC::BPM_VERSION_MISMATCH,
+ TWO_UINT32_TO_UINT64(bpmFwVersion,
+ i_fwImage.getVersion()),
+ TARGETING::get_huid(iv_nvdimm));
+ exitErrl->collectTrace(BPM_COMP_NAME);
+ handleMultipleErrors(errl, exitErrl);
+ }
+ }
+
TRACFCOMP(g_trac_bpm, EXIT_MRK"Bpm::runUpdate(): "
"Concluding BPM Update for NVDIMM 0x%.8X %s",
TARGETING::get_huid(iv_nvdimm),
@@ -3771,80 +3853,6 @@ errlHndl_t Bpm::runFirmwareUpdates(BpmFirmwareLidImage i_image)
handleMultipleErrors(errl, exitErrl);
}
- // If the update was successful then we must wait for 15 seconds before
- // polling the status of the BPM since it has to finish updating its
- // firmware and resetting.
- TRACFCOMP(g_trac_bpm, "Bpm::runFirmwareUpdates(): "
- "Wait for the BPM to finish update and reset procedure, "
- "sleep for 15 seconds");
- longSleep(15);
-
- // Poll SCAP_STATUS register for BPM state before we check final
- // firmware version.
- exitErrl = verifyGoodBpmState();
- if (exitErrl != nullptr)
- {
- TRACFCOMP(g_trac_bpm, ERR_MRK"Bpm::runFirmwareUpdates(): "
- "Could not verify that BPM was present and enabled!");
- handleMultipleErrors(errl, exitErrl);
- }
-
- uint16_t bpmFwVersion = INVALID_VERSION;
- exitErrl = getFwVersion(bpmFwVersion);
- if (exitErrl != nullptr)
- {
- TRACFCOMP(g_trac_bpm, ERR_MRK"Bpm::runFirmwareUpdates(): "
- "Could not determine firmware version on the BPM");
- handleMultipleErrors(errl, exitErrl);
- }
-
- TRACFCOMP(g_trac_bpm, INFO_MRK"Bpm::runFirmwareUpdates(): "
- "Firmware version on the BPM 0x%.4X, "
- "Firmware version of image 0x%.4X.",
- bpmFwVersion, i_image.getVersion());
-
- if (i_image.getVersion() == bpmFwVersion)
- {
- TRACFCOMP(g_trac_bpm, INFO_MRK"Bpm::runFirmwareUpdates(): "
- "Firmware version on the BPM matches the version in the "
- "image. Firmware Update Successful.");
- iv_attemptAnotherUpdate = false;
- }
- else
- {
- // Attempt another update if one hasn't already been attempted.
- setAttemptAnotherUpdate();
- TRACFCOMP(g_trac_bpm, ERR_MRK"Bpm:: runFirmwareUpdates(): "
- "Version on BPM didn't match image. %s ",
- iv_attemptAnotherUpdate ?
- "Attempt another update..."
- : "Attempts to update the BPM have failed.");
- if (iv_attemptAnotherUpdate == false)
- {
- /*@
- * @errortype
- * @severity ERRORLOG::ERRL_SEV_UNRECOVERABLE
- * @moduleid BPM_RC::BPM_RUN_FW_UPDATES
- * @reasoncode BPM_RC::BPM_VERSION_MISMATCH
- * @userdata1[00:31] Version on the BPM
- * @userdata1[32:63] Version of the flash image
- * @userdata2 NVDIMM Target HUID associated with this BPM
- * @devdesc The version on the BPM didn't match the
- * version in the flash image.
- * @custdesc A problem occurred during IPL of the system.
- */
- exitErrl = new ERRORLOG::ErrlEntry(
- ERRORLOG::ERRL_SEV_UNRECOVERABLE,
- BPM_RC::BPM_RUN_FW_UPDATES,
- BPM_RC::BPM_VERSION_MISMATCH,
- TWO_UINT32_TO_UINT64(bpmFwVersion,
- i_image.getVersion()),
- TARGETING::get_huid(iv_nvdimm));
- exitErrl->collectTrace(BPM_COMP_NAME);
- handleMultipleErrors(errl, exitErrl);
- }
- }
-
return errl;
}
OpenPOWER on IntegriCloud