summaryrefslogtreecommitdiffstats
path: root/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/memory_size.C
diff options
context:
space:
mode:
authorBrian Silver <bsilver@us.ibm.com>2016-08-15 12:39:58 -0500
committerStephen M. Cprek <smcprek@us.ibm.com>2016-08-17 17:36:31 -0400
commitdfd724f98e9b0e1e4b83fe345d77db9b31eba1c3 (patch)
tree109a2d2e9cb31f70cf2483ac72b0b77ba6ff8fa0 /src/import/chips/p9/procedures/hwp/memory/lib/eff_config/memory_size.C
parentdbf7a3f38b467b73e39c9fc2ceb6121e95c5b020 (diff)
downloadtalos-hostboot-dfd724f98e9b0e1e4b83fe345d77db9b31eba1c3.tar.gz
talos-hostboot-dfd724f98e9b0e1e4b83fe345d77db9b31eba1c3.zip
Change eff_memory_size to account for non-initialized attrs
Change-Id: I1584de8060e884f10acc249c7a57b956ef3ce1ca Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/28262 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com> Reviewed-by: ANDRE A. MARIN <aamarin@us.ibm.com> Reviewed-by: Dean Sanner <dsanner@us.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/28266 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Stephen M. Cprek <smcprek@us.ibm.com>
Diffstat (limited to 'src/import/chips/p9/procedures/hwp/memory/lib/eff_config/memory_size.C')
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/eff_config/memory_size.C27
1 files changed, 11 insertions, 16 deletions
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 28d035b18..0120de737 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
@@ -53,14 +53,16 @@ namespace mss
template<>
fapi2::ReturnCode eff_memory_size( const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target, uint64_t& o_size )
{
- uint32_t l_sizes[MAX_DIMM_PER_PORT];
+ // 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;
o_size = 0;
- FAPI_TRY( mss::eff_dimm_size(i_target, &(l_sizes[0])) );
-
- for (size_t i = 0; i < MAX_DIMM_PER_PORT; ++i)
+ for (const auto& d : mss::find_targets<fapi2::TARGET_TYPE_DIMM>(i_target))
{
- o_size += l_sizes[i];
+ FAPI_TRY( mss::eff_dimm_size(d, l_sizes) );
+ o_size += l_sizes;
}
fapi_try_exit:
@@ -78,18 +80,11 @@ fapi2::ReturnCode eff_memory_size( const fapi2::Target<fapi2::TARGET_TYPE_MCBIST
{
o_size = 0;
- for (const auto& mcs : mss::find_targets<fapi2::TARGET_TYPE_MCS>(i_target))
+ for (const auto& p : mss::find_targets<fapi2::TARGET_TYPE_MCA>(i_target))
{
- uint32_t l_sizes[PORTS_PER_MCS][MAX_DIMM_PER_PORT];
- FAPI_TRY( mss::eff_dimm_size(mcs, &(l_sizes[0][0])) );
-
- for (size_t i = 0; i < PORTS_PER_MCS; ++i)
- {
- for (size_t j = 0; j < MAX_DIMM_PER_PORT; ++j)
- {
- o_size += l_sizes[i][j];
- }
- }
+ uint64_t l_size = 0;
+ FAPI_TRY( eff_memory_size(p, l_size) );
+ o_size += l_size;
}
fapi_try_exit:
OpenPOWER on IntegriCloud