diff options
author | Mark Pizzutillo <Mark.Pizzutillo@ibm.com> | 2019-07-29 18:23:07 -0500 |
---|---|---|
committer | Christian R Geddes <crgeddes@us.ibm.com> | 2019-08-13 14:36:14 -0500 |
commit | 3c930cf140f925293af0ce5c28e7e3b13c75d0e7 (patch) | |
tree | 055acec39dc9ddf4aa753f6f1c2810f2567726a5 /src/import/chips/ocmb/explorer/procedures/hwp/memory | |
parent | 24762ab00d2ac17a7b48002fb312e3c41e56c32a (diff) | |
download | talos-hostboot-3c930cf140f925293af0ce5c28e7e3b13c75d0e7.tar.gz talos-hostboot-3c930cf140f925293af0ce5c28e7e3b13c75d0e7.zip |
Add workaround for gemini OMI config settings
Change-Id: I4318e5d696056a3250999248aec360ce5ea7bcd3
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/81320
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: STEPHEN GLANCY <sglancy@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com>
Tested-by: HWSV CI <hwsv-ci+hostboot@us.ibm.com>
Reviewed-by: Louis Stermole <stermole@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: Jennifer A Stofer <stofer@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/81326
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: Christian R Geddes <crgeddes@us.ibm.com>
Diffstat (limited to 'src/import/chips/ocmb/explorer/procedures/hwp/memory')
4 files changed, 51 insertions, 2 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 94929c1cb..9b46f9f50 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 @@ -39,6 +39,7 @@ #include <mss_explorer_attribute_getters.H> #include <mss_p9a_attribute_getters.H> #include <generic/memory/mss_git_data_helper.H> +#include <lib/workarounds/exp_omi_workarounds.H> /// /// @brief Verify we know how to talk to the connected device @@ -607,6 +608,7 @@ fapi2::ReturnCode exp_omi_init(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP> mss::display_git_commit_info("exp_omi_init"); FAPI_DBG("Start"); + FAPI_TRY(mss::exp::workarounds::omi::gem_setup_config(i_target)); FAPI_TRY(omiDeviceVerify(i_target)); FAPI_TRY(omiSetUpstreamTemplates(i_target)); FAPI_TRY(omiValidateDownstream(i_target)); diff --git a/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/omi/exp_omi_utils.H b/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/omi/exp_omi_utils.H index 577743a06..cb52d1ac0 100644 --- a/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/omi/exp_omi_utils.H +++ b/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/omi/exp_omi_utils.H @@ -136,6 +136,7 @@ inline fapi2::ReturnCode check_enterprise_mode( const fapi2::Target<fapi2::TARGE fapi2::buffer<uint64_t>& i_data ) { const bool l_actual = mss::exp::omi::get_enterprise_config(i_data); + FAPI_ASSERT(l_actual == i_is_enterprise, fapi2::MSS_EXP_ENTERPRISE_SETUP_ERROR() .set_EXPECTED(i_is_enterprise) @@ -145,6 +146,8 @@ inline fapi2::ReturnCode check_enterprise_mode( const fapi2::Target<fapi2::TARGE "%s failed to setup enterprise mode properly expected: %u actual: %u register data 0x%016lx", mss::c_str(i_target), i_is_enterprise, l_actual, i_data); + return fapi2::FAPI2_RC_SUCCESS; + fapi_try_exit: return fapi2::current_err; } diff --git a/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/workarounds/exp_omi_workarounds.C b/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/workarounds/exp_omi_workarounds.C index e12d3381c..1bfe94371 100644 --- a/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/workarounds/exp_omi_workarounds.C +++ b/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/workarounds/exp_omi_workarounds.C @@ -33,12 +33,15 @@ // *HWP Level: 2 // *HWP Consumed by: Memory +#include <fapi2.H> #include <generic/memory/lib/utils/find.H> #include <lib/workarounds/exp_omi_workarounds.H> #include <lib/shared/exp_consts.H> #include <lib/omi/exp_omi_utils.H> #include <generic/memory/lib/mss_generic_attribute_getters.H> #include <generic/memory/lib/mss_generic_system_attribute_getters.H> +#include <lib/inband/exp_inband.H> +#include <exp_oc_regs.H> namespace mss { @@ -137,6 +140,40 @@ fapi_try_exit: return fapi2::current_err; } +/// @brief Determine if / perform the gemini workaround to setup the OMI config registers +/// +/// @param[in] i_target OCMB (gemini) +/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff success, else error +/// @note Gemini workaround to setup METADATA and TEMPLATE bits before doing reads +/// +fapi2::ReturnCode gem_setup_config(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target) +{ + uint8_t l_gemini_config_workaround = 0; + + // Check if gemini workaround should be performed + FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_CHIP_EC_FEATURE_GEMINI_OMI_SETUP_CONFIG_WORKAROUND, i_target, + l_gemini_config_workaround), + "Error getting ATTR_CHIP_EC_FEATURE_GEMINI_OMI_SETUP_CONFIG_WORKAROUND"); + + if (l_gemini_config_workaround) + { + // Set metadata bits + fapi2::buffer<uint32_t> l_value; + l_value.setBit<EXPLR_OC_OCTRLPID_MSB_METADATA_SUPPORTED>(); + l_value.setBit<EXPLR_OC_OCTRLPID_MSB_METADATA_ENABLED>(); + FAPI_TRY(mss::exp::ib::putOCCfg(i_target, EXPLR_OC_OCTRLPID_MSB, l_value)); + + // Set template bits + l_value.flush<0>(); + l_value.setBit<EXPLR_OC_OTTCFG_MSB_TEMPLATE_0>(); + l_value.setBit<EXPLR_OC_OTTCFG_MSB_TEMPLATE_5>(); + FAPI_TRY(mss::exp::ib::putOCCfg(i_target, EXPLR_OC_OTTCFG_MSB, l_value)); + } + +fapi_try_exit: + return fapi2::current_err; +} + } // omi } // workarounds } // exp diff --git a/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/workarounds/exp_omi_workarounds.H b/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/workarounds/exp_omi_workarounds.H index 39a77497c..5d45f2e13 100644 --- a/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/workarounds/exp_omi_workarounds.H +++ b/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/workarounds/exp_omi_workarounds.H @@ -33,8 +33,8 @@ // *HWP Level: 2 // *HWP Consumed by: Memory -#ifndef EXP_OMI_WORKAROUNDS_H_ -#define EXP_OMI_WORKAROUNDS_H_ +#ifndef _EXP_OMI_WORKAROUNDS_H_ +#define _EXP_OMI_WORKAROUNDS_H_ #include <fapi2.H> @@ -79,6 +79,13 @@ fapi2::ReturnCode prbs_ocmb( fapi2::ReturnCode gem_menterp(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP> i_target, uint8_t& o_workaround); +/// @brief Determine if / perform the gemini workaround to setup the OMI config registers +/// +/// @param[in] i_target OCMB (gemini) +/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff success, else error +/// +fapi2::ReturnCode gem_setup_config(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target); + } // omi } // workarounds } // exp |