summaryrefslogtreecommitdiffstats
path: root/src/usr/diag/prdf/common/framework/service/prdfPlatServices_common.C
diff options
context:
space:
mode:
authorZane Shelley <zshelle@us.ibm.com>2013-01-25 17:21:05 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-02-16 00:22:26 -0600
commit6abba603d161e8ca70a2d0de0c0bffc82924f99e (patch)
treedad9215330c4759114fe41d248ebff303bb95695 /src/usr/diag/prdf/common/framework/service/prdfPlatServices_common.C
parent7c73f96c7e3f309210d58332dc7f3fc4012118ef (diff)
downloadtalos-hostboot-6abba603d161e8ca70a2d0de0c0bffc82924f99e.tar.gz
talos-hostboot-6abba603d161e8ca70a2d0de0c0bffc82924f99e.zip
PRD: Refactor prdfPlatServices
The prdfPlatServices_common.[HC] files should only contain code that is common between FSP and Hostboot. The prdfTargetServices.[HC] files should only contain code specific to the common FSP/Hostboot targeting code. The FSP prdfPlatServices.[HC] and Hostboot prdfPlatServices.[HC] files will contain code that is specific to FSP or Hostboot, respectively. Only prdfPlatServices_common.H will include prdfTargetServices.H. Only the prdfPlatServices.H files will include prdfPlatServices_common.H. All user code should include the respective prdfPlatServices.H file. Change-Id: I6e723d6e6602194abfc24ee9c20c1949c393c0e2 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/3041 Tested-by: Jenkins Server Reviewed-by: Christopher T. Phan <cphan@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com> Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/3213
Diffstat (limited to 'src/usr/diag/prdf/common/framework/service/prdfPlatServices_common.C')
-rwxr-xr-xsrc/usr/diag/prdf/common/framework/service/prdfPlatServices_common.C254
1 files changed, 254 insertions, 0 deletions
diff --git a/src/usr/diag/prdf/common/framework/service/prdfPlatServices_common.C b/src/usr/diag/prdf/common/framework/service/prdfPlatServices_common.C
new file mode 100755
index 000000000..fa8f56515
--- /dev/null
+++ b/src/usr/diag/prdf/common/framework/service/prdfPlatServices_common.C
@@ -0,0 +1,254 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: ./common/framework/service/prdfPlatServices_common.C $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2012,2013 */
+/* */
+/* 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 prdfPlatServices_common.C
+ * @brief Wrapper code for external interfaces used by PRD.
+ *
+ * This file contains code that is strictly common between FSP and Hostboot. All
+ * platform specific code should be in the respective FSP only or Hostboot only
+ * files.
+ */
+
+#include <prdfPlatServices.H>
+
+#include <iipglobl.h>
+#include <prdfTrace.H>
+
+#include <dimmBadDqBitmapFuncs.H> // for dimm[S|G]etBadDqBitmap()
+#include <dram_initialization/mss_memdiag/mss_maint_cmds.H>
+
+using namespace TARGETING;
+
+//------------------------------------------------------------------------------
+
+namespace PRDF
+{
+
+namespace PlatServices
+{
+
+//##############################################################################
+//## System Level Utility Functions
+//##############################################################################
+
+void getECIDString( TargetHandle_t i_target, const char * o_ecidStr )
+{
+ o_ecidStr ="";
+ PRDF_ERR( "[PlatServices::getECIDString] Function not implemented yet" );
+}
+
+//##############################################################################
+//## Processor specific functions
+//##############################################################################
+
+//##############################################################################
+//## Memory specific functions
+//##############################################################################
+
+int32_t getBadDqBitmap( TargetHandle_t i_mbaTarget, const uint8_t i_portSlct,
+ const uint8_t i_dimmSlct, const uint8_t i_rankSlct,
+ uint8_t (&o_data)[DIMM_DQ_RANK_BITMAP_SIZE] )
+{
+ int32_t o_rc = SUCCESS;
+
+ errlHndl_t errl = NULL;
+
+ PRD_FAPI_TO_ERRL( errl, dimmGetBadDqBitmap,
+ fapi::Target(fapi::TARGET_TYPE_MBA_CHIPLET, i_mbaTarget),
+ i_portSlct, i_dimmSlct, i_rankSlct, o_data );
+
+ if ( NULL != errl )
+ {
+ PRDF_ERR( "[PlatServices::getBadDqBitmap] dimmGetBadDqBitmap() failed. "
+ "HUID: 0x%08x port: %d DIMM: %d rank: %d",
+ getHuid(i_mbaTarget), i_portSlct, i_dimmSlct, i_rankSlct );
+ PRDF_COMMIT_ERRL( errl, ERRL_ACTION_REPORT );
+ o_rc = FAIL;
+ }
+
+ return o_rc;
+}
+
+//------------------------------------------------------------------------------
+
+int32_t setBadDqBitmap( TargetHandle_t i_mbaTarget, const uint8_t i_portSlct,
+ const uint8_t i_dimmSlct, const uint8_t i_rankSlct,
+ const uint8_t (&i_data)[DIMM_DQ_RANK_BITMAP_SIZE] )
+{
+ int32_t o_rc = SUCCESS;
+
+ errlHndl_t errl = NULL;
+
+ PRD_FAPI_TO_ERRL( errl, dimmSetBadDqBitmap,
+ fapi::Target(fapi::TARGET_TYPE_MBA_CHIPLET, i_mbaTarget),
+ i_portSlct, i_dimmSlct, i_rankSlct, i_data );
+
+ if ( NULL != errl )
+ {
+ PRDF_ERR( "[PlatServices::getBadDqBitmap] dimmSetBadDqBitmap() failed. "
+ "HUID: 0x%08x ps: %d ds: %d rs: %d",
+ getHuid(i_mbaTarget), i_portSlct, i_dimmSlct, i_rankSlct );
+ PRDF_COMMIT_ERRL( errl, ERRL_ACTION_REPORT );
+ o_rc = FAIL;
+ }
+
+ return o_rc;
+}
+
+//------------------------------------------------------------------------------
+
+int32_t mssGetMarkStore( TargetHandle_t i_mbaTarget, uint8_t i_rank,
+ uint8_t & o_chipMark, uint8_t & o_symbolMark )
+{
+ int32_t o_rc = SUCCESS;
+
+ errlHndl_t errl = NULL;
+
+ PRD_FAPI_TO_ERRL( errl, mss_get_mark_store,
+ fapi::Target(fapi::TARGET_TYPE_MBA_CHIPLET, i_mbaTarget),
+ i_rank, o_chipMark, o_symbolMark );
+
+ if ( NULL != errl )
+ {
+ PRDF_ERR( "[PlatServices::mssGetMarkStore] mss_get_mark_store() "
+ "failed. HUID: 0x%08x rank: %d",
+ getHuid(i_mbaTarget), i_rank );
+ PRDF_COMMIT_ERRL( errl, ERRL_ACTION_REPORT );
+ o_rc = FAIL;
+ }
+
+ return o_rc;
+}
+
+//------------------------------------------------------------------------------
+
+int32_t mssSetMarkStore( TargetHandle_t i_mbaTarget, uint8_t i_rank,
+ uint8_t i_chipMark, uint8_t i_symbolMark )
+{
+ int32_t o_rc = SUCCESS;
+
+ errlHndl_t errl = NULL;
+
+ // TODO: mss_put_mark_store() will give a certain return code if the write
+ // to mark store was circumvented by hardware. Will need to check this
+ // return code.
+
+ PRD_FAPI_TO_ERRL( errl, mss_put_mark_store,
+ fapi::Target(fapi::TARGET_TYPE_MBA_CHIPLET, i_mbaTarget),
+ i_rank, i_chipMark, i_symbolMark );
+
+ if ( NULL != errl )
+ {
+ PRDF_ERR( "[PlatServices::mssSetMarkStore] mss_put_mark_store() "
+ "failed. HUID: 0x%08x rank: %d cm: %d sm: %d",
+ getHuid(i_mbaTarget), i_rank, i_chipMark, i_symbolMark );
+ PRDF_COMMIT_ERRL( errl, ERRL_ACTION_REPORT );
+ o_rc = FAIL;
+ }
+
+ return o_rc;
+}
+
+//------------------------------------------------------------------------------
+
+int32_t mssGetSteerMux( TargetHandle_t i_mbaTarget, uint8_t i_rank,
+ uint8_t & o_port0Spare, uint8_t & o_port1Spare,
+ uint8_t & o_eccSpare )
+{
+ int32_t o_rc = SUCCESS;
+
+/* TODO: Marc is creating a new interface.
+ errlHndl_t errl = NULL;
+
+ PRD_FAPI_TO_ERRL( errl, TODO,
+ fapi::Target(fapi::TARGET_TYPE_MBA_CHIPLET, i_mbaTarget),
+ i_rank, o_port0Spare, o_port1Spare, o_eccSpare );
+
+ if ( NULL != errl )
+ {
+ PRDF_ERR( "[PlatServices::mssGetSteerMux] TODO() "
+ "failed. HUID: 0x%08x rank: %d",
+ getHuid(i_mbaTarget), i_rank );
+ PRDF_COMMIT_ERRL( errl, ERRL_ACTION_REPORT );
+ o_rc = FAIL;
+ }
+*/
+
+ return o_rc;
+
+}
+
+//------------------------------------------------------------------------------
+
+int32_t mssSetSteerMux( TargetHandle_t i_mbaTarget, uint8_t i_rank,
+ uint8_t i_symbol, bool i_x4EccSpare )
+{
+ int32_t o_rc = SUCCESS;
+
+/* TODO: Marc is creating a new interface.
+ errlHndl_t errl = NULL;
+
+ PRD_FAPI_TO_ERRL( errl, TODO,
+ fapi::Target(fapi::TARGET_TYPE_MBA_CHIPLET, i_mbaTarget),
+ i_rank, i_symbol, i_x4EccSpare );
+
+ if ( NULL != errl )
+ {
+ PRDF_ERR( "[PlatServices::mssSetSteerMux] TODO() "
+ "failed. HUID: 0x%08x rank: %d symbol: %d eccSpare: %c",
+ getHuid(i_mbaTarget), i_rank, i_symbol,
+ i_x4EccSpare ? 'T' : 'F' );
+ PRDF_COMMIT_ERRL( errl, ERRL_ACTION_REPORT );
+ o_rc = FAIL;
+ }
+*/
+
+ return o_rc;
+
+}
+
+//------------------------------------------------------------------------------
+
+/* TODO - Get the memory buffer raw card type (i.e. R/C A). This is needed for
+ the DRAM site locations for buffered DIMMs. Should be able to get this
+ from an attribute but doesn't look like this is available yet.
+getMembufRawCardType()
+{
+}
+*/
+
+//------------------------------------------------------------------------------
+
+/* TODO - Get the type of the card a DIMM is plugged into. This is needed for
+ the DRAM site locations for IS DIMMs. Should be able to get this from
+ an attribute but doesn't look like this is available yet.
+getDimmPlugCardType()
+{
+}
+*/
+
+} // end namespace PlatServices
+
+} // end namespace PRDF
+
OpenPOWER on IntegriCloud