Skip to content

Commit

Permalink
Always send NV_STATUS to Opal when opal-prd starts
Browse files Browse the repository at this point in the history
Opal does not persist NVDIMM status state so HBRT
must send this info to Opal when opal-prd starts.

Change-Id: I0771c63ff2857f9b70fbfad5760267e3da463009
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/87541
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: Roland Veloz <rveloz@us.ibm.com>
Reviewed-by: Matt Derksen <mderkse1@us.ibm.com>
Reviewed-by: Daniel M Crowell <dcrowell@us.ibm.com>
  • Loading branch information
cvswen authored and dcrowell77 committed Dec 12, 2019
1 parent ea01d25 commit 5eaa67a
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/include/runtime/interface.h
Expand Up @@ -1124,6 +1124,11 @@ struct postInitCalls_t
*/
void (*callCommitRsvdTraceBufErrl)();

/**
* @brief Sends current NV_STATUS to host
*
*/
void (*callSendNvStatus)();
};

extern hostInterfaces_t* g_hostInterfaces;
Expand Down
7 changes: 7 additions & 0 deletions src/include/usr/isteps/nvdimm/nvdimm.H
Expand Up @@ -271,6 +271,12 @@ bool nvDimmNvmCheckHealthStatus(const TARGETING::TargetHandleList
*/
bool nvDimmNvmCheckHealthStatusOnSystem();


/**
* @brief Send NV_STATUS to host
*/
void nvdimmSendNvStatus();

#endif

/**
Expand Down Expand Up @@ -299,6 +305,7 @@ enum nvdimm_protection_t
NVDIMM_ENCRYPTION_ERROR = 6,
ENCRYPTION_ENABLED = 7,
ENCRYPTION_DISABLED = 8,
SEND_NV_STATUS = 11,
/* deprecated, still used by PRD */
UNPROTECTED_BECAUSE_ERROR = 4,
};
Expand Down
7 changes: 6 additions & 1 deletion src/runtime/rt_main.C
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2013,2018 */
/* Contributors Listed Below - COPYRIGHT 2013,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -166,6 +166,11 @@ runtimeInterfaces_t* rt_start(hostInterfaces_t* intf)
// (HTMGT not compiled in by default)
}

#ifdef CONFIG_NVDIMM
// Update hose with current NV_STATUS
rtPost->callSendNvStatus();
#endif

// do any version mismatch fixups
rt_version_fixup();

Expand Down
4 changes: 4 additions & 0 deletions src/usr/isteps/nvdimm/nvdimm.C
Expand Up @@ -3660,6 +3660,10 @@ errlHndl_t notifyNvdimmProtectionChange(Target* i_target,
break;
case ENCRYPTION_DISABLED:
l_clr_encryption = true;
break;
case SEND_NV_STATUS:
// no action, just send status
break;
}

// Set the attribute and send it to the FSP if needed
Expand Down
32 changes: 32 additions & 0 deletions src/usr/isteps/nvdimm/runtime/nvdimm_rt.C
Expand Up @@ -1021,4 +1021,36 @@ bool nvDimmNvmCheckHealthStatusOnSystem()
} // end nvDimmCheckHealthStatusOnSystem


/**
* @brief Send NV_STATUS to host
*/
void nvdimmSendNvStatus()
{
// Send NV_STATUS for all nvdimms
TargetHandleList l_nvdimmTargetList;
nvdimm_getNvdimmList(l_nvdimmTargetList);
for (const auto & l_nvdimm : l_nvdimmTargetList)
{
errlHndl_t l_err = nullptr;
l_err = notifyNvdimmProtectionChange(l_nvdimm,SEND_NV_STATUS);
if (l_err)
{
errlCommit(l_err, NVDIMM_COMP_ID);
}
}
}


struct registerNvdimmRt
{
registerNvdimmRt()
{
// Register function to call at end of RT init
postInitCalls_t * rt_post = getPostInitCalls();
rt_post->callSendNvStatus = &nvdimmSendNvStatus;
}
};

registerNvdimmRt g_registerNvdimmRt;

} // end NVDIMM namespace

0 comments on commit 5eaa67a

Please sign in to comment.