Skip to content

Commit

Permalink
PRD: Axone updates for MemDqBitmap class
Browse files Browse the repository at this point in the history
Change-Id: I8613b8ead60f5a94201e35abe03e1c041ce18a7a
RTC: 201603
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/69843
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Brian J. Stegmiller <bjs@us.ibm.com>
Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/70294
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
  • Loading branch information
cnpalmer authored and zane131 committed Jan 15, 2019
1 parent f5dd1c1 commit 451596e
Show file tree
Hide file tree
Showing 20 changed files with 510 additions and 542 deletions.
38 changes: 23 additions & 15 deletions src/usr/diag/prdf/common/plat/mem/prdfMemCaptureData.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016,2018 */
/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -262,14 +262,15 @@ void captureDramRepairsData( TARGETING::TargetHandle_t i_trgt,

//------------------------------------------------------------------------------

template<TARGETING::TYPE T, DIMMS_PER_RANK D>
template<TARGETING::TYPE T>
void captureDramRepairsVpd(TargetHandle_t i_trgt, CaptureData & io_cd)
{
#define PRDF_FUNC "[captureDramRepairsVpd] "

// Get the maximum capture data size.
static const size_t sz_rank = sizeof(uint8_t);
static const size_t sz_entry = D * DQ_BITMAP::BITMAP_SIZE;
static const size_t sz_port = sizeof(uint8_t);
static const size_t sz_entry = DQ_BITMAP::BITMAP_SIZE;
static const size_t sz_word = sizeof(CPU_WORD);

do
Expand All @@ -283,7 +284,7 @@ void captureDramRepairsVpd(TargetHandle_t i_trgt, CaptureData & io_cd)
}

// Get the maximum capture data size.
size_t sz_maxData = masterRanks.size() * (sz_rank + sz_entry);
size_t sz_maxData = masterRanks.size() * (sz_rank + sz_port + sz_entry);

// Adjust the size for endianness.
sz_maxData = ((sz_maxData + sz_word-1) / sz_word) * sz_word;
Expand All @@ -296,22 +297,29 @@ void captureDramRepairsVpd(TargetHandle_t i_trgt, CaptureData & io_cd)
uint32_t idx = 0;
for ( auto & rank : masterRanks )
{
MemDqBitmap<D> bitmap;
MemDqBitmap bitmap;

if ( SUCCESS != getBadDqBitmap<D>(i_trgt, rank, bitmap) )
if ( SUCCESS != getBadDqBitmap(i_trgt, rank, bitmap) )
{
PRDF_ERR( PRDF_FUNC "getBadDqBitmap() failed: MCA=0x%08x"
" rank=0x%02x", getHuid(i_trgt), rank.getKey() );
continue; // skip this rank
}
size_t numPorts = bitmap.getNumPorts();

if ( bitmap.badDqs() ) // make sure the data is non-zero
{
// Add the rank, then the entry data.
capData[idx] = rank.getMaster();
idx += sz_rank;
memcpy(&capData[idx], bitmap.getData(), sz_entry);
idx += sz_entry;
// Iterate over the ports
for ( uint8_t ps = 0; ps < numPorts; ps++ )
{
// Add the rank, port, then the entry data.
capData[idx] = rank.getMaster();
idx += sz_rank;
capData[idx] = ps;
idx += sz_port;
memcpy(&capData[idx], bitmap.getData(ps), sz_entry);
idx += sz_entry;
}
}
}

Expand Down Expand Up @@ -458,7 +466,7 @@ void addEccData<TYPE_MCA>( ExtensibleChip * i_chip,
captureDramRepairsData<TYPE_MCA>( trgt, cd );

// Add DRAM repairs data from VPD.
captureDramRepairsVpd<TYPE_MCA, DIMMS_PER_RANK::MCA>( trgt, cd );
captureDramRepairsVpd<TYPE_MCA>( trgt, cd );

// Add IUE counts to capture data.
captureIueCounts<McaDataBundle*>( trgt, db, cd );
Expand Down Expand Up @@ -503,7 +511,7 @@ void addEccData<TYPE_MBA>( ExtensibleChip * i_chip,
captureDramRepairsData<TYPE_MBA>( i_chip->getTrgt(), cd );

// Add DRAM repairs data from VPD.
captureDramRepairsVpd<TYPE_MBA, DIMMS_PER_RANK::MBA>(i_chip->getTrgt(), cd);
captureDramRepairsVpd<TYPE_MBA>(i_chip->getTrgt(), cd);

// Add Row Repair data from VPD
captureRowRepairVpd<TYPE_MBA>(i_chip->getTrgt(), cd);
Expand All @@ -521,7 +529,7 @@ void addEccData<TYPE_MCA>( TargetHandle_t i_trgt, errlHndl_t io_errl )
captureDramRepairsData<TYPE_MCA>( i_trgt, cd );

// Add DRAM repairs data from VPD.
captureDramRepairsVpd<TYPE_MCA, DIMMS_PER_RANK::MCA>( i_trgt, cd );
captureDramRepairsVpd<TYPE_MCA>( i_trgt, cd );

ErrDataService::AddCapData( cd, io_errl );
}
Expand All @@ -535,7 +543,7 @@ void addEccData<TYPE_MBA>( TargetHandle_t i_trgt, errlHndl_t io_errl )
captureDramRepairsData<TYPE_MBA>( i_trgt, cd );

// Add DRAM repairs data from VPD.
captureDramRepairsVpd<TYPE_MBA, DIMMS_PER_RANK::MBA>( i_trgt, cd );
captureDramRepairsVpd<TYPE_MBA>( i_trgt, cd );

// Add Row Repair data from VPD.
captureRowRepairVpd<TYPE_MBA>( i_trgt, cd );
Expand Down
8 changes: 4 additions & 4 deletions src/usr/diag/prdf/common/plat/mem/prdfMemCaptureData.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016,2018 */
/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -67,7 +67,7 @@ void addExtMemMruData( const MemoryMru & i_memMru, errlHndl_t io_errl );
/**
* @brief Queries hardware for all DRAM repairs data (chip/symbol marks, DRAM
* spare, etc.) for the given MBA or MCA and adds it to the capture data.
* @param i_trgt An MBA or MCA target.
* @param i_trgt An MBA, MCA, or MEM_PORT target.
* @param io_cd Capture data struct.
* @note This function will be used to capture DRAM repair data into the
* capture data struct. Other functions can call this function and
Expand All @@ -80,13 +80,13 @@ void captureDramRepairsData( TARGETING::TargetHandle_t i_trgt,
/**
* @brief Queries the Bad DQ attributes for the content of the DRAM repairs VPD
* and adds it to the capture data.
* @param i_trgt An MBA or MCA target.
* @param i_trgt An MBA, MCA, or MEM_PORT target.
* @param io_cd Capture data struct.
* @note This function will be used to capture DRAM repair data into the
* capture data struct. Other functions can call this function and
* update the error log.
*/
template<TARGETING::TYPE T, DIMMS_PER_RANK D>
template<TARGETING::TYPE T>
void captureDramRepairsVpd( TARGETING::TargetHandle_t i_trgt,
CaptureData & io_cd );

Expand Down
15 changes: 7 additions & 8 deletions src/usr/diag/prdf/common/plat/mem/prdfMemConst.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2013,2016 */
/* Contributors Listed Below - COPYRIGHT 2013,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -49,16 +49,15 @@ enum
DQS_PER_BYTE = 8,
DQS_PER_NIBBLE = 4,

// MCA only
MCA_DIMMS_PER_RANK = 1,
MEM_DIMMS_PER_RANK = 1,

MCA_BYTES_PER_RANK = BYTES_PER_DIMM * MCA_DIMMS_PER_RANK,
MCA_NIBBLES_PER_RANK = NIBBLES_PER_DIMM * MCA_DIMMS_PER_RANK,
MEM_BYTES_PER_RANK = BYTES_PER_DIMM * MEM_DIMMS_PER_RANK,
MEM_NIBBLES_PER_RANK = NIBBLES_PER_DIMM * MEM_DIMMS_PER_RANK,

MCA_SYMBOLS_PER_BYTE = SYMBOLS_PER_RANK / MCA_BYTES_PER_RANK,
MCA_SYMBOLS_PER_NIBBLE = SYMBOLS_PER_RANK / MCA_NIBBLES_PER_RANK,
MEM_SYMBOLS_PER_BYTE = SYMBOLS_PER_RANK / MEM_BYTES_PER_RANK,
MEM_SYMBOLS_PER_NIBBLE = SYMBOLS_PER_RANK / MEM_NIBBLES_PER_RANK,

MCA_DQS_PER_SYMBOL = DQS_PER_BYTE / MCA_SYMBOLS_PER_BYTE,
MEM_DQS_PER_SYMBOL = DQS_PER_BYTE / MEM_SYMBOLS_PER_BYTE,

// MBA only
MBA_DIMMS_PER_RANK = 2,
Expand Down

0 comments on commit 451596e

Please sign in to comment.