diff options
author | Zane Shelley <zshelle@us.ibm.com> | 2013-01-25 17:21:05 -0600 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2013-02-16 00:22:26 -0600 |
commit | 6abba603d161e8ca70a2d0de0c0bffc82924f99e (patch) | |
tree | dad9215330c4759114fe41d248ebff303bb95695 /src/usr | |
parent | 7c73f96c7e3f309210d58332dc7f3fc4012118ef (diff) | |
download | talos-hostboot-6abba603d161e8ca70a2d0de0c0bffc82924f99e.tar.gz talos-hostboot-6abba603d161e8ca70a2d0de0c0bffc82924f99e.zip |
PRD: Refactor prdfPlatServices
The prdfPlatServices_common.[HC] files should only contain code that is
common between FSP and Hostboot.
The prdfTargetServices.[HC] files should only contain code specific to
the common FSP/Hostboot targeting code.
The FSP prdfPlatServices.[HC] and Hostboot prdfPlatServices.[HC] files
will contain code that is specific to FSP or Hostboot, respectively.
Only prdfPlatServices_common.H will include prdfTargetServices.H.
Only the prdfPlatServices.H files will include prdfPlatServices_common.H.
All user code should include the respective prdfPlatServices.H file.
Change-Id: I6e723d6e6602194abfc24ee9c20c1949c393c0e2
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/3041
Tested-by: Jenkins Server
Reviewed-by: Christopher T. Phan <cphan@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/3213
Diffstat (limited to 'src/usr')
18 files changed, 871 insertions, 1013 deletions
diff --git a/src/usr/diag/prdf/common/framework/rule/prdfGroup.C b/src/usr/diag/prdf/common/framework/rule/prdfGroup.C index 6aca1bb9a..8ee505fa4 100755 --- a/src/usr/diag/prdf/common/framework/rule/prdfGroup.C +++ b/src/usr/diag/prdf/common/framework/rule/prdfGroup.C @@ -22,11 +22,14 @@ /* IBM_PROLOG_END_TAG */ #include <prdfGroup.H> -#include <prdfBitString.H> -#include <prdfResolutionMap.H> + +#include <algorithm> + #include <iipResetErrorRegister.h> -#include <prdfMain.H> #include <iipServiceDataCollector.h> +#include <prdfBitString.H> +#include <prdfMain.H> +#include <prdfResolutionMap.H> namespace PRDF { diff --git a/src/usr/diag/prdf/common/framework/service/prdfPlatServices.C b/src/usr/diag/prdf/common/framework/service/prdfPlatServices.C deleted file mode 100755 index b6d6ad84f..000000000 --- a/src/usr/diag/prdf/common/framework/service/prdfPlatServices.C +++ /dev/null @@ -1,511 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/usr/diag/prdf/common/framework/service/prdfPlatServices.C $ */ -/* */ -/* IBM CONFIDENTIAL */ -/* */ -/* COPYRIGHT International Business Machines Corp. 2012,2013 */ -/* */ -/* p1 */ -/* */ -/* Object Code Only (OCO) source materials */ -/* Licensed Internal Code Source Materials */ -/* IBM HostBoot Licensed Internal Code */ -/* */ -/* The source code for this program is not published or otherwise */ -/* divested of its trade secrets, irrespective of what has been */ -/* deposited with the U.S. Copyright Office. */ -/* */ -/* Origin: 30 */ -/* */ -/* IBM_PROLOG_END_TAG */ - -/** - * @file prdfPlatServices.C - * @brief PRD wrapper of external componnets ( other then targetting) - */ - -//------------------------------------------------------------------------------ -// Includes -//------------------------------------------------------------------------------ - -#include <prdfPlatServices.H> - -#include <iipbits.h> -#include <iipsdbug.h> -#include <iipglobl.h> -#include <prdfTrace.H> - -#include <fapi.H> -#include <fapiTarget.H> -#include <fapiPlatHwpInvoker.H> - -#ifdef __HOSTBOOT_MODULE - #include <time.h> - #include <errno.h> - #include <sys/time.h> - #include <diag/mdia/mdia.H> - #include <diag/mdia/mdiamevent.H> - #include <dimmBadDqBitmapFuncs.H> -#else - #include <iplp_registry.H> - #include <mboxclientlib.H> - #include <smgr_ipltypes.H> - #include <smgr_registry.H> - #include <svpd_externals.H> - #include <svpdextstructs.H> - #include <GardExtInt.H> - #include <dscvReg.H> - #include <dadaProcMsViaProc.H> - #include <utillib.H> - #include <rmgrBaseClientLib.H> - #include <services/hwas/hwsvHwAvailSvc.H> // For deconfigureTargetAtRuntime() - #include <dumpHWURequest_applet.H> - #include <proc_mpipl_check_eligibility.H> -#endif - -//------------------------------------------------------------------------------ - -namespace PRDF -{ - -namespace PlatServices -{ - -//############################################################################## -//## -//## Hostboot and FSP functions -//## -//############################################################################## - -//############################################################################## -//## System Level Utility Functions -//############################################################################## - -bool isMasterFSP() -{ - bool l_isMaster = true; - #ifdef __HOSTBOOT_MODULE - // Always true in hostboot - l_isMaster = true; - #else - // We're going to assume master because it's better to have scom - // errors by writing on the slave then to not do something on the - // master. - - errlHndl_t l_errl = NULL; - uint8_t l_roleRegValue; - size_t l_roleRegSize = sizeof(l_roleRegValue); - - l_errl = UtilReg::read(FSP_ROLE_STR,&l_roleRegValue, - l_roleRegSize); - - if (NULL != l_errl) - { - PRDF_COMMIT_ERRL(l_errl, ERRL_ACTION_REPORT); - } - else - { - l_isMaster = (DSCV_FSP_MASTER == l_roleRegValue); - } - #endif - - return l_isMaster; -} - -//------------------------------------------------------------------------------ - -bool isMemoryPreservingIpl() -{ - bool l_isMemPreservingIpl = false; - #ifdef __HOSTBOOT_MODULE - //TODO - #else - //if (inCMMode()) - // return false; - - // Check the fsp ipl type so we know if this needs to be initialized - uint32_t l_iplType = 0x00000000; - size_t l_size = sizeof( l_iplType ); - - // Terry Opie Comments: First thing I see... You're gonna want to - // read:SMGR_REG_CECIPL_TYPE_KEY instead of the fsp ipl type. - // The one(SMGR_REG_FSPIPL_TYPE_KEY) you're reading is strictly fsp - // related ipl types. resets/reset reloads, etc. - - errlHndl_t l_errl = UtilReg::read( SMGR_REG_CECIPL_TYPE_KEY, - &l_iplType, - l_size ); - if (NULL != l_errl) - { - PRDF_ERR( "[isMemoryPreservingIpl] Failed to read registry" ); - PRDF_COMMIT_ERRL(l_errl, ERRL_ACTION_REPORT); - } - else - { - // Terry Opie Comments: Also for checking the mask..You can do - // it the way you have it,or use a macro that are in - // smgr_ipltypes.H. Returns true if the Main Store preserved - // attribute bit is set #define - // SMGR_IPLTYPE_IS_MS_PRESVD(_i_ipltype_)(((_i_ipltype_)& - // SMGR_ATTR_MS_PRESVD_MASK) != 0)Call that - // passing in the ipl type, and it'll return true if its Mem presv. - if(SMGR_IPLTYPE_IS_MS_PRESVD(l_iplType)) - { - l_isMemPreservingIpl = true; - } - } - #endif - - return l_isMemPreservingIpl; -} - -//------------------------------------------------------------------------------ - -void getECIDString(TARGETING::TargetHandle_t i_pGivenTarget, const char *o_ecidStr ) -{ - o_ecidStr =""; - PRDF_ERR( "[getECIDString] Function not implemented yet" ); - -} - -//------------------------------------------------------------------------------ - -void getCurrentTime( Timer & o_timer ) -{ -#ifdef __HOSTBOOT_MODULE - - timespec_t curTime; - PRDF_ASSERT(0 == clock_gettime(CLOCK_MONOTONIC, &curTime)) - - // Hostboot uptime in secs - o_timer = curTime.tv_sec; - - //Since Hostboot doesn't have any System checkstop - //We don't have to worry about the detailed time struct - //for System checkstop timestamp - -#else - - time_t thetime = time(NULL); - struct tm * l_curEventTime = localtime(&thetime); - - // record the detailed time struct - Timer::prdftm_t l_tm(l_curEventTime->tm_sec, - l_curEventTime->tm_min, - l_curEventTime->tm_hour, - l_curEventTime->tm_wday, - l_curEventTime->tm_mday, - l_curEventTime->tm_yday, - l_curEventTime->tm_mon, - l_curEventTime->tm_year); - o_timer.settm(l_tm); - -#endif -} - -//------------------------------------------------------------------------------ - -errlHndl_t syncFile( const char* i_fileName ) -{ -#ifdef __HOSTBOOT_MODULE - return NULL; -#else - return rmgrSyncFile(PRDF_COMP_ID, i_fileName); -#endif -} - -//############################################################################## -//## Memory specific functions -//############################################################################## - -/* TODO - Get the memory buffer raw card type (i.e. R/C A). This is needed for - the DRAM site locations for buffered DIMMs. Should be able to get this - from an attribute but doesn't look like this is available yet. -getMembufRawCardType() -{ -} -*/ - -//------------------------------------------------------------------------------ - -/* TODO - Get the type of the card a DIMM is plugged into. This is needed for - the DRAM site locations for IS DIMMs. Should be able to get this from - an attribute but doesn't look like this is available yet. -getDimmPlugCardType() -{ -} -*/ - -//------------------------------------------------------------------------------ - -/* TODO -//------------------------------------------------------------------------------ - -int32_t setBadDqBitmap( TARGETING::TargetHandle_t i_mbaTarget - const uint8_t i_portSlct, - const uint8_t i_dimmSlct, - const uint8_t i_rankSlct, - const uint8_t (&i_data)[DIMM_DQ_RANK_BITMAP_SIZE] ) -{ - int32_t o_rc = SUCCESS; - - // TODO: Call dimmSetBadDqBitmap() in dimmBadDqBitmapFuncs.H. - // NOTE: DIMM_DQ_RANK_BITMAP_SIZE is in dimmConsts.H - // NOTE: Will need to convert TARGETING::TargetHandle_t to fapi::Target. - - return o_rc; -} -*/ - -//############################################################################## -//## -//## Hostboot only functions -//## -//############################################################################## - -#ifdef __HOSTBOOT_MODULE - -bool isInMdiaMode() -{ - bool o_isInMdiaMode = false; - - MDIA::waitingForMaintCmdEvents(o_isInMdiaMode); - - return o_isInMdiaMode; -} - -//------------------------------------------------------------------------------ - -int32_t mdiaSendCmdComplete( TARGETING::TargetHandle_t i_mbaTarget ) -{ - using namespace TARGETING; - - int32_t o_rc = SUCCESS; - - do - { - // Verify type. - TYPE l_type = getTargetType(i_mbaTarget); - if ( TYPE_MBA != l_type ) - { - PRDF_ERR( "[PlatServices::mdiaSendCmdComplete] unsupported target " - "type %d", l_type ); - o_rc = FAIL; - break; - } - - // Send command complete to MDIA. - MDIA::MaintCommandEvent l_mdiaEvent; - l_mdiaEvent.type = MDIA::COMMAND_COMPLETE; - l_mdiaEvent.target = i_mbaTarget; - - errlHndl_t errl = MDIA::processEvent( l_mdiaEvent ); - if ( NULL != errl ) - { - PRDF_ERR( "[PlatServices::mdiaSendCmdComplete] MDIA::processEvent " - "failed" ); - PRDF_COMMIT_ERRL( errl, ERRL_ACTION_REPORT ); - o_rc = FAIL; - break; - } - - } while (0); - - if ( SUCCESS != o_rc ) - { - PRDF_ERR( "[PlatServices::mdiaSendCmdComplete] Failed: i_target=0x%08x", - getHuid(i_mbaTarget) ); - } - - return o_rc; -} - -int32_t mssGetMarkStore( - TARGETING::TargetHandle_t i_mbaTarget, - uint8_t i_rank, - uint8_t & o_chipMark, - uint8_t & o_symbolMark) -{ - int32_t o_rc = SUCCESS; - - errlHndl_t err = NULL; - - FAPI_INVOKE_HWP( - err, - mss_get_mark_store, - fapi::Target(fapi::TARGET_TYPE_MBA_CHIPLET, i_mbaTarget), - i_rank, - o_chipMark, - o_symbolMark); - - if(NULL != err) - { - PRDF_ERR( "[PlatServices::mssGetMarkStore] mss_get_mark_store" - "failed" ); - PRDF_COMMIT_ERRL( err, ERRL_ACTION_REPORT ); - o_rc = FAIL; - } - - return o_rc; -} - -int32_t mssGetSteerMux( - TARGETING::TargetHandle_t i_mbaTarget, - uint8_t i_rank, - mss_SteerMux::muxType i_muxType, - uint8_t & o_portZeroSpare, - uint8_t & o_portOneSpare, - uint8_t & o_eccSpare) -{ - int32_t o_rc = SUCCESS; - - errlHndl_t err = NULL; - - FAPI_INVOKE_HWP( - err, - mss_get_steer_mux, - fapi::Target(fapi::TARGET_TYPE_MBA_CHIPLET, i_mbaTarget), - i_rank, - i_muxType, - o_portZeroSpare, - o_portOneSpare, - o_eccSpare); - - if(NULL != err) - { - PRDF_ERR( "[PlatServices::mssGetSteerMux] mss_get_steer_mux" - "failed" ); - PRDF_COMMIT_ERRL( err, ERRL_ACTION_REPORT ); - o_rc = FAIL; - } - - return o_rc; - -} - -int32_t mssRestoreDramRepairs( - TARGETING::TargetHandle_t i_mbaTarget, - uint8_t & o_repairedRankMask, - uint8_t & o_badDimmMask) -{ - int32_t o_rc = SUCCESS; - - errlHndl_t err = NULL; - - FAPI_INVOKE_HWP( - err, - mss_restore_DRAM_repairs, - fapi::Target(fapi::TARGET_TYPE_MBA_CHIPLET, i_mbaTarget), - o_repairedRankMask, - o_badDimmMask); - - if(NULL != err) - { - PRDF_ERR( "[PlatServices::mssRestoreDramRepairs] " - "mss_restore_dram_repairs failed" ); - PRDF_COMMIT_ERRL( err, ERRL_ACTION_REPORT ); - o_rc = FAIL; - } - - return o_rc; -} - -int32_t getBadDqBitmap( TARGETING::TargetHandle_t i_mbaTarget, - const uint8_t i_portSlct, - const uint8_t i_dimmSlct, - const uint8_t i_rankSlct, - uint8_t (&o_data)[DIMM_DQ_RANK_BITMAP_SIZE] ) -{ - int32_t o_rc = SUCCESS; - - errlHndl_t err = NULL; - - FAPI_INVOKE_HWP( - err, - dimmGetBadDqBitmap, - fapi::Target(fapi::TARGET_TYPE_MBA_CHIPLET, i_mbaTarget), - i_portSlct, - i_dimmSlct, - i_rankSlct, - o_data); - - if(NULL != err) - { - PRDF_ERR( "[PlatServices::getBadDqBitmap] dimmGetBadDqBitmap" - "failed" ); - PRDF_COMMIT_ERRL( err, ERRL_ACTION_REPORT ); - o_rc = FAIL; - } - - return o_rc; -} - -#endif // __HOSTBOOT_MODULE - -//############################################################################## -//## -//## FSP only functions -//## -//############################################################################## - -#ifndef __HOSTBOOT_MODULE - -//------------------------------------------------------------------------------ - -errlHndl_t runtimeDeconfig( TARGETING::TargetHandle_t i_target ) -{ - using namespace HWAS; - return deconfigureTargetAtRuntime( i_target, DECONFIG_FOR_DUMP ); -} - -//------------------------------------------------------------------------------ - -errlHndl_t dumpHWURequest( hwTableContent i_Content, - comp_id_t i_ClientId, - uint32_t i_ErrorLogId, - SrciSrc &i_Src, - TARGETING::HUID_ATTR i_FailingHomUnitId ) -{ - return dumpHWURequestApplet( i_Content, - i_ClientId, - i_ErrorLogId, - i_Src, - i_FailingHomUnitId ); -} - - -//------------------------------------------------------------------------------ - -int32_t checkMpiplEligibility(TARGETING::TargetHandle_t i_procTarget, - bool & o_mpiplEligible) -{ - int32_t o_rc = SUCCESS; - errlHndl_t l_err = NULL; - o_mpiplEligible = false; - - FAPI_INVOKE_HWP( - l_err, - proc_mpipl_check_eligibility, - fapi::Target(fapi::TARGET_TYPE_PROC_CHIP, i_procTarget), - o_mpiplEligible); - - if(NULL != l_err) - { - PRDF_ERR( "[PlatServices::checkMpiplEligibility] error [0x%X]" - "returned from proc_mpipl_check_eligibility for " - "Proc: 0x%08x", l_err->getRC(), getHuid(i_procTarget) ); - PRDF_COMMIT_ERRL( l_err, ERRL_ACTION_REPORT ); - o_rc = FAIL; - } - - return o_rc; -} - -#endif // not __HOSTBOOT_MODULE - -} // end namespace PlatServices - -} // end namespace PRDF - diff --git a/src/usr/diag/prdf/common/framework/service/prdfPlatServices.H b/src/usr/diag/prdf/common/framework/service/prdfPlatServices.H deleted file mode 100755 index ee650f7e2..000000000 --- a/src/usr/diag/prdf/common/framework/service/prdfPlatServices.H +++ /dev/null @@ -1,288 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/usr/diag/prdf/common/framework/service/prdfPlatServices.H $ */ -/* */ -/* IBM CONFIDENTIAL */ -/* */ -/* COPYRIGHT International Business Machines Corp. 2012,2013 */ -/* */ -/* p1 */ -/* */ -/* Object Code Only (OCO) source materials */ -/* Licensed Internal Code Source Materials */ -/* IBM HostBoot Licensed Internal Code */ -/* */ -/* The source code for this program is not published or otherwise */ -/* divested of its trade secrets, irrespective of what has been */ -/* deposited with the U.S. Copyright Office. */ -/* */ -/* Origin: 30 */ -/* */ -/* IBM_PROLOG_END_TAG */ - -#ifndef PRDFPLATSERVICES_H -#define PRDFPLATSERVICES_H - -/** - * @file prdfPlatServices.H - * @brief Wrapper code for things PRD needs from external components ( other then targetting ). - */ - -//------------------------------------------------------------------------------ -// Includes -//------------------------------------------------------------------------------ - -#include <algorithm> - -#include <iipconst.h> -#include <prdfTargetServices.H> -#include <prdfTimer.H> - -#include <errlentry.H> -#include <dimmConsts.H> - -#ifdef __HOSTBOOT_MODULE - #include <dram_initialization/mss_memdiag/mss_maint_cmds.H> -#else - #include <hdctContent.H> -#endif - -//------------------------------------------------------------------------------ - -namespace PRDF -{ - -namespace PlatServices -{ - -//############################################################################## -//## -//## Hostboot and FSP functions -//## -//############################################################################## - -//############################################################################## -//## System Level Utility Functions -//############################################################################## - -//FIXME functions defintion not found.Should we remove it? -//void enterCCMMode(); -//bool inCMMode(); -//bool isCM_FUNCTIONAL(TARGETING::TargetHandle_t); - -/** - * @brief Returns if role is mater fsp. - * @param None. - * @return TRUE if master fsp. FALSE if not master fsp. - * @pre None. - * @post None. - */ -bool isMasterFSP(); - -/** - * @brief Checks if we are currently doing a memory preserving IPL. - * @param None. - * @return TRUE if this is a memory preserving IPL, FALSE otherwise. - * @pre None. - * @post None. - */ -bool isMemoryPreservingIpl(); - -/** - * @brief Return ecidString for a given target - * @param i_pGivenTarget handle to target - * @param o_ecidStr buffer for ecidstring - * @return Returns ecidString for given target Handle - * @pre none - * @post none - */ -void getECIDString( TARGETING::TargetHandle_t i_pGivenHandle, const char *o_ecidStr ); - -/** - * @brief Get a PRD timer value based on the current time. - * @param o_timer The returned Timer - */ -void getCurrentTime( Timer & o_timer ); - -/** - * @brief synch the file with rmgr - * @param i_fileName file name - * @return NULL if synch is unsuccessfull, error handle otherwise - */ -errlHndl_t syncFile( const char* i_fileName ); - -//############################################################################## -//## Memory specific functions -//############################################################################## - -/** - * @brief Returns the memory buffer raw card type (i.e. R/C A). - * @param i_memTarget A memory buffer, MBA, or DIMM. - * @return - */ -/* TODO - See .C -getMembufRawCardType( TARGETING::TargetHandle_t i_memTarget ); -*/ - -/** - * @brief Returns the type of the card the DIMM is plugged into. - * @param i_dimmTarget A DIMM target. - * @return - */ - -/* TODO - See .C -getDimmPlugCardType( TARGETING::TargetHandle_t i_dimmTarget ); -*/ - -/** - * @brief Writes the bad DQ bitmap attribute. - * @param i_mbaTarget A MBA target. - * @param i_portSlct Port select (0-1). - * @param i_dimmSlct DIMM select (0-1). - * @param i_rankSlct Rank select (0-3). - * @param i_data The input data array. - * @return Non-SUCCESS if an internal function fails, SUCCESS otherwise. - */ -/* TODO - See .C -int32_t setBadDqBitmap( TARGETING::TargetHandle_t i_mbaTarget - const uint8_t i_portSlct, - const uint8_t i_dimmSlct, - const uint8_t i_rankSlct, - const uint8_t (&i_data)[DIMM_DQ_RANK_BITMAP_SIZE] ); -*/ - -//############################################################################## -//## -//## Hostboot only functions -//## -//############################################################################## - -#ifdef __HOSTBOOT_MODULE - -/** - * @brief Checks if we are running in MDIA mode. - * @return TRUE if in MDIA mode, FALSE otherwise. - */ -bool isInMdiaMode(); - -/** - * @brief Sends a command complete message to MDIA. - * @param i_mbaTarget An MBA target. - * @return Non-SUCCESS in internal function fails, SUCCESS otherwise. - */ -int32_t mdiaSendCmdComplete( TARGETING::TargetHandle_t i_mbaTarget ); - -/** - * @brief Invokes the get mark store hardware procedure. - * @param i_mbaTarget - * @param i_rank - * @param o_chipMark - * @param o_symbolMark - * @return Non-SUCCESS in internal function fails, SUCCESS otherwise. - */ -int32_t mssGetMarkStore( - TARGETING::TargetHandle_t i_mbaTarget, - uint8_t i_rank, - uint8_t & o_chipMark, - uint8_t & o_symbolMark); - -/** - * @brief Invokes the get steer mux hardware procedure. - * @param i_mbaTarget - * @param i_rank - * @param i_muxType Read/Write Mux select - * @param o_portZeroSpare - * @param o_portOneSpare - * @param o_eccSpare - * @return Non-SUCCESS in internal function fails, SUCCESS otherwise. - */ -int32_t mssGetSteerMux( - TARGETING::TargetHandle_t i_mbaTarget, - uint8_t i_rank, - mss_SteerMux::muxType i_muxType, - uint8_t & o_portZeroSpare, - uint8_t & o_portOneSpare, - uint8_t & o_eccSpare); - -/** - * @brief Invokes the restore DRAM repairs hardware procedure. - * @param i_mbaTarget - * @param o_repairedRankMask An encoded bitmask of repaired ranks. - * @param o_badDimm An encoded bitmask of bad DIMMs. - * @return Non-SUCCESS in internal function fails, SUCCESS otherwise. - */ -int32_t mssRestoreDramRepairs( - TARGETING::TargetHandle_t i_mbaTarget, - uint8_t & o_repairedRankMask, - uint8_t & o_badDimmMask); - -/** - * @brief Reads the bad DQ bitmap attribute. - * @param i_mbaTarget A MBA target. - * @param i_portSlct Port select (0-1). - * @param i_dimmSlct DIMM select (0-1). - * @param i_rankSlct Rank select (0-3). - * @param o_data The return data array. - * @return Non-SUCCESS if an internal function fails, SUCCESS otherwise. - */ -// FIXME: Eventually needs to be supported in FSP code as well. -int32_t getBadDqBitmap( TARGETING::TargetHandle_t i_mbaTarget, - const uint8_t i_portSlct, - const uint8_t i_dimmSlct, - const uint8_t i_rankSlct, - uint8_t (&o_data)[DIMM_DQ_RANK_BITMAP_SIZE] ); - -#endif // __HOSTBOOT_MODULE - -//############################################################################## -//## -//## FSP only functions -//## -//############################################################################## - -#ifndef __HOSTBOOT_MODULE - -/** - * @brief Do a runtime deconfiguration of the given target. - * @param i_target The target to deconfigure. - * @return NULL if deconfig is successful, non-NULL otherwise. - */ -errlHndl_t runtimeDeconfig( TARGETING::TargetHandle_t i_target ); - - -/** - * @brief Interface for HWSV (PRD) to request a local dump of a hardware target. - * @param[in] i_Content Content to collect - * @param[in] i_ClientId Component ID requesting the hardware unit dump - * @param[in] i_ErrorLogId Platform Log ID, PLID, received from the failure - * @param[in] i_Src Primary SRC of reason error log - * @param[in] i_FailingHomUnitId Failing target to dump -*/ -errlHndl_t dumpHWURequest( hwTableContent i_Content, - comp_id_t i_ClientId, - uint32_t i_ErrorLogId, - SrciSrc &i_Src, - TARGETING::HUID_ATTR i_FailingHomUnitId ); - -/** - * @brief determine whether a checkstop is eligible for - * Memory Preserving IPL - * - * @param i_procTarget A PROC target - * @param o_mpiplMode true for MPIPL and false for no MPIPL - * - * @return non-SUCCESS for failure, SUCCESS otherwise -*/ - -int32_t checkMpiplEligibility(TARGETING::TargetHandle_t i_procTarget, - bool & o_mpiplEligible); - -#endif // not __HOSTBOOT_MODULE - -} // end namespace PlatServices - -} // end namespace PRDF - -#endif // PRDFPLATSERVICES_H - diff --git a/src/usr/diag/prdf/common/framework/service/prdfPlatServices_common.C b/src/usr/diag/prdf/common/framework/service/prdfPlatServices_common.C new file mode 100755 index 000000000..fa8f56515 --- /dev/null +++ b/src/usr/diag/prdf/common/framework/service/prdfPlatServices_common.C @@ -0,0 +1,254 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: ./common/framework/service/prdfPlatServices_common.C $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2012,2013 */ +/* */ +/* p1 */ +/* */ +/* Object Code Only (OCO) source materials */ +/* Licensed Internal Code Source Materials */ +/* IBM HostBoot Licensed Internal Code */ +/* */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ + +/** + * @file prdfPlatServices_common.C + * @brief Wrapper code for external interfaces used by PRD. + * + * This file contains code that is strictly common between FSP and Hostboot. All + * platform specific code should be in the respective FSP only or Hostboot only + * files. + */ + +#include <prdfPlatServices.H> + +#include <iipglobl.h> +#include <prdfTrace.H> + +#include <dimmBadDqBitmapFuncs.H> // for dimm[S|G]etBadDqBitmap() +#include <dram_initialization/mss_memdiag/mss_maint_cmds.H> + +using namespace TARGETING; + +//------------------------------------------------------------------------------ + +namespace PRDF +{ + +namespace PlatServices +{ + +//############################################################################## +//## System Level Utility Functions +//############################################################################## + +void getECIDString( TargetHandle_t i_target, const char * o_ecidStr ) +{ + o_ecidStr =""; + PRDF_ERR( "[PlatServices::getECIDString] Function not implemented yet" ); +} + +//############################################################################## +//## Processor specific functions +//############################################################################## + +//############################################################################## +//## Memory specific functions +//############################################################################## + +int32_t getBadDqBitmap( TargetHandle_t i_mbaTarget, const uint8_t i_portSlct, + const uint8_t i_dimmSlct, const uint8_t i_rankSlct, + uint8_t (&o_data)[DIMM_DQ_RANK_BITMAP_SIZE] ) +{ + int32_t o_rc = SUCCESS; + + errlHndl_t errl = NULL; + + PRD_FAPI_TO_ERRL( errl, dimmGetBadDqBitmap, + fapi::Target(fapi::TARGET_TYPE_MBA_CHIPLET, i_mbaTarget), + i_portSlct, i_dimmSlct, i_rankSlct, o_data ); + + if ( NULL != errl ) + { + PRDF_ERR( "[PlatServices::getBadDqBitmap] dimmGetBadDqBitmap() failed. " + "HUID: 0x%08x port: %d DIMM: %d rank: %d", + getHuid(i_mbaTarget), i_portSlct, i_dimmSlct, i_rankSlct ); + PRDF_COMMIT_ERRL( errl, ERRL_ACTION_REPORT ); + o_rc = FAIL; + } + + return o_rc; +} + +//------------------------------------------------------------------------------ + +int32_t setBadDqBitmap( TargetHandle_t i_mbaTarget, const uint8_t i_portSlct, + const uint8_t i_dimmSlct, const uint8_t i_rankSlct, + const uint8_t (&i_data)[DIMM_DQ_RANK_BITMAP_SIZE] ) +{ + int32_t o_rc = SUCCESS; + + errlHndl_t errl = NULL; + + PRD_FAPI_TO_ERRL( errl, dimmSetBadDqBitmap, + fapi::Target(fapi::TARGET_TYPE_MBA_CHIPLET, i_mbaTarget), + i_portSlct, i_dimmSlct, i_rankSlct, i_data ); + + if ( NULL != errl ) + { + PRDF_ERR( "[PlatServices::getBadDqBitmap] dimmSetBadDqBitmap() failed. " + "HUID: 0x%08x ps: %d ds: %d rs: %d", + getHuid(i_mbaTarget), i_portSlct, i_dimmSlct, i_rankSlct ); + PRDF_COMMIT_ERRL( errl, ERRL_ACTION_REPORT ); + o_rc = FAIL; + } + + return o_rc; +} + +//------------------------------------------------------------------------------ + +int32_t mssGetMarkStore( TargetHandle_t i_mbaTarget, uint8_t i_rank, + uint8_t & o_chipMark, uint8_t & o_symbolMark ) +{ + int32_t o_rc = SUCCESS; + + errlHndl_t errl = NULL; + + PRD_FAPI_TO_ERRL( errl, mss_get_mark_store, + fapi::Target(fapi::TARGET_TYPE_MBA_CHIPLET, i_mbaTarget), + i_rank, o_chipMark, o_symbolMark ); + + if ( NULL != errl ) + { + PRDF_ERR( "[PlatServices::mssGetMarkStore] mss_get_mark_store() " + "failed. HUID: 0x%08x rank: %d", + getHuid(i_mbaTarget), i_rank ); + PRDF_COMMIT_ERRL( errl, ERRL_ACTION_REPORT ); + o_rc = FAIL; + } + + return o_rc; +} + +//------------------------------------------------------------------------------ + +int32_t mssSetMarkStore( TargetHandle_t i_mbaTarget, uint8_t i_rank, + uint8_t i_chipMark, uint8_t i_symbolMark ) +{ + int32_t o_rc = SUCCESS; + + errlHndl_t errl = NULL; + + // TODO: mss_put_mark_store() will give a certain return code if the write + // to mark store was circumvented by hardware. Will need to check this + // return code. + + PRD_FAPI_TO_ERRL( errl, mss_put_mark_store, + fapi::Target(fapi::TARGET_TYPE_MBA_CHIPLET, i_mbaTarget), + i_rank, i_chipMark, i_symbolMark ); + + if ( NULL != errl ) + { + PRDF_ERR( "[PlatServices::mssSetMarkStore] mss_put_mark_store() " + "failed. HUID: 0x%08x rank: %d cm: %d sm: %d", + getHuid(i_mbaTarget), i_rank, i_chipMark, i_symbolMark ); + PRDF_COMMIT_ERRL( errl, ERRL_ACTION_REPORT ); + o_rc = FAIL; + } + + return o_rc; +} + +//------------------------------------------------------------------------------ + +int32_t mssGetSteerMux( TargetHandle_t i_mbaTarget, uint8_t i_rank, + uint8_t & o_port0Spare, uint8_t & o_port1Spare, + uint8_t & o_eccSpare ) +{ + int32_t o_rc = SUCCESS; + +/* TODO: Marc is creating a new interface. + errlHndl_t errl = NULL; + + PRD_FAPI_TO_ERRL( errl, TODO, + fapi::Target(fapi::TARGET_TYPE_MBA_CHIPLET, i_mbaTarget), + i_rank, o_port0Spare, o_port1Spare, o_eccSpare ); + + if ( NULL != errl ) + { + PRDF_ERR( "[PlatServices::mssGetSteerMux] TODO() " + "failed. HUID: 0x%08x rank: %d", + getHuid(i_mbaTarget), i_rank ); + PRDF_COMMIT_ERRL( errl, ERRL_ACTION_REPORT ); + o_rc = FAIL; + } +*/ + + return o_rc; + +} + +//------------------------------------------------------------------------------ + +int32_t mssSetSteerMux( TargetHandle_t i_mbaTarget, uint8_t i_rank, + uint8_t i_symbol, bool i_x4EccSpare ) +{ + int32_t o_rc = SUCCESS; + +/* TODO: Marc is creating a new interface. + errlHndl_t errl = NULL; + + PRD_FAPI_TO_ERRL( errl, TODO, + fapi::Target(fapi::TARGET_TYPE_MBA_CHIPLET, i_mbaTarget), + i_rank, i_symbol, i_x4EccSpare ); + + if ( NULL != errl ) + { + PRDF_ERR( "[PlatServices::mssSetSteerMux] TODO() " + "failed. HUID: 0x%08x rank: %d symbol: %d eccSpare: %c", + getHuid(i_mbaTarget), i_rank, i_symbol, + i_x4EccSpare ? 'T' : 'F' ); + PRDF_COMMIT_ERRL( errl, ERRL_ACTION_REPORT ); + o_rc = FAIL; + } +*/ + + return o_rc; + +} + +//------------------------------------------------------------------------------ + +/* TODO - Get the memory buffer raw card type (i.e. R/C A). This is needed for + the DRAM site locations for buffered DIMMs. Should be able to get this + from an attribute but doesn't look like this is available yet. +getMembufRawCardType() +{ +} +*/ + +//------------------------------------------------------------------------------ + +/* TODO - Get the type of the card a DIMM is plugged into. This is needed for + the DRAM site locations for IS DIMMs. Should be able to get this from + an attribute but doesn't look like this is available yet. +getDimmPlugCardType() +{ +} +*/ + +} // end namespace PlatServices + +} // end namespace PRDF + diff --git a/src/usr/diag/prdf/common/framework/service/prdfPlatServices_common.H b/src/usr/diag/prdf/common/framework/service/prdfPlatServices_common.H new file mode 100755 index 000000000..5b8c1913a --- /dev/null +++ b/src/usr/diag/prdf/common/framework/service/prdfPlatServices_common.H @@ -0,0 +1,217 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: ./common/framework/service/prdfPlatServices_common.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2012,2013 */ +/* */ +/* p1 */ +/* */ +/* Object Code Only (OCO) source materials */ +/* Licensed Internal Code Source Materials */ +/* IBM HostBoot Licensed Internal Code */ +/* */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ + +#ifndef PRDFPLATSERVICES_COMMON_H +#define PRDFPLATSERVICES_COMMON_H + +/** + * @file prdfPlatServices_common.H + * @brief Wrapper code for external interfaces used by PRD. + * + * This file contains code that is strictly common between FSP and Hostboot. All + * platform specific code should be in the respective FSP only or Hostboot only + * files. + * + * Note that only the respective platform specific header files should include + * this header file. + */ + +#include <prdfTargetServices.H> // must include all common targeting code + +#include <prdfTimer.H> + +#include <dimmConsts.H> // for DIMM_DQ_RANK_BITMAP_SIZE +#include <fapiPlatHwpInvoker.H> // for fapi::fapiRcToErrl() + +#define PRD_FAPI_TO_ERRL(ERRHNDL, FUNC, _args_...) \ + { \ + fapi::ReturnCode l_rc = FUNC(_args_); \ + ERRHNDL = fapi::fapiRcToErrl(l_rc); \ + } + +//------------------------------------------------------------------------------ + +namespace PRDF +{ + +namespace PlatServices +{ + +//############################################################################## +//## System Level Utility functions +//############################################################################## + +//FIXME functions defintion not found.Should we remove it? +//void enterCCMMode(); +//bool inCMMode(); +//bool isCM_FUNCTIONAL(TARGETING::TargetHandle_t); + +/** + * @brief Returns if role is mater fsp. + * @param None. + * @return TRUE if master fsp. FALSE if not master fsp. + * @pre None. + * @post None. + */ +bool isMasterFSP(); + +/** + * @brief Checks if we are currently doing a memory preserving IPL. + * @return TRUE if this is a memory preserving IPL, FALSE otherwise. + */ +bool isMemoryPreservingIpl(); + +/** + * @brief Return ECID string for a given target + * @param i_target Any target + * @param o_ecidStr buffer for ECID string + * @return Returns ECID string for given target + */ +void getECIDString( TARGETING::TargetHandle_t i_target, + const char * o_ecidStr ); + +/** + * @brief Get a PRD timer value based on the current time. + * @param o_timer The returned Timer + */ +void getCurrentTime( Timer & o_timer ); + +/** + * @brief Sync the file with RMGR + * @param i_fileName File name + * @return Non-SUCCESS if sync is unsuccessful, SUCCESS otherwise. + */ +int32_t syncFile( const char * i_fileName ); + +//############################################################################## +//## Processor specific functions +//############################################################################## + +//############################################################################## +//## Memory specific functions +//############################################################################## + +/** + * @brief Reads the bad DQ bitmap attribute. + * @param i_mbaTarget A MBA target. + * @param i_portSlct Port select (0-1). + * @param i_dimmSlct DIMM select (0-1). + * @param i_rankSlct Rank select (0-3). + * @param o_data The return data array. + * @return Non-SUCCESS if an internal function fails, SUCCESS otherwise. + */ +int32_t getBadDqBitmap( TARGETING::TargetHandle_t i_mbaTarget, + const uint8_t i_portSlct, + const uint8_t i_dimmSlct, + const uint8_t i_rankSlct, + uint8_t (&o_data)[DIMM_DQ_RANK_BITMAP_SIZE] ); + +/** + * @brief Writes the bad DQ bitmap attribute. + * @param i_mbaTarget A MBA target. + * @param i_portSlct Port select (0-1). + * @param i_dimmSlct DIMM select (0-1). + * @param i_rankSlct Rank select (0-3). + * @param i_data The input data array. + * @return Non-SUCCESS if an internal function fails, SUCCESS otherwise. + */ +int32_t setBadDqBitmap( TARGETING::TargetHandle_t i_mbaTarget, + const uint8_t i_portSlct, + const uint8_t i_dimmSlct, + const uint8_t i_rankSlct, + const uint8_t (&i_data)[DIMM_DQ_RANK_BITMAP_SIZE] ); + +/** + * @brief Invokes the get mark store hardware procedure. + * @param i_mbaTarget A MBA target. + * @param i_rank Target rank (0-7). + * @param o_chipMark A symbol associated with the returned chip mark. + * @param o_symbolMark A symbol associated with the returned symbol mark. + * @return Non-SUCCESS in internal function fails, SUCCESS otherwise. + */ +int32_t mssGetMarkStore( TARGETING::TargetHandle_t i_mbaTarget, uint8_t i_rank, + uint8_t & o_chipMark, uint8_t & o_symbolMark ); + +/** + * @brief Invokes the set mark store hardware procedure. + * @param i_mbaTarget A MBA target. + * @param i_rank Target rank (0-7). + * @param i_chipMark A symbol associated with the new chip mark. + * @param i_symbolMark A symbol associated with the new symbol mark. + * @note Both the chip mark and the symbol mark will be written at the same + * time, so do a RMW operation to avoid overwriting a previous mark. + * @return Non-SUCCESS in internal function fails, SUCCESS otherwise. + */ +int32_t mssSetMarkStore( TARGETING::TargetHandle_t i_mbaTarget, uint8_t i_rank, + uint8_t i_chipMark, uint8_t i_symbolMark ); + +/** + * @brief Invokes the get steer mux hardware procedure. + * @param i_mbaTarget A MBA target. + * @param i_rank Target rank (0-7). + * @param o_port0Spare A symbol associated with the spare on port 0. + * @param o_port1Spare A symbol associated with the spare on port 1. + * @param o_eccSpare A symbol associated with the ECC spare (x4 mode only). + * @return Non-SUCCESS in internal function fails, SUCCESS otherwise. + */ +int32_t mssGetSteerMux( TARGETING::TargetHandle_t i_mbaTarget, uint8_t i_rank, + uint8_t & o_port0Spare, uint8_t & o_port1Spare, + uint8_t & o_eccSpare ); + +/** + * @brief Invokes the set steer mux hardware procedure. + * @param i_mbaTarget A MBA target. + * @param i_rank Target rank (0-7). + * @param i_symbol A symbol associated with the DRAM to be spared. + * @param i_x4EccSpare If true, will set ECC spare instead (x4 mode only). + * @note The procedure will be able to derive the port from the given symbol. + * @return Non-SUCCESS in internal function fails, SUCCESS otherwise. + */ +int32_t mssSetSteerMux( TARGETING::TargetHandle_t i_mbaTarget, uint8_t i_rank, + uint8_t i_symbol, bool i_x4EccSpare ); + +/** + * @brief Returns the memory buffer raw card type (i.e. R/C A). + * @param i_memTarget A memory buffer, MBA, or DIMM. + * @return + */ +/* TODO - See .C +getMembufRawCardType( TARGETING::TargetHandle_t i_memTarget ); +*/ + +/** + * @brief Returns the type of the card the DIMM is plugged into. + * @param i_dimmTarget A DIMM target. + * @return + */ + +/* TODO - See .C +getDimmPlugCardType( TARGETING::TargetHandle_t i_dimmTarget ); +*/ + +} // end namespace PlatServices + +} // end namespace PRDF + +#endif // PRDFPLATSERVICES_COMMON_H + diff --git a/src/usr/diag/prdf/common/framework/service/prdfTargetServices.C b/src/usr/diag/prdf/common/framework/service/prdfTargetServices.C index 9ce9039b1..66d3454ea 100755 --- a/src/usr/diag/prdf/common/framework/service/prdfTargetServices.C +++ b/src/usr/diag/prdf/common/framework/service/prdfTargetServices.C @@ -32,17 +32,11 @@ #include <prdfTargetServices.H> -#include <algorithm> - -#include <iipbits.h> -#include <iipsdbug.h> #include <iipglobl.h> #include <prdfTrace.H> -#include <errlentry.H> #include <fapi.H> #include <targeting/common/targetservice.H> -#include <attributeenums.H> using namespace TARGETING; @@ -820,33 +814,6 @@ uint32_t getNodePosition( TARGETING::TargetHandle_t i_target ) //############################################################################## //## -//## DUMP and Runtime Deconfig support code -//## -//############################################################################## - -//------------------------------------------------------------------------------ - -errlHndl_t dumpHWURequest(errlHndl_t i_errl, HUID i_huid ) -{ - // FIXME : need to implement this once P8 DUMP support is in - PRDF_ERR( "[dumpHWURequest] i_huid=0x%08x - Function not implemented yet", i_huid ); - - return NULL; -} - -//------------------------------------------------------------------------------ - -errlHndl_t runtimeDeconfig( HUID i_huid ) -{ - // FIXME : need to implement this once Story 42422 - // in CEC HW Enablement is done - PRDF_ERR( "[runtimeDeconfig] i_huid=0x%08x - Function not implemented yet", i_huid ); - - return NULL; -} - -//############################################################################## -//## //## Memory specific functions //## //############################################################################## diff --git a/src/usr/diag/prdf/common/framework/service/prdfTargetServices.H b/src/usr/diag/prdf/common/framework/service/prdfTargetServices.H index 1af230afe..0e1dfe506 100755 --- a/src/usr/diag/prdf/common/framework/service/prdfTargetServices.H +++ b/src/usr/diag/prdf/common/framework/service/prdfTargetServices.H @@ -26,25 +26,18 @@ /** * @file prdfTargetServices.H - * @brief Wrapper code for things PRD needs from target services. + * @brief Wrapper code for external interfaces used by PRD. + * + * This file should only contain targeting external interfaces, which are + * strictly common between FSP and Hostboot. All other interfaces should be in + * prdfPlatServices.H. + * + * Also, this file should not be included directly. Instead, include + * prdfPlatServices.H, which includes this file. */ -//------------------------------------------------------------------------------ -// Includes -//------------------------------------------------------------------------------ - #include <iipconst.h> -#include <prdfTimer.H> -#include <algorithm> #include <targeting/common/target.H> -#include <targeting/common/entitypath.H> -#include <errlentry.H> - -#ifdef __HOSTBOOT_MODULE - -#else - -#endif //------------------------------------------------------------------------------ @@ -246,32 +239,6 @@ uint32_t getNodePosition( TARGETING::TargetHandle_t i_target ); //############################################################################## //## -//## DUMP and Runtime Deconfig support code -//## -//############################################################################## - -/** - * Interface to request a Hardware Unit dump collection. - * - * @param[in] i_errl input error log handle - * @param[in] i_huid The HUID of Failing target to dump - * - * @return NULL on success, else error log - */ -errlHndl_t dumpHWURequest(errlHndl_t i_errl, HUID i_huid ); - -/** -* Change the state of the given HUID at runtime. -* -* @param i_huid The HUID of a target -* -* @return NULL on success, else error log -*/ -errlHndl_t runtimeDeconfig( HUID i_huid ); - - -//############################################################################## -//## //## Memory specific functions //## //############################################################################## diff --git a/src/usr/diag/prdf/common/framework/service/prdf_ras_services.C b/src/usr/diag/prdf/common/framework/service/prdf_ras_services.C index e680e25ba..3eb42974f 100755 --- a/src/usr/diag/prdf/common/framework/service/prdf_ras_services.C +++ b/src/usr/diag/prdf/common/framework/service/prdf_ras_services.C @@ -1223,73 +1223,57 @@ will also be removed. Need to confirm if this code is required anymore. delete errLog; errLog = NULL; } - else if (!ReturnELog && !ForceTerminate && !i_sdc.IsMpFatal() && !i_sdc.Terminate()) + else if ( !ReturnELog && !ForceTerminate && + !i_sdc.IsMpFatal() && !i_sdc.Terminate() ) { - //Check to see if we need to do a Proc Core dump - if (sdc.IsUnitCS() && (!sdc.IsUsingSavedSdc() ) ) + // Check to see if we need to do a Proc Core dump + if ( sdc.IsUnitCS() && !sdc.IsUsingSavedSdc() ) { - if (l_targetType == TYPE_PROC) + if ( l_targetType == TYPE_PROC ) { // NX Unit Checktop - runtime deconfig each accelerator - errlHndl_t dumpErrl = NULL; + int32_t l_rc = SUCCESS; SDC_MRU_LIST mrulist = sdc.GetMruList(); - for (SDC_MRU_LIST::iterator i = mrulist.begin(); - i < mrulist.end(); ++i) + for ( SDC_MRU_LIST::iterator i = mrulist.begin(); + i < mrulist.end(); ++i ) { - //FIXME: need to add accelerators runtime deconfig -/* - TargetHandle_t l_acceleratorHandle = (*i).callout.getMruValues(); - if (TYPE_CORE == PlatServices::getTargetType(l_acceleratorHandle)) + /* FIXME: need to add accelerators runtime deconfig + TargetHandle_t accelTarget = i->callout.getMruValues(); + if ( TYPE_CORE == PlatServices::getTargetType(accelTarget) ) { - dumpErrl = PlatServices::runtimeDeconfig(PlatServices::getHuid(l_acceleratorHandle)); - if (dumpErrl != NULL) + l_rc = PRDF_RUNTIME_DECONFIG( accelTarget ); + if ( SUCCESS != l_rc ) break; } -*/ + */ } - if (dumpErrl != NULL) - { - PRDF_COMMIT_ERRL(dumpErrl, ERRL_ACTION_REPORT); - } - else + if ( SUCCESS == l_rc ) { - PRDF_HWUDUMP(dumpErrl, errLog, CONTENT_HWNXLCL, - pfaData.MsDumpInfo.DumpId); - if (dumpErrl != NULL) - { - PRDF_COMMIT_ERRL(dumpErrl, ERRL_ACTION_REPORT); - } + l_rc = PRDF_HWUDUMP( errLog, CONTENT_HWNXLCL, + pfaData.MsDumpInfo.DumpId ); } } else { - errlHndl_t dumpErrl =NULL; - PRDF_RUNTIME_DECONFIG(dumpErrl, l_dumpHandle); - if (dumpErrl != NULL) + int32_t l_rc = PRDF_RUNTIME_DECONFIG( l_dumpHandle ); + if ( SUCCESS == l_rc ) { - PRDF_COMMIT_ERRL(dumpErrl, ERRL_ACTION_REPORT); - } - else - { //Call Dump for Proc Core CS - if (TYPE_CORE == l_targetType) + // Call Dump for Proc Core CS + if ( TYPE_CORE == l_targetType ) { - PRDF_HWUDUMP(dumpErrl, errLog, CONTENT_SINGLE_CORE_CHECKSTOP, - pfaData.MsDumpInfo.DumpId); + l_rc = PRDF_HWUDUMP( errLog, + CONTENT_SINGLE_CORE_CHECKSTOP, + pfaData.MsDumpInfo.DumpId ); } - // remove dump CONTENT_HWGAL2LCL since no IOHUB dump - // is supported in P8 - // FIXME : will need to add Centaur DMI channel checkstop support later + // FIXME: Will need to add Centaur DMI channel checkstop + // support later. else - { //This is not Proc ..ie. it is Galaxy 2 - PRDF_ERR( PRDF_FUNC"Unsupported dump for DumpId: %x, TargetType: %x", - pfaData.MsDumpInfo.DumpId, l_targetType ); + { + PRDF_ERR( PRDF_FUNC"Unsupported dump for target 0x%08x", + pfaData.MsDumpInfo.DumpId ); } } - if (dumpErrl != NULL) - { - PRDF_COMMIT_ERRL(dumpErrl, ERRL_ACTION_REPORT); - } } } diff --git a/src/usr/diag/prdf/common/iipglobl.h b/src/usr/diag/prdf/common/iipglobl.h index 3514a9601..d21d49a5a 100755 --- a/src/usr/diag/prdf/common/iipglobl.h +++ b/src/usr/diag/prdf/common/iipglobl.h @@ -368,9 +368,10 @@ class System; #endif -// ----------- Hostboot macros begin ----------- #ifdef __HOSTBOOT_MODULE +// ----------- Hostboot macros begin ------------------------------------------- + /** * @brief function to create an error log. */ @@ -442,19 +443,22 @@ class System; * @brief Interface to request a Hardware Unit dump collection */ // FIXME - need to implement in Hostboot -#define PRDF_HWUDUMP(io_dumpErrl, i_errl, \ - i_content, i_dumpHuid) +#define PRDF_HWUDUMP( i_errl, i_content, i_huid ) \ + SUCCESS /** * @brief Interface to deconfig target at Runtime (Not valid in Hostboot) */ -#define PRDF_RUNTIME_DECONFIG(io_errl, i_pTarget) +// FIXME - need to implement in Hostboot +#define PRDF_RUNTIME_DECONFIG( i_pTarget ) \ + SUCCESS -// ----------- Hostboot macros end ----------- +// ----------- Hostboot macros end ------------------------------------------- -// ----------- FSP macros begin ----------- #else +// ----------- FSP macros begin ------------------------------------------------ + /** * @brief function to create an error log. */ @@ -541,22 +545,17 @@ class System; /** * @brief Interface to request a Hardware Unit dump collection */ -#define PRDF_HWUDUMP(io_dumpErrl, i_errl, \ - i_content, i_dumpHuid) \ - SrciSrc l_src(*(i_errl->getSRC(0))); \ - io_dumpErrl= PlatServices::dumpHWURequest( i_content, \ - PRDF_COMP_ID, \ - i_errl->plid(),\ - l_src, \ - i_dumpHuid ); +#define PRDF_HWUDUMP( i_errl, i_content, i_huid ) \ + PlatServices::dumpHWURequest( i_errl, i_content, i_huid ) /** * @brief Interface to deconfig target at Runtime */ -#define PRDF_RUNTIME_DECONFIG( io_errl, i_target ) \ - io_errl = PlatServices::runtimeDeconfig( i_target ); +#define PRDF_RUNTIME_DECONFIG( i_target ) \ + PlatServices::runtimeDeconfig( i_target ) -// ----------- FSP macros end ----------- -#endif +// ----------- FSP macros end ------------------------------------------------ -#endif +#endif // not __HOSTBOOT_MODULE + +#endif // IIPGLOBL_H diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfDramRepairs.C b/src/usr/diag/prdf/common/plat/pegasus/prdfDramRepairs.C index 5dc675643..308abb2d0 100644 --- a/src/usr/diag/prdf/common/plat/pegasus/prdfDramRepairs.C +++ b/src/usr/diag/prdf/common/plat/pegasus/prdfDramRepairs.C @@ -181,7 +181,6 @@ bool processRepairedRanks( if(SUCCESS != PlatServices::mssGetSteerMux( i_mba, rankNumber, - mss_SteerMux::READ_MUX, sp0, sp1, sp)) { // skip this rank diff --git a/src/usr/diag/prdf/common/prd_framework.mk b/src/usr/diag/prdf/common/prd_framework.mk index 9abedbc8f..64b9f80c8 100755 --- a/src/usr/diag/prdf/common/prd_framework.mk +++ b/src/usr/diag/prdf/common/prd_framework.mk @@ -21,21 +21,15 @@ # # IBM_PROLOG_END_TAG -# Object files for prd shared library - -######## Framework ######## +################################################################################ +# PRD object files (common Hostboot and FSP). +################################################################################ prd_framework = \ iipTemplates.o \ prdfTrace.o \ prdfMain.o -prd_framework_includes = \ - prdfMain.H \ - prdf_service_codes.H - -######## Util ######## - prd_util = \ prdfBitString.o \ prdfBitKey.o \ @@ -45,11 +39,6 @@ prd_util = \ prdfFilters.o \ prdfAssert.o -prd_util_includes = \ - prdfCompressBuffer.H - -######## Config ######## - prd_config = \ iipchip.o \ iipConfigurator.o \ @@ -62,44 +51,15 @@ prd_config = \ iipSystem.o \ prdfExtensibleDomain.o \ -prd_config_FSP = \ - prdfChipPersist.o \ - prdfSystemData.o - -prd_config_includes = \ - -######## Service ######## - prd_service = \ prdfServiceDataCollector.o \ prdf_ras_services.o \ prdfTargetServices.o \ xspprdsdbug.o -prd_service_FSP = \ - prdfSdcFileControl.o - -prd_service_includes = \ - -######## Platform Specfic Services ######## - -prd_env_service = \ - prdfHomRegisterAccess.o \ - prdfPlatServices.o - -prd_env_service_includes = \ - -######## Chip ######## - prd_ss = \ prdfMemoryMru.o -prd_ss_includes = \ - prdfMemoryMru.H \ - prdfRepairHealth.H - -######## Resolution ######## - prd_resolution = \ iipResolution.o \ iipResolutionFactory.o \ @@ -111,10 +71,6 @@ prd_resolution = \ prdfClockResolution.o \ prdfCaptureResolution.o -prd_resolution_includes = \ - -######## Register ######## - prd_register = \ iipscr.o \ prdfErrorRegister.o \ @@ -126,16 +82,20 @@ prd_register = \ prdfCaptureData.o \ prdfScanFacility.o +prd_object_files = \ + ${prd_framework} \ + ${prd_util} \ + ${prd_config} \ + ${prd_service} \ + ${prd_ss} \ + ${prd_resolution} \ + ${prd_register} \ -prd_register_includes = \ +################################################################################ +# PRD object files common to Hostboot and FSP, but not to PRD simulator. +################################################################################ -######## Threshold ######## - -prd_mnfgtools = \ - prdfMfgThresholdFile.o \ - prdfMfgThresholdMgr.o \ - prdfMesThresholds.o +prd_object_files_no_sim = \ + prdfHomRegisterAccess.o \ + prdfPlatServices_common.o prdfPlatServices.o -prd_mnfgtools_includes = \ - prdfMfgThresholds.H \ - prdfMesThresholds.H diff --git a/src/usr/diag/prdf/common/prd_pegasus.mk b/src/usr/diag/prdf/common/prd_pegasus.mk index 1bca6f7ca..1e3c964e8 100755 --- a/src/usr/diag/prdf/common/prd_pegasus.mk +++ b/src/usr/diag/prdf/common/prd_pegasus.mk @@ -43,5 +43,3 @@ prd_pegasus_specific = \ prdfPegasusConfigurator.o \ prdfRegisterData.o -prd_pegasus_specific_HB = \ - prdfDramRepairs.o diff --git a/src/usr/diag/prdf/framework/service/prdfPlatServices.C b/src/usr/diag/prdf/framework/service/prdfPlatServices.C new file mode 100644 index 000000000..c031ad89f --- /dev/null +++ b/src/usr/diag/prdf/framework/service/prdfPlatServices.C @@ -0,0 +1,186 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: ./framework/service/prdfPlatServices.C $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2012,2013 */ +/* */ +/* p1 */ +/* */ +/* Object Code Only (OCO) source materials */ +/* Licensed Internal Code Source Materials */ +/* IBM HostBoot Licensed Internal Code */ +/* */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ + +/** + * @file prdfPlatServices.C + * @brief Wrapper code for external interfaces used by PRD. + * + * This file contains code that is strictly specific to Hostboot. All code that + * is common between FSP and Hostboot should be in the respective common file. + */ + +#include <prdfPlatServices.H> + +#include <iipglobl.h> +#include <prdfAssert.h> + +#include <diag/mdia/mdia.H> +#include <diag/mdia/mdiamevent.H> +#include <dram_initialization/mss_memdiag/mss_maint_cmds.H> +#include <errno.h> +#include <sys/time.h> +#include <time.h> + +using namespace TARGETING; + +//------------------------------------------------------------------------------ + +namespace PRDF +{ + +namespace PlatServices +{ + +//############################################################################## +//## System Level Utility functions +//############################################################################## + +bool isMasterFSP() +{ + // Always true in Hostboot + return true; +} + +//------------------------------------------------------------------------------ + +bool isMemoryPreservingIpl() +{ + bool l_isMemPreservingIpl = false; + + // TODO (RTC 23138): Add support for Hostboot. + + return l_isMemPreservingIpl; +} + +//------------------------------------------------------------------------------ + +void getCurrentTime( Timer & o_timer ) +{ + timespec_t curTime; + PRDF_ASSERT(0 == clock_gettime(CLOCK_MONOTONIC, &curTime)) + + // Hostboot uptime in seconds + o_timer = curTime.tv_sec; + + // Since Hostboot doesn't have any system checkstop, we don't have to worry + // about the detailed time struct for system checkstop timestamp. +} + +//------------------------------------------------------------------------------ + +int32_t syncFile( const char * i_fileName ) +{ + return SUCCESS; +} + +//############################################################################## +//## Processor specific functions +//############################################################################## + +//############################################################################## +//## Memory specific functions +//############################################################################## + +bool isInMdiaMode() +{ + bool o_isInMdiaMode = false; + + MDIA::waitingForMaintCmdEvents(o_isInMdiaMode); + + return o_isInMdiaMode; +} + +//------------------------------------------------------------------------------ + +int32_t mdiaSendCmdComplete( TargetHandle_t i_mbaTarget ) +{ + int32_t o_rc = SUCCESS; + + do + { + // Verify type. + TYPE l_type = getTargetType(i_mbaTarget); + if ( TYPE_MBA != l_type ) + { + PRDF_ERR( "[PlatServices::mdiaSendCmdComplete] unsupported target " + "type %d", l_type ); + o_rc = FAIL; + break; + } + + // Send command complete to MDIA. + MDIA::MaintCommandEvent l_mdiaEvent; + l_mdiaEvent.type = MDIA::COMMAND_COMPLETE; + l_mdiaEvent.target = i_mbaTarget; + + errlHndl_t errl = MDIA::processEvent( l_mdiaEvent ); + if ( NULL != errl ) + { + PRDF_ERR( "[PlatServices::mdiaSendCmdComplete] MDIA::processEvent " + "failed" ); + PRDF_COMMIT_ERRL( errl, ERRL_ACTION_REPORT ); + o_rc = FAIL; + break; + } + + } while (0); + + if ( SUCCESS != o_rc ) + { + PRDF_ERR( "[PlatServices::mdiaSendCmdComplete] Failed: i_target=0x%08x", + getHuid(i_mbaTarget) ); + } + + return o_rc; +} + +//------------------------------------------------------------------------------ + +int32_t mssRestoreDramRepairs( TargetHandle_t i_mbaTarget, + uint8_t & o_repairedRankMask, + uint8_t & o_badDimmMask ) +{ + int32_t o_rc = SUCCESS; + + errlHndl_t errl = NULL; + + PRD_FAPI_TO_ERRL( errl, mss_restore_DRAM_repairs, + fapi::Target(fapi::TARGET_TYPE_MBA_CHIPLET, i_mbaTarget), + o_repairedRankMask, o_badDimmMask ); + + if ( NULL != errl ) + { + PRDF_ERR( "[PlatServices::mssRestoreDramRepairs] " + "mss_restore_dram_repairs() failed. HUID: 0x%08x", + getHuid(i_mbaTarget) ); + PRDF_COMMIT_ERRL( errl, ERRL_ACTION_REPORT ); + o_rc = FAIL; + } + + return o_rc; +} + +} // end namespace PlatServices + +} // end namespace PRDF + diff --git a/src/usr/diag/prdf/framework/service/prdfPlatServices.H b/src/usr/diag/prdf/framework/service/prdfPlatServices.H new file mode 100644 index 000000000..0eaaa12e8 --- /dev/null +++ b/src/usr/diag/prdf/framework/service/prdfPlatServices.H @@ -0,0 +1,89 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: ./framework/service/prdfPlatServices.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2012,2013 */ +/* */ +/* p1 */ +/* */ +/* Object Code Only (OCO) source materials */ +/* Licensed Internal Code Source Materials */ +/* IBM HostBoot Licensed Internal Code */ +/* */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ + +#ifndef PRDFPLATSERVICES_H +#define PRDFPLATSERVICES_H + +/** + * @file prdfPlatServices.H + * @brief Wrapper code for external interfaces used by PRD. + * + * This file contains code that is strictly specific to Hostboot. All code that + * is common between FSP and Hostboot should be in the respective common file. + */ + +// This must be included after all other includes. This will take care of cases +// where a file must be included in the common code, but the include paths are +// different between FSP and Hostboot. +#include <prdfPlatServices_common.H> + +//------------------------------------------------------------------------------ + +namespace PRDF +{ + +namespace PlatServices +{ + +//############################################################################## +//## System Level Utility functions +//############################################################################## + +//############################################################################## +//## Processor specific functions +//############################################################################## + +//############################################################################## +//## Memory specific functions +//############################################################################## + +/** + * @brief Checks if we are running in MDIA mode. + * @return TRUE if in MDIA mode, FALSE otherwise. + */ +bool isInMdiaMode(); + +/** + * @brief Sends a command complete message to MDIA. + * @param i_mbaTarget An MBA target. + * @return Non-SUCCESS in internal function fails, SUCCESS otherwise. + */ +int32_t mdiaSendCmdComplete( TARGETING::TargetHandle_t i_mbaTarget ); + +/** + * @brief Invokes the restore DRAM repairs hardware procedure. + * @param i_mbaTarget + * @param o_repairedRankMask An encoded bitmask of repaired ranks. + * @param o_badDimm An encoded bitmask of bad DIMMs. + * @return Non-SUCCESS in internal function fails, SUCCESS otherwise. + */ +int32_t mssRestoreDramRepairs( TARGETING::TargetHandle_t i_mbaTarget, + uint8_t & o_repairedRankMask, + uint8_t & o_badDimmMask ); + +} // end namespace PlatServices + +} // end namespace PRDF + +#endif // PRDFPLATSERVICES_H + diff --git a/src/usr/diag/prdf/makefile b/src/usr/diag/prdf/makefile index e94273a46..7529925ea 100755 --- a/src/usr/diag/prdf/makefile +++ b/src/usr/diag/prdf/makefile @@ -45,6 +45,7 @@ VPATH = \ common/framework/rule \ framework \ framework/rule \ + framework/service \ #FIXME: we can remove most of these as well if we have them include correctly EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/fapi @@ -67,27 +68,29 @@ EXTRAINCDIR += ${PRD_USR_PATH}/common/framework/config EXTRAINCDIR += ${PRD_USR_PATH}/common/framework/rule EXTRAINCDIR += ${PRD_USR_PATH}/common/plat EXTRAINCDIR += ${PRD_USR_PATH}/common/plat/pegasus -#conditionally enables profiling of flyweight register and resolution object +EXTRAINCDIR += ${PRD_USR_PATH}/framework/service + +# Conditionally enables profiling of flyweight register and resolution object ifeq ($(PRD_PROFILER),1) CUSTOMFLAGS += -DFLYWEIGHT_PROFILING endif + #------------------------------------------------------------------------------ # objects #------------------------------------------------------------------------------ + include common/prd_framework.mk include common/prd_ruletable.mk include common/prd_pegasus.mk +include prdf_hb_only.mk -OBJS = ${prd_framework} \ - ${prd_util} \ - ${prd_register} \ - ${prd_resolution} \ - ${prd_ruletable} \ - ${prd_service} \ - ${prd_env_service} \ - ${prd_config} \ - ${prd_pegasus_specific} ${prd_pegasus_specific_HB} \ - ${PRDF_RULE_PLUGINS_PEGASUS_WSIM} \ - ${PRDF_RULE_PLUGINS_PEGASUS} +OBJS = \ + ${prd_object_files} \ + ${prd_object_files_no_sim} \ + ${prd_ruletable} \ + ${prd_pegasus_specific} \ + ${prd_pegasus_specific_HB} \ + ${PRDF_RULE_PLUGINS_PEGASUS} \ + ${PRDF_RULE_PLUGINS_PEGASUS_WSIM} \ include ${ROOTPATH}/config.mk diff --git a/src/usr/diag/prdf/common/prdfMain.C b/src/usr/diag/prdf/prdfMain.C index b2645c49e..275085b08 100755 --- a/src/usr/diag/prdf/common/prdfMain.C +++ b/src/usr/diag/prdf/prdfMain.C @@ -1,7 +1,7 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: src/usr/diag/prdf/common/prdfMain.C $ */ +/* $Source: ./prdfMain.C $ */ /* */ /* IBM CONFIDENTIAL */ /* */ diff --git a/src/usr/diag/prdf/prdf_hb_only.mk b/src/usr/diag/prdf/prdf_hb_only.mk new file mode 100644 index 000000000..b8ad36280 --- /dev/null +++ b/src/usr/diag/prdf/prdf_hb_only.mk @@ -0,0 +1,30 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: ./prdf_hb_only.mk $ +# +# IBM CONFIDENTIAL +# +# COPYRIGHT International Business Machines Corp. 2013 +# +# p1 +# +# Object Code Only (OCO) source materials +# Licensed Internal Code Source Materials +# IBM HostBoot Licensed Internal Code +# +# The source code for this program is not published or otherwise +# divested of its trade secrets, irrespective of what has been +# deposited with the U.S. Copyright Office. +# +# Origin: 30 +# +# IBM_PROLOG_END_TAG + +################################################################################ +# PRD object files (Hostboot only). +################################################################################ + +prd_pegasus_specific_HB = \ + prdfDramRepairs.o + diff --git a/src/usr/diag/prdf/test/makefile b/src/usr/diag/prdf/test/makefile index 3e3ad9c05..fff6b4852 100755 --- a/src/usr/diag/prdf/test/makefile +++ b/src/usr/diag/prdf/test/makefile @@ -42,6 +42,7 @@ EXTRAINCDIR += ${PRD_USR_PATH}/common/framework/config EXTRAINCDIR += ${PRD_USR_PATH}/common/framework/rule EXTRAINCDIR += ${PRD_USR_PATH}/common/plat EXTRAINCDIR += ${PRD_USR_PATH}/common/plat/pegasus +EXTRAINCDIR += ${PRD_USR_PATH}/framework/service EXTRAINCDIR += ${PRD_USR_PATH}/mnfgtools EXTRAINCDIR += ${PRD_USR_PATH}/test |