diff options
author | Alvin Wang <wangat@tw.ibm.com> | 2019-05-24 04:11:23 -0500 |
---|---|---|
committer | Christian R. Geddes <crgeddes@us.ibm.com> | 2019-06-13 09:35:39 -0500 |
commit | dbba2f9d8fe31f408c905e9df49f040fc1949218 (patch) | |
tree | 36a127594b216f49cea9934eb7002138f3919f59 /src/import/chips/ocmb/explorer/procedures/hwp/memory | |
parent | 9192b12a33dc07d4a4f3d88c323ac373dd8f6367 (diff) | |
download | talos-hostboot-dbba2f9d8fe31f408c905e9df49f040fc1949218.tar.gz talos-hostboot-dbba2f9d8fe31f408c905e9df49f040fc1949218.zip |
Add OMI_EDPL_DISABLE attribute
Change-Id: I75de2f084824c94eb3f70cc7c0898a8a87c1bf90
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/77826
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: Louis Stermole <stermole@us.ibm.com>
Tested-by: HWSV CI <hwsv-ci+hostboot@us.ibm.com>
Reviewed-by: STEPHEN GLANCY <sglancy@us.ibm.com>
Reviewed-by: Jennifer A Stofer <stofer@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/77834
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Tested-by: Christian R. Geddes <crgeddes@us.ibm.com>
Diffstat (limited to 'src/import/chips/ocmb/explorer/procedures/hwp/memory')
-rw-r--r-- | src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_omi_setup.C | 10 | ||||
-rw-r--r-- | src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/omi/exp_omi_utils.H | 45 |
2 files changed, 55 insertions, 0 deletions
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 <lib/exp_attribute_accessors_manual.H> #include <lib/omi/exp_omi_utils.H> #include <generic/memory/mss_git_data_helper.H> +#include <generic/memory/lib/mss_generic_attribute_getters.H> extern "C" { @@ -53,12 +54,15 @@ extern "C" // Declares variables fapi2::buffer<uint64_t> l_data; + fapi2::buffer<uint64_t> 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<uint64_t>& i_data ) return i_data.getBit<EXPLR_MMIO_MENTERP_CFG_ENTERPRISE_MODE>(); } + +/// +/// @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<uint64_t>& i_data ) +{ + return i_data.getBit<EXPLR_DLX_DL0_CONFIG1_CFG_EDPL_ENA>(); +} + +/// +/// @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<uint64_t>& io_data, const bool i_enable ) +{ + io_data.writeBit<EXPLR_DLX_DL0_CONFIG1_CFG_EDPL_ENA>(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<fapi2::TAR return fapi2::putScom(i_target, EXPLR_MMIO_MENTERP, i_data); } +/// +/// @brief Reads the EXPLR_DLX_DL0_CONFIG1 register using I2C +/// @param[in] i_target the OCMB target on which to operate +/// @param[out] o_data the register contents +/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK +/// +inline fapi2::ReturnCode read_dlx_config1( const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target, + fapi2::buffer<uint64_t>& 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<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target, + const fapi2::buffer<uint64_t>& i_data ) +{ + return fapi2::putScom(i_target, EXPLR_DLX_DL0_CONFIG1, i_data); +} + namespace train { |