diff options
author | Zane Shelley <zshelle@us.ibm.com> | 2018-04-12 21:39:14 -0500 |
---|---|---|
committer | Zane C. Shelley <zshelle@us.ibm.com> | 2018-04-19 16:45:32 -0400 |
commit | 81c7d1cc28c7dc7a6b208165031aeab1f459fcbc (patch) | |
tree | cebde6f69830bef887dd721eb96e62598907d402 /src/usr/diag/prdf/plat/mem | |
parent | c0e2f1e9a7901c5409c25fa15351f5d7213e2be1 (diff) | |
download | talos-hostboot-81c7d1cc28c7dc7a6b208165031aeab1f459fcbc.tar.gz talos-hostboot-81c7d1cc28c7dc7a6b208165031aeab1f459fcbc.zip |
PRD: add full maint cmd support for all DSD procedures
Change-Id: Ia99afea6ebcb79a1554d9b23b66cb9fdd6bf9352
RTC: 190428
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/57153
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Matt Derksen <mderkse1@us.ibm.com>
Reviewed-by: Benjamin J. Weisenbeck <bweisenb@us.ibm.com>
Reviewed-by: Caleb N. Palmer <cnpalmer@us.ibm.com>
Reviewed-by: Brian J. Stegmiller <bjs@us.ibm.com>
Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/57476
CI-Ready: Zane C. Shelley <zshelle@us.ibm.com>
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>
Diffstat (limited to 'src/usr/diag/prdf/plat/mem')
-rw-r--r-- | src/usr/diag/prdf/plat/mem/prdfMemDsd.H | 175 | ||||
-rw-r--r-- | src/usr/diag/prdf/plat/mem/prdfMemDsd_ipl.C | 134 | ||||
-rw-r--r-- | src/usr/diag/prdf/plat/mem/prdfMemDsd_rt.C | 124 | ||||
-rwxr-xr-x | src/usr/diag/prdf/plat/mem/prdfMemTdQueue.H | 3 | ||||
-rw-r--r-- | src/usr/diag/prdf/plat/mem/prdf_plat_mem_hb_only.mk | 2 |
5 files changed, 437 insertions, 1 deletions
diff --git a/src/usr/diag/prdf/plat/mem/prdfMemDsd.H b/src/usr/diag/prdf/plat/mem/prdfMemDsd.H new file mode 100644 index 000000000..de1816927 --- /dev/null +++ b/src/usr/diag/prdf/plat/mem/prdfMemDsd.H @@ -0,0 +1,175 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/plat/mem/prdfMemDsd.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2018 */ +/* [+] International Business Machines Corp. */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ + +/** @file prdfMemDsd.H */ + +#ifndef __prdfMemDsd_H +#define __prdfMemDsd_H + +// Platform includes +#include <prdfMemEccAnalysis.H> +#include <prdfMemMark.H> +#include <prdfMemScrubUtils.H> +#include <prdfMemTdQueue.H> +#include <prdfP9McaExtraSig.H> +#include <prdfPlatServices.H> + +namespace PRDF +{ + +/** @brief DRAM Spare Deploy procedure. */ +template<TARGETING::TYPE T> +class DsdEvent : public TdEntry +{ + public: // functions + + /** + * @brief Constructor + * @param i_chip MCA or MBA. + * @param i_rank Rank reporting chip mark. + */ + DsdEvent<T>( ExtensibleChip * i_chip, const MemRank & i_rank, + const MemMark & i_mark ) : + TdEntry(DSD_EVENT, i_chip, i_rank), iv_mark(i_mark) + { + PRDF_ASSERT( nullptr != i_chip ); + PRDF_ASSERT( T == i_chip->getType() ); + PRDF_ASSERT( i_mark.isValid() ); + } + + public: // overloaded functions from parent class + + uint32_t nextStep( STEP_CODE_DATA_STRUCT & io_sc, bool & o_done ) + { + #define PRDF_FUNC "[DsdEvent::nextStep] " + + // TODO: RTC 189221 should assert if DRAM Sparing is NOT supported. + + uint32_t o_rc = SUCCESS; + + do + { + // First, do analysis. + o_rc = analyzePhase( io_sc, o_done ); + if ( SUCCESS != o_rc ) + { + PRDF_ERR( PRDF_FUNC "analyzePhase() failed on 0x%08x,0x%2x", + iv_chip->getHuid(), getKey() ); + break; + } + + if ( o_done ) break; // Nothing more to do. + + // Then, start the next phase of the procedure. + o_rc = startNextPhase( io_sc ); + if ( SUCCESS != o_rc ) + { + PRDF_ERR( PRDF_FUNC "analyzePhase() failed on 0x%08x,0x%2x", + iv_chip->getHuid(), getKey() ); + break; + } + + } while (0); + + // Add the chip mark to the callout list if no callouts in the list. + if ( 0 == io_sc.service_data->getMruListSize() ) + { + MemoryMru mm { iv_chip->getTrgt(), iv_rank, iv_mark.getSymbol() }; + io_sc.service_data->SetCallout( mm ); + } + + return o_rc; + + #undef PRDF_FUNC + } + + uint32_t getKey() const + { return MemRank(iv_rank.getMaster()).getKey(); } // Master rank only + + 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. + * @return Non-SUCCESS if an internal function fails, SUCCESS otherwise. + */ + uint32_t analyzePhase( 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. + * @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 ) + { + uint32_t signature = 0; + + switch ( iv_phase ) + { + case TD_PHASE_0: + iv_phase = TD_PHASE_1; + signature = PRDFSIG_StartDsdPhase1; + break; + + #ifndef __HOSTBOOT_RUNTIME // IPL only + + case TD_PHASE_1: + iv_phase = TD_PHASE_2; + signature = PRDFSIG_StartDsdPhase2; + break; + + #endif + + default: PRDF_ASSERT( false ); // invalid phase + } + + 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 startCmd(); + } + + private: // instance variables + + const MemMark iv_mark; ///< The chip mark from hardware. +}; + +} // end namespace PRDF + +#endif // __prdfMemDsd_H + diff --git a/src/usr/diag/prdf/plat/mem/prdfMemDsd_ipl.C b/src/usr/diag/prdf/plat/mem/prdfMemDsd_ipl.C new file mode 100644 index 000000000..63fea6ea8 --- /dev/null +++ b/src/usr/diag/prdf/plat/mem/prdfMemDsd_ipl.C @@ -0,0 +1,134 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/plat/mem/prdfMemDsd_ipl.C $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2018 */ +/* [+] International Business Machines Corp. */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ + +/** @file prdfMemDsd_ipl.C */ + +// Platform includes +#include <prdfMemDqBitmap.H> +#include <prdfMemDsd.H> + +using namespace TARGETING; + +namespace PRDF +{ + +using namespace PlatServices; + +//############################################################################## +// +// Generic template functions +// +//############################################################################## + +template<TARGETING::TYPE T> +uint32_t DsdEvent<T>::analyzePhase( STEP_CODE_DATA_STRUCT & io_sc, + bool & o_done ) +{ + #define PRDF_FUNC "[DsdEvent::analyzePhase] " + + uint32_t o_rc = SUCCESS; + + do + { + if ( TD_PHASE_0 == iv_phase ) + { + // Before starting the next command, set iv_mark in the steer mux. + /* TODO: RTC 189221 + o_rc = setSteerMux<T>( iv_chip, iv_rank, iv_mark ); + if ( SUCCESS != o_rc ) + { + PRDF_ERR( PRDF_FUNC "setSteerMux(0x%08x,0x%2x) failed", + iv_chip->getHuid(), getKey() ); + break; + } + */ + + break; // Nothing to analyze yet. + } + + // TODO: RTC 189221 finish supporting this function. + + } while (0); + + // TODO: RTC 189221 remove once function is supported + PRDF_ERR( PRDF_FUNC "not supported yet" ); + o_done = true; // to ensure nothing else gets executed + + return o_rc; + + #undef PRDF_FUNC +} + +//############################################################################## +// +// Specializations for MBA +// +//############################################################################## + +template<> +uint32_t DsdEvent<TYPE_MBA>::startCmd() +{ + #define PRDF_FUNC "[DsdEvent::startCmd] " + + uint32_t o_rc = SUCCESS; + + uint32_t stopCond = mss_MaintCmd::NO_STOP_CONDITIONS; + + switch ( iv_phase ) + { + case TD_PHASE_1: + // Start the steer cleanup procedure on this master rank. + o_rc = startTdSteerCleanup<TYPE_MBA>( iv_chip, iv_rank, MASTER_RANK, + stopCond ); + if ( SUCCESS != o_rc ) + { + PRDF_ERR( PRDF_FUNC "startTdSteerCleanup(0x%08x,0x%2x) failed", + iv_chip->getHuid(), getKey() ); + } + break; + + case TD_PHASE_2: + // Start the superfast read procedure on this master rank. + o_rc = startTdSfRead<TYPE_MBA>( iv_chip, iv_rank, MASTER_RANK, + stopCond ); + if ( SUCCESS != o_rc ) + { + PRDF_ERR( PRDF_FUNC "startTdSfRead(0x%08x,0x%2x) failed", + iv_chip->getHuid(), getKey() ); + } + break; + + default: PRDF_ASSERT( false ); // invalid phase + } + + return o_rc; + + #undef PRDF_FUNC +} + +//------------------------------------------------------------------------------ + +} // end namespace PRDF + diff --git a/src/usr/diag/prdf/plat/mem/prdfMemDsd_rt.C b/src/usr/diag/prdf/plat/mem/prdfMemDsd_rt.C new file mode 100644 index 000000000..668496476 --- /dev/null +++ b/src/usr/diag/prdf/plat/mem/prdfMemDsd_rt.C @@ -0,0 +1,124 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/plat/mem/prdfMemDsd_rt.C $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2018 */ +/* [+] International Business Machines Corp. */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ + +/** @file prdfMemDsd_rt.C */ + +// Platform includes +#include <prdfMemDsd.H> + +using namespace TARGETING; + +namespace PRDF +{ + +using namespace PlatServices; + +//############################################################################## +// +// Generic template functions +// +//############################################################################## + +template<TARGETING::TYPE T> +uint32_t DsdEvent<T>::analyzePhase( STEP_CODE_DATA_STRUCT & io_sc, + bool & o_done ) +{ + #define PRDF_FUNC "[DsdEvent::analyzePhase] " + + uint32_t o_rc = SUCCESS; + + do + { + if ( TD_PHASE_0 == iv_phase ) + { + // Before starting the next command, set iv_mark in the steer mux. + /* TODO: RTC 189221 + o_rc = setSteerMux<T>( iv_chip, iv_rank, iv_mark ); + if ( SUCCESS != o_rc ) + { + PRDF_ERR( PRDF_FUNC "setSteerMux(0x%08x,0x%2x) failed", + iv_chip->getHuid(), getKey() ); + break; + } + */ + + break; // Nothing to analyze yet. + } + + // TODO: RTC 189221 finish supporting this function. + + } while (0); + + // TODO: RTC 189221 remove once function is supported + PRDF_ERR( PRDF_FUNC "not supported yet" ); + o_done = true; // to ensure nothing else gets executed + + return o_rc; + + #undef PRDF_FUNC +} + +//############################################################################## +// +// Specializations for MBA +// +//############################################################################## + +template<> +uint32_t DsdEvent<TYPE_MBA>::startCmd() +{ + #define PRDF_FUNC "[DsdEvent::startCmd] " + + uint32_t o_rc = SUCCESS; + + uint32_t stopCond = mss_MaintCmd::NO_STOP_CONDITIONS; + + // Due to a hardware bug in the Centaur, we must execute runtime maintenance + // commands at a very slow rate. Because of this, we decided that we should + // stop the command immediately on error if there is a UE so that we can + // respond quicker and send a DMD message to the hypervisor as soon as + // possible. + + stopCond |= mss_MaintCmd::STOP_ON_UE; + stopCond |= mss_MaintCmd::STOP_IMMEDIATE; + + // Start the time based scrub procedure on this master rank. + o_rc = startTdScrub<TYPE_MBA>( iv_chip, iv_rank, MASTER_RANK, stopCond ); + if ( SUCCESS != o_rc ) + { + PRDF_ERR( PRDF_FUNC "startTdScrub(0x%08x,0x%2x) failed", + iv_chip->getHuid(), getKey() ); + } + + return o_rc; + + #undef PRDF_FUNC +} + + +//------------------------------------------------------------------------------ + +} // end namespace PRDF + diff --git a/src/usr/diag/prdf/plat/mem/prdfMemTdQueue.H b/src/usr/diag/prdf/plat/mem/prdfMemTdQueue.H index 35fe21277..01fa7aaa0 100755 --- a/src/usr/diag/prdf/plat/mem/prdfMemTdQueue.H +++ b/src/usr/diag/prdf/plat/mem/prdfMemTdQueue.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016,2017 */ +/* Contributors Listed Below - COPYRIGHT 2016,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -61,6 +61,7 @@ class TdEntry enum TdType { VCM_EVENT = 0, ///< A Verify Chip Mark event. + DSD_EVENT, ///< A DRAM Spare Deploy event. TPS_EVENT, ///< A Two-Phase Scrub event. INVALID_EVENT = 0xf, ///< Used to denote that no event is in progress }; diff --git a/src/usr/diag/prdf/plat/mem/prdf_plat_mem_hb_only.mk b/src/usr/diag/prdf/plat/mem/prdf_plat_mem_hb_only.mk index fd0f8dd4a..2ff127bc1 100644 --- a/src/usr/diag/prdf/plat/mem/prdf_plat_mem_hb_only.mk +++ b/src/usr/diag/prdf/plat/mem/prdf_plat_mem_hb_only.mk @@ -55,6 +55,7 @@ ifneq (${HOSTBOOT_RUNTIME},1) # plat/mem/ (non-rule plugin related) prd_obj += prdfMemTdCtlr_ipl.o +prd_obj += prdfMemDsd_ipl.o prd_obj += prdfMemTps_ipl.o prd_obj += prdfMemVcm_ipl.o prd_obj += prdfMemIplCeStats.o @@ -70,6 +71,7 @@ ifeq (${HOSTBOOT_RUNTIME},1) # plat/mem/ (non-rule plugin related) prd_obj += prdfMemTdCtlr_rt.o +prd_obj += prdfMemDsd_rt.o prd_obj += prdfMemTps_rt.o prd_obj += prdfMemVcm_rt.o prd_obj += prdfMemDynDealloc.o |