Skip to content

Commit

Permalink
NVDIMM: Mask mbacalfir at the beginning of restore step during mpipl
Browse files Browse the repository at this point in the history
Mask MBACALFIR[8]: EVENT_N: MBACALFIR_MASK_OR = 0x0080000000000000
at the beginning of nvdimm_restore() to avoid PRD errors.
This mask is normal for non-mpipl path, so just needed for mpipl.

CQ: SW477028
Change-Id: I3368b89af67f58edecb42dd0a99ca7799679e84d
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/84190
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Reviewed-by: TSUNG K YEUNG <tyeung@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: Corey V Swenson <cswenson@us.ibm.com>
Reviewed-by: Daniel M Crowell <dcrowell@us.ibm.com>
  • Loading branch information
mderkse1 authored and dcrowell77 committed Jan 10, 2020
1 parent 2a1b24b commit 45cb275
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 3 deletions.
34 changes: 32 additions & 2 deletions src/usr/isteps/nvdimm/nvdimm.C
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2014,2019 */
/* Contributors Listed Below - COPYRIGHT 2014,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -1134,6 +1134,32 @@ errlHndl_t nvdimmValidImage(Target *i_nvdimm, bool &o_imgValid)
return l_err;
}

void maskMbacalfir_eventn(TARGETING::Target* i_nvdimm)
{
errlHndl_t l_err = nullptr;
TargetHandleList l_mcaList;
uint64_t l_writeData;
uint32_t l_writeAddress;
size_t l_writeSize = sizeof(l_writeData);

getParentAffinityTargets(l_mcaList, i_nvdimm, CLASS_UNIT, TYPE_MCA);
assert(l_mcaList.size(), "maskMbacalfir_eventn() failed to find parent MCA.");

l_writeAddress = MBACALFIR_OR_MASK_REG;
l_writeData = MBACALFIR_EVENTN_OR_BIT;
l_err = deviceWrite(l_mcaList[0], &l_writeData, l_writeSize,
DEVICE_SCOM_ADDRESS(l_writeAddress));
if(l_err)
{
TRACFCOMP(g_trac_nvdimm,
ERR_MRK "Failed to mask MBACALFIR EventN using address "
"0x%08x on NVDIMM 0x%08X MCA 0x%08X",
l_writeAddress, get_huid(i_nvdimm), get_huid(l_mcaList[0]));
l_err->collectTrace(NVDIMM_COMP_NAME);
errlCommit( l_err, NVDIMM_COMP_ID );
}
}

#ifndef __HOSTBOOT_RUNTIME
/**
* @brief This function handles all the restore related operations.
Expand Down Expand Up @@ -1175,6 +1201,11 @@ errlHndl_t nvdimmRestore(TargetHandleList& io_nvdimmList, uint8_t &i_mpipl)
if (i_mpipl)
{
TRACFCOMP(g_trac_nvdimm, "nvdimmRestore(): in MPIPL");

// To avoid PRD error during mpipl need to Mask MBACALFIR EventN
// Note: a regular IPL will already have this masked
maskMbacalfir_eventn(*it);

FAPI_INVOKE_HWP(l_err, mss::ddr_resetn, l_fapi_mca, HIGH);

if (l_err)
Expand Down Expand Up @@ -1755,7 +1786,6 @@ errlHndl_t nvdimmEpowSetup(TargetHandleList &i_nvdimmList)
}



/**
* @brief Entry function to NVDIMM restore
* - Restore image from NVDIMM NAND flash to DRAM
Expand Down
10 changes: 9 additions & 1 deletion src/usr/isteps/nvdimm/nvdimm.H
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2014,2019 */
/* Contributors Listed Below - COPYRIGHT 2014,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -513,6 +513,14 @@ enum mbacal_bitmask_values : uint64_t
MBACALFIR_UNMASK_BIT = 0xff7fffffffffffff,
};


/**
* @brief Mask MCBACALFIR Event N to prevent PRD from handling event
*
* @param[in] - i_nvdimm - nvdimm target for operation on its parent MCA
*/
void maskMbacalfir_eventn(TARGETING::Target* i_nvdimm);

/**
* @brief Wrapper to call deviceOp to read the NV controller via I2C
*
Expand Down

0 comments on commit 45cb275

Please sign in to comment.