summaryrefslogtreecommitdiffstats
path: root/src/usr/xscom/runtime/rt_xscom.C
diff options
context:
space:
mode:
Diffstat (limited to 'src/usr/xscom/runtime/rt_xscom.C')
-rw-r--r--src/usr/xscom/runtime/rt_xscom.C101
1 files changed, 14 insertions, 87 deletions
diff --git a/src/usr/xscom/runtime/rt_xscom.C b/src/usr/xscom/runtime/rt_xscom.C
index 93e011864..cf7d40052 100644
--- a/src/usr/xscom/runtime/rt_xscom.C
+++ b/src/usr/xscom/runtime/rt_xscom.C
@@ -28,6 +28,7 @@
#include <errl/errlmanager.H>
#include <xscom/xscomreasoncodes.H>
#include "../xscom.H"
+#include <scom/scomif.H>
#include <scom/runtime/rt_scomif.H>
// Trace definition
@@ -42,7 +43,7 @@ DEVICE_REGISTER_ROUTE(DeviceFW::WILDCARD,
TARGETING::TYPE_PROC,
xscomPerformOp);
-// Direct all scom calls though this interface at runtime
+// Also direct fsi scom calls though this interface at runtime
DEVICE_REGISTER_ROUTE(DeviceFW::WILDCARD,
DeviceFW::FSISCOM,
TARGETING::TYPE_PROC,
@@ -53,86 +54,6 @@ DEVICE_REGISTER_ROUTE(DeviceFW::WILDCARD,
TARGETING::TYPE_MEMBUF,
xscomPerformOp);
-DEVICE_REGISTER_ROUTE(DeviceFW::WILDCARD,
- DeviceFW::IBSCOM,
- TARGETING::TYPE_MEMBUF,
- xscomPerformOp);
-
-/**
- * @brief Internal routine that verifies the validity of input parameters
- * for an XSCOM access.
- *
- * @param[in] i_opType Operation type, see DeviceFW::OperationType
- * in driverif.H
- * @param[in] i_target XSCom target
- * @param[in/out] i_buffer Read: Pointer to output data storage
- * Write: Pointer to input data storage
- * @param[in/out] i_buflen Input: size of io_buffer (in bytes)
- * Output:
- * Read: Size of output data
- * Write: Size of data written
- * @param[in] i_args This is an argument list for DD framework.
- * In this function, there's only one argument,
- * which is the MMIO XSCom address
- * @return errlHndl_t
- */
-errlHndl_t xscomOpSanityCheck(const DeviceFW::OperationType i_opType,
- const TARGETING::Target* i_target,
- const void* i_buffer,
- const size_t& i_buflen,
- const va_list i_args){
- errlHndl_t l_err = NULL;
-
- do
- {
- // Verify data buffer
- if ( (i_buflen < XSCOM_BUFFER_SIZE) ||
- (i_buffer == NULL) )
- {
- /*@
- * @errortype
- * @moduleid XSCOM_RT_SANITY_CHECK
- * @reasoncode XSCOM_INVALID_DATA_BUFFER
- * @userdata1 Buffer size
- * @userdata2 XSCom address
- * @devdesc XSCOM buffer size < 8 bytes or NULL data buff
- */
- l_err =
- new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE,
- XSCOM_RT_SANITY_CHECK,
- XSCOM_INVALID_DATA_BUFFER,
- i_buflen,
- va_arg(i_args,uint64_t));
- break;
- }
-
- // Verify OP type
- if ( (i_opType != DeviceFW::READ) &&
- (i_opType != DeviceFW::WRITE) )
- {
- /*@
- * @errortype
- * @moduleid XSCOM_RT_SANITY_CHECK
- * @reasoncode XSCOM_INVALID_OP_TYPE
- * @userdata1 Operation type
- * @userdata2 XSCom address
- * @devdesc XSCOM invalid operation type
- */
- l_err =
- new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE,
- XSCOM_RT_SANITY_CHECK,
- XSCOM_INVALID_OP_TYPE,
- i_opType,
- va_arg(i_args,uint64_t));
- break;
- }
-
-
- } while(0);
-
- return l_err;
-}
-
/**
* @brief Complete the xscom op
@@ -161,13 +82,19 @@ errlHndl_t xscomPerformOp(DeviceFW::OperationType i_opType,
errlHndl_t l_err = NULL;
uint64_t l_addr = va_arg(i_args,uint64_t);
- l_err = xscomOpSanityCheck(i_opType,
- i_target,
- io_buffer,
- io_buflen,
- i_args);
+ l_err = SCOM::scomOpSanityCheck(i_opType,
+ i_target,
+ io_buffer,
+ io_buflen,
+ l_addr,
+ XSCOM_BUFFER_SIZE);
- if (!l_err)
+ if (l_err)
+ {
+ // Trace here - sanity check does not know scom type
+ TRACFCOMP(g_trac_xscom,"Runtime XScom sanity check failed");
+ }
+ else
{
l_err = SCOM::sendScomToHyp(i_opType, i_target, l_addr, io_buffer);
}
OpenPOWER on IntegriCloud