Skip to content

Commit

Permalink
OCC active notification for NVDIMM protection
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mderkse1 authored and dcrowell77 committed Jan 24, 2019
1 parent cb35695 commit 0b958d9
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/include/runtime/generic_hbrt_fsp_message.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,2018 */
/* Contributors Listed Below - COPYRIGHT 2013,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -191,6 +191,7 @@ struct GenericFspMboxMessage_t
MSG_SINGLE_SCOM_OP = 0x0005,
MSG_MULTI_SCOM_OP = 0x0006,
MSG_ATTR_SYNC_REQUEST = 0x000000A5,
MSG_OCC_ACTIVE = 0x000000A6,
MSG_SBE_ERROR = 0x000000D4,
MSG_SBE_RECOVERY_SUCCESS = 0x000000D5,
MSG_SBE_RECOVERY_FAILED = 0x000000D6,
Expand Down
4 changes: 3 additions & 1 deletion src/include/usr/mbox/mbox_queues.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 @@ -81,6 +81,8 @@ namespace MBOX
FSP_SBE_SYNC_MSGQ_ID = 0x8000000F,
FSP_TARG_DECONFIG_MSGQ = 0x80000010,
FSP_SCOM_OPS_MSGQ = 0x80000011,
FSP_OCC_MSGQ_ID = 0x80000012,

FSP_LID_MSGQ = FSP_ATTR_SYNC_MSGQ,


Expand Down
64 changes: 62 additions & 2 deletions src/usr/util/runtime/rt_fwnotify.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2017,2018 */
/* Contributors Listed Below - COPYRIGHT 2017,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 ==
Expand Down

0 comments on commit 0b958d9

Please sign in to comment.