From 33f3061fdea98fd2e930407aae99231c0a68b8ff Mon Sep 17 00:00:00 2001 From: Zane Shelley Date: Thu, 16 Feb 2017 17:02:54 -0600 Subject: [PATCH] PRD: add CE table to default capture data Change-Id: I3add30d1700289dde4ee6059bdafb8d22edd212a RTC: 165382 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/36752 Tested-by: Jenkins Server Reviewed-by: Caleb N. Palmer Reviewed-by: Benjamin J. Weisenbeck Reviewed-by: Zane C. Shelley Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/37014 Tested-by: Jenkins OP Build CI Tested-by: FSP CI Jenkins --- .../prdf/common/plat/mem/prdfMemCaptureData.C | 7 +++++-- .../diag/prdf/common/plat/mem/prdfMemCeTable.C | 12 ++++++------ .../diag/prdf/common/plat/mem/prdfMemCeTable.H | 13 +++++++++++-- .../diag/prdf/common/plat/mem/prdfMemUeTable.C | 4 ++-- .../diag/prdf/common/plat/mem/prdfMemUeTable.H | 15 ++++++++++++--- .../prdf/common/plat/mem/prdfP9McaDataBundle.H | 6 ++++-- 6 files changed, 40 insertions(+), 17 deletions(-) diff --git a/src/usr/diag/prdf/common/plat/mem/prdfMemCaptureData.C b/src/usr/diag/prdf/common/plat/mem/prdfMemCaptureData.C index 033aca09bd8..500fbcd729d 100644 --- a/src/usr/diag/prdf/common/plat/mem/prdfMemCaptureData.C +++ b/src/usr/diag/prdf/common/plat/mem/prdfMemCaptureData.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016 */ +/* Contributors Listed Below - COPYRIGHT 2016,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -53,8 +53,11 @@ void addEccData( ExtensibleChip * i_chip, CaptureData & cd = io_sc.service_data->GetCaptureData(); McaDataBundle * db = getMcaDataBundle( i_chip ); + // Add CE table to capture data. + db->iv_ceTable.addCapData( cd ); + // Add UE table to capture data. - db->iv_ueTable.addCapData( i_chip, cd ); + db->iv_ueTable.addCapData( cd ); } template<> diff --git a/src/usr/diag/prdf/common/plat/mem/prdfMemCeTable.C b/src/usr/diag/prdf/common/plat/mem/prdfMemCeTable.C index 69b2894e0a8..121aa088a57 100644 --- a/src/usr/diag/prdf/common/plat/mem/prdfMemCeTable.C +++ b/src/usr/diag/prdf/common/plat/mem/prdfMemCeTable.C @@ -174,7 +174,7 @@ void MemCeTable::getMnfgCounts( const MemRank & i_rank, //------------------------------------------------------------------------------ -void MemCeTable::addCapData( ExtensibleChip * i_chip, CaptureData & io_cd ) +void MemCeTable::addCapData( CaptureData & io_cd ) { static const size_t sz_word = sizeof(CPU_WORD); @@ -191,16 +191,16 @@ void MemCeTable::addCapData( ExtensibleChip * i_chip, CaptureData & io_cd ) uint8_t isMba = 0; uint8_t mbaPos = 0; uint8_t rcType = CEN_SYMBOL::WIRING_INVALID; - if ( TYPE_MBA == i_chip->getType() ) + if ( TYPE_MBA == iv_chip->getType() ) { isMba = 1; - mbaPos = getTargetPosition( i_chip->getTrgt() ); + mbaPos = getTargetPosition( iv_chip->getTrgt() ); /* TODO: RTC 157888 - if ( SUCCESS != getMemBufRawCardType(i_chip->getTrgt(), rcType) ) + if ( SUCCESS != getMemBufRawCardType(iv_chip->getTrgt(), rcType) ) { PRDF_ERR( "[MemCeTable::addCapData] getMemBufRawCardType(0x%08x) " - "failed", i_chip->getHuid() ); + "failed", iv_chip->getHuid() ); rcType = CEN_SYMBOL::WIRING_INVALID; // Just in case. } */ @@ -257,7 +257,7 @@ void MemCeTable::addCapData( ExtensibleChip * i_chip, CaptureData & io_cd ) // Add data to capture data. BitString bs ( sz_actData*8, (CPU_WORD *) &data ); - io_cd.Add( i_chip->getTrgt(), Util::hashString("MEM_CE_TABLE"), bs ); + io_cd.Add( iv_chip->getTrgt(), Util::hashString("MEM_CE_TABLE"), bs ); } } diff --git a/src/usr/diag/prdf/common/plat/mem/prdfMemCeTable.H b/src/usr/diag/prdf/common/plat/mem/prdfMemCeTable.H index 00b38d69188..dadd0d38039 100644 --- a/src/usr/diag/prdf/common/plat/mem/prdfMemCeTable.H +++ b/src/usr/diag/prdf/common/plat/mem/prdfMemCeTable.H @@ -76,6 +76,14 @@ class MemCeTable public: // functions + /** + * @brief Constructor. + * @param i_chip MCA or MBA associated with this data. + */ + explicit MemCeTable( ExtensibleChip * i_chip ) : + iv_chip( i_chip ) + {} + /** * @brief Will attempt to add a new entry to the table. * @@ -115,10 +123,9 @@ class MemCeTable /** * @brief Gathers all table data to be stored in capture data. - * @param i_chip An MCA or MBA chip. * @param io_cd Capture data struct. */ - void addCapData( ExtensibleChip * i_chip, CaptureData & io_cd ); + void addCapData( CaptureData & io_cd ); private: // structs, typedefs @@ -167,6 +174,8 @@ class MemCeTable private: // instance variables + ExtensibleChip * iv_chip; ///< MCA or MBA associated with this data. + /** A storage container for memory fetch CE errors. */ CeTable iv_table; diff --git a/src/usr/diag/prdf/common/plat/mem/prdfMemUeTable.C b/src/usr/diag/prdf/common/plat/mem/prdfMemUeTable.C index f29c3c7d4a4..dcd11754b3a 100755 --- a/src/usr/diag/prdf/common/plat/mem/prdfMemUeTable.C +++ b/src/usr/diag/prdf/common/plat/mem/prdfMemUeTable.C @@ -69,7 +69,7 @@ void MemUeTable::addEntry( UE_TABLE::Type i_type, const MemAddr & i_addr ) //------------------------------------------------------------------------------ -void MemUeTable::addCapData( ExtensibleChip * i_chip, CaptureData & io_cd ) +void MemUeTable::addCapData( CaptureData & io_cd ) { static const size_t sz_word = sizeof(CPU_WORD); @@ -117,7 +117,7 @@ void MemUeTable::addCapData( ExtensibleChip * i_chip, CaptureData & io_cd ) // Add data to capture data. BitString bs ( sz_actData*8, (CPU_WORD *) &data ); - io_cd.Add( i_chip->getTrgt(), Util::hashString("MEM_UE_TABLE"), bs ); + io_cd.Add( iv_chip->getTrgt(), Util::hashString("MEM_UE_TABLE"), bs ); } } diff --git a/src/usr/diag/prdf/common/plat/mem/prdfMemUeTable.H b/src/usr/diag/prdf/common/plat/mem/prdfMemUeTable.H index e683634f3c7..21f7ff9f253 100755 --- a/src/usr/diag/prdf/common/plat/mem/prdfMemUeTable.H +++ b/src/usr/diag/prdf/common/plat/mem/prdfMemUeTable.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2013,2016 */ +/* Contributors Listed Below - COPYRIGHT 2013,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -60,6 +60,14 @@ class MemUeTable public: // functions + /** + * @brief Constructor. + * @param i_chip MCA or MBA associated with this data. + */ + explicit MemUeTable( ExtensibleChip * i_chip ) : + iv_chip( i_chip ) + {} + /** * @brief Will attempt to add a new entry to the table. * @note If an entry already exists, the entry's count is incremented and @@ -71,10 +79,9 @@ class MemUeTable /** * @brief Gathers all table data to be stored in capture data. - * @param i_chip An MCA or MBA chip. * @param io_cd Capture data struct. */ - void addCapData( ExtensibleChip * i_chip, CaptureData & io_cd ); + void addCapData( CaptureData & io_cd ); private: // structs, typedefs @@ -108,6 +115,8 @@ class MemUeTable private: // instance variables + ExtensibleChip * iv_chip; ///< MCA or MBA associated with this data. + /** A FIFO that stores the latest memory UE addresses and their types. This * is not a pure FIFO, because if a new entry matches an existing entry, * the existing entries count is incremented and it is moved to the end of diff --git a/src/usr/diag/prdf/common/plat/mem/prdfP9McaDataBundle.H b/src/usr/diag/prdf/common/plat/mem/prdfP9McaDataBundle.H index 2adcbddf3d1..7540a861e47 100644 --- a/src/usr/diag/prdf/common/plat/mem/prdfP9McaDataBundle.H +++ b/src/usr/diag/prdf/common/plat/mem/prdfP9McaDataBundle.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016 */ +/* Contributors Listed Below - COPYRIGHT 2016,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -30,6 +30,7 @@ #include // Platform includes +#include #include namespace PRDF @@ -45,7 +46,7 @@ class McaDataBundle : public DataBundle * @param i_chip An MCA chip. */ explicit McaDataBundle( ExtensibleChip * i_chip ) : - iv_ueTable() + iv_ceTable(i_chip), iv_ueTable(i_chip) {} /** @brief Destructor */ @@ -59,6 +60,7 @@ class McaDataBundle : public DataBundle public: // instance variables + MemCeTable iv_ceTable; ///< CE table for FFDC MemUeTable iv_ueTable; ///< UE table for FFDC };