diff options
author | Zane Shelley <zshelle@us.ibm.com> | 2016-03-07 20:07:34 -0600 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2016-03-25 12:24:57 -0400 |
commit | 91e03307dfe1fc47f26d23eb35bde39af751ef17 (patch) | |
tree | 145bc7b1d81f2d50ba1573faccf4006deab52f0d /src/usr/diag/prdf/plat/prdfPlatServices_ipl.C | |
parent | 4dea56a10f144a1b0acb8aa9cc027870fd3c8d41 (diff) | |
download | talos-hostboot-91e03307dfe1fc47f26d23eb35bde39af751ef17.tar.gz talos-hostboot-91e03307dfe1fc47f26d23eb35bde39af751ef17.zip |
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 <zshelle@us.ibm.com>
Tested-by: Jenkins Server
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/22138
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/diag/prdf/plat/prdfPlatServices_ipl.C')
-rw-r--r-- | src/usr/diag/prdf/plat/prdfPlatServices_ipl.C | 187 |
1 files changed, 187 insertions, 0 deletions
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 <prdfPlatServices.H> + +#include <prdfGlobal.H> +#include <prdfErrlUtil.H> +#include <prdfTrace.H> + +//#include <prdfCenDqBitmap.H> TODO RTC 136126 + +#include <diag/mdia/mdia.H> +#include <diag/mdia/mdiamevent.H> +#include <config.h> + +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 + |