Skip to content

Commit

Permalink
Add check for compatible upstream templates before enabling Explorer …
Browse files Browse the repository at this point in the history
…metadata

Change-Id: I9c406ae9134799a7f524a4ecc86cc2ff78ec791c
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/87354
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: Louis Stermole <stermole@us.ibm.com>
Reviewed-by: STEPHEN GLANCY <sglancy@us.ibm.com>
Tested-by: HWSV CI <hwsv-ci+hostboot@us.ibm.com>
Reviewed-by: Jennifer A Stofer <stofer@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/87367
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M Crowell <dcrowell@us.ibm.com>
  • Loading branch information
markypizz authored and dcrowell77 committed Dec 2, 2019
1 parent 30077cd commit 7e3eaed
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 1 deletion.
Expand Up @@ -40,6 +40,7 @@
#include <mss_p9a_attribute_getters.H>
#include <generic/memory/mss_git_data_helper.H>
#include <lib/workarounds/exp_omi_workarounds.H>
#include <generic/memory/lib/utils/find.H>

///
/// @brief Verify we know how to talk to the connected device
Expand Down Expand Up @@ -510,6 +511,42 @@ fapi2::ReturnCode omiSetACTagPASIDMetaData(const fapi2::Target<fapi2::TARGET_TYP
l_meta_data_ena,
"Metadata requested but not supported", l_meta_data_ena));

// If we plan on enabling metadata, make sure either upstream templates 5 or 9 are enabled
if (l_meta_data_ena)
{
uint8_t l_enable_template_5 = 0;
uint8_t l_enable_template_9 = 0;
uint8_t l_enable_template_4 = 0;

const auto& l_mcc = mss::find_target<fapi2::TARGET_TYPE_MCC>(i_target);

FAPI_TRY(mss::attr::get_explr_enable_us_tmpl_5(i_target, l_enable_template_5));
FAPI_TRY(mss::attr::get_explr_enable_us_tmpl_9(i_target, l_enable_template_9));

FAPI_ASSERT((l_enable_template_5 == fapi2::ENUM_ATTR_EXPLR_ENABLE_US_TMPL_5_ENABLED) ||
(l_enable_template_9 == fapi2::ENUM_ATTR_EXPLR_ENABLE_US_TMPL_9_ENABLED),
fapi2::METADATA_ENABLE_REQUIRES_TEMPLATE_5_OR_9()
.set_TARGET(i_target)
.set_TMPL_5(l_enable_template_5)
.set_TMPL_9(l_enable_template_9),
"%s METADATA_ENABLE requires upstream template either 5 or 9 to be set. "
"TMPL_5: %u TMPL_9: %u",
mss::c_str(i_target),
l_enable_template_5,
l_enable_template_9)

// Check for downstream template 4 as well. We won't bomb out here, just have an error printout if not enabled
FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_PROC_ENABLE_DL_TMPL_4, l_mcc, l_enable_template_4),
"Error from FAPI_ATTR_GET (ATTR_PROC_ENABLE_DL_TMPL_4)");

if (l_enable_template_4 != fapi2::ENUM_ATTR_PROC_ENABLE_DL_TMPL_4_ENABLED)
{
FAPI_ERR("%s Expected MCC %s TMPL_4 to be enabled for metadata enabling. Was not enabled: may be incorrectly configured",
mss::c_str(i_target),
mss::c_str(l_mcc));
}
}

l_value.insertFromRight<EXPLR_OC_OCTRLPID_MSB_METADATA_ENABLED,
EXPLR_OC_OCTRLPID_MSB_METADATA_ENABLED_LEN>
(l_meta_data_ena);
Expand Down
Expand Up @@ -5,7 +5,7 @@
<!-- -->
<!-- OpenPOWER HostBoot Project -->
<!-- -->
<!-- Contributors Listed Below - COPYRIGHT 2018 -->
<!-- Contributors Listed Below - COPYRIGHT 2018,2019 -->
<!-- [+] International Business Machines Corp. -->
<!-- -->
<!-- -->
Expand Down Expand Up @@ -83,4 +83,16 @@
<ffdc>A</ffdc>
</hwpError>
<!-- ******************************************************************** -->
<hwpError>
<rc>RC_METADATA_ENABLE_REQUIRES_TEMPLATE_5_OR_9</rc>
<description>
Procedure: exp_omi_init.C
Upstream template 5 or 9 need to be enabled for
metadata enable.
</description>
<ffdc>TARGET</ffdc>
<ffdc>TMPL_5</ffdc>
<ffdc>TMPL_9</ffdc>
</hwpError>
<!-- ******************************************************************** -->
</hwpErrors>
13 changes: 13 additions & 0 deletions src/import/generic/memory/lib/utils/find.H
Expand Up @@ -163,6 +163,19 @@ inline fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP> find_target(const fapi2::Targ
.getParent<fapi2::TARGET_TYPE_PROC_CHIP>();
}

///
/// @brief find the MCC given a OCMB_CHIP
/// @param[in] i_target the fapi2 target OCMB_CHIP
/// @return a MCC target.
///
template<>
inline fapi2::Target<fapi2::TARGET_TYPE_MCC> find_target(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>&
i_target)
{
return i_target.getParent<fapi2::TARGET_TYPE_OMI>()
.getParent<fapi2::TARGET_TYPE_MCC>();
}

///
/// @brief find all the OCMB_CHIPs connected to a PROC_CHIP
/// @param[in] i_target a fapi2::Target PROC_CHIP
Expand Down

0 comments on commit 7e3eaed

Please sign in to comment.