From dbba2f9d8fe31f408c905e9df49f040fc1949218 Mon Sep 17 00:00:00 2001 From: Alvin Wang Date: Fri, 24 May 2019 04:11:23 -0500 Subject: Add OMI_EDPL_DISABLE attribute Change-Id: I75de2f084824c94eb3f70cc7c0898a8a87c1bf90 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/77826 Tested-by: Jenkins Server Tested-by: FSP CI Jenkins Tested-by: Hostboot CI Reviewed-by: Louis Stermole Tested-by: HWSV CI Reviewed-by: STEPHEN GLANCY Reviewed-by: Jennifer A Stofer Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/77834 Reviewed-by: Christian R. Geddes Tested-by: Christian R. Geddes --- .../explorer/procedures/hwp/memory/exp_omi_setup.C | 10 +++ .../procedures/hwp/memory/lib/omi/exp_omi_utils.H | 45 ++++++++++++ .../procedures/hwp/memory/lib/dimm/nimbus_kind.C | 84 ---------------------- .../procedures/hwp/memory/lib/dimm/nimbus_kind.H | 61 ++++++++++++++++ .../hwp/memory/lib/eff_config/plug_rules.H | 2 +- .../chips/p9/procedures/hwp/memory/lib/mc/mc.H | 2 +- .../chips/p9/procedures/hwp/memory/lib/mc/xlate.C | 2 +- .../chips/p9/procedures/hwp/memory/lib/mc/xlate.H | 2 +- .../p9/procedures/hwp/memory/lib/mcbist/mcbist.H | 2 +- .../hwp/memory/lib/power_thermal/decoder.C | 2 +- .../hwp/memory/lib/power_thermal/decoder.H | 2 +- .../memory/lib/workarounds/mcbist_workarounds.C | 2 +- src/import/chips/p9/procedures/hwp/memory/mss.H | 2 +- .../chips/p9a/procedures/hwp/memory/lib/mc/omi.H | 5 +- 14 files changed, 129 insertions(+), 94 deletions(-) delete mode 100644 src/import/chips/p9/procedures/hwp/memory/lib/dimm/nimbus_kind.C (limited to 'src/import/chips') diff --git a/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_omi_setup.C b/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_omi_setup.C index 5d7698656..2dbacb2ae 100644 --- a/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_omi_setup.C +++ b/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_omi_setup.C @@ -38,6 +38,7 @@ #include #include #include +#include extern "C" { @@ -53,12 +54,15 @@ extern "C" // Declares variables fapi2::buffer l_data; + fapi2::buffer dlx_config1_data; + uint8_t l_edpl_disable = 0; bool l_is_enterprise = false; bool l_is_half_dimm = false; // Gets the configuration information from attributes FAPI_TRY(mss::enterprise_mode(i_target, l_is_enterprise)); FAPI_TRY(mss::half_dimm_mode(i_target, l_is_half_dimm)); + FAPI_TRY(mss::attr::get_mss_omi_edpl_disable(l_edpl_disable)); // Prints out the data FAPI_INF("%s is %s enterprise mode, and %s-DIMM mode", mss::c_str(i_target), l_is_enterprise ? "" : "non", @@ -75,6 +79,12 @@ extern "C" FAPI_TRY(mss::exp::omi::read_enterprise_config(i_target, l_data)); FAPI_TRY(mss::exp::omi::check_enterprise_mode(i_target, l_is_enterprise, l_data)); + // Set the EDPL according the attribute + FAPI_TRY(mss::exp::omi::read_dlx_config1(i_target, dlx_config1_data)); + mss::exp::omi::set_edpl_enable_bit(dlx_config1_data, l_edpl_disable); + FAPI_TRY(mss::exp::omi::write_dlx_config1(i_target, dlx_config1_data)); + FAPI_INF("%s EDPL enable: ", mss::c_str(i_target), l_edpl_disable ? "false" : "true"); + fapi_try_exit: return fapi2::current_err; } 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 1faf02014..3658100b1 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 @@ -103,6 +103,27 @@ inline bool get_enterprise_config( const fapi2::buffer& i_data ) return i_data.getBit(); } + +/// +/// @brief Get edpl enable bit +/// @param[in] i_data the register data +/// @return The register's EDPL_ENA bit +/// +inline bool get_edpl_enable_bit( const fapi2::buffer& i_data ) +{ + return i_data.getBit(); +} + +/// +/// @brief Set edpl enable bit +/// @param[in,out] io_data the register data +/// @param[in] i_enable The register's EDPL_ENA bit +/// +inline void set_edpl_enable_bit( fapi2::buffer& io_data, const bool i_enable ) +{ + io_data.writeBit(i_enable); +} + /// /// @brief Checks if the enterprise config bit is in the correct mode /// @param[in] i_target target on which we are operating - for logging @@ -157,6 +178,30 @@ inline fapi2::ReturnCode write_enterprise_config( const fapi2::Target& i_target, + fapi2::buffer& o_data ) +{ + return fapi2::getScom(i_target, EXPLR_DLX_DL0_CONFIG1, o_data); +} + +/// +/// @brief Writes the EXPLR_DLX_DL0_CONFIG1 register using I2C +/// @param[in] i_target the OCMB target on which to operate +/// @param[in] i_data the register contents +/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK +/// +inline fapi2::ReturnCode write_dlx_config1( const fapi2::Target& i_target, + const fapi2::buffer& i_data ) +{ + return fapi2::putScom(i_target, EXPLR_DLX_DL0_CONFIG1, i_data); +} + namespace train { diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/nimbus_kind.C b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/nimbus_kind.C deleted file mode 100644 index 9db02eff0..000000000 --- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/nimbus_kind.C +++ /dev/null @@ -1,84 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/import/chips/p9/procedures/hwp/memory/lib/dimm/nimbus_kind.C $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2019 */ -/* [+] International Business Machines Corp. */ -/* */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); */ -/* you may not use this file except in compliance with the License. */ -/* You may obtain a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ -/* implied. See the License for the specific language governing */ -/* permissions and limitations under the License. */ -/* */ -/* IBM_PROLOG_END_TAG */ - -/// -/// @file kind.C -/// @brief Encapsulation for dimms of all types -/// -// *HWP HWP Owner: Louis Stermole -// *HWP HWP Backup: Andre Marin -// *HWP Team: Memory -// *HWP Level: 3 -// *HWP Consumed by: HB:FSP - - - -#include - -#include -#include -#include -#include -#include - -namespace mss -{ - -namespace dimm -{ - -/// -/// @class mss::dimm::kind specilization for NIMBUS -/// @brief A class containing information about a dimm like ranks, density, configuration - what kind of dimm is it? -/// -template<> -kind::kind(const fapi2::Target& i_target) : - iv_target(i_target), - iv_module_height(0) -{ - FAPI_TRY( mss::eff_dram_gen(i_target, iv_dram_generation) ); - FAPI_TRY( mss::eff_dimm_type(i_target, iv_dimm_type) ); - FAPI_TRY( mss::eff_dram_density(i_target, iv_dram_density) ); - FAPI_TRY( mss::eff_dram_width(i_target, iv_dram_width) ); - FAPI_TRY( mss::eff_num_master_ranks_per_dimm(i_target, iv_master_ranks) ); - FAPI_TRY( mss::eff_num_ranks_per_dimm(i_target, iv_total_ranks) ); - FAPI_TRY( mss::eff_dram_row_bits(i_target, iv_rows) ); - FAPI_TRY( mss::eff_dimm_size(i_target, iv_size) ); - FAPI_TRY( mss::eff_dram_mfg_id(i_target, iv_mfgid) ); - FAPI_TRY( mss::eff_prim_stack_type( i_target, iv_stack_type) ); - FAPI_TRY( mss::eff_hybrid( i_target, iv_hybrid )); - FAPI_TRY( mss::eff_hybrid_memory_type( i_target, iv_hybrid_memory_type )); - FAPI_TRY( mss::eff_rcd_mfg_id(i_target, iv_rcd_mfgid) ); - return; - -fapi_try_exit: - // Not 100% sure what to do here ... - FAPI_ERR("error initializing DIMM structure: %s 0x%016lx", mss::c_str(i_target), uint64_t(fapi2::current_err)); - fapi2::Assert(false); -} - - -} //ns dimm -} //ns mss diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/nimbus_kind.H b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/nimbus_kind.H index 31163355d..6c8d16bc0 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/nimbus_kind.H +++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/nimbus_kind.H @@ -22,3 +22,64 @@ /* permissions and limitations under the License. */ /* */ /* IBM_PROLOG_END_TAG */ + +/// +/// @file nimbus_kind.H +/// @brief Encapsulation for dimms of all types +/// +// *HWP HWP Owner: Louis Stermole +// *HWP HWP Backup: Andre Marin +// *HWP Team: Memory +// *HWP Level: 3 +// *HWP Consumed by: HB:FSP + +#ifndef _MSS_NIMBUS_KIND_H_ +#define _MSS_NIMBUS_KIND_H_ + +#include + +#include +#include +#include +#include + +namespace mss +{ + +namespace dimm +{ + +/// +/// @class mss::dimm::kind specilization for NIMBUS +/// @brief A class containing information about a dimm like ranks, density, configuration - what kind of dimm is it? +/// +template<> +inline kind::kind(const fapi2::Target& i_target) : + iv_target(i_target), + iv_module_height(0) +{ + FAPI_TRY( mss::eff_dram_gen(i_target, iv_dram_generation) ); + FAPI_TRY( mss::eff_dimm_type(i_target, iv_dimm_type) ); + FAPI_TRY( mss::eff_dram_density(i_target, iv_dram_density) ); + FAPI_TRY( mss::eff_dram_width(i_target, iv_dram_width) ); + FAPI_TRY( mss::eff_num_master_ranks_per_dimm(i_target, iv_master_ranks) ); + FAPI_TRY( mss::eff_num_ranks_per_dimm(i_target, iv_total_ranks) ); + FAPI_TRY( mss::eff_dram_row_bits(i_target, iv_rows) ); + FAPI_TRY( mss::eff_dimm_size(i_target, iv_size) ); + FAPI_TRY( mss::eff_dram_mfg_id(i_target, iv_mfgid) ); + FAPI_TRY( mss::eff_prim_stack_type( i_target, iv_stack_type) ); + FAPI_TRY( mss::eff_hybrid( i_target, iv_hybrid )); + FAPI_TRY( mss::eff_hybrid_memory_type( i_target, iv_hybrid_memory_type )); + FAPI_TRY( mss::eff_rcd_mfg_id(i_target, iv_rcd_mfgid) ); + return; + +fapi_try_exit: + // Not 100% sure what to do here ... + FAPI_ERR("error initializing DIMM structure: %s 0x%016lx", mss::c_str(i_target), uint64_t(fapi2::current_err)); + fapi2::Assert(false); +} + + +} //ns dimm +} //ns mss +#endif diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/plug_rules.H b/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/plug_rules.H index 9463db39a..24da77869 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/plug_rules.H +++ b/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/plug_rules.H @@ -38,7 +38,7 @@ #include #include -#include +#include namespace mss { diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/mc/mc.H b/src/import/chips/p9/procedures/hwp/memory/lib/mc/mc.H index 77f419d7a..b589c0479 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/mc/mc.H +++ b/src/import/chips/p9/procedures/hwp/memory/lib/mc/mc.H @@ -41,7 +41,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/mc/xlate.C b/src/import/chips/p9/procedures/hwp/memory/lib/mc/xlate.C index 39394c9f6..e57e593fa 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/mc/xlate.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/mc/xlate.C @@ -45,7 +45,7 @@ #include #include #include -#include +#include using fapi2::TARGET_TYPE_MCA; using fapi2::TARGET_TYPE_DIMM; diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/mc/xlate.H b/src/import/chips/p9/procedures/hwp/memory/lib/mc/xlate.H index 759c302e3..5b7db7076 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/mc/xlate.H +++ b/src/import/chips/p9/procedures/hwp/memory/lib/mc/xlate.H @@ -44,7 +44,7 @@ #include #include #include -#include +#include namespace mss { diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/mcbist.H b/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/mcbist.H index 64ca161d1..a76c3ea76 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/mcbist.H +++ b/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/mcbist.H @@ -46,7 +46,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/decoder.C b/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/decoder.C index dc13963eb..981432a30 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/decoder.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/decoder.C @@ -46,7 +46,7 @@ #include #include #include -#include +#include namespace mss diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/decoder.H b/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/decoder.H index 993c887b8..f6f9bf5ea 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/decoder.H +++ b/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/decoder.H @@ -37,7 +37,7 @@ #include #include -#include +#include #include #include diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/mcbist_workarounds.C b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/mcbist_workarounds.C index 9aec9173f..e172dfbdb 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/mcbist_workarounds.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/mcbist_workarounds.C @@ -43,7 +43,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/import/chips/p9/procedures/hwp/memory/mss.H b/src/import/chips/p9/procedures/hwp/memory/mss.H index 2c4294c1f..9f291c73c 100644 --- a/src/import/chips/p9/procedures/hwp/memory/mss.H +++ b/src/import/chips/p9/procedures/hwp/memory/mss.H @@ -68,7 +68,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/import/chips/p9a/procedures/hwp/memory/lib/mc/omi.H b/src/import/chips/p9a/procedures/hwp/memory/lib/mc/omi.H index 7a11c0863..7bb473659 100644 --- a/src/import/chips/p9a/procedures/hwp/memory/lib/mc/omi.H +++ b/src/import/chips/p9a/procedures/hwp/memory/lib/mc/omi.H @@ -47,6 +47,7 @@ #include #include #include +#include namespace mss { @@ -600,6 +601,7 @@ fapi2::ReturnCode setup_mc_config1_helper(const fapi2::Target& i_target) fapi2::buffer l_val; uint8_t l_sim = 0; + uint8_t l_edpl_disable = 0; FAPI_TRY( mss::attr::get_is_simulation( l_sim) ); // CFG_DL0_CFG1_PREIPL_PRBS @@ -687,7 +689,8 @@ fapi2::ReturnCode setup_mc_config1_helper(const fapi2::Target& i_target) TT::MC_REG2_DL0_CONFIG1_CFG_EDPL_THRESHOLD_LEN>(EDPL_ERR_THRES_16); // CFG_DL0_EDPL_ENA: dl0 error detection per lane "edpl" enable - l_val.template writeBit(1); + FAPI_TRY(mss::attr::get_mss_omi_edpl_disable(l_edpl_disable)); + l_val.template writeBit(l_edpl_disable ? 0 : 1); FAPI_TRY( mss::putScom(i_target, TT::MC_REG2_DL0_CONFIG1, l_val) ); -- cgit v1.2.1