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 ++++++++++++++++++++++ 2 files changed, 55 insertions(+) (limited to 'src/import/chips/ocmb/explorer/procedures') 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 { -- cgit v1.2.1