Skip to content

Commit

Permalink
Disable NVDIMM Trigger Before Draminit and Deassert DDR_RESETn During…
Browse files Browse the repository at this point in the history
… MPIPL

- Per the JEDEC spec, DDR_RESETn is masked from the DRAM when the NVDIMM
is armed. This could cause the training to fail if the trigger is not
disabled before training. Two scenarios where this can happen are warm
reboot and cold boot before the backup power module can deplete the
charge

- Deassert DDR_RESETn in MPIPL before triggering the restore.
- Fix the config flag to enable NVDIMM code

Change-Id: I9d25c2f653fc54d379f0dbab49218f5b59a407a0
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/70035
Reviewed-by: Matt Derksen <mderkse1@us.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: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
Tsung Yeung authored and dcrowell77 committed Feb 12, 2019
1 parent 95bbfc7 commit b2027cd
Show file tree
Hide file tree
Showing 13 changed files with 881 additions and 388 deletions.
1 change: 1 addition & 0 deletions src/build/configs/fsprelease.config
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ unset NO_SBE_UPDATES
unset BMC_BT_LPC_IPMI
unset HTMGT
set FSP_BUILD
set NVDIMM

set CONFIG_NVDIMM

Expand Down
5 changes: 4 additions & 1 deletion src/include/usr/isteps/istep13list.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2012,2017 */
/* Contributors Listed Below - COPYRIGHT 2012,2019 */
/* [+] Google Inc. */
/* [+] International Business Machines Corp. */
/* */
Expand Down Expand Up @@ -296,6 +296,9 @@ const DepModInfo g_istep13Dependancies = {
DEP_LIB(libistep13.so),
DEP_LIB(libisteps_mss.so),
DEP_LIB(libcen.so),
#ifdef CONFIG_NVDIMM
DEP_LIB(libnvdimm.so),
#endif
NULL
}
};
Expand Down
6 changes: 5 additions & 1 deletion src/include/usr/isteps/istep14list.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2012,2018 */
/* Contributors Listed Below - COPYRIGHT 2012,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -169,7 +169,11 @@ namespace INITSERVICE
{
ISTEPNAME(14,04,"mss_power_cleanup"),
ISTEP_14::call_mss_power_cleanup,
#ifdef CONFIG_NVDIMM
{ START_FN, EXT_IMAGE, MPIPL_OP | NORMAL_IPL_OP, true }
#else
{ START_FN, EXT_IMAGE, NORMAL_IPL_OP, true }
#endif
},
{
ISTEPNAME(14,05,"proc_setup_bars"),
Expand Down
5 changes: 4 additions & 1 deletion src/include/usr/isteps/istep21list.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2012,2018 */
/* Contributors Listed Below - COPYRIGHT 2012,2019 */
/* [+] Google Inc. */
/* [+] International Business Machines Corp. */
/* */
Expand Down Expand Up @@ -131,6 +131,9 @@ const DepModInfo g_istep21Dependancies = {
#endif
#ifndef CONFIG_FSP_BUILD
DEP_LIB(libnvram.so),
#endif
#ifdef CONFIG_NVDIMM
DEP_LIB(libnvdimm.so),
#endif
NULL
}
Expand Down
20 changes: 14 additions & 6 deletions src/include/usr/isteps/nvdimm/nvdimm.H
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

namespace NVDIMM
{
enum
enum nvdimm_err_status
{
NSTD_VAL_NOPRSV = 0x08, // memory valid, contents not preserved (genesis)
NSTD_VAL_NOPRSV_MASK = 0xF7,
Expand All @@ -41,6 +41,7 @@ enum
NSTD_ERR_NOBKUP_MASK = 0xFE,
NSTD_ERR = 0x03, // NSTD_ERR_NOPRSV+NSTD_ERR_NOBKUP
};

#ifndef __HOSTBOOT_RUNTIME
/**
* @brief Entry function to NVDIMM management
Expand Down Expand Up @@ -76,7 +77,6 @@ errlHndl_t nvdimmEraseNF(TARGETING::Target *i_nvdimm);
*/
void nvdimmSetStatusFlag(TARGETING::Target *i_nvdimm, const uint8_t i_status_flag);


#ifdef __HOSTBOOT_RUNTIME

/**
Expand All @@ -89,15 +89,16 @@ void nvdimmSetStatusFlag(TARGETING::Target *i_nvdimm, const uint8_t i_status_fla
bool nvdimmInErrorState(TARGETING::Target *i_nvdimm);

/**
* @brief This function arms the trigger to enable backup in the event
* of power loss (DDR Reset_n goes low)
* @brief This function arms/disarms the trigger based on i_state
*
* @param[in] i_nvdimm - nvdimm target with NV controller
*
* @param[in] i_state - true to arm, false to disarm
*
* @return errlHndl_t - Null if successful, otherwise a pointer to
* the error log.
*/
errlHndl_t nvdimmArmResetN(TARGETING::Target *i_nvdimm);
errlHndl_t nvdimmChangeArmState(TARGETING::Target *i_nvdimm, bool i_state);

/**
* @brief Arms the trigger to enable backup in the event of a power loss
Expand All @@ -113,7 +114,6 @@ errlHndl_t nvdimmArmResetN(TARGETING::Target *i_nvdimm);
*/
bool nvdimmArm(TARGETING::TargetHandleList &i_nvdimmTargetList);


/**
* @brief NVDIMM protection state
*
Expand All @@ -139,6 +139,14 @@ enum nvdimm_protection_t
errlHndl_t notifyNvdimmProtectionChange(TARGETING::Target* i_target,
const nvdimm_protection_t i_state);
#endif
/**
* @brief Entry function to NVDIMM initialization
* - Checks for ready state
* - Waits for the ongoing backup to complete
* - Disarms the trigger for draminit
* @param i_target nvdimm target
*/
void nvdimm_init(TARGETING::Target *i_nvdimm);

}

Expand Down
5 changes: 3 additions & 2 deletions src/include/usr/vpd/spdenums.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2013,2016 */
/* Contributors Listed Below - COPYRIGHT 2013,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -142,7 +142,8 @@ enum
MODULE_REVISION_CODE_DDR4 = MODULE_REVISION_CODE,
DRAM_STEPPING = SPD_FIRST_NORM_KEYWORD | 0x57,
MANUFACTURING_SECTION_CRC = SPD_FIRST_NORM_KEYWORD | 0x58,
SPD_LAST_NORM_KEYWORD = SPD_FIRST_NORM_KEYWORD | 0x58,
NVM_INIT_TIME = SPD_FIRST_NORM_KEYWORD | 0x59,
SPD_LAST_NORM_KEYWORD = SPD_FIRST_NORM_KEYWORD | 0x59,

// ==============================================================
// Module Specific Keywords (Available for both DDR3 and DDR4 DIMMs)
Expand Down
20 changes: 19 additions & 1 deletion src/usr/isteps/istep13/call_mss_draminit.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015,2017 */
/* Contributors Listed Below - COPYRIGHT 2015,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -50,6 +50,11 @@
#include <p9_mss_draminit.H>
#include <p9c_mss_draminit.H>

#ifdef CONFIG_NVDIMM
// NVDIMM support
#include <isteps/nvdimm/nvdimm.H>
#endif

using namespace ERRORLOG;
using namespace ISTEP;
using namespace ISTEP_ERROR;
Expand Down Expand Up @@ -161,6 +166,19 @@ void* call_mss_draminit (void *io_pArgs)
fapi2::Target<fapi2::TARGET_TYPE_MCBIST> l_fapi_mcbist_target
(l_mcbist_target);

// Initialize the NVDIMMs before hitting draminit
#ifdef CONFIG_NVDIMM
TARGETING::TargetHandleList l_dimmTargetList;
getChildAffinityTargets(l_dimmTargetList, l_mcbist_target, CLASS_NA, TYPE_DIMM);

for (const auto & l_dimm : l_dimmTargetList)
{
if (isNVDIMM(l_dimm))
{
NVDIMM::nvdimm_init(l_dimm);
}
}
#endif
FAPI_INVOKE_HWP(l_err, p9_mss_draminit, l_fapi_mcbist_target);

if (l_err)
Expand Down

0 comments on commit b2027cd

Please sign in to comment.