summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
Diffstat (limited to 'src/usr')
-rw-r--r--src/usr/hwpf/fapi/fapiHwAccess.C286
-rw-r--r--src/usr/hwpf/fapi/makefile7
-rw-r--r--src/usr/hwpf/plat/fapiPlatHwAccess.C95
3 files changed, 335 insertions, 53 deletions
diff --git a/src/usr/hwpf/fapi/fapiHwAccess.C b/src/usr/hwpf/fapi/fapiHwAccess.C
index adeec19dc..5d43bfda2 100644
--- a/src/usr/hwpf/fapi/fapiHwAccess.C
+++ b/src/usr/hwpf/fapi/fapiHwAccess.C
@@ -1,25 +1,26 @@
-// IBM_PROLOG_BEGIN_TAG
-// This is an automatically generated prolog.
-//
-// $Source: src/usr/hwpf/fapi/fapiHwAccess.C $
-//
-// IBM CONFIDENTIAL
-//
-// COPYRIGHT International Business Machines Corp. 2011
-//
-// 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 other-
-// wise divested of its trade secrets, irrespective of what has
-// been deposited with the U.S. Copyright Office.
-//
-// Origin: 30
-//
-// IBM_PROLOG_END
+/* IBM_PROLOG_BEGIN_TAG
+ * This is an automatically generated prolog.
+ *
+ * $Source: src/usr/hwpf/fapi/fapiHwAccess.C $
+ *
+ * IBM CONFIDENTIAL
+ *
+ * COPYRIGHT International Business Machines Corp. 2011-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 other-
+ * wise divested of its trade secrets, irrespective of what has
+ * been deposited with the U.S. Copyright Office.
+ *
+ * Origin: 30
+ *
+ * IBM_PROLOG_END_TAG
+ */
/**
* @file fapiHwAccess.C
*
@@ -40,6 +41,7 @@
* mjjones 10/13/2011 util namespace change
* mjjones 02/21/2012 Use high performance Target
* toEcmdString
+ * 836579 thi May 18,2012 Spy/ring supports
*/
#include <fapi.H>
@@ -56,7 +58,7 @@ fapi::ReturnCode fapiGetScom(const fapi::Target& i_target,
ecmdDataBufferBase & o_data)
{
fapi::ReturnCode l_rc;
- bool l_traceit = platIsScanTraceEnabled();
+ bool l_traceit = platIsScanTraceEnabled();
// call the platform implementation
l_rc = platGetScom( i_target, i_address, o_data );
@@ -71,7 +73,7 @@ fapi::ReturnCode fapiGetScom(const fapi::Target& i_target,
FAPI_SCAN( "TRACE : GETSCOM : %s : %.16llX %.16llX",
i_target.toEcmdString(),
i_address,
- o_data.getDoubleWord( 0 ) );
+ o_data.getDoubleWord( 0 ) );
}
return l_rc;
@@ -86,7 +88,7 @@ fapi::ReturnCode fapiPutScom(const fapi::Target& i_target,
ecmdDataBufferBase & i_data)
{
fapi::ReturnCode l_rc;
- bool l_traceit = platIsScanTraceEnabled();
+ bool l_traceit = platIsScanTraceEnabled();
// call the platform implementation
l_rc = platPutScom( i_target, i_address, i_data );
@@ -116,7 +118,7 @@ fapi::ReturnCode fapiPutScomUnderMask(const fapi::Target& i_target,
ecmdDataBufferBase & i_mask)
{
fapi::ReturnCode l_rc;
- bool l_traceit = platIsScanTraceEnabled();
+ bool l_traceit = platIsScanTraceEnabled();
// call the platform implementation
l_rc = platPutScomUnderMask( i_target, i_address, i_data, i_mask );
@@ -175,7 +177,7 @@ fapi::ReturnCode fapiPutCfamRegister(const fapi::Target& i_target,
ecmdDataBufferBase & i_data)
{
fapi::ReturnCode l_rc;
- bool l_traceit = platIsScanTraceEnabled();
+ bool l_traceit = platIsScanTraceEnabled();
// call the platform implementation
l_rc = platPutCfamRegister( i_target, i_address, i_data );
@@ -205,7 +207,7 @@ fapi::ReturnCode fapiModifyCfamRegister(const fapi::Target& i_target,
const fapi::ChipOpModifyMode i_modifyMode)
{
fapi::ReturnCode l_rc;
- bool l_traceit = platIsScanTraceEnabled();
+ bool l_traceit = platIsScanTraceEnabled();
// call the platform implementation
l_rc = platModifyCfamRegister( i_target, i_address, i_data, i_modifyMode );
@@ -247,4 +249,232 @@ fapi::ReturnCode fapiModifyCfamRegister(const fapi::Target& i_target,
return l_rc;
}
+////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////
+fapi::ReturnCode fapiGetRing(const fapi::Target& i_target,
+ const uint32_t i_address,
+ ecmdDataBufferBase & o_data)
+{
+ fapi::ReturnCode l_rc;
+ bool l_traceit = platIsScanTraceEnabled();
+
+ // call the platform implementation
+ l_rc = platGetRing( i_target, i_address, o_data );
+
+ if (l_rc)
+ {
+ FAPI_ERR("fapiGetRing failed - Target %s, Addr 0x%.8X", i_target.toEcmdString(), i_address);
+ }
+
+ if( l_traceit )
+ {
+ FAPI_SCAN( "TRACE : GETRING : %s : %.8X %.16llX",
+ i_target.toEcmdString(),
+ i_address,
+ o_data.getDoubleWord( 0 ) );
+ }
+
+ return l_rc;
+}
+
+////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////
+fapi::ReturnCode fapiPutRing(const fapi::Target& i_target,
+ const uint32_t i_address,
+ ecmdDataBufferBase & i_data)
+{
+ fapi::ReturnCode l_rc;
+ bool l_traceit = platIsScanTraceEnabled();
+
+ // call the platform implementation
+ l_rc = platPutRing( i_target, i_address, i_data );
+
+ if (l_rc)
+ {
+ FAPI_ERR("fapiPutRing failed - Target %s, Addr 0x%.8X", i_target.toEcmdString(), i_address);
+ }
+
+ if( l_traceit )
+ {
+ FAPI_SCAN( "TRACE : PUTRING : %s : %.8X %.16llX",
+ i_target.toEcmdString(),
+ i_address,
+ i_data.getDoubleWord(0));
+ }
+
+ return l_rc;
+}
+
+////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////
+fapi::ReturnCode fapiModifyRing(const fapi::Target& i_target,
+ const uint32_t i_address,
+ ecmdDataBufferBase & i_data,
+ const fapi::ChipOpModifyMode i_modifyMode)
+{
+ fapi::ReturnCode l_rc;
+ bool l_traceit = platIsScanTraceEnabled();
+
+ // call the platform implementation
+ l_rc = platModifyRing( i_target, i_address, i_data, i_modifyMode );
+
+ if (l_rc)
+ {
+ FAPI_ERR("platModifyRing failed - Target %s, Addr 0x%.8X, ModifyMode 0x%.8X",
+ i_target.toEcmdString(), i_address, i_modifyMode);
+ }
+
+ if( l_traceit )
+ {
+ // get string representation of the modify mode
+ const char * l_pMode = NULL;
+
+ if (i_modifyMode == fapi::CHIP_OP_MODIFY_MODE_OR)
+ {
+ l_pMode = "OR";
+ }
+ else if (i_modifyMode == fapi::CHIP_OP_MODIFY_MODE_AND)
+ {
+ l_pMode = "AND";
+ }
+ else if (i_modifyMode == fapi::CHIP_OP_MODIFY_MODE_XOR)
+ {
+ l_pMode = "XOR";
+ }
+ else
+ {
+ l_pMode = "?";
+ }
+
+ FAPI_SCAN( "TRACE : MODRING : %s : %.8X %.16llX %s",
+ i_target.toEcmdString(),
+ i_address,
+ i_data.getDoubleWord(0),
+ l_pMode);
+ }
+
+ return l_rc;
+}
+
+// --------------------------------------------------------------------------
+// NOTE:
+// These spy access interfaces are only used in FSP.
+// HB does not allow spy access
+
+#ifndef _NO_SPY_ACCESS
+////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////
+fapi::ReturnCode fapiGetSpy(const fapi::Target& i_target,
+ const uint32_t i_spyId,
+ ecmdDataBufferBase & o_data)
+{
+ fapi::ReturnCode l_rc;
+ bool l_traceit = platIsScanTraceEnabled();
+
+ // call the platform implementation
+ l_rc = platGetSpy( i_target, i_spyId, o_data );
+
+ if (l_rc)
+ {
+ FAPI_ERR("fapiGetSpy failed - Target %s, SpyId 0x%.8X", i_target.toEcmdString(), i_spyId);
+ }
+
+ if( l_traceit )
+ {
+ FAPI_SCAN( "TRACE : GETSPY : %s : %.8X %.16llX",
+ i_target.toEcmdString(),
+ i_spyId,
+ o_data.getDoubleWord(0));
+ }
+
+ return l_rc;
+}
+
+////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////
+fapi::ReturnCode fapiPutSpy(const fapi::Target& i_target,
+ const uint32_t i_spyId,
+ ecmdDataBufferBase & i_data)
+{
+ fapi::ReturnCode l_rc;
+ bool l_traceit = platIsScanTraceEnabled();
+
+ // call the platform implementation
+ l_rc = platPutSpy( i_target, i_spyId, i_data );
+
+ if (l_rc)
+ {
+ FAPI_ERR("fapiPutSpy failed - Target %s, SpyId 0x%.8X", i_target.toEcmdString(), i_spyId);
+ }
+
+ if( l_traceit )
+ {
+ FAPI_SCAN( "TRACE : PUTSPY : %s : %.8X %.16llX",
+ i_target.toEcmdString(),
+ i_spyId,
+ i_data.getDoubleWord(0));
+ }
+
+ return l_rc;
+}
+
+////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////
+fapi::ReturnCode fapiGetSpyEnum(const fapi::Target& i_target,
+ const uint32_t i_spyId,
+ uint32_t& o_enumVal)
+{
+ fapi::ReturnCode l_rc;
+ bool l_traceit = platIsScanTraceEnabled();
+
+ // call the platform implementation
+ l_rc = platGetSpyEnum( i_target, i_spyId, o_enumVal );
+
+ if (l_rc)
+ {
+ FAPI_ERR("fapiGetSpyEnum failed - Target %s, SpyId 0x%.8X", i_target.toEcmdString(), i_spyId);
+ }
+
+ if( l_traceit )
+ {
+ FAPI_SCAN( "TRACE : GETSPYENUM : %s : %.8X %.8X",
+ i_target.toEcmdString(),
+ i_spyId,
+ o_enumVal);
+ }
+
+ return l_rc;
+}
+
+////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////
+fapi::ReturnCode fapiPutSpyEnum(const fapi::Target& i_target,
+ const uint32_t i_spyId,
+ const uint32_t i_enumVal)
+{
+ fapi::ReturnCode l_rc;
+ bool l_traceit = platIsScanTraceEnabled();
+
+ // call the platform implementation
+ l_rc = platPutSpyEnum( i_target, i_spyId, i_enumVal );
+
+ if (l_rc)
+ {
+ FAPI_ERR("fapiPutSpyEnum failed - Target %s, SpyId 0x%.8X, EnumVal %d",
+ i_target.toEcmdString(), i_spyId, i_enumVal);
+ }
+
+ if( l_traceit )
+ {
+ FAPI_SCAN( "TRACE : PUTSPYENUM : %s : %.8X %.8X",
+ i_target.toEcmdString(),
+ i_spyId,
+ i_enumVal);
+ }
+
+ return l_rc;
+}
+
+#endif
+
} // extern "C"
diff --git a/src/usr/hwpf/fapi/makefile b/src/usr/hwpf/fapi/makefile
index 262a73ece..9df36f54c 100644
--- a/src/usr/hwpf/fapi/makefile
+++ b/src/usr/hwpf/fapi/makefile
@@ -1,11 +1,11 @@
-# IBM_PROLOG_BEGIN_TAG
+# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
# $Source: src/usr/hwpf/fapi/makefile $
#
# IBM CONFIDENTIAL
#
-# COPYRIGHT International Business Machines Corp. 2011
+# COPYRIGHT International Business Machines Corp. 2011-2012
#
# p1
#
@@ -19,7 +19,7 @@
#
# Origin: 30
#
-# IBM_PROLOG_END
+# IBM_PROLOG_END_TAG
ROOTPATH = ../../../..
MODULE = fapi
@@ -27,6 +27,7 @@ EXTRAINCDIR += ${ROOTPATH}/src/include/usr/ecmddatabuffer
EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/fapi
EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/plat
EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/hwp
+CUSTOMFLAGS += -D_NO_SPY_ACCESS=1
OBJS = fapiReturnCode.o \
fapiReturnCodeDataRef.o \
diff --git a/src/usr/hwpf/plat/fapiPlatHwAccess.C b/src/usr/hwpf/plat/fapiPlatHwAccess.C
index 1464ff906..ad3a02aef 100644
--- a/src/usr/hwpf/plat/fapiPlatHwAccess.C
+++ b/src/usr/hwpf/plat/fapiPlatHwAccess.C
@@ -1,25 +1,26 @@
-// IBM_PROLOG_BEGIN_TAG
-// This is an automatically generated prolog.
-//
-// $Source: src/usr/hwpf/plat/fapiPlatHwAccess.C $
-//
-// IBM CONFIDENTIAL
-//
-// COPYRIGHT International Business Machines Corp. 2011
-//
-// 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 other-
-// wise divested of its trade secrets, irrespective of what has
-// been deposited with the U.S. Copyright Office.
-//
-// Origin: 30
-//
-// IBM_PROLOG_END
+/* IBM_PROLOG_BEGIN_TAG
+ * This is an automatically generated prolog.
+ *
+ * $Source: src/usr/hwpf/plat/fapiPlatHwAccess.C $
+ *
+ * IBM CONFIDENTIAL
+ *
+ * COPYRIGHT International Business Machines Corp. 2011-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 other-
+ * wise divested of its trade secrets, irrespective of what has
+ * been deposited with the U.S. Copyright Office.
+ *
+ * Origin: 30
+ *
+ * IBM_PROLOG_END_TAG
+ */
// This is an automatically generated prolog.
//
// $Source: src/usr/hwpf/plat/fapiPlatHwAccess.C $
@@ -551,4 +552,54 @@ fapi::ReturnCode platModifyCfamRegister(const fapi::Target& i_target,
return l_rc;
}
+//******************************************************************************
+// platGetRing function, the platform implementation
+//******************************************************************************
+fapi::ReturnCode platGetRing(const fapi::Target& i_target,
+ const uint32_t i_address,
+ ecmdDataBufferBase & o_data)
+{
+ FAPI_DBG(ENTER_MRK "platGetRing");
+
+ fapi::ReturnCode l_rc;
+
+ //TODO - Implement getRing when RTC 34014 is ready
+
+ FAPI_DBG(EXIT_MRK "platGetRing");
+ return l_rc;
+}
+
+//******************************************************************************
+// platPutRing function
+//******************************************************************************
+fapi::ReturnCode platPutRing(const fapi::Target& i_target,
+ const uint32_t i_address,
+ ecmdDataBufferBase & i_data)
+{
+ FAPI_DBG(ENTER_MRK "platPutRing");
+ fapi::ReturnCode l_rc;
+
+ //TODO - Implement getRing when RTC 34014 is ready
+
+ FAPI_DBG(EXIT_MRK "platPutRing");
+ return l_rc;
+}
+
+//******************************************************************************
+// platModifyRing function
+//******************************************************************************
+fapi::ReturnCode platModifyRing(const fapi::Target& i_target,
+ const uint32_t i_address,
+ ecmdDataBufferBase & i_data,
+ const fapi::ChipOpModifyMode i_modifyMode)
+{
+ FAPI_DBG(ENTER_MRK "platModifyRing");
+ fapi::ReturnCode l_rc;
+
+ //TODO - Implement ModifyRing when RTC 34014 is ready
+
+ FAPI_DBG(EXIT_MRK "platModifyRing");
+ return l_rc;
+}
+
} // extern "C"
OpenPOWER on IntegriCloud