diff options
author | Zane Shelley <zshelle@us.ibm.com> | 2012-09-20 12:18:46 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-11-07 16:13:29 -0600 |
commit | 63aca27a47a3b60ca107c12cad8d132a0cfeb64c (patch) | |
tree | e3e38fb25b6986223f8ba8f617f04697f4801b2d /src/usr/diag/prdf/plat/pegasus/prdfCenMba.C | |
parent | 1190a8872faeac22924a4528c9fbeabdafe9fad6 (diff) | |
download | talos-hostboot-63aca27a47a3b60ca107c12cad8d132a0cfeb64c.tar.gz talos-hostboot-63aca27a47a3b60ca107c12cad8d132a0cfeb64c.zip |
Initial port of PRD to Hostboot
Change-Id: I7ee2673131d4891d482e99a403a36300b79e547e
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1853
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/diag/prdf/plat/pegasus/prdfCenMba.C')
-rwxr-xr-x | src/usr/diag/prdf/plat/pegasus/prdfCenMba.C | 145 |
1 files changed, 145 insertions, 0 deletions
diff --git a/src/usr/diag/prdf/plat/pegasus/prdfCenMba.C b/src/usr/diag/prdf/plat/pegasus/prdfCenMba.C new file mode 100755 index 000000000..9739a0b75 --- /dev/null +++ b/src/usr/diag/prdf/plat/pegasus/prdfCenMba.C @@ -0,0 +1,145 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/plat/pegasus/prdfCenMba.C $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2012 */ +/* */ +/* 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 prdfCenMba.C + * @brief Contains all the plugin code for the PRD Centaur MBA + */ + +#include <iipServiceDataCollector.h> +#include <prdfCalloutUtil.H> +#include <prdfExtensibleChip.H> +#include <prdfMemUtil.H> +#include <prdfPlatServices.H> +#include <prdfPluginMap.H> + +#include <prdfCenMbaDataBundle.H> + +namespace PRDF +{ +namespace Mba +{ + +//############################################################################## +// +// Special plugins +// +//############################################################################## + +/** + * @brief Plugin that initializes the P8 Centaur MBA data bundle. + * @param i_mbaChip A Centaur MBA chip. + * @return SUCCESS + */ +int32_t Initialize( PrdfExtensibleChip * i_mbaChip ) +{ + i_mbaChip->getDataBundle() = new CenMbaDataBundle( i_mbaChip ); + return SUCCESS; +} +PRDF_PLUGIN_DEFINE( Mba, Initialize ); + +//------------------------------------------------------------------------------ + +/** + * @brief Plugin function called after analysis is complete but before PRD + * exits. + * @param i_mbaChip A Centaur MBA chip. + * @param i_sc The step code data struct. + * @note This is especially useful for any analysis that still needs to be + * done after the framework clears the FIR bits that were at attention. + * @return SUCCESS. + */ +int32_t PostAnalysis( PrdfExtensibleChip * i_mbaChip, + STEP_CODE_DATA_STRUCT & i_sc ) +{ + #ifdef __HOSTBOOT_MODULE + + using namespace TARGETING; + + // In hostboot, we need to clear MCI Fir bits. Do we will get the mcs + // chiplet connected with Mba and call its plugin to clear those FIR bits + int32_t l_rc = MemUtil::clearHostAttns( i_mbaChip, i_sc ); + if ( SUCCESS != l_rc ) + PRDF_ERR( "[Mba::PostAnalysis] MemUtil::clearHostAttns failed" ); + + // Send command complete to MDIA. + // This must be done in post analysis after attentions have been cleared. + if ( PlatServices::isInMdiaMode() ) + { + TargetHandle_t mbaTarget = i_mbaChip->GetChipHandle(); + CenMbaDataBundle * mbadb = getMbaDataBundle( i_mbaChip ); + + mbadb->iv_sendCmdCompleteMsg = false; + PlatServices::mdiaSendCmdComplete( mbaTarget ); + } + + #endif // __HOSTBOOT_MODULE + + return SUCCESS; +} +PRDF_PLUGIN_DEFINE( Mba, PostAnalysis ); + +//############################################################################## +// +// MBASPA +// +//############################################################################## + +/** + * @brief MBASPA[0] - Maintenance command complete. + * @param i_mbaChip A Centaur MBA chip. + * @param i_sc The step code data struct. + * @return SUCCESS + */ +int32_t MaintCmdComplete( PrdfExtensibleChip * i_mbaChip, + STEP_CODE_DATA_STRUCT & i_sc ) +{ + using namespace TARGETING; + + int32_t l_rc = SUCCESS; + TargetHandle_t mbaTarget = i_mbaChip->GetChipHandle(); + + do + { + #ifdef __HOSTBOOT_MODULE + + // TODO: Will need to change design once this for error path. + CenMbaDataBundle * mbadb = getMbaDataBundle( i_mbaChip ); + mbadb->iv_sendCmdCompleteMsg = true; + + #endif // __HOSTBOOT_MODULE + + } while (0); + + if ( SUCCESS != l_rc ) + { + PRDF_ERR( "[Mba::MaintCmdComplete] failed on MBA 0x%08x", + PlatServices::getHuid(mbaTarget) ); + CalloutUtil::defaultError( i_sc ); + } + + return SUCCESS; +} +PRDF_PLUGIN_DEFINE( Mba, MaintCmdComplete ); + +} // end namespace Mba +} // end namespace PRDF |