diff options
author | Louis Stermole <stermole@us.ibm.com> | 2019-03-04 17:05:49 -0500 |
---|---|---|
committer | Christian R. Geddes <crgeddes@us.ibm.com> | 2019-03-20 09:42:14 -0500 |
commit | 8fc0e7abffb04554f63196f5aaab035f1a72d245 (patch) | |
tree | cfb8c2d9a20292bed239ff4257db011c7f9e5c51 /src/import/chips/p9 | |
parent | 71d98844bb93c20cdc7c0eb438ee8be7b3806908 (diff) | |
download | talos-hostboot-8fc0e7abffb04554f63196f5aaab035f1a72d245.tar.gz talos-hostboot-8fc0e7abffb04554f63196f5aaab035f1a72d245.zip |
Add p9a version of eff_memory_size API
Adds mc_type template on eff_memory_size functions to avoid
symbol duplication on future systems.
Change-Id: I11552c94ac1dfc7ea367e0a6bb5d63e13d18c183
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/72790
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Mark Pizzutillo <mark.pizzutillo@ibm.com>
Reviewed-by: STEPHEN GLANCY <sglancy@us.ibm.com>
Tested-by: HWSV CI <hwsv-ci+hostboot@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/72896
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Diffstat (limited to 'src/import/chips/p9')
8 files changed, 52 insertions, 23 deletions
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/nvdimm_utils.C b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/nvdimm_utils.C index b33056dfd..b9ded1c6c 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/nvdimm_utils.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/nvdimm_utils.C @@ -140,7 +140,7 @@ fapi2::ReturnCode self_refresh_exit_helper( const fapi2::Target<fapi2::TARGET_TY mss::poll_parameters l_poll_parameters(0, 200, 100 * mss::DELAY_1MS, 200, 500); uint64_t l_memory_size = 0; - FAPI_TRY( mss::eff_memory_size(l_mcbist, l_memory_size) ); + FAPI_TRY( mss::eff_memory_size<mss::mc_type::NIMBUS>(l_mcbist, l_memory_size) ); l_poll_parameters.iv_initial_delay = mss::calculate_initial_delay(l_mcbist, (l_memory_size * mss::BYTES_PER_GB)); { diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/memory_size.C b/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/memory_size.C index 6249fcc39..35e1dd62e 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/memory_size.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/memory_size.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016,2017 */ +/* Contributors Listed Below - COPYRIGHT 2016,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -44,23 +44,46 @@ namespace mss { /// +/// @brief Return the total memory size behind a DIMM target +/// @param[in] i_target the DIMM target +/// @param[out] o_size the size of memory in GB behind the target +/// @return FAPI2_RC_SUCCESS if ok +/// @note The purpose of this specialization is to bridge the gap between different accessor functions +/// +template<> +fapi2::ReturnCode eff_memory_size<mss::mc_type::NIMBUS>( + const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target, + uint64_t& o_size ) +{ + uint32_t l_size = 0; + o_size = 0; + FAPI_TRY( mss::eff_dimm_size(i_target, l_size) ); + o_size = l_size; + +fapi_try_exit: + return fapi2::current_err; +} + +/// /// @brief Return the total memory size behind an MCA /// @param[in] i_target the MCA target /// @param[out] o_size the size of memory in GB behind the target /// @return FAPI2_RC_SUCCESS if ok /// template<> -fapi2::ReturnCode eff_memory_size( const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target, uint64_t& o_size ) +fapi2::ReturnCode eff_memory_size<mss::mc_type::NIMBUS>( + const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target, + uint64_t& o_size ) { // Don't try to get cute and read the attributes once and loop over the array. // Cronus honors initToZero which would work, but HB might not and so we might get // crap in some of the attributes (which we shouldn't access as there's no DIMM there) - uint32_t l_sizes = 0; + uint64_t l_sizes = 0; o_size = 0; for (const auto& d : mss::find_targets<fapi2::TARGET_TYPE_DIMM>(i_target)) { - FAPI_TRY( mss::eff_dimm_size(d, l_sizes) ); + FAPI_TRY( eff_memory_size<mss::mc_type::NIMBUS>(d, l_sizes) ); o_size += l_sizes; } @@ -75,14 +98,16 @@ fapi_try_exit: /// @return FAPI2_RC_SUCCESS if ok /// template<> -fapi2::ReturnCode eff_memory_size( const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target, uint64_t& o_size ) +fapi2::ReturnCode eff_memory_size<mss::mc_type::NIMBUS>( + const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target, + uint64_t& o_size ) { o_size = 0; for (const auto& p : mss::find_targets<fapi2::TARGET_TYPE_MCA>(i_target)) { uint64_t l_size = 0; - FAPI_TRY( eff_memory_size(p, l_size) ); + FAPI_TRY( eff_memory_size<mss::mc_type::NIMBUS>(p, l_size) ); o_size += l_size; } 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 bafdc6e98..e42dcce00 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 @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2018 */ +/* Contributors Listed Below - COPYRIGHT 2015,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -41,10 +41,11 @@ #include <p9_mc_scom_addresses.H> #include <p9_mc_scom_addresses_fld.H> +#include <lib/shared/mss_const.H> +#include <generic/memory/lib/utils/find.H> #include <generic/memory/lib/utils/poll.H> #include <generic/memory/lib/utils/memory_size.H> #include <lib/utils/mss_nimbus_conversions.H> -#include <lib/shared/mss_const.H> #include <lib/utils/bit_count.H> #include <lib/utils/num.H> #include <lib/mcbist/patterns.H> @@ -1866,7 +1867,7 @@ class program constexpr uint64_t l_seconds = SEC_IN_HOUR * BG_SCRUB_IN_HOURS; FAPI_TRY( mss::freq(i_target, l_freq) ); - FAPI_TRY( mss::eff_memory_size(i_target, l_size) ); + FAPI_TRY( mss::eff_memory_size<mss::mc_type::NIMBUS>(i_target, l_size) ); calculate_min_cmd_gap(i_target, l_freq, l_size, l_min_cmd_gap, l_timebase); diff --git a/src/import/chips/p9/procedures/hwp/memory/p9_mss_memdiag.C b/src/import/chips/p9/procedures/hwp/memory/p9_mss_memdiag.C index 95a766a60..dcaaef851 100644 --- a/src/import/chips/p9/procedures/hwp/memory/p9_mss_memdiag.C +++ b/src/import/chips/p9/procedures/hwp/memory/p9_mss_memdiag.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2018 */ +/* Contributors Listed Below - COPYRIGHT 2015,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -95,7 +95,7 @@ extern "C" mss::poll_parameters l_poll_parameters(INITIAL_DELAY, INITIAL_SIM_DELAY, DELAY_TIME, SIM_DELAY_TIME, MAX_POLL_COUNT); uint64_t l_memory_size = 0; - FAPI_TRY( mss::eff_memory_size(i_target, l_memory_size) ); + FAPI_TRY( mss::eff_memory_size<mss::mc_type::NIMBUS>(i_target, l_memory_size) ); l_poll_parameters.iv_initial_delay = mss::calculate_initial_delay(i_target, (l_memory_size * mss::BYTES_PER_GB)); FAPI_TRY( mss::is_simulation( l_sim) ); diff --git a/src/import/chips/p9/procedures/hwp/memory/p9_mss_scrub.C b/src/import/chips/p9/procedures/hwp/memory/p9_mss_scrub.C index 4ebaab6ac..cda0dd9f8 100644 --- a/src/import/chips/p9/procedures/hwp/memory/p9_mss_scrub.C +++ b/src/import/chips/p9/procedures/hwp/memory/p9_mss_scrub.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2018 */ +/* Contributors Listed Below - COPYRIGHT 2015,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -82,7 +82,7 @@ fapi2::ReturnCode p9_mss_scrub( const fapi2::Target<TARGET_TYPE_MCBIST>& i_targe mss::poll_parameters l_poll_parameters(0, 200, 100 * mss::DELAY_1MS, 200, 10000); uint64_t l_memory_size = 0; - FAPI_TRY( mss::eff_memory_size(i_target, l_memory_size) ); + FAPI_TRY( mss::eff_memory_size<mss::mc_type::NIMBUS>(i_target, l_memory_size) ); l_poll_parameters.iv_initial_delay = mss::calculate_initial_delay(i_target, (l_memory_size * mss::BYTES_PER_GB)); FAPI_TRY( mss::is_simulation( l_sim) ); diff --git a/src/import/chips/p9/procedures/hwp/nest/p9_mss_eff_grouping.C b/src/import/chips/p9/procedures/hwp/nest/p9_mss_eff_grouping.C index 45066b62d..231c83426 100644 --- a/src/import/chips/p9/procedures/hwp/nest/p9_mss_eff_grouping.C +++ b/src/import/chips/p9/procedures/hwp/nest/p9_mss_eff_grouping.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2018 */ +/* Contributors Listed Below - COPYRIGHT 2015,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -46,6 +46,7 @@ #include <p9_mss_eff_grouping.H> #include <p9_fbc_utils.H> #include <map> +#include <lib/shared/mss_const.H> #include <generic/memory/lib/utils/memory_size.H> #include <lib/mss_attribute_accessors.H> @@ -534,7 +535,7 @@ fapi2::ReturnCode EffGroupingMcaAttrs::getAttrs( // Get the amount of memory behind this MCA target // Note: DIMM must be enabled to be accounted for. - FAPI_TRY(mss::eff_memory_size(i_target, iv_dimmSize), + FAPI_TRY(mss::eff_memory_size<mss::mc_type::NIMBUS>(i_target, iv_dimmSize), "Error returned from eff_memory_size, l_rc 0x%.8X", (uint64_t)fapi2::current_err); @@ -608,7 +609,7 @@ fapi2::ReturnCode EffGroupingDmiAttrs::getAttrs( iv_membuf = l_attachedMembuf.front(); // Get the amount of memory behind this DMI target - FAPI_TRY(mss::eff_memory_size(i_target, iv_dimmSize), + FAPI_TRY(mss::eff_memory_size<mss::mc_type::CENTAUR>(i_target, iv_dimmSize), "Error returned from eff_memory_size, l_rc 0x%.8X", (uint64_t)fapi2::current_err); } @@ -3129,8 +3130,8 @@ fapi2::ReturnCode findMinDeconfigForPortPair( { if (l_mba_functional[ii][jj]) { - FAPI_TRY(mss::eff_memory_size(l_mba_targets[ii][l_mba_tgt_index[ii][jj]], - l_mba_size[ii][jj]), + FAPI_TRY(mss::eff_memory_size<mss::mc_type::CENTAUR>(l_mba_targets[ii][l_mba_tgt_index[ii][jj]], + l_mba_size[ii][jj]), "Error from eff_memory_size"); FAPI_DBG("Set MBA size[%d][%d] = %d", ii, jj, l_mba_size[ii][jj]); diff --git a/src/import/chips/p9/procedures/hwp/nest/p9_mss_setup_bars.C b/src/import/chips/p9/procedures/hwp/nest/p9_mss_setup_bars.C index d64ead488..1138a3447 100644 --- a/src/import/chips/p9/procedures/hwp/nest/p9_mss_setup_bars.C +++ b/src/import/chips/p9/procedures/hwp/nest/p9_mss_setup_bars.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2018 */ +/* Contributors Listed Below - COPYRIGHT 2015,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -45,6 +45,7 @@ #include <p9n2_mc_scom_addresses.H> #include <p9n2_mc_scom_addresses_fld.H> #include <map> +#include <lib/shared/mss_const.H> #include <generic/memory/lib/utils/memory_size.H> ///---------------------------------------------------------------------------- @@ -293,7 +294,7 @@ fapi2::ReturnCode getMcMemSize( (uint64_t)fapi2::current_err); // Get the amount of memory behind this MCA target - FAPI_TRY(mss::eff_memory_size(l_mca, l_mcaSize), + FAPI_TRY(mss::eff_memory_size<mss::mc_type::NIMBUS>(l_mca, l_mcaSize), "Error returned from eff_memory_size - MCA, l_rc 0x%.8X", (uint64_t)fapi2::current_err); @@ -327,7 +328,7 @@ fapi2::ReturnCode getMcMemSize( (uint64_t)fapi2::current_err); // Get the amount of memory behind this DMI target - FAPI_TRY(mss::eff_memory_size(l_dmi, l_dmiSize), + FAPI_TRY(mss::eff_memory_size<mss::mc_type::CENTAUR>(l_dmi, l_dmiSize), "Error returned from eff_memory_size - DMI, l_rc 0x%.8X", (uint64_t)fapi2::current_err); diff --git a/src/import/chips/p9/procedures/hwp/nest/p9_mss_setup_bars.mk b/src/import/chips/p9/procedures/hwp/nest/p9_mss_setup_bars.mk index f8299de1c..db115d16a 100644 --- a/src/import/chips/p9/procedures/hwp/nest/p9_mss_setup_bars.mk +++ b/src/import/chips/p9/procedures/hwp/nest/p9_mss_setup_bars.mk @@ -5,7 +5,7 @@ # # OpenPOWER HostBoot Project # -# Contributors Listed Below - COPYRIGHT 2015,2017 +# Contributors Listed Below - COPYRIGHT 2015,2019 # [+] International Business Machines Corp. # # @@ -25,6 +25,7 @@ # Include the macros and things for MSS procedures PROCEDURE=p9_mss_setup_bars +$(call ADD_MODULE_INCDIR,$(PROCEDURE),$(ROOTPATH)/chips/p9/procedures/hwp/memory/) lib$(PROCEDURE)_DEPLIBS+=cen $(call ADD_MODULE_INCDIR,$(PROCEDURE),$(ROOTPATH)) $(call BUILD_PROCEDURE) |