From 67bce7927b46080e76f048d9c305b29dcbb5cc3f Mon Sep 17 00:00:00 2001 From: Matt Derksen Date: Fri, 13 Apr 2018 16:35:49 -0500 Subject: Update isDramWidthX4() function to handle X8 drams TYPE_MCA for Nimbus should always return true, TYPE_MBA should check ATTR_CEN_EFF_DRAM_WIDTH. No other type is supported. Template was initially tried but it required a lot of other changes in calling functions. Change-Id: I25b11e33d541c57689ee491a81f0dc630734101d RTC:161599 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/57206 Reviewed-by: Benjamin J. Weisenbeck CI-Ready: Zane C. Shelley Reviewed-by: Caleb N. Palmer Reviewed-by: Brian J. Stegmiller Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Tested-by: FSP CI Jenkins Reviewed-by: Zane C. Shelley --- src/usr/diag/prdf/common/plat/prdfTargetServices.C | 25 ++++++++++++++++------ src/usr/diag/prdf/common/plat/prdfTargetServices.H | 8 +++---- 2 files changed, 23 insertions(+), 10 deletions(-) (limited to 'src/usr') diff --git a/src/usr/diag/prdf/common/plat/prdfTargetServices.C b/src/usr/diag/prdf/common/plat/prdfTargetServices.C index 275b774c9..0a15b80bc 100755 --- a/src/usr/diag/prdf/common/plat/prdfTargetServices.C +++ b/src/usr/diag/prdf/common/plat/prdfTargetServices.C @@ -1424,12 +1424,25 @@ int32_t getDimmRowCol( TARGETING::TargetHandle_t i_mba, uint8_t & o_rowNum, bool isDramWidthX4( TargetHandle_t i_trgt ) { - // TODO RTC 161599 - // all drams for Nimbus will be treated as X4 - this will need to be - // updated for Cumulus - return true; - //return ( fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X4 == - // i_trgt->getAttr() ); + bool o_dramWidthX4 = false; + + PRDF_ASSERT( nullptr != i_trgt ); + switch ( getTargetType(i_trgt) ) + { + case TYPE_MCA: + o_dramWidthX4 = true; // Nimbus only supports x4 DRAMs + break; + + case TYPE_MBA: + o_dramWidthX4 = ( fapi2::ENUM_ATTR_CEN_EFF_DRAM_WIDTH_X4 == + i_trgt->getAttr() ); + break; + + default: + PRDF_ASSERT(false); // code bug + } + + return o_dramWidthX4; } //------------------------------------------------------------------------------ diff --git a/src/usr/diag/prdf/common/plat/prdfTargetServices.H b/src/usr/diag/prdf/common/plat/prdfTargetServices.H index 48aa0d1c6..b00e5cadd 100755 --- a/src/usr/diag/prdf/common/plat/prdfTargetServices.H +++ b/src/usr/diag/prdf/common/plat/prdfTargetServices.H @@ -397,11 +397,11 @@ template uint8_t getDimmSlct( TARGETING::TargetHandle_t i_trgt ); /** - * @brief checks dram widh ( x4 ) for mba - * @param i_mbaTarget MBA target - * @return true if DRAM with is X4 false otherwise + * @brief checks dram width ( x4 ) + * @param i_trgt MCA or MBA target + * @return true if DRAM width is X4, false otherwise */ -bool isDramWidthX4(TARGETING::TargetHandle_t i_mbaTarget); +bool isDramWidthX4(TARGETING::TargetHandle_t i_trgt); /** * @brief Get DRAM generation -- cgit v1.2.1