From 7e3eaedffa203b920c0f8ddcff2f38f92a9b29a4 Mon Sep 17 00:00:00 2001 From: Mark Pizzutillo Date: Mon, 18 Nov 2019 17:24:22 -0500 Subject: Add check for compatible upstream templates before enabling Explorer metadata Change-Id: I9c406ae9134799a7f524a4ecc86cc2ff78ec791c Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/87354 Tested-by: FSP CI Jenkins Tested-by: Jenkins Server Tested-by: Hostboot CI Reviewed-by: Louis Stermole Reviewed-by: STEPHEN GLANCY Tested-by: HWSV CI Reviewed-by: Jennifer A Stofer Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/87367 Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Reviewed-by: Daniel M Crowell --- .../explorer/procedures/hwp/memory/exp_omi_init.C | 37 ++++++++++++++++++++++ .../xml/error_info/exp_omi_init_errors.xml | 14 +++++++- src/import/generic/memory/lib/utils/find.H | 13 ++++++++ 3 files changed, 63 insertions(+), 1 deletion(-) (limited to 'src/import') 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 #include #include +#include /// /// @brief Verify we know how to talk to the connected device @@ -510,6 +511,42 @@ fapi2::ReturnCode omiSetACTagPASIDMetaData(const fapi2::Target(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 (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 @@ - + @@ -83,4 +83,16 @@ A + + RC_METADATA_ENABLE_REQUIRES_TEMPLATE_5_OR_9 + + Procedure: exp_omi_init.C + Upstream template 5 or 9 need to be enabled for + metadata enable. + + TARGET + TMPL_5 + TMPL_9 + + 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 @@ -163,6 +163,19 @@ inline fapi2::Target find_target(const fapi2::Targ .getParent(); } +/// +/// @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 find_target(const fapi2::Target& + i_target) +{ + return i_target.getParent() + .getParent(); +} + /// /// @brief find all the OCMB_CHIPs connected to a PROC_CHIP /// @param[in] i_target a fapi2::Target PROC_CHIP -- cgit v1.2.1