diff options
author | Tsung Yeung <tyeung@us.ibm.com> | 2018-10-30 16:20:12 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2019-01-09 12:41:27 -0600 |
commit | 468aed31ffbed5d33e14de5959c66230ed50ee05 (patch) | |
tree | bcd09912499f1b786a0cacef4b366e69043060a2 /src/include/usr | |
parent | b9a994a7a57a0d909b452e4e8a385224498beae3 (diff) | |
download | talos-hostboot-468aed31ffbed5d33e14de5959c66230ed50ee05.tar.gz talos-hostboot-468aed31ffbed5d33e14de5959c66230ed50ee05.zip |
Move NVDIMM Erase and Arm to Runtime
-Move erase and arm to after OCC has started
-Address several TODOs in I2d68123ceb0b8e7a33b54f9acad0968670a67ea9
-Combine arm and erase into an atomic operation with ATOMIC_SAVE_AND_ERASE
Change-Id: Iad06f6fe7128df3defc4ded57b0151f9c4b9d15e
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/68197
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Tested-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/include/usr')
-rw-r--r-- | src/include/usr/i2c/nvdimmif.H | 9 | ||||
-rw-r--r-- | src/include/usr/isteps/nvdimm/nvdimm.H | 60 | ||||
-rw-r--r-- | src/include/usr/targeting/common/util.H | 11 |
3 files changed, 66 insertions, 14 deletions
diff --git a/src/include/usr/i2c/nvdimmif.H b/src/include/usr/i2c/nvdimmif.H index fb875149f..2b60ac4de 100644 --- a/src/include/usr/i2c/nvdimmif.H +++ b/src/include/usr/i2c/nvdimmif.H @@ -30,15 +30,6 @@ namespace NVDIMM { -//TODO: move isNVDIMM() to targeting/common/util.C -/** - * @brief Determine if the given dimm target is an NVDIMM - * - * @param[in] i_target : dimm target to check - * - * @return bool - True if the given target is an NVDIMM - */ -bool isNVDIMM( TARGETING::Target * i_target ); /** * @brief Return a set of information related to every unique diff --git a/src/include/usr/isteps/nvdimm/nvdimm.H b/src/include/usr/isteps/nvdimm/nvdimm.H index 3c448a9ac..bfe39fcd0 100644 --- a/src/include/usr/isteps/nvdimm/nvdimm.H +++ b/src/include/usr/isteps/nvdimm/nvdimm.H @@ -22,14 +22,26 @@ /* permissions and limitations under the License. */ /* */ /* IBM_PROLOG_END_TAG */ -#ifndef NVDIMM_H__ -#define NVDIMM_H__ +#ifndef NVDIMM_EXT_H__ +#define NVDIMM_EXT_H__ #include <targeting/common/util.H> namespace NVDIMM { - +enum +{ + NSTD_VAL_NOPRSV = 0x08, // memory valid, contents not preserved (genesis) + NSTD_VAL_NOPRSV_MASK = 0xF7, + NSTD_VAL_PRSV = 0x04, // memory contents preserved + NSTD_VAL_PRSV_MASK = 0xFB, + NSTD_ERR_NOPRSV = 0x02, // memory failed to preserve contents + NSTD_ERR_NOPRSV_MASK = 0xFD, + NSTD_ERR_NOBKUP = 0x01, // memory unable to preserve future content + NSTD_ERR_NOBKUP_MASK = 0xFE, + NSTD_ERR = 0x03, // NSTD_ERR_NOPRSV+NSTD_ERR_NOBKUP +}; +#ifndef __HOSTBOOT_RUNTIME /** * @brief Entry function to NVDIMM management * - Restore image from NVDIMM NAND flash to DRAM @@ -41,8 +53,48 @@ namespace NVDIMM * **/ 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) + * + * @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); + +/** + * @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 nvdimmEraseNF(TARGETING::Target *i_nvdimm); + +/** + * @brief Check nvdimm error state + * + * @param[in] i_nvdimm - nvdimm target + * + * @return bool - true if nvdimm is in any error state, false otherwise + */ +bool nvdimmInErrorState(TARGETING::Target *i_nvdimm); +/** + * @brief Set the status flag + * + * @param[in] i_nvdimm - nvdimm target + * + * @param[in] i_status_flag - status flag to set for each nvdimm + * + */ +void nvdimmSetStatusFlag(TARGETING::Target *i_nvdimm, const uint8_t i_status_flag); } -#endif // NVDIMM_H__ +#endif // NVDIMM_EXT_H__ diff --git a/src/include/usr/targeting/common/util.H b/src/include/usr/targeting/common/util.H index 68b61b1f1..971408d16 100644 --- a/src/include/usr/targeting/common/util.H +++ b/src/include/usr/targeting/common/util.H @@ -172,6 +172,15 @@ bool orderByNodeAndPosition( Target* i_firstProc, */ uint8_t is_fused_mode( ); -} // TARGETING +/** + * @brief Determine if the given dimm target is an NVDIMM + * + * @param[in] i_target : dimm target to check + * + * @return bool - True if the given target is an NVDIMM + */ +bool isNVDIMM( TARGETING::Target * i_target ); + +} #endif // __TARGETING_COMMON_UTIL_H |