summaryrefslogtreecommitdiffstats
path: root/src/usr/util/runtime/rt_fwnotify.C
diff options
context:
space:
mode:
authorMatt Derksen <mderkse1@us.ibm.com>2018-12-07 13:48:14 -0600
committerDaniel M. Crowell <dcrowell@us.ibm.com>2019-01-24 13:17:16 -0600
commit0b958d9ac441adf71624d9eb59ec0638d86bad59 (patch)
tree26c14d1525147ecce6110e14c1223d3df3bd121e /src/usr/util/runtime/rt_fwnotify.C
parentcb35695328fbc1cb6764f048a8dbb3e81faba1e9 (diff)
downloadtalos-hostboot-0b958d9ac441adf71624d9eb59ec0638d86bad59.tar.gz
talos-hostboot-0b958d9ac441adf71624d9eb59ec0638d86bad59.zip
OCC active notification for NVDIMM protection
TMGT needs to let PHYP know when the NVDIMMs are protected by the OCC. This protection happens when the OCCs are in active state. When the OCC goes active, TMGT will send a msg via HWSV->MBOX to HBRT. HBRT will then notify PHYP of the OCC protection status of the NVDIMMs. Change-Id: Id23ab8020bd76941adcac76279cc46106dc2b1b2 RTC:201290 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/69577 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: Christian R. Geddes <crgeddes@us.ibm.com> Reviewed-by: Roland Veloz <rveloz@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/util/runtime/rt_fwnotify.C')
-rw-r--r--src/usr/util/runtime/rt_fwnotify.C64
1 files changed, 62 insertions, 2 deletions
diff --git a/src/usr/util/runtime/rt_fwnotify.C b/src/usr/util/runtime/rt_fwnotify.C
index 600a99fc6..dae81e7d6 100644
--- a/src/usr/util/runtime/rt_fwnotify.C
+++ b/src/usr/util/runtime/rt_fwnotify.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2017,2018 */
+/* Contributors Listed Below - COPYRIGHT 2017,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -33,6 +33,10 @@
#include <targeting/common/target.H> // TargetHandle_t, getTargetFromHuid
#include <attributeenums.H> // ATTRIBUTE_ID
+#ifdef CONFIG_NVDIMM
+#include <isteps/nvdimm/nvdimm.H> // notify NVDIMM protection change
+#endif
+
using namespace TARGETING;
using namespace RUNTIME;
using namespace ERRORLOG;
@@ -229,6 +233,55 @@ void sbeAttemptRecovery(uint64_t i_data)
TRACFCOMP(g_trac_runtime, EXIT_MRK"sbeAttemptRecovery");
}
+/**
+ * @brief Attempt to notify PHYP of OCC active status change
+ * @param[in] i_data - contains a byte indicating OCC active status
+ * @platform FSP
+ **/
+void occActiveNotification( void * i_data )
+{
+ // data is one byte - 1 = OCC active, 0 = OCC not active
+ uint8_t * l_active = reinterpret_cast<uint8_t*>(i_data);
+
+ // Just a safety check
+ assert(l_active != nullptr, "occActiveNotification: invalid NULL data ptr");
+
+ TRACFCOMP(g_trac_runtime, ENTER_MRK"occActiveNotification: 0x%02X", *l_active);
+
+#ifdef CONFIG_NVDIMM
+ errlHndl_t l_err = nullptr;
+
+ TargetHandleList l_procList;
+ getAllChips(l_procList, TYPE_PROC);
+
+ // Now send msg to PHYP notifying them if OCC is protecting the NVDIMMs
+ for (auto & l_proc : l_procList)
+ {
+ if (*l_active)
+ {
+ l_err = NVDIMM::notifyNvdimmProtectionChange(l_proc,
+ NVDIMM::PROTECTED);
+ }
+ else
+ {
+ l_err = NVDIMM::notifyNvdimmProtectionChange(l_proc,
+ NVDIMM::NOT_PROTECTED);
+ }
+
+ // commit error if it exists
+ // continue notification to all functional processors
+ if (l_err)
+ {
+ TRACFCOMP(g_trac_runtime,
+ ERR_MRK"occActiveNotification: 0x%02X - 0x%.8X processor",
+ *l_active, TARGETING::get_huid(l_proc));
+
+ errlCommit(l_err, RUNTIME_COMP_ID);
+ l_err = nullptr;
+ }
+ }
+#endif
+}
/**
* @brief Attempt to sync attribute setting with the FSP
@@ -316,7 +369,7 @@ void firmware_notify( uint64_t i_len, void *i_data )
errlHndl_t l_err = nullptr;
- // Flag to detect an invlaid/unknown/not used message
+ // Flag to detect an invalid/unknown/not used message
bool l_badMessage = false;
// Capture the unique message data associated with errant message
@@ -351,6 +404,13 @@ void firmware_notify( uint64_t i_len, void *i_data )
{
attrSyncRequest((void*)&(l_hbrt_fw_msg->generic_msg.data));
}
+ else if ((l_hbrt_fw_msg->generic_msg.msgType ==
+ GenericFspMboxMessage_t::MSG_OCC_ACTIVE) &&
+ (l_hbrt_fw_msg->generic_msg.msgq ==
+ MBOX::FSP_OCC_MSGQ_ID) )
+ {
+ occActiveNotification((void*)&(l_hbrt_fw_msg->generic_msg.data));
+ }
// Placing this at end as it does not have a msgq specified
// Want to match msgType & msgq combos first
else if (l_hbrt_fw_msg->generic_msg.msgType ==
OpenPOWER on IntegriCloud