diff options
author | Zane Shelley <zshelle@us.ibm.com> | 2017-04-07 17:19:19 -0500 |
---|---|---|
committer | Zane C. Shelley <zshelle@us.ibm.com> | 2017-04-13 17:55:30 -0400 |
commit | a6100976bd9360ee8cec08c48004466f59eff235 (patch) | |
tree | 59cd875523f288f9e85dcc29b29f595cbfb921c5 /src/usr/diag/prdf/plat/mem/prdfMemTdCtlr.C | |
parent | 49cfc4ab949189e3dd3f67b797c79de78a9de334 (diff) | |
download | talos-hostboot-a6100976bd9360ee8cec08c48004466f59eff235.tar.gz talos-hostboot-a6100976bd9360ee8cec08c48004466f59eff235.zip |
PRD: consolidated MemTdCtlr::initiStoppedRank() function
Change-Id: I21fe3aa557907f29166c4c64197910399cbfdfc6
RTC: 171915
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/39110
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Caleb N. Palmer <cnpalmer@us.ibm.com>
Reviewed-by: Brian J. Stegmiller <bjs@us.ibm.com>
Reviewed-by: Benjamin J. Weisenbeck <bweisenb@us.ibm.com>
Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com>
Diffstat (limited to 'src/usr/diag/prdf/plat/mem/prdfMemTdCtlr.C')
-rw-r--r-- | src/usr/diag/prdf/plat/mem/prdfMemTdCtlr.C | 139 |
1 files changed, 55 insertions, 84 deletions
diff --git a/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr.C b/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr.C index 12dd4f8a1..3e93152b4 100644 --- a/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr.C +++ b/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr.C @@ -155,79 +155,6 @@ uint32_t MemTdCtlr<T>::handleCmdComplete( STEP_CODE_DATA_STRUCT & io_sc ) //------------------------------------------------------------------------------ -template<> -uint32_t MemTdCtlr<TYPE_MCBIST>::initStoppedRank( const MemAddr & i_addr ) -{ - #define PRDF_FUNC "[initStoppedRank] " - - uint32_t o_rc = SUCCESS; - - do - { - // Get all ports in which the command was run. In broadcast mode, the - // rank configuration for all ports will be the same. In non-broadcast - // mode, there will only be one MCA in the list. Therefore, we can - // simply use the first MCA in the list for all configs. - std::vector<ExtensibleChip *> portList; - o_rc = getMcbistMaintPort( iv_chip, portList ); - if ( SUCCESS != o_rc ) - { - PRDF_ERR( PRDF_FUNC "getMcbistMaintPort(0x%08x) failed", - iv_chip->getHuid() ); - break; - } - - ExtensibleChip * mcaChip = portList.front(); - MemRank rank = i_addr.getRank(); - - // ############################ SIMICs only ############################ - // We have found it to be increasingly difficult to simulate the MCBMCAT - // register in SIMICs. We tried copying the address in the MCBEA - // registers, but the HWP code will input the last possible address to - // the MCBEA registers, but it is likely that this address is not a - // configured address. MCBIST commands are tolerant of this, where MBA - // maintenance commands are not. Also, there are multiple possible - // subtests for MCBIST commands. So it is difficult to determine which - // subtest will be the last configured address. To maintain sanity, we - // will simply short-circuit the code and ensure we always get the last - // configured rank. - if ( Util::isSimicsRunning() ) - { - std::vector<MemRank> list; - getSlaveRanks<TYPE_MCA>( mcaChip->getTrgt(), list ); - PRDF_ASSERT( !list.empty() ); // func target with no config ranks - - rank = list.back(); // Get the last configured rank. - } - // ##################################################################### - - // Update iv_stoppedRank. - iv_stoppedRank = TdRankListEntry ( mcaChip, rank ); - #ifndef __HOSTBOOT_RUNTIME - // Update iv_broadcastMode. - iv_broadcastMode = ( 1 < portList.size() ); - #endif - - } while (0); - - return o_rc; - - #undef PRDF_FUNC -} - -//------------------------------------------------------------------------------ - -template<> -uint32_t MemTdCtlr<TYPE_MBA>::initStoppedRank( const MemAddr & i_addr ) -{ - // Update iv_stoppedRank. - iv_stoppedRank = TdRankListEntry( iv_chip, i_addr.getRank() ); - - return SUCCESS; -} - -//------------------------------------------------------------------------------ - // This is a forward reference to a function that is locally defined in // prdfMemTdCtlr_ipl.C and prdfMemTdCtlr_rt.C. The reason for this is that the // MemTdCtlr template is only created for the MCBIST and MBA targets, not the @@ -245,6 +172,10 @@ uint32_t __checkEcc( ExtensibleChip * i_chip, TdQueue & io_queue, template<TARGETING::TYPE T> uint32_t __analyzeCmdComplete( ExtensibleChip * i_chip, TdQueue & io_queue, + TdRankListEntry & o_stoppedRank, + #ifndef __HOSTBOOT_RUNTIME + bool & o_broadcastMode, + #endif const MemAddr & i_addr, bool & o_errorsFound, STEP_CODE_DATA_STRUCT & io_sc ); @@ -252,6 +183,10 @@ uint32_t __analyzeCmdComplete( ExtensibleChip * i_chip, template<> uint32_t __analyzeCmdComplete<TYPE_MCBIST>( ExtensibleChip * i_chip, TdQueue & io_queue, + TdRankListEntry & o_stoppedRank, + #ifndef __HOSTBOOT_RUNTIME + bool & o_broadcastMode, + #endif const MemAddr & i_addr, bool & o_errorsFound, STEP_CODE_DATA_STRUCT & io_sc ) @@ -274,6 +209,41 @@ uint32_t __analyzeCmdComplete<TYPE_MCBIST>( ExtensibleChip * i_chip, break; } + // In broadcast mode, the rank configuration for all ports will be the + // same. In non-broadcast mode, there will only be one MCA in the list. + // Therefore, we can simply use the first MCA in the list for all + // configs. + ExtensibleChip * stopChip = portList.front(); + MemRank stopRank = i_addr.getRank(); + + // ############################ SIMICs only ############################ + // We have found it to be increasingly difficult to simulate the MCBMCAT + // register in SIMICs. We tried copying the address in the MCBEA + // registers, but the HWP code will input the last possible address to + // the MCBEA registers, but it is likely that this address is not a + // configured address. MCBIST commands are tolerant of this, where MBA + // maintenance commands are not. Also, there are multiple possible + // subtests for MCBIST commands. So it is difficult to determine which + // subtest will be the last configured address. To maintain sanity, we + // will simply short-circuit the code and ensure we always get the last + // configured rank. + if ( Util::isSimicsRunning() ) + { + std::vector<MemRank> list; + getSlaveRanks<TYPE_MCA>( stopChip->getTrgt(), list ); + PRDF_ASSERT( !list.empty() ); // func target with no config ranks + + stopRank = list.back(); // Get the last configured rank. + } + // ##################################################################### + + // Update iv_stoppedRank. + o_stoppedRank = TdRankListEntry ( stopChip, stopRank ); + #ifndef __HOSTBOOT_RUNTIME + // Update iv_broadcastMode. + o_broadcastMode = ( 1 < portList.size() ); + #endif + // Check each MCA for ECC errors. for ( auto & mcaChip : portList ) { @@ -301,10 +271,17 @@ uint32_t __analyzeCmdComplete<TYPE_MCBIST>( ExtensibleChip * i_chip, template<> uint32_t __analyzeCmdComplete<TYPE_MBA>( ExtensibleChip * i_chip, TdQueue & io_queue, + TdRankListEntry & o_stoppedRank, + #ifndef __HOSTBOOT_RUNTIME + bool & o_broadcastMode, + #endif const MemAddr & i_addr, bool & o_errorsFound, STEP_CODE_DATA_STRUCT & io_sc ) { + // Update iv_stoppedRank. + o_stoppedRank = TdRankListEntry( i_chip, i_addr.getRank() ); + // Check the MBA for ECC errors. return __checkEcc<TYPE_MBA>(i_chip, io_queue, i_addr, o_errorsFound, io_sc); } @@ -331,18 +308,12 @@ uint32_t MemTdCtlr<T>::analyzeCmdComplete( bool & o_errorsFound, break; } - // First, keep track of where the command stopped. Must be done - // before calling checkEcc(). - o_rc = initStoppedRank( addr ); - if ( SUCCESS != o_rc ) - { - PRDF_ERR( PRDF_FUNC "initStoppedRank() failed" ); - break; - } - // Then, check for ECC errors, if they exist. - o_rc = __analyzeCmdComplete<T>( iv_chip, iv_queue, addr, o_errorsFound, - io_sc ); + o_rc = __analyzeCmdComplete<T>( iv_chip, iv_queue, iv_stoppedRank, + #ifndef __HOSTBOOT_RUNTIME + iv_broadcastMode, + #endif + addr, o_errorsFound, io_sc ); if ( SUCCESS != o_rc ) { PRDF_ERR( PRDF_FUNC "__analyzeCmdComplete<T>(0x%08x) failed", |