summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZane Shelley <zshelle@us.ibm.com>2016-11-07 10:22:33 -0600
committerZane C. Shelley <zshelle@us.ibm.com>2016-11-11 09:57:10 -0500
commite20b5b95829709afa33de46e4e8e187c27adf8b2 (patch)
treea426d56d63ec94e4625effee8ec2b771e17d5c14
parente7f3ba824a75c7708e3da353557090bd923a0e63 (diff)
downloadtalos-hostboot-e20b5b95829709afa33de46e4e8e187c27adf8b2.tar.gz
talos-hostboot-e20b5b95829709afa33de46e4e8e187c27adf8b2.zip
PRD: create temporary super fast read PlatServices interface
The HWP is not complete yet, but we can at least fake it until it is ready. Change-Id: I05b488bca30dded0ff3f85092e4d0af7f2d4aeaf RTC: 164217 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/32314 Reviewed-by: Caleb N. Palmer <cnpalmer@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Benjamin J. Weisenbeck <bweisenb@us.ibm.com> Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/32502 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
-rw-r--r--src/usr/diag/prdf/plat/prdfPlatServices_ipl.C131
-rw-r--r--src/usr/diag/prdf/plat/prdfPlatServices_ipl.H16
2 files changed, 147 insertions, 0 deletions
diff --git a/src/usr/diag/prdf/plat/prdfPlatServices_ipl.C b/src/usr/diag/prdf/plat/prdfPlatServices_ipl.C
index e12952575..a140142c1 100644
--- a/src/usr/diag/prdf/plat/prdfPlatServices_ipl.C
+++ b/src/usr/diag/prdf/plat/prdfPlatServices_ipl.C
@@ -38,6 +38,7 @@
#include <prdfTrace.H>
//#include <prdfCenDqBitmap.H> TODO RTC 136126
+#include <prdfMemScrubUtils.H>
#include <diag/mdia/mdia.H>
#include <config.h>
@@ -165,6 +166,136 @@ int32_t mssIplUeIsolation( TargetHandle_t i_mba, const CenRank & i_rank,
}
*/
+//##############################################################################
+//## Nimbus Maintenance Command wrappers
+//##############################################################################
+
+template<>
+uint32_t startSfRead<TYPE_MCA>( ExtensibleChip * i_mcaChip,
+ const MemRank & i_rank )
+{
+ #define PRDF_FUNC "[PlatServices::startSfRead<TYPE_MCA>] "
+
+ PRDF_ASSERT( isInMdiaMode() ); // MDIA must be running.
+
+ PRDF_ASSERT( nullptr != i_mcaChip );
+ PRDF_ASSERT( TYPE_MCA == i_mcaChip->getType() );
+
+ uint32_t o_rc = SUCCESS;
+
+ // Get the MCBIST fapi target
+ ExtensibleChip * mcbChip = getConnectedParent( i_mcaChip, TYPE_MCBIST );
+ PRDF_ASSERT( nullptr != mcbChip );
+ fapi2::Target<fapi2::TARGET_TYPE_MCBIST> fapiTrgt ( mcbChip->getTrgt() );
+
+ // Get the stop conditions.
+ mss::mcbist::stop_conditions stopCond;
+ stopCond.set_pause_on_mpe(mss::ON)
+ .set_pause_on_ue(mss::ON)
+ .set_nce_inter_symbol_count_enable(mss::ON)
+ .set_nce_soft_symbol_count_enable( mss::ON)
+ .set_nce_hard_symbol_count_enable( mss::ON);
+
+ // Stop on hard CEs if MNFG CE checking is enable.
+ if ( isMfgCeCheckingEnabled() ) stopCond.set_pause_on_nce_hard(mss::ON);
+
+ // Get the first address of the given rank.
+ uint32_t port = i_mcaChip->getPos() % MAX_MCA_PER_MCBIST;
+ mss::mcbist::address saddr, eaddr;
+ mss::mcbist::address::get_srank_range( port,
+ i_rank.getDimmSlct(),
+ i_rank.getRankSlct(),
+ i_rank.getSlave(),
+ saddr,
+ eaddr );
+
+ do
+ {
+ // Clear all of the counters and maintenance ECC attentions.
+ o_rc = prepareNextCmd<TYPE_MCBIST>( mcbChip );
+ if ( SUCCESS != o_rc )
+ {
+ PRDF_ERR( PRDF_FUNC "prepareNextCmd(0x%08x) failed",
+ mcbChip->getHuid() );
+ break;
+ }
+
+ // Start the super fast read command.
+ // TODO: RTC 159778 - Still waiting for Brian Silver to update this
+ // interface. In the meantime, tell MDIA that command has
+ // completed (even though it hasn't) so that we do not hang up
+ // MDIA and the IPL.
+ o_rc = mdiaSendEventMsg( mcbChip->getTrgt(), MDIA::COMMAND_COMPLETE );
+ if ( SUCCESS != o_rc )
+ {
+ PRDF_ERR( PRDF_FUNC "mdiaSendEventMsg(COMMAND_COMPLETE) failed" );
+ }
+/*
+ fapi2::ReturnCode fapi_rc = memdiags::sf_read( fapiTrgt, stopCond,
+ saddr );
+ errlHndl_t errl = fapi2::rcToErrl( fapi_rc );
+ if ( nullptr != errl )
+ {
+ PRDF_ERR( PRDF_FUNC "memdiags::sf_read(0x%08x,%d) failed",
+ mcbChip->getHuid(), i_rank.getMaster() );
+ PRDF_COMMIT_ERRL( errl, ERRL_ACTION_REPORT );
+ o_rc = FAIL; break;
+ }
+*/
+ } while (0);
+
+ return o_rc;
+
+ #undef PRDF_FUNC
+}
+
+//------------------------------------------------------------------------------
+
+// This specialization only exists to avoid a lot of extra code in some classes.
+// The input chip must still be an MCA chip.
+template<>
+uint32_t startSfRead<TYPE_MCBIST>( ExtensibleChip * i_mcaChip,
+ const MemRank & i_rank )
+{
+ return startSfRead<TYPE_MCA>( i_mcaChip, i_rank );
+}
+
+//##############################################################################
+//## Centaur Maintenance Command wrappers
+//##############################################################################
+
+template<>
+uint32_t startSfRead<TYPE_MBA>( ExtensibleChip * i_mbaChip,
+ const MemRank & i_rank )
+{
+ #define PRDF_FUNC "[PlatServices::startSfRead<TYPE_MBA>] "
+
+ PRDF_ASSERT( nullptr != i_mbaChip );
+ PRDF_ASSERT( TYPE_MBA == i_mbaChip->getType() );
+
+ uint32_t o_rc = SUCCESS;
+
+ do
+ {
+ // Clear all of the counters and maintenance ECC attentions.
+ o_rc = prepareNextCmd<TYPE_MBA>( i_mbaChip );
+ if ( SUCCESS != o_rc )
+ {
+ PRDF_ERR( PRDF_FUNC "prepareNextCmd(0x%08x) failed",
+ i_mbaChip->getHuid() );
+ break;
+ }
+
+ // Start the background scrub command.
+ PRDF_ERR( PRDF_FUNC "function not implemented yet" ); // TODO RTC 136126
+
+ } while (0);
+
+ return o_rc;
+
+ #undef PRDF_FUNC
+}
+
//------------------------------------------------------------------------------
} // end namespace PlatServices
diff --git a/src/usr/diag/prdf/plat/prdfPlatServices_ipl.H b/src/usr/diag/prdf/plat/prdfPlatServices_ipl.H
index 6dcdc2e98..e16aad9de 100644
--- a/src/usr/diag/prdf/plat/prdfPlatServices_ipl.H
+++ b/src/usr/diag/prdf/plat/prdfPlatServices_ipl.H
@@ -90,6 +90,22 @@ int32_t mssIplUeIsolation( TARGETING::TargetHandle_t i_mba,
CenDqBitmap & o_bitmap );
*/
+//##############################################################################
+//## Nimbus/Centaur Maintenance Command wrappers
+//##############################################################################
+
+/**
+ * @brief Starts a super fast read command from the first address of the given
+ * rank to the end of memory.
+ * @param i_chip MCA or MBA chip.
+ * @param i_rank Will start the command on the first address of this slave
+ * rank. To ensure the command is started on a master rank boundary,
+ * make sure the slave rank value is 0.
+ * @return Non-SUCCESS if an internal function fails, otherwise SUCCESS.
+ */
+template<TARGETING::TYPE T>
+uint32_t startSfRead( ExtensibleChip * i_chip, const MemRank & i_rank );
+
} // end namespace PlatServices
} // end namespace PRDF
OpenPOWER on IntegriCloud