summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
authorZane Shelley <zshelle@us.ibm.com>2015-11-18 16:20:31 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2015-12-08 14:22:16 -0600
commitfab4f39714343827a1bcf3a8eb2d10868e6d34ab (patch)
tree47f2d92afc9aa03e302ced2071f34adf70bfc4cf /src/usr
parent1292ffb89082617c7a43338fe1147a77131332b1 (diff)
downloadtalos-hostboot-fab4f39714343827a1bcf3a8eb2d10868e6d34ab.tar.gz
talos-hostboot-fab4f39714343827a1bcf3a8eb2d10868e6d34ab.zip
PRD: Enable dynamic memory deallocation for DDR4
Change-Id: Id8745c744ba8f283a0c4f994e17c14df0368d777 CQ: SW329198 Backport: release-fips840 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/22216 Tested-by: Jenkins Server Reviewed-by: Caleb N. Palmer <cnpalmer@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com> Reviewed-by: Zane Shelley <zshelle@us.ibm.com> Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/22255 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/22368 Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW
Diffstat (limited to 'src/usr')
-rwxr-xr-xsrc/usr/diag/prdf/common/runtime/prdfCenMbaDynMemDealloc_rt.C61
1 files changed, 24 insertions, 37 deletions
diff --git a/src/usr/diag/prdf/common/runtime/prdfCenMbaDynMemDealloc_rt.C b/src/usr/diag/prdf/common/runtime/prdfCenMbaDynMemDealloc_rt.C
index 51494f346..823649baa 100755
--- a/src/usr/diag/prdf/common/runtime/prdfCenMbaDynMemDealloc_rt.C
+++ b/src/usr/diag/prdf/common/runtime/prdfCenMbaDynMemDealloc_rt.C
@@ -418,76 +418,63 @@ int32_t getSystemAddr( ExtensibleChip * i_mbaChip, CenAddr i_addr,
{
#define PRDF_FUNC "[DEALLOC::getSystemAddr] "
- uint64_t cenAddr = 0;
- o_addr = 0;
int32_t o_rc = SUCCESS;
- do
- {
- uint8_t dramGen = 0;
- TargetHandle_t mba = i_mbaChip->GetChipHandle();
- o_rc = getDramGen( mba, dramGen );
- if( SUCCESS != o_rc )
- {
- PRDF_ERR( PRDF_FUNC "getDramGen() failed. HUID:0x%08X",
- i_mbaChip->GetId());
- break;
- }
- if( fapi::ENUM_ATTR_EFF_DRAM_GEN_DDR3 != dramGen )
- {
- PRDF_ERR( PRDF_FUNC "page Gard is only supported for DDR3."
- "HUID:0x%08X DRAM Generation : %u",
- i_mbaChip->GetId(), dramGen );
- o_rc = FAIL; break;
- }
+ o_addr = 0;
- CenMbaDataBundle * mbadb = getMbaDataBundle( i_mbaChip );
- ExtensibleChip *mbChip = mbadb->getMembChip();
- if( NULL == mbChip )
+ do
+ {
+ // Get the MEMBUF chip.
+ CenMbaDataBundle * mbadb = getMbaDataBundle( i_mbaChip );
+ ExtensibleChip * mbChip = mbadb->getMembChip();
+ if ( NULL == mbChip )
{
- PRDF_ERR( PRDF_FUNC " Null Membuf chip for mba. HUID:0x%08X",
+ PRDF_ERR( PRDF_FUNC "getMembChip() returned NULL. MBA:0x%08X",
i_mbaChip->GetId() );
o_rc = FAIL; break;
}
- CenMembufDataBundle * mbdb = getMembufDataBundle( mbChip );
- ExtensibleChip * mcsChip = mbdb->getMcsChip();
- if( NULL == mbChip )
+ // Get the MCS chip.
+ CenMembufDataBundle * mbdb = getMembufDataBundle( mbChip );
+ ExtensibleChip * mcsChip = mbdb->getMcsChip();
+ if ( NULL == mbChip )
{
- PRDF_ERR( PRDF_FUNC " Null Mcs chip for Membuf. HUID:0x%08X",
+ PRDF_ERR( PRDF_FUNC "getMcsChip() returned NULL. MEMBUF:0x%08X",
mbChip->GetId() );
o_rc = FAIL; break;
}
- o_rc = getCenPhyAddr( i_mbaChip, mbChip, i_addr, cenAddr);
- if( SUCCESS != o_rc )
+ // Get the physical Centaur address.
+ uint64_t cenAddr = 0;
+ o_rc = getCenPhyAddr( i_mbaChip, mbChip, i_addr, cenAddr );
+ if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "getCenPhyAddr() failed. MBA:0x%08X "
- "Membuf:0x%08X", i_mbaChip->GetId(), mbChip->GetId());
+ "MEMBUF:0x%08X", i_mbaChip->GetId(), mbChip->GetId());
break;
}
+ // Get the MCS group information.
SCAN_COMM_REGISTER_CLASS * mcgfp = mcsChip->getRegister( "MCFGP" );
-
o_rc = mcgfp->Read();
if ( SUCCESS != o_rc )
{
- PRDF_ERR( PRDF_FUNC "Read() failed on MCFGP. HUID:0x%08X",
+ PRDF_ERR( PRDF_FUNC "Read() failed on MCFGP. MCS:0x%08X",
mcsChip->GetId() ) ;
break;
}
// Get the MCS per group
// 000 - 1, 001 - 2, 010 - 4, 100 - 8
- uint8_t mcsPerGrp = mcgfp->GetBitFieldJustified( 1,3 );
+ uint8_t mcsPerGrp = mcgfp->GetBitFieldJustified( 1,3 );
uint8_t grpShift = 0;
// Get the number of bits required to accomondate mcsPos
- while( 0 != ( mcsPerGrp >> grpShift ) ) { grpShift++; }
+ while ( 0 != ( mcsPerGrp >> grpShift ) ) { grpShift++; }
// Get the MCS position within group. Though it is 5 bit field,
// two bits are not used.
- uint64_t grpSlct = mcgfp->GetBitFieldJustified( 4, 5 ) << 7;
+ uint64_t grpSlct = mcgfp->GetBitFieldJustified( 4, 5 ) << 7;
// Get the base address for MCS
uint64_t baseAddr = mcgfp->GetBitFieldJustified( 26, 18 ) << 32;
@@ -495,13 +482,13 @@ int32_t getSystemAddr( ExtensibleChip * i_mbaChip, CenAddr i_addr,
uint64_t cenUpper33 = (cenAddr & 0xFFFFFFFF80ull) << grpShift;
uint64_t cenLower7 = cenAddr & 0x000000007full;
-
// Put the whole address together
o_addr = baseAddr | cenUpper33 | grpSlct | cenLower7;
} while( 0 );
return o_rc;
+
#undef PRDF_FUNC
}
OpenPOWER on IntegriCloud