diff options
Diffstat (limited to 'src/usr/diag/prdf/plat/mem/prdfMemDsd.H')
-rw-r--r-- | src/usr/diag/prdf/plat/mem/prdfMemDsd.H | 120 |
1 files changed, 92 insertions, 28 deletions
diff --git a/src/usr/diag/prdf/plat/mem/prdfMemDsd.H b/src/usr/diag/prdf/plat/mem/prdfMemDsd.H index c53af33bc..ac1b1e044 100644 --- a/src/usr/diag/prdf/plat/mem/prdfMemDsd.H +++ b/src/usr/diag/prdf/plat/mem/prdfMemDsd.H @@ -70,6 +70,8 @@ class DsdEvent : public TdEntry uint32_t o_rc = SUCCESS; + o_done = false; + do { // First, do analysis. @@ -112,59 +114,121 @@ class DsdEvent : public TdEntry private: // functions /** - * @brief Do analysis based on the current phase. - * @param io_sc The step code data struct. - * @param o_done True if the procedure is complete or has aborted, false - * otherwise. + * @brief Does isolation for ECC attentions during each phase. + * @param i_eccAttns Mask of all currently active maintenance attentions. + * See enum MaintEccAttns for values. + * @param io_sc The step code data struct. + * @param o_done True if the procedure is complete or has aborted. * @return Non-SUCCESS if an internal function fails, SUCCESS otherwise. */ - uint32_t analyzePhase( STEP_CODE_DATA_STRUCT & io_sc, bool & o_done ); + uint32_t checkEcc( const uint32_t & i_eccAttns, + STEP_CODE_DATA_STRUCT & io_sc, bool & o_done ); /** - * @brief Starts the appropriate maintenance command for each phase of the - * procedure. - * @pre iv_phase must be set appropriately before calling this function. + * @brief Called in the last phase of the procedure to determine if the + * spare was successfully applied. + * @param i_eccAttns Mask of all currently active maintenance attentions. + * See enum MaintEccAttns for values. + * @param io_sc The step code data struct. + * @param o_done True if the procedure is complete or has aborted. * @return Non-SUCCESS if an internal function fails, SUCCESS otherwise. */ - uint32_t startCmd(); + uint32_t verifySpare( const uint32_t & i_eccAttns, + STEP_CODE_DATA_STRUCT & io_sc, bool & o_done ); /** - * @brief Starts the next phase of the procedure. + * @brief Do analysis based on the current phase. * @param io_sc The step code data struct. - * @post iv_phase will be updated appropriately per design. + * @param o_done True if the procedure is complete or has aborted. * @return Non-SUCCESS if an internal function fails, SUCCESS otherwise. */ - uint32_t startNextPhase( STEP_CODE_DATA_STRUCT & io_sc ) + uint32_t analyzePhase( STEP_CODE_DATA_STRUCT & io_sc, bool & o_done ) { - uint32_t signature = 0; + #define PRDF_FUNC "[DsdEvent::analyzePhase] " + + uint32_t o_rc = SUCCESS; - switch ( iv_phase ) + do { - case TD_PHASE_0: - iv_phase = TD_PHASE_1; - signature = PRDFSIG_StartDsdPhase1; + if ( TD_PHASE_0 == iv_phase ) + { + // Before starting the first command, set iv_mark in the + // hardware steer mux. + /* TODO: RTC 189221 + o_rc = mssSetSteerMux<T>( iv_chip, iv_rank, iv_mark, + iv_eccSpare ); + if ( SUCCESS != o_rc ) + { + PRDF_ERR( PRDF_FUNC "mssSetSteerMux(0x%08x,0x%2x) failed", + iv_chip->getHuid(), getKey() ); + break; + } + */ + + break; // Nothing to analyze yet. + } + + // Look for any ECC errors that occurred during the command. + uint32_t eccAttns; + o_rc = checkEccFirs<T>( iv_chip, eccAttns ); + if ( SUCCESS != o_rc ) + { + PRDF_ERR( PRDF_FUNC "checkEccFirs(0x%08x) failed", + iv_chip->getHuid() ); break; + } + + // Analyze the ECC errors, if needed. + o_rc = checkEcc( eccAttns, io_sc, o_done ); + if ( SUCCESS != o_rc ) + { + PRDF_ERR( PRDF_FUNC "checkEcc() failed on 0x%08x", + iv_chip->getHuid() ); + break; + } - #ifndef __HOSTBOOT_RUNTIME // IPL only + if ( o_done ) break; // abort the procedure. - case TD_PHASE_1: - iv_phase = TD_PHASE_2; - signature = PRDFSIG_StartDsdPhase2; + // Determine if the spare was applied successfully. + o_rc = verifySpare( eccAttns, io_sc, o_done ); + if ( SUCCESS != o_rc ) + { + PRDF_ERR( PRDF_FUNC "verifySpare() failed on 0x%08x", + iv_chip->getHuid() ); break; + } - #endif + } while (0); - default: PRDF_ASSERT( false ); // invalid phase + #ifdef __HOSTBOOT_RUNTIME + if ( (SUCCESS == o_rc) && o_done ) + { + // Clear the ECC FFDC for this master rank. + MemDbUtils::resetEccFfdc<T>( iv_chip, iv_rank, MASTER_RANK ); } + #endif - PRDF_TRAC( "[DsdEvent] Starting DSD Phase %d: 0x%08x,0x%02x", - iv_phase, iv_chip->getHuid(), getKey() ); - - io_sc.service_data->AddSignatureList( iv_chip->getTrgt(), signature ); + return o_rc; - return startCmd(); + #undef PRDF_FUNC } + /** + * @brief Starts the appropriate maintenance command for each phase of the + * procedure. + * @pre iv_phase must be set appropriately before calling this function. + * @return Non-SUCCESS if an internal function fails, SUCCESS otherwise. + */ + uint32_t startCmd(); + + /** + * @brief Starts the next phase of the procedure. + * @param io_sc The step code data struct. + * @post iv_phase will be updated appropriately per design. + * @return Non-SUCCESS if an internal function fails, SUCCESS otherwise. + */ + uint32_t startNextPhase( STEP_CODE_DATA_STRUCT & io_sc ); + private: // instance variables const MemMark iv_mark; ///< The chip mark from hardware. |