diff options
Diffstat (limited to 'src')
3 files changed, 63 insertions, 1 deletions
diff --git a/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_omi_init.C b/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_omi_init.C index 9b46f9f50..40c253590 100644 --- a/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_omi_init.C +++ b/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_omi_init.C @@ -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 @@ -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); diff --git a/src/import/chips/ocmb/explorer/procedures/xml/error_info/exp_omi_init_errors.xml b/src/import/chips/ocmb/explorer/procedures/xml/error_info/exp_omi_init_errors.xml index 7654fe832..eba974e3b 100644 --- a/src/import/chips/ocmb/explorer/procedures/xml/error_info/exp_omi_init_errors.xml +++ b/src/import/chips/ocmb/explorer/procedures/xml/error_info/exp_omi_init_errors.xml @@ -5,7 +5,7 @@ <!-- --> <!-- OpenPOWER HostBoot Project --> <!-- --> -<!-- Contributors Listed Below - COPYRIGHT 2018 --> +<!-- Contributors Listed Below - COPYRIGHT 2018,2019 --> <!-- [+] International Business Machines Corp. --> <!-- --> <!-- --> @@ -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> diff --git a/src/import/generic/memory/lib/utils/find.H b/src/import/generic/memory/lib/utils/find.H index dd5a6dbfd..297334ae7 100644 --- a/src/import/generic/memory/lib/utils/find.H +++ b/src/import/generic/memory/lib/utils/find.H @@ -164,6 +164,19 @@ inline fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP> find_target(const fapi2::Targ } /// +/// @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 /// @return a vector of fapi2::TARGET_TYPE_OCMB_CHIP |