summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCorey Swenson <cswenson@us.ibm.com>2019-11-20 16:26:49 -0600
committerDaniel M Crowell <dcrowell@us.ibm.com>2019-12-12 15:13:53 -0600
commit5eaa67a665bf3c6d4809718f8f98838c2af80d6b (patch)
treeaa7cde0a48830db2a95fdde05953a53a05c8368b
parentea01d258c6f7493c3c33f8404ce4af3eaf61ef22 (diff)
downloadtalos-hostboot-5eaa67a665bf3c6d4809718f8f98838c2af80d6b.tar.gz
talos-hostboot-5eaa67a665bf3c6d4809718f8f98838c2af80d6b.zip
Always send NV_STATUS to Opal when opal-prd starts
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>
-rw-r--r--src/include/runtime/interface.h5
-rw-r--r--src/include/usr/isteps/nvdimm/nvdimm.H7
-rw-r--r--src/runtime/rt_main.C7
-rw-r--r--src/usr/isteps/nvdimm/nvdimm.C4
-rw-r--r--src/usr/isteps/nvdimm/runtime/nvdimm_rt.C32
5 files changed, 54 insertions, 1 deletions
diff --git a/src/include/runtime/interface.h b/src/include/runtime/interface.h
index 638bf8b89..2d54dd1f3 100644
--- a/src/include/runtime/interface.h
+++ b/src/include/runtime/interface.h
@@ -1124,6 +1124,11 @@ struct postInitCalls_t
*/
void (*callCommitRsvdTraceBufErrl)();
+ /**
+ * @brief Sends current NV_STATUS to host
+ *
+ */
+ void (*callSendNvStatus)();
};
extern hostInterfaces_t* g_hostInterfaces;
diff --git a/src/include/usr/isteps/nvdimm/nvdimm.H b/src/include/usr/isteps/nvdimm/nvdimm.H
index 136e5cda1..97655b24b 100644
--- a/src/include/usr/isteps/nvdimm/nvdimm.H
+++ b/src/include/usr/isteps/nvdimm/nvdimm.H
@@ -271,6 +271,12 @@ bool nvDimmNvmCheckHealthStatus(const TARGETING::TargetHandleList
*/
bool nvDimmNvmCheckHealthStatusOnSystem();
+
+/**
+ * @brief Send NV_STATUS to host
+ */
+void nvdimmSendNvStatus();
+
#endif
/**
@@ -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,
};
diff --git a/src/runtime/rt_main.C b/src/runtime/rt_main.C
index b8f37e46c..3aa2931e6 100644
--- a/src/runtime/rt_main.C
+++ b/src/runtime/rt_main.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2013,2018 */
+/* Contributors Listed Below - COPYRIGHT 2013,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -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();
diff --git a/src/usr/isteps/nvdimm/nvdimm.C b/src/usr/isteps/nvdimm/nvdimm.C
index 3c6c1a055..6576b5a63 100644
--- a/src/usr/isteps/nvdimm/nvdimm.C
+++ b/src/usr/isteps/nvdimm/nvdimm.C
@@ -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
diff --git a/src/usr/isteps/nvdimm/runtime/nvdimm_rt.C b/src/usr/isteps/nvdimm/runtime/nvdimm_rt.C
index 32c4dd18f..f22c7d33a 100644
--- a/src/usr/isteps/nvdimm/runtime/nvdimm_rt.C
+++ b/src/usr/isteps/nvdimm/runtime/nvdimm_rt.C
@@ -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
OpenPOWER on IntegriCloud