diff options
author | Caleb Palmer <cnpalmer@us.ibm.com> | 2016-06-10 14:39:32 -0500 |
---|---|---|
committer | Stephen Cprek <smcprek@us.ibm.com> | 2016-07-18 15:32:30 -0500 |
commit | 76fb6f89084a0c1c65da87d6d1da72b1891e77de (patch) | |
tree | f49be62b2a9acf562395f43312914e787e30be49 /src/usr/diag/prdf/plat/p9 | |
parent | 50753b255daea0d3e0fb3c3f689b8c5ca9f8c969 (diff) | |
download | talos-hostboot-76fb6f89084a0c1c65da87d6d1da72b1891e77de.tar.gz talos-hostboot-76fb6f89084a0c1c65da87d6d1da72b1891e77de.zip |
PRD: Add support for MCBIST cmd complete
Change-Id: Iad915174af7fa12d7c9e1f9943b04ed9bfc62e4d
RTC: 154875
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/25676
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Benjamin J. Weisenbeck <bweisenb@us.ibm.com>
Reviewed-by: Brian J. Stegmiller <bjs@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com>
Squashed: Ibbf382f0befdee54a8a8626643d52c8d48f9bac0
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/26556
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Diffstat (limited to 'src/usr/diag/prdf/plat/p9')
-rw-r--r-- | src/usr/diag/prdf/plat/p9/prdfP9Mcbist.C | 132 | ||||
-rw-r--r-- | src/usr/diag/prdf/plat/p9/prdfP9McbistDataBundle.H | 101 | ||||
-rw-r--r-- | src/usr/diag/prdf/plat/p9/prdf_plat_p9_hb_only.mk | 58 |
3 files changed, 291 insertions, 0 deletions
diff --git a/src/usr/diag/prdf/plat/p9/prdfP9Mcbist.C b/src/usr/diag/prdf/plat/p9/prdfP9Mcbist.C new file mode 100644 index 000000000..111497e3a --- /dev/null +++ b/src/usr/diag/prdf/plat/p9/prdfP9Mcbist.C @@ -0,0 +1,132 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/plat/p9/prdfP9Mcbist.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 prdfP9Mcbist.C + * @brief Contains plugin code for MCBIST on Hostboot (IPL and runtime). + */ + +// Framework includes +#include <iipServiceDataCollector.h> +#include <prdfExtensibleChip.H> +#include <prdfPluginDef.H> +#include <prdfPluginMap.H> + +// Platform includes +#include <prdfPlatServices.H> +#include <prdfP9McbistDataBundle.H> + +namespace PRDF +{ + +using namespace PlatServices; + +namespace p9_mcbist +{ + +//############################################################################## +// +// Special plugins +// +//############################################################################## + +#ifndef __HOSTBOOT_RUNTIME + +/** + * @brief Plugin function called after analysis is complete but before PRD + * exits. + * @param i_mcbChip An MCBIST 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( ExtensibleChip * i_mcbChip, + STEP_CODE_DATA_STRUCT & i_sc ) +{ + #define PRDF_FUNC "[p9_mcbist::PostAnalysis] " + + // Send command complete to MDIA. + // This must be done in post analysis after attentions have been cleared. + + McbistDataBundle * mcbdb = getMcbistDataBundle( i_mcbChip ); + + if ( mcbdb->iv_sendCmdCompleteMsg ) + { + mcbdb->iv_sendCmdCompleteMsg = false; + + int32_t rc = mdiaSendEventMsg( i_mcbChip->GetChipHandle(), + MDIA::COMMAND_COMPLETE ); + if ( SUCCESS != rc ) + { + PRDF_ERR( PRDF_FUNC "mdiaSendEventMsg(COMMAND_COMPLETE) failed" ); + } + } + + return SUCCESS; // Intentionally return SUCCESS for this plugin + + #undef PRDF_FUNC +} +PRDF_PLUGIN_DEFINE( p9_mcbist, PostAnalysis ); + +#endif // not __HOSTBOOT_RUNTIME + +//############################################################################## +// +// MCBISTFIR +// +//############################################################################## + +/** + * @brief MCBIST[10] - MCBIST Command Complete. + * @param i_mcbChip An MCBIST chip. + * @param i_sc The step code data struct. + * @return SUCCESS + */ +int32_t McbistCmdComplete( ExtensibleChip * i_mcbChip, + STEP_CODE_DATA_STRUCT & i_sc ) +{ + #define PRDF_FUNC "[p9_mcbist::McbistCmdComplete] " + + // TODO: RTC 152592 - This code is only temporary so that we can get MDIA + // working in SIMICs. Eventually, we will add a call to the TD + // controller which will handle errors, restart commands, communicate + // with MDIA, etc. + #ifndef __HOSTBOOT_RUNTIME + + McbistDataBundle * mcbdb = getMcbistDataBundle( i_mcbChip ); + mcbdb->iv_sendCmdCompleteMsg = true; + + #endif + + return SUCCESS; + + #undef PRDF_FUNC +} +PRDF_PLUGIN_DEFINE( p9_mcbist, McbistCmdComplete ); + +} // end namespace p9_mcbist + +} // end namespace PRDF + diff --git a/src/usr/diag/prdf/plat/p9/prdfP9McbistDataBundle.H b/src/usr/diag/prdf/plat/p9/prdfP9McbistDataBundle.H new file mode 100644 index 000000000..f4d12d471 --- /dev/null +++ b/src/usr/diag/prdf/plat/p9/prdfP9McbistDataBundle.H @@ -0,0 +1,101 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/plat/p9/prdfP9McbistDataBundle.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 __prdfP9McbistDataBundle_H +#define __prdfP9McbistDataBundle_H + +/** @file prdfP9McbistDataBundle.H + * @brief Contains the data bundle for a P9 MCBIST object. + */ + +// Framework includes +#include <prdfExtensibleChip.H> + +// Platform includes +#include <prdfPlatServices.H> + +namespace PRDF +{ + +/** @brief P9 MCBIST data bundle. */ +class McbistDataBundle : public DataBundle +{ + public: // functions + + #ifdef __HOSTBOOT_RUNTIME + + /** + * @brief Constructor. + * @param i_mcbChip The MCBIST chip. + */ + explicit McbistDataBundle( ExtensibleChip * i_mcbChip ) = default; + + #else + + /** + * @brief Constructor. + * @param i_mcbChip The MCBIST chip. + */ + explicit McbistDataBundle( ExtensibleChip * i_mcbChip ) : + iv_sendCmdCompleteMsg(false) + {} + + #endif + + /** @brief Destructor. */ + ~McbistDataBundle() = default; + + // Don't allow copy or assignment. + McbistDataBundle( const McbistDataBundle & ) = delete; + const McbistDataBundle & operator=( const McbistDataBundle & ) = delete; + + public: // instance variables + + #ifndef __HOSTBOOT_RUNTIME + + /** TRUE if a message needs to be sent to MDIA in the post analysis plugin, + * FALSE otherwise. */ + bool iv_sendCmdCompleteMsg; + + #endif + + private: // instance variables + +}; + +/** + * @brief Wrapper function for the McbistDataBundle. + * @param i_mcbChip The MCBIST chip. + * @return This MBA's data bundle. + */ +inline McbistDataBundle * getMcbistDataBundle( ExtensibleChip * i_mcbChip ) +{ + return static_cast<McbistDataBundle *>(i_mcbChip->getDataBundle()); +} + +} // end namespace PRDF + +#endif // __prdfP9McbistDataBundle_H + diff --git a/src/usr/diag/prdf/plat/p9/prdf_plat_p9_hb_only.mk b/src/usr/diag/prdf/plat/p9/prdf_plat_p9_hb_only.mk new file mode 100644 index 000000000..256615fb4 --- /dev/null +++ b/src/usr/diag/prdf/plat/p9/prdf_plat_p9_hb_only.mk @@ -0,0 +1,58 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/usr/diag/prdf/plat/p9/prdf_plat_p9_hb_only.mk $ +# +# 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 + +# NOTE: PRD_SRC_PATH and PRD_INC_PATH must be defined before including this file + +################################################################################ +# Paths common to both IPL and runtime +################################################################################ + +prd_vpath += ${PRD_SRC_PATH}/plat/p9 + +prd_incpath += ${PRD_SRC_PATH}/plat/p9 + +################################################################################ +# Hostboot only object files common to both IPL and runtime +################################################################################ + +# plat/p9/ (rule plugin related) +prd_rule_plugin += prdfP9Mcbist.o + +################################################################################ +# Hostboot only object files (IPL only) +################################################################################ + +ifneq (${HOSTBOOT_RUNTIME},1) + +endif + +################################################################################ +# Hostboot only object files (runtime only) +################################################################################ + +ifeq (${HOSTBOOT_RUNTIME},1) + +endif + |