summaryrefslogtreecommitdiffstats
path: root/src/include/usr/isteps
diff options
context:
space:
mode:
authorMatt Derksen <mderkse1@us.ibm.com>2019-01-15 10:48:31 -0600
committerDaniel M. Crowell <dcrowell@us.ibm.com>2019-01-24 13:12:08 -0600
commitcb35695328fbc1cb6764f048a8dbb3e81faba1e9 (patch)
treeea9cce42514a9f000c687545ab5f417842df04af /src/include/usr/isteps
parent9de9d8f7c5b5c73247dc69925a594fcd07ce060c (diff)
downloadtalos-hostboot-cb35695328fbc1cb6764f048a8dbb3e81faba1e9.tar.gz
talos-hostboot-cb35695328fbc1cb6764f048a8dbb3e81faba1e9.zip
Inform PHYP of NVDIMM protection by OCC
The OCC is responsible for detecting the EPOW signal and triggering the save operation on the NVDIMM. Therefore, if the OCC is not running we are unprotected from a poweroff event. PHYP needs to inform the LPARs using the NV (non-volatile) memory of this state so they can behave accordingly. HBRT is responsible for telling PHYP when we get into this state. There are two ways we can detect this state: a) HBRT explicitly puts the PM complex into reset b) PRD detects a specific FIR bit The message should include this data: - what state we are in (protected or unprotected) - which processor is affected Work for this story will include: - Definition of the new message - Creating a utility function to send the message - Calling utility function to send 'unprotected' message inside of all pm reset paths at runtime Change-Id: Ib015d001d47883a247faedabedb0705ba0f1b215 RTC:201181 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/68870 Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com> 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: TSUNG K. YEUNG <tyeung@us.ibm.com> Reviewed-by: Roland Veloz <rveloz@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/include/usr/isteps')
-rw-r--r--src/include/usr/isteps/nvdimm/nvdimm.H70
-rw-r--r--src/include/usr/isteps/nvdimm/nvdimmreasoncodes.H4
2 files changed, 60 insertions, 14 deletions
diff --git a/src/include/usr/isteps/nvdimm/nvdimm.H b/src/include/usr/isteps/nvdimm/nvdimm.H
index bfe39fcd0..c1df3033e 100644
--- a/src/include/usr/isteps/nvdimm/nvdimm.H
+++ b/src/include/usr/isteps/nvdimm/nvdimm.H
@@ -55,26 +55,29 @@ enum
void nvdimm_restore(TARGETING::TargetHandleList &i_nvdimmList);
#endif
+
/**
- * @brief This function arms the trigger to enable backup in the event
- * of power loss (DDR Reset_n goes low)
+ * @brief This function erases image on the nvdimm target
*
* @param[in] i_nvdimm - nvdimm target with NV controller
*
* @return errlHndl_t - Null if successful, otherwise a pointer to
* the error log.
*/
-errlHndl_t nvdimmArmResetN(TARGETING::Target *i_nvdimm);
+errlHndl_t nvdimmEraseNF(TARGETING::Target *i_nvdimm);
/**
- * @brief This function erases image on the nvdimm target
+ * @brief Set the status flag
*
- * @param[in] i_nvdimm - nvdimm target with NV controller
+ * @param[in] i_nvdimm - nvdimm target
+ *
+ * @param[in] i_status_flag - status flag to set for each nvdimm
*
- * @return errlHndl_t - Null if successful, otherwise a pointer to
- * the error log.
*/
-errlHndl_t nvdimmEraseNF(TARGETING::Target *i_nvdimm);
+void nvdimmSetStatusFlag(TARGETING::Target *i_nvdimm, const uint8_t i_status_flag);
+
+
+#ifdef __HOSTBOOT_RUNTIME
/**
* @brief Check nvdimm error state
@@ -86,14 +89,57 @@ errlHndl_t nvdimmEraseNF(TARGETING::Target *i_nvdimm);
bool nvdimmInErrorState(TARGETING::Target *i_nvdimm);
/**
- * @brief Set the status flag
+ * @brief This function arms the trigger to enable backup in the event
+ * of power loss (DDR Reset_n goes low)
*
- * @param[in] i_nvdimm - nvdimm target
+ * @param[in] i_nvdimm - nvdimm target with NV controller
*
- * @param[in] i_status_flag - status flag to set for each nvdimm
+ * @return errlHndl_t - Null if successful, otherwise a pointer to
+ * the error log.
+ */
+errlHndl_t nvdimmArmResetN(TARGETING::Target *i_nvdimm);
+
+/**
+ * @brief Arms the trigger to enable backup in the event of a power loss
+ * on each NVDIMM
+ *
+ * The trigger (DDR_RESETN to the DIMM) is used to tell the NVDIMM
+ * that we have an EPOW event, so the NV controller can backup the
+ * data from the DRAM to flash. This will enable the NV controller
+ * to react when it sees the trigger toggles.
*
+ * @param[in] i_nvdimmTargetList : list of dimms that are NVDIMMs
+ * @return true if no errors logged, else false
*/
-void nvdimmSetStatusFlag(TARGETING::Target *i_nvdimm, const uint8_t i_status_flag);
+bool nvdimmArm(TARGETING::TargetHandleList &i_nvdimmTargetList);
+
+
+/**
+ * @brief NVDIMM protection state
+ *
+ * NOT_PROTECTED - default state
+ * PROTECTED - switches to this when armed & OCC is in control
+ * UNPROTECTED_BECAUSE_ERROR - PRD detected error on NV controller
+ * Note: error will stay with target preventing PROTECTED status
+ * until power is cycled again
+ */
+enum nvdimm_protection_t
+{
+ NOT_PROTECTED = 0,
+ PROTECTED = 1,
+ UNPROTECTED_BECAUSE_ERROR = 2
+};
+
+/**
+ * @brief Notify PHYP of NVDIMM protection status
+ *
+ * @param i_target Processor with NVDIMM
+ * @param i_state Protection state of NVDIMM
+ */
+errlHndl_t notifyNvdimmProtectionChange(TARGETING::Target* i_target,
+ const nvdimm_protection_t i_state);
+#endif
+
}
#endif // NVDIMM_EXT_H__
diff --git a/src/include/usr/isteps/nvdimm/nvdimmreasoncodes.H b/src/include/usr/isteps/nvdimm/nvdimmreasoncodes.H
index bde22b942..0b48e94a0 100644
--- a/src/include/usr/isteps/nvdimm/nvdimmreasoncodes.H
+++ b/src/include/usr/isteps/nvdimm/nvdimmreasoncodes.H
@@ -72,7 +72,7 @@ enum nvdimmModuleId
NVDIMM_CHECK_ERASE = 0x16,
NVDIMM_ARM_ERASE = 0x17,
NVDIMM_CHECK_READY = 0x18,
-
+ NOTIFY_NVDIMM_PROTECTION_CHG = 0x19,
};
/**
@@ -111,7 +111,7 @@ enum nvdimmReasonCode
NVDIMM_ERASE_FAILED = NVDIMM_COMP_ID | 0x19, // Failure to erase
NVDIMM_RESTORE_FAILED = NVDIMM_COMP_ID | 0x1A, // Failure to restore
NVDIMM_NOT_READY = NVDIMM_COMP_ID | 0x1B, // NVDIMM not ready for host to access
-
+ NVDIMM_NULL_FIRMWARE_REQUEST_PTR = NVDIMM_COMP_ID | 0x1C, // Firmware request is NULL
};
enum UserDetailsTypes
OpenPOWER on IntegriCloud