summaryrefslogtreecommitdiffstats
path: root/src/import
diff options
context:
space:
mode:
authorLouis Stermole <stermole@us.ibm.com>2019-03-04 17:05:49 -0500
committerChristian R. Geddes <crgeddes@us.ibm.com>2019-03-20 09:42:14 -0500
commit8fc0e7abffb04554f63196f5aaab035f1a72d245 (patch)
treecfb8c2d9a20292bed239ff4257db011c7f9e5c51 /src/import
parent71d98844bb93c20cdc7c0eb438ee8be7b3806908 (diff)
downloadtalos-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')
-rw-r--r--src/import/chips/centaur/procedures/hwp/memory/lib/utils/mem_size.C10
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/nvdimm_utils.C2
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/eff_config/memory_size.C37
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/mcbist/mcbist.H7
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/p9_mss_memdiag.C4
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/p9_mss_scrub.C4
-rw-r--r--src/import/chips/p9/procedures/hwp/nest/p9_mss_eff_grouping.C11
-rw-r--r--src/import/chips/p9/procedures/hwp/nest/p9_mss_setup_bars.C7
-rw-r--r--src/import/chips/p9/procedures/hwp/nest/p9_mss_setup_bars.mk3
-rw-r--r--src/import/chips/p9a/procedures/hwp/memory/lib/eff_config/axone_memory_size.C42
-rw-r--r--src/import/generic/memory/lib/utils/memory_size.H55
-rw-r--r--src/import/generic/memory/lib/utils/shared/mss_generic_consts.H1
12 files changed, 155 insertions, 28 deletions
diff --git a/src/import/chips/centaur/procedures/hwp/memory/lib/utils/mem_size.C b/src/import/chips/centaur/procedures/hwp/memory/lib/utils/mem_size.C
index b07e9c281..0a804bdf0 100644
--- a/src/import/chips/centaur/procedures/hwp/memory/lib/utils/mem_size.C
+++ b/src/import/chips/centaur/procedures/hwp/memory/lib/utils/mem_size.C
@@ -82,7 +82,9 @@ bool is_dimm_functional(const uint8_t i_valid_dimm_bitmap,
/// @return FAPI2_RC_SUCCESS if ok
///
template<>
-fapi2::ReturnCode eff_memory_size( const fapi2::Target<fapi2::TARGET_TYPE_MBA>& i_target, uint64_t& o_size )
+fapi2::ReturnCode eff_memory_size<mss::mc_type::CENTAUR>(
+ const fapi2::Target<fapi2::TARGET_TYPE_MBA>& i_target,
+ uint64_t& o_size )
{
o_size = 0;
uint8_t l_sizes[MAX_PORTS_PER_MBA][MAX_DIMM_PER_PORT] = {};
@@ -116,14 +118,16 @@ fapi_try_exit:
/// @return FAPI2_RC_SUCCESS if ok
///
template<>
-fapi2::ReturnCode eff_memory_size( const fapi2::Target<fapi2::TARGET_TYPE_DMI>& i_target, uint64_t& o_size )
+fapi2::ReturnCode eff_memory_size<mss::mc_type::CENTAUR>(
+ const fapi2::Target<fapi2::TARGET_TYPE_DMI>& i_target,
+ uint64_t& o_size )
{
o_size = 0;
for (const auto& mba : mss::find_targets<fapi2::TARGET_TYPE_MBA>(i_target))
{
uint64_t l_mba_size;
- FAPI_TRY(eff_memory_size(mba, l_mba_size),
+ FAPI_TRY(eff_memory_size<mss::mc_type::CENTAUR>(mba, l_mba_size),
"Error from eff_memory_size (mba: %s)", mss::c_str(mba));
o_size += l_mba_size;
}// mba
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)
diff --git a/src/import/chips/p9a/procedures/hwp/memory/lib/eff_config/axone_memory_size.C b/src/import/chips/p9a/procedures/hwp/memory/lib/eff_config/axone_memory_size.C
index 89358e29e..5ad3766cc 100644
--- a/src/import/chips/p9a/procedures/hwp/memory/lib/eff_config/axone_memory_size.C
+++ b/src/import/chips/p9a/procedures/hwp/memory/lib/eff_config/axone_memory_size.C
@@ -22,3 +22,45 @@
/* permissions and limitations under the License. */
/* */
/* IBM_PROLOG_END_TAG */
+
+///
+/// @file axone_memory_size.C
+/// @brief Return the effective memory size behind a target
+///
+// *HWP HWP Owner: Andre Marin <aamarin@us.ibm.com>
+// *HWP HWP Backup: Louis Stermole <stermole@us.ibm.com>
+// *HWP Team: Memory
+// *HWP Level: 3
+// *HWP Consumed by: HB:FSP
+
+#include <fapi2.H>
+
+#include <lib/shared/axone_consts.H>
+#include <mss_generic_attribute_getters.H>
+#include <generic/memory/lib/utils/memory_size.H>
+
+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::EXPLORER>(
+ const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ uint64_t& o_size )
+{
+ uint32_t l_size = 0;
+ o_size = 0;
+ FAPI_TRY( mss::attr::get_dimm_size(i_target, l_size) );
+ o_size = l_size;
+
+fapi_try_exit:
+ return fapi2::current_err;
+}
+
+}
diff --git a/src/import/generic/memory/lib/utils/memory_size.H b/src/import/generic/memory/lib/utils/memory_size.H
index 0c18f90d0..dc2e73cc7 100644
--- a/src/import/generic/memory/lib/utils/memory_size.H
+++ b/src/import/generic/memory/lib/utils/memory_size.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2017 */
+/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -37,6 +37,7 @@
#define _MSS_EFF_MEMORY_SIZE_H_
#include <fapi2.H>
+#include <generic/memory/lib/utils/find.H>
namespace mss
{
@@ -53,13 +54,63 @@ bool is_dimm_functional(const uint8_t i_valid_dimm_bitmap,
///
/// @brief Return the total memory size behind the target
+/// @tparam MC the type of memory controller (defaults to DEFAULT_MC_TYPE)
/// @tparam T fapi2 target template parameter
/// @param[in] i_target the fapi2::Target, typically a port
/// @param[out] o_size the size of memory in GB behind the target
/// @return FAPI2_RC_SUCCESS if ok
///
-template< fapi2::TargetType T >
+template< mss::mc_type MC, fapi2::TargetType T >
fapi2::ReturnCode eff_memory_size( const fapi2::Target<T>& i_target, uint64_t& o_size );
+
+///
+/// @brief Return the total memory size behind a MEM_PORT target
+/// @param[in] i_target the port target
+/// @param[out] o_size the size of memory in GB behind the target
+/// @return FAPI2_RC_SUCCESS if ok
+///
+template< mss::mc_type MC >
+inline fapi2::ReturnCode eff_memory_size( const fapi2::Target<fapi2::TARGET_TYPE_MEM_PORT>& 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)
+ uint64_t l_sizes = 0;
+ o_size = 0;
+
+ for (const auto& d : mss::find_targets<fapi2::TARGET_TYPE_DIMM>(i_target))
+ {
+ FAPI_TRY( eff_memory_size<MC>(d, l_sizes) );
+ o_size += l_sizes;
+ }
+
+fapi_try_exit:
+ return fapi2::current_err;
+}
+
+///
+/// @brief Return the total memory size behind an OCMB_CHIP target
+/// @param[in] i_target the OCMB target
+/// @param[out] o_size the size of memory in GB behind the target
+/// @return FAPI2_RC_SUCCESS if ok
+///
+template< mss::mc_type MC >
+inline fapi2::ReturnCode eff_memory_size( const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target,
+ uint64_t& o_size )
+{
+ o_size = 0;
+
+ for (const auto& p : mss::find_targets<fapi2::TARGET_TYPE_MEM_PORT>(i_target))
+ {
+ uint64_t l_size = 0;
+ FAPI_TRY( eff_memory_size<MC>(p, l_size) );
+ o_size += l_size;
+ }
+
+fapi_try_exit:
+ return fapi2::current_err;
+}
+
}
#endif
diff --git a/src/import/generic/memory/lib/utils/shared/mss_generic_consts.H b/src/import/generic/memory/lib/utils/shared/mss_generic_consts.H
index 194e36526..17fe87ac4 100644
--- a/src/import/generic/memory/lib/utils/shared/mss_generic_consts.H
+++ b/src/import/generic/memory/lib/utils/shared/mss_generic_consts.H
@@ -377,6 +377,7 @@ struct procTraits<proc_type::AXONE>
enum
{
EXP_PORTS_PER_OCMB = 1,
+ DIMMS_PER_PORT = 2,
};
};
OpenPOWER on IntegriCloud