From 91e03307dfe1fc47f26d23eb35bde39af751ef17 Mon Sep 17 00:00:00 2001 From: Zane Shelley Date: Mon, 7 Mar 2016 20:07:34 -0600 Subject: PRD: moved PlatServices code to plat/ directory Change-Id: I950a1eba9abe3a80a75b00ab3c82696167141554 RTC: 140081 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/21861 Reviewed-by: Zane C. Shelley Tested-by: Jenkins Server Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/22138 Reviewed-by: Daniel M. Crowell --- src/usr/diag/prdf/plat/prdfPlatServices.C | 215 ++++++++++++++++++++++++++ src/usr/diag/prdf/plat/prdfPlatServices.H | 82 ++++++++++ src/usr/diag/prdf/plat/prdfPlatServices_ipl.C | 187 ++++++++++++++++++++++ src/usr/diag/prdf/plat/prdfPlatServices_ipl.H | 98 ++++++++++++ src/usr/diag/prdf/plat/prdfPlatServices_rt.C | 113 ++++++++++++++ src/usr/diag/prdf/plat/prdfRasServices.C | 169 ++++++++++++++++++++ src/usr/diag/prdf/plat/prdfRasServices.H | 44 ++++++ 7 files changed, 908 insertions(+) create mode 100644 src/usr/diag/prdf/plat/prdfPlatServices.C create mode 100644 src/usr/diag/prdf/plat/prdfPlatServices.H create mode 100644 src/usr/diag/prdf/plat/prdfPlatServices_ipl.C create mode 100644 src/usr/diag/prdf/plat/prdfPlatServices_ipl.H create mode 100644 src/usr/diag/prdf/plat/prdfPlatServices_rt.C create mode 100644 src/usr/diag/prdf/plat/prdfRasServices.C create mode 100644 src/usr/diag/prdf/plat/prdfRasServices.H (limited to 'src/usr/diag/prdf/plat') diff --git a/src/usr/diag/prdf/plat/prdfPlatServices.C b/src/usr/diag/prdf/plat/prdfPlatServices.C new file mode 100644 index 000000000..781b8528f --- /dev/null +++ b/src/usr/diag/prdf/plat/prdfPlatServices.C @@ -0,0 +1,215 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/plat/prdfPlatServices.C $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2016 */ +/* [+] 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 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 + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include + +using namespace TARGETING; + +namespace PRDF +{ + +namespace PlatServices +{ + +//############################################################################## +//## System Level Utility functions +//############################################################################## + +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. +} + +//------------------------------------------------------------------------------ + +void milliSleep( uint32_t i_seconds, uint32_t i_milliseconds ) +{ + nanosleep( i_seconds, i_milliseconds * 1000000 ); +} + +//------------------------------------------------------------------------------ + +/* TODO RTC 144705 +void initiateUnitDump( TargetHandle_t i_target, + errlHndl_t i_errl, + uint32_t i_errlActions ) +{ + // no-op in Hostboot but just go ahead and commit + // the errorlog in case it's not null. + if ( NULL != i_errl ) + { + PRDF_COMMIT_ERRL(i_errl, i_errlActions); + } +} +*/ + +//------------------------------------------------------------------------------ + +bool isSpConfigFsp() +{ + #ifdef __HOSTBOOT_RUNTIME + + return false; // Should never have an FSP when using HBRT. + + #else + + return INITSERVICE::spBaseServicesEnabled(); + + #endif +} + +//############################################################################## +//## Processor specific functions +//############################################################################## + +/* TODO RTC 136050 +void collectSBE_FFDC(TARGETING::TargetHandle_t i_procTarget) +{ + // Do nothing for Hostboot +} +*/ + +//------------------------------------------------------------------------------ + +TARGETING::TargetHandle_t getMasterCore( TARGETING::TargetHandle_t i_procTgt ) +{ + #define PRDF_FUNC "[PlatServices::getMasterCore] " + + PRDF_ERR( PRDF_FUNC "MasterCore info not available in hostboot: PROC = " + "0x%08x ",getHuid( i_procTgt ) ); + return NULL; + + #undef PRDF_FUNC +} + +//############################################################################## +//## util functions +//############################################################################## + +/* TODO RTC 136052 +int32_t getCfam( ExtensibleChip * i_chip, + const uint32_t i_addr, + uint32_t & o_data) +{ + #define PRDF_FUNC "[PlatServices::getCfam] " + + int32_t rc = SUCCESS; + + do + { + // HB doesn't allow cfam access on master proc + TargetHandle_t l_procTgt = i_chip->GetChipHandle(); + + if( TYPE_PROC == getTargetType(l_procTgt) ) + { + TargetHandle_t l_pMasterProcChip = NULL; + targetService(). + masterProcChipTargetHandle( l_pMasterProcChip ); + + if( l_pMasterProcChip == l_procTgt ) + { + PRDF_DTRAC( PRDF_FUNC "can't access CFAM from master " + "proc: 0x%.8X", i_chip->GetId() ); + break; + } + } + + errlHndl_t errH = NULL; + ecmdDataBufferBase cfamData(32); + + FAPI_INVOKE_HWP(errH, + fapiGetCfamRegister, + PlatServices::getFapiTarget(l_procTgt), + i_addr, + cfamData); + + if ( NULL == errH ) + { + o_data = cfamData.getWord(0); + } + else + { + rc = FAIL; + PRDF_ERR( PRDF_FUNC "chip: 0x%.8X, failed to get cfam address: " + "0x%X", i_chip->GetId(), i_addr ); + PRDF_COMMIT_ERRL(errH, ERRL_ACTION_SA|ERRL_ACTION_REPORT); + break; + } + + + } while(0); + + + return rc; + + #undef PRDF_FUNC +} +*/ + +//------------------------------------------------------------------------------ + +TARGETING::TargetHandle_t getActiveRefClk(TARGETING::TargetHandle_t + i_procTarget, + TARGETING::TYPE i_connType, + uint32_t i_oscPos) +{ + return PlatServices::getClockId( i_procTarget, + i_connType, + i_oscPos ); +} + +} // end namespace PlatServices + +} // end namespace PRDF + diff --git a/src/usr/diag/prdf/plat/prdfPlatServices.H b/src/usr/diag/prdf/plat/prdfPlatServices.H new file mode 100644 index 000000000..00cbb4e32 --- /dev/null +++ b/src/usr/diag/prdf/plat/prdfPlatServices.H @@ -0,0 +1,82 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/plat/prdfPlatServices.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2016 */ +/* [+] 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 */ + +#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. + */ + +//#include TODO: RTC 136126 + +// This must be included after all Hostboot specific 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 + +// Must be included after including the common PlatServices code. +#ifdef __HOSTBOOT_RUNTIME + #include +#else + #include +#endif + +//------------------------------------------------------------------------------ + +namespace PRDF +{ + +namespace PlatServices +{ + +//############################################################################## +//## System Level Utility functions +//############################################################################## + +// Inline function definitions for Hostboot compiler optimization. See +// prdfPlatServices_common.H for the function declarations. + +inline bool atRuntime() +{ + #ifdef __HOSTBOOT_RUNTIME + return true; + #else + return false; + #endif +} + +inline bool isSmpCoherent() { return false; } + +} // end namespace PlatServices + +} // end namespace PRDF + +#endif // PRDFPLATSERVICES_H + diff --git a/src/usr/diag/prdf/plat/prdfPlatServices_ipl.C b/src/usr/diag/prdf/plat/prdfPlatServices_ipl.C new file mode 100644 index 000000000..edad4f39a --- /dev/null +++ b/src/usr/diag/prdf/plat/prdfPlatServices_ipl.C @@ -0,0 +1,187 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/plat/prdfPlatServices_ipl.C $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2016 */ +/* [+] 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 prdfPlatServices_ipl.C + * @brief Wrapper code for external interfaces used by PRD (IPL only). + * + * 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 + +#include +#include +#include + +//#include TODO RTC 136126 + +#include +#include +#include + +using namespace TARGETING; + +namespace PRDF +{ + +namespace PlatServices +{ + +//############################################################################## +//## Memory specific functions +//############################################################################## + +bool isInMdiaMode() +{ + bool o_isInMdiaMode = false; +#ifndef CONFIG_VPO_COMPILE + MDIA::waitingForMaintCmdEvents(o_isInMdiaMode); +#endif + return o_isInMdiaMode; +} + +//------------------------------------------------------------------------------ + +int32_t mdiaSendEventMsg( TargetHandle_t i_mbaTarget, + MDIA::MaintCommandEventType i_eventType ) +{ + #define PRDF_FUNC "[PlatServices::mdiaSendCmdComplete] " + + int32_t o_rc = SUCCESS; + +#ifndef CONFIG_VPO_COMPILE + + do + { + if ( !isInMdiaMode() ) break; // no-op + + // Verify type. + TYPE l_type = getTargetType(i_mbaTarget); + if ( TYPE_MBA != l_type ) + { + PRDF_ERR( PRDF_FUNC "unsupported target type %d", l_type ); + o_rc = FAIL; + break; + } + + // Send command complete to MDIA. + MDIA::MaintCommandEvent l_mdiaEvent; + + l_mdiaEvent.target = i_mbaTarget; + l_mdiaEvent.type = i_eventType; + + errlHndl_t errl = MDIA::processEvent( l_mdiaEvent ); + if ( NULL != errl ) + { + PRDF_ERR( PRDF_FUNC "MDIA::processEvent() failed" ); + PRDF_COMMIT_ERRL( errl, ERRL_ACTION_REPORT ); + o_rc = FAIL; + break; + } + + } while (0); + + if ( SUCCESS != o_rc ) + { + PRDF_ERR( PRDF_FUNC "Failed: i_target=0x%08x i_eventType=%d", + getHuid(i_mbaTarget), i_eventType ); + } + +#endif + + return o_rc; + + #undef PRDF_FUNC +} + +//------------------------------------------------------------------------------ + +/* TODO RTC 136126 +int32_t mssRestoreDramRepairs( TargetHandle_t i_mbaTarget, + uint8_t & o_repairedRankMask, + uint8_t & o_badDimmMask ) +{ + int32_t o_rc = SUCCESS; + + errlHndl_t errl = NULL; + + FAPI_INVOKE_HWP( 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; +} +*/ + +//------------------------------------------------------------------------------ + +/* TODO RTC 136126 +int32_t mssIplUeIsolation( TargetHandle_t i_mba, const CenRank & i_rank, + CenDqBitmap & o_bitmap ) +{ + #define PRDF_FUNC "[PlatServices::mssIplUeIsolation] " + + int32_t o_rc = SUCCESS; + + uint8_t data[PORT_SLCT_PER_MBA][DIMM_DQ_RANK_BITMAP_SIZE]; + + errlHndl_t errl = NULL; + FAPI_INVOKE_HWP( errl, mss_IPL_UE_isolation, getFapiTarget(i_mba), + i_rank.getMaster(), data ); + if ( NULL != errl ) + { + PRDF_ERR( PRDF_FUNC "mss_IPL_UE_isolation() failed: MBA=0x%08x " + "rank=%d", getHuid(i_mba), i_rank.getMaster() ); + PRDF_COMMIT_ERRL( errl, ERRL_ACTION_REPORT ); + o_rc = FAIL; + } + else + { + o_bitmap = CenDqBitmap ( i_mba, i_rank, data ); + } + + return o_rc; + + #undef PRDF_FUNC +} +*/ + +//------------------------------------------------------------------------------ + +} // end namespace PlatServices + +} // end namespace PRDF + diff --git a/src/usr/diag/prdf/plat/prdfPlatServices_ipl.H b/src/usr/diag/prdf/plat/prdfPlatServices_ipl.H new file mode 100644 index 000000000..177e38c15 --- /dev/null +++ b/src/usr/diag/prdf/plat/prdfPlatServices_ipl.H @@ -0,0 +1,98 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/plat/prdfPlatServices_ipl.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2016 */ +/* [+] 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 */ + +#ifndef __prdfPlatServices_ipl_H +#define __prdfPlatServices_ipl_H + +/** + * @file prdfPlatServices_ipl.H + * @brief Wrapper code for external interfaces used by PRD (IPL only). + * + * 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 + +//------------------------------------------------------------------------------ + +namespace PRDF +{ + +namespace PlatServices +{ + +//############################################################################## +//## 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 maintenance command message to MDIA. + * @param i_mbaTarget An MBA target. + * @param i_eventType MDIA event type + * @return Non-SUCCESS in internal function fails, SUCCESS otherwise. + */ +int32_t mdiaSendEventMsg( TARGETING::TargetHandle_t i_mbaTarget, + MDIA::MaintCommandEventType i_eventType ); + +/** + * @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. + */ +/* TODO RTC 136126 +int32_t mssRestoreDramRepairs( TARGETING::TargetHandle_t i_mbaTarget, + uint8_t & o_repairedRankMask, + uint8_t & o_badDimmMask ); +*/ + +/** + * @brief Invokes the mss_IPL_UE_isolation hardware procedure. + * This function will identify the bits that caused the UE. + * @param i_mba Target MBA. + * @param i_rank Target rank. + * @param o_bitmap DQ bitmap container. + * @return Non-SUCCESS in internal function fails, SUCCESS otherwise. + */ +/* TODO RTC 136126 +int32_t mssIplUeIsolation( TARGETING::TargetHandle_t i_mba, + const CenRank & i_rank, + CenDqBitmap & o_bitmap ); +*/ + +} // end namespace PlatServices + +} // end namespace PRDF + +#endif // __prdfPlatServices_ipl_H + diff --git a/src/usr/diag/prdf/plat/prdfPlatServices_rt.C b/src/usr/diag/prdf/plat/prdfPlatServices_rt.C new file mode 100644 index 000000000..98d7d73b9 --- /dev/null +++ b/src/usr/diag/prdf/plat/prdfPlatServices_rt.C @@ -0,0 +1,113 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/plat/prdfPlatServices_rt.C $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2016 */ +/* [+] 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 prdfPlatServices_rt.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 +#include +#include + +//------------------------------------------------------------------------------ + +namespace PRDF +{ + +namespace PlatServices +{ + +//############################################################################## +//## Memory specific functions +//############################################################################## + +void sendPageGardRequest( uint64_t i_systemAddress ) +{ + #define PRDF_FUNC "[PlatServices::sendPageGardRequest] " + + do + { + if( !g_hostInterfaces || !g_hostInterfaces->memory_error ) + { + PRDF_ERR(PRDF_FUNC " memory_error() interface is not defined"); + break; + } + + int32_t rc = g_hostInterfaces->memory_error( i_systemAddress, + i_systemAddress, + MEMORY_ERROR_CE ); + if( SUCCESS != rc ) + { + PRDF_ERR(PRDF_FUNC " memory_error() failed"); + break; + } + }while(0); + + #undef PRDF_FUNC +} + +//------------------------------------------------------------------------------ + +void sendLmbGardRequest( uint64_t i_systemAddress, bool i_isFetchUE ) +{ + //NO-OP for OPAL +} +//------------------------------------------------------------------------------ + +void sendDynMemDeallocRequest( uint64_t i_startAddr, uint64_t i_endAddr ) +{ + #define PRDF_FUNC "[PlatServices::sendDynMemDeallocRequest] " + + do + { + if( !g_hostInterfaces || !g_hostInterfaces->memory_error ) + { + PRDF_ERR(PRDF_FUNC " memory_error() interface is not defined"); + break; + } + + int32_t rc = g_hostInterfaces->memory_error( i_startAddr, + i_startAddr, + MEMORY_ERROR_UE ); + if( SUCCESS != rc ) + { + PRDF_ERR(PRDF_FUNC " memory_error() failed"); + break; + } + }while(0); + + #undef PRDF_FUNC +} + +//------------------------------------------------------------------------------ + +} // end namespace PlatServices + +} // end namespace PRDF + diff --git a/src/usr/diag/prdf/plat/prdfRasServices.C b/src/usr/diag/prdf/plat/prdfRasServices.C new file mode 100644 index 000000000..b40ce55ba --- /dev/null +++ b/src/usr/diag/prdf/plat/prdfRasServices.C @@ -0,0 +1,169 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/plat/prdfRasServices.C $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2016 */ +/* [+] 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 prdfRasServices.C + * @brief Utility code to parse an SDC and produce the appropriate error log. + */ + +#include +#include +#include +#include + +#include + +using namespace TARGETING; + +namespace PRDF +{ + +using namespace PlatServices; + +//------------------------------------------------------------------------------ + +void ErrDataService::MnfgTrace( ErrorSignature * i_esig, + const PfaData & i_pfaData ) +{ + #define PRDF_FUNC "[ErrDataService::MnfgTrace] " + + do + { + // This is for Hostboot IPL and FSP machines only. + #ifndef __HOSTBOOT_RUNTIME + if ( !INITSERVICE::spBaseServicesEnabled() ) break; + + errlHndl_t errl = NULL; + errl = getMfgSync().syncMfgTraceToFsp(i_esig, i_pfaData); + if (errl) + { + PRDF_ERR(PRDF_FUNC "failed to sync to the FSP"); + PRDF_COMMIT_ERRL(errl, ERRL_ACTION_REPORT); + break; + } + #endif + + } while(0); + + #undef PRDF_FUNC +} + +//------------------------------------------------------------------------------ + +void ErrDataService::updateSrc( uint32_t i_user1, uint32_t i_user2, + uint32_t i_user3, uint32_t i_user4, + uint16_t i_rc ) +{ + // We should always have a valid pointer here. If it is NULL, there + // is some major issue. + PRDF_ASSERT ( NULL != iv_errl); + + iv_errl->setReasonCode(i_rc); + iv_errl->addUserData1( PRDF_GET_UINT64_FROM_UINT32( i_user1, i_user2 )); + iv_errl->addUserData2( PRDF_GET_UINT64_FROM_UINT32( i_user3, i_user4 )); +} + +//------------------------------------------------------------------------------ + +void ErrDataService::createInitialErrl( ATTENTION_TYPE i_attnType ) +{ + // We should always have a NULL pointer here. If it is not NULL, there + // is some major issue. + PRDF_ASSERT ( NULL == iv_errl ); + using namespace ERRORLOG; + + iv_errl = new ErrlEntry( + ERRL_SEV_RECOVERED, + PRDF_RAS_SERVICES, + PRDF_CODE_FAIL, //ERRL keys off of ReasonCode to set + //creator id. ReasonCode will later be + //changed to reflect the actual one + PRDF_GET_UINT64_FROM_UINT32( 0, 0 ), + PRDF_GET_UINT64_FROM_UINT32( 0, 0 ) ); +} + +//------------------------------------------------------------------------------ + +void ErrDataService::checkMpIplEligibility( ATTENTION_TYPE i_attnType, + TargetHandle_t i_dumpTrgt, + hwTableContent & io_dumpContent ) +{ + // no-op for Hostboot +} + +//------------------------------------------------------------------------------ + +bool ErrDataService::checkForceTerm( const ServiceDataCollector & i_sdc, + TargetHandle_t i_dumpTrgt, + PfaData &io_pfaData ) +{ + //Return false from HB + return false; +} + +//------------------------------------------------------------------------------ + +void ErrDataService::handleUnitCS( const ServiceDataCollector & i_sdc, + TargetHandle_t i_unitCsTarget, + bool & o_initiateHwudump) +{ + // No-op in Hostboot + o_initiateHwudump = false; // default to not initiate hwudump +} + +//------------------------------------------------------------------------------ + +void ErrDataService::handleChannelFail( TargetHandle_t i_memTarget ) +{ + // No-op in Hostboot +} + +//------------------------------------------------------------------------------ + +void ErrDataService::handleCoreUnitCS( TargetHandle_t i_exTarget, + bool & o_initiateHwudump) +{ + // No-op in Hostboot + o_initiateHwudump = false; // default to not initiate hwudump +} + +//------------------------------------------------------------------------------ + +void ErrDataService::handleNxUnitCS( TargetHandle_t i_nxTarget ) +{ + // No-op in Hostboot +} + +//------------------------------------------------------------------------------ + +void ErrDataService::commitErrLog( errlHndl_t & io_errl, + const PfaData & i_pfaData ) + +{ + errlCommit( io_errl, PRDF_COMP_ID ); + io_errl = NULL; +} + +} // end namespace PRDF + diff --git a/src/usr/diag/prdf/plat/prdfRasServices.H b/src/usr/diag/prdf/plat/prdfRasServices.H new file mode 100644 index 000000000..4d1ef12f3 --- /dev/null +++ b/src/usr/diag/prdf/plat/prdfRasServices.H @@ -0,0 +1,44 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/plat/prdfRasServices.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2016 */ +/* [+] 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 */ + +#ifndef __prdfRasServices_H +#define __prdfRasServices_H + +/** @file prdfRasServices.H + * @brief Utility code to parse an SDC and produce the appropriate error log. + */ + +// This must be included after all external 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 + +namespace PRDF +{ + +} // end namespace PRDF + +#endif // __prdfRasServices_H + -- cgit v1.2.1