diff options
author | Zane Shelley <zshelle@us.ibm.com> | 2014-11-15 15:20:44 -0600 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2014-12-01 15:45:03 -0600 |
commit | 5a9286445de293872985a0c38207e396c76f16b8 (patch) | |
tree | 37366d080d0e6a18cef9ebba7e93731259493788 | |
parent | 991b550a9e53036f13e728105b10b85e341dff3f (diff) | |
download | blackbird-hostboot-5a9286445de293872985a0c38207e396c76f16b8.tar.gz blackbird-hostboot-5a9286445de293872985a0c38207e396c76f16b8.zip |
PRD: split HB IPL only PlatServices functions
Change-Id: Ibd00dd76980616cff065e38e8dbf612116575ac8
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/14467
Tested-by: Jenkins Server
Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Reviewed-by: Christopher T. Phan <cphan@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Reviewed-by: Zane Shelley <zshelle@us.ibm.com>
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/14577
8 files changed, 293 insertions, 176 deletions
diff --git a/src/usr/diag/prdf/common/framework/service/prdfRasServices_common.C b/src/usr/diag/prdf/common/framework/service/prdfRasServices_common.C index bb9320292..88cde46a9 100644 --- a/src/usr/diag/prdf/common/framework/service/prdfRasServices_common.C +++ b/src/usr/diag/prdf/common/framework/service/prdfRasServices_common.C @@ -421,7 +421,7 @@ errlHndl_t ErrDataService::GenerateSrcPfa( ATTENTION_TYPE i_attnType, // Check for IPL Diag Mode and set up for Deferred Deconfig //-------------------------------------------------------------------------- -#ifdef __HOSTBOOT_MODULE + #if defined(__HOSTBOOT_MODULE) && !defined(__HOSTBOOT_RUNTIME) iplDiagMode = PlatServices::isInMdiaMode(); @@ -433,8 +433,7 @@ errlHndl_t ErrDataService::GenerateSrcPfa( ATTENTION_TYPE i_attnType, deconfigState = HWAS::DECONFIG; } -#endif - + #endif //************************************************************** // Update Error Log with SRC diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMemUtils.C b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMemUtils.C index c6a0f1812..70fdb645d 100755 --- a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMemUtils.C +++ b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMemUtils.C @@ -506,7 +506,8 @@ int32_t chnlCsCleanup( ExtensibleChip *i_mbChip, TargetHandle_t mba = mbaChip->GetChipHandle(); if ( NULL != mba ) { - #ifdef __HOSTBOOT_MODULE + #if defined(__HOSTBOOT_MODULE) && \ + !defined(__HOSTBOOT_RUNTIME) // This is very small platform specific code. So not // creating a separate file for this. int32_t l_rc = mdiaSendEventMsg( mba, MDIA::SKIP_MBA ); diff --git a/src/usr/diag/prdf/framework/service/prdfPlatServices.C b/src/usr/diag/prdf/framework/service/prdfPlatServices.C index ecd325a5d..23fd6d19e 100644 --- a/src/usr/diag/prdf/framework/service/prdfPlatServices.C +++ b/src/usr/diag/prdf/framework/service/prdfPlatServices.C @@ -104,126 +104,6 @@ void collectSBE_FFDC(TARGETING::TargetHandle_t i_procTarget) // Do nothing for Hostboot } -//############################################################################## -//## Memory specific functions -//############################################################################## - -bool isInMdiaMode() -{ - bool o_isInMdiaMode = false; - - MDIA::waitingForMaintCmdEvents(o_isInMdiaMode); - - return o_isInMdiaMode; -} - -//------------------------------------------------------------------------------ - -int32_t mdiaSendEventMsg( TargetHandle_t i_mbaTarget, - MDIA::MaintCommandEventType i_eventType ) -{ - #define PRDF_FUNC "[PlatServices::mdiaSendCmdComplete] " - - int32_t o_rc = SUCCESS; - - 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 ); - } - - return o_rc; - - #undef PRDF_FUNC -} - -//------------------------------------------------------------------------------ - -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; -} - -//------------------------------------------------------------------------------ - -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; - PRD_FAPI_TO_ERRL( 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 -} - //------------------------------------------------------------------------------ TARGETING::TargetHandle_t getMasterCore( TARGETING::TargetHandle_t i_procTgt ) diff --git a/src/usr/diag/prdf/framework/service/prdfPlatServices.H b/src/usr/diag/prdf/framework/service/prdfPlatServices.H index c366bd69b..8b7fe471c 100644 --- a/src/usr/diag/prdf/framework/service/prdfPlatServices.H +++ b/src/usr/diag/prdf/framework/service/prdfPlatServices.H @@ -34,14 +34,18 @@ * is common between FSP and Hostboot should be in the respective common file. */ -#include <diag/mdia/mdia.H> #include <utility_procedures/mss_maint_cmds.H> -// 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. +// 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 <prdfPlatServices_common.H> +// Must be included after including the common PlatServices code. +#ifndef __HOSTBOOT_RUNTIME + #include <prdfPlatServices_ipl.H> +#endif + //------------------------------------------------------------------------------ namespace PRDF @@ -77,52 +81,6 @@ inline bool isSapphireRunning() inline bool isSmpCoherent() { return false; } -//############################################################################## -//## 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 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. - */ -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. - */ -int32_t mssIplUeIsolation( TARGETING::TargetHandle_t i_mba, - const CenRank & i_rank, - CenDqBitmap & o_bitmap ); - } // end namespace PlatServices } // end namespace PRDF diff --git a/src/usr/diag/prdf/framework/service/prdfPlatServices_ipl.C b/src/usr/diag/prdf/framework/service/prdfPlatServices_ipl.C new file mode 100644 index 000000000..d64a882c3 --- /dev/null +++ b/src/usr/diag/prdf/framework/service/prdfPlatServices_ipl.C @@ -0,0 +1,178 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/framework/service/prdfPlatServices_ipl.C $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2014 */ +/* [+] 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 <prdfPlatServices.H> + +#include <prdfGlobal.H> +#include <prdfErrlUtil.H> +#include <prdfTrace.H> + +#include <prdfCenDqBitmap.H> + +#include <diag/mdia/mdia.H> +#include <diag/mdia/mdiamevent.H> + +using namespace TARGETING; + +namespace PRDF +{ + +namespace PlatServices +{ + +//############################################################################## +//## Memory specific functions +//############################################################################## + +bool isInMdiaMode() +{ + bool o_isInMdiaMode = false; + + MDIA::waitingForMaintCmdEvents(o_isInMdiaMode); + + return o_isInMdiaMode; +} + +//------------------------------------------------------------------------------ + +int32_t mdiaSendEventMsg( TargetHandle_t i_mbaTarget, + MDIA::MaintCommandEventType i_eventType ) +{ + #define PRDF_FUNC "[PlatServices::mdiaSendCmdComplete] " + + int32_t o_rc = SUCCESS; + + 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 ); + } + + return o_rc; + + #undef PRDF_FUNC +} + +//------------------------------------------------------------------------------ + +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; +} + +//------------------------------------------------------------------------------ + +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; + PRD_FAPI_TO_ERRL( 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/framework/service/prdfPlatServices_ipl.H b/src/usr/diag/prdf/framework/service/prdfPlatServices_ipl.H new file mode 100644 index 000000000..31d342198 --- /dev/null +++ b/src/usr/diag/prdf/framework/service/prdfPlatServices_ipl.H @@ -0,0 +1,94 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/framework/service/prdfPlatServices_ipl.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2014 */ +/* [+] 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 <diag/mdia/mdia.H> + +//------------------------------------------------------------------------------ + +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. + */ +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. + */ +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/pegasus/prdfPlatCenPll.C b/src/usr/diag/prdf/plat/pegasus/prdfPlatCenPll.C index 9945e615e..1315173c0 100644 --- a/src/usr/diag/prdf/plat/pegasus/prdfPlatCenPll.C +++ b/src/usr/diag/prdf/plat/pegasus/prdfPlatCenPll.C @@ -60,7 +60,6 @@ int32_t PllPostAnalysis( ExtensibleChip * i_cenChip, int32_t o_rc = SUCCESS; - TargetHandle_t cenTrgt = i_cenChip->GetChipHandle(); do { @@ -79,6 +78,9 @@ int32_t PllPostAnalysis( ExtensibleChip * i_cenChip, break; // nothing to do } + #ifndef __HOSTBOOT_RUNTIME + + TargetHandle_t cenTrgt = i_cenChip->GetChipHandle(); TargetHandleList list = getConnected( cenTrgt, TYPE_MBA ); if ( 0 == list.size() ) { @@ -101,6 +103,8 @@ int32_t PllPostAnalysis( ExtensibleChip * i_cenChip, } } + #endif + } while(0); return o_rc; diff --git a/src/usr/diag/prdf/prdf_hb_only.mk b/src/usr/diag/prdf/prdf_hb_only.mk index a748b3bc9..5eeaee42b 100644 --- a/src/usr/diag/prdf/prdf_hb_only.mk +++ b/src/usr/diag/prdf/prdf_hb_only.mk @@ -74,7 +74,7 @@ prd_obj += prdfMain.o prd_obj += prdfDumpResolution.o # framework/service/ -prd_obj_no_sim += prdfPlatServices.o +prd_obj += prdfPlatServices.o prd_obj += prdfRasServices.o # mnfgtools/ @@ -108,6 +108,9 @@ prd_obj += prdfMain_ipl.o # framework/config/ prd_obj += prdfMbaDomain.o +# framework/service/ +prd_obj += prdfPlatServices_ipl.o + endif ################################################################################ |