summaryrefslogtreecommitdiffstats
path: root/src/sbefw
diff options
context:
space:
mode:
authorspashabk-in <shakeebbk@in.ibm.com>2016-11-08 05:43:34 -0600
committerAMIT J. TENDOLKAR <amit.tendolkar@in.ibm.com>2016-12-02 04:28:08 -0500
commit2dc7ab8f6d79749396dc913088e21fff6fc1822e (patch)
tree11b18eaa6b5648cd1c3d007c7aa0ce6cc73ec9fd /src/sbefw
parent7e9ef2247c142869c58d7fe3ffac8a0bb1cdb12f (diff)
downloadtalos-sbe-2dc7ab8f6d79749396dc913088e21fff6fc1822e.tar.gz
talos-sbe-2dc7ab8f6d79749396dc913088e21fff6fc1822e.zip
SBE tracearray chip-op
Change-Id: Ic01d96424c2459c56d4cb7578cf87f592b748466 RTC:128332 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/32359 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com> Reviewed-by: RAJA DAS <rajadas2@in.ibm.com> Reviewed-by: AMIT J. TENDOLKAR <amit.tendolkar@in.ibm.com>
Diffstat (limited to 'src/sbefw')
-rw-r--r--src/sbefw/sbe_sp_intf.H13
-rw-r--r--src/sbefw/sbecmdparser.C22
-rw-r--r--src/sbefw/sbecmdtracearray.C91
-rw-r--r--src/sbefw/sbecmdtracearray.H55
-rw-r--r--src/sbefw/sbefwfiles.mk1
5 files changed, 178 insertions, 4 deletions
diff --git a/src/sbefw/sbe_sp_intf.H b/src/sbefw/sbe_sp_intf.H
index f3563f7a..348d50ba 100644
--- a/src/sbefw/sbe_sp_intf.H
+++ b/src/sbefw/sbe_sp_intf.H
@@ -137,8 +137,7 @@ enum sbeRegisterAccessCommands
enum sbeArrayAccessCommands
{
SBE_CMD_GET_FAST_ARRAY = 0x01, /* Get Fast Array */
- SBE_CMD_GET_TRACE_ARRAY = 0x02, /* Get Trace Array */
- SBE_CMD_CONTROL_TRACE_ARRAY = 0x03, /* Control Trace Array */
+ SBE_CMD_CONTROL_TRACE_ARRAY = 0x02, /* Control Trace Array */
};
/**
@@ -268,8 +267,7 @@ enum
GET_REGISTER_SUPPPORTED = 0xA5000001,
PUT_REGISTER_SUPPPORTED = 0xA5000002,
READ_FAST_ARRAY_SUPPPORTED = 0xA6000001,
- READ_TRACE_ARRAY_SUPPPORTED = 0xA6000002,
- COLLECT_TRACE_ARRAY_SUPPPORTED = 0xA6000004,
+ CONTROL_TRACE_ARRAY_SUPPPORTED = 0xA6000002,
CONTROL_INSTRUCTIONS_SUPPPORTED = 0xA7000001,
GET_SBE_FFDC_SUPPPORTED = 0xA8000001,
GET_SBE_CAPABILITIES_SUPPPORTED = 0xA8000002,
@@ -414,6 +412,13 @@ typedef enum
/// to all hold types
} sbeRingAccessModes_t;
+// Trace array chip-op operation bitmaps
+static const uint16_t SBE_TA_RESET = 0x0001;
+static const uint16_t SBE_TA_RESTART = 0x0002;
+static const uint16_t SBE_TA_STOP = 0x0004;
+static const uint16_t SBE_TA_COLLECT_DUMP = 0x0008;
+static const uint16_t SBE_TA_IGNORE_MUX_SETTING = 0x0010;
+
#ifdef __cplusplus
}
#endif
diff --git a/src/sbefw/sbecmdparser.C b/src/sbefw/sbecmdparser.C
index e5a3bd7f..4457321e 100644
--- a/src/sbefw/sbecmdparser.C
+++ b/src/sbefw/sbecmdparser.C
@@ -47,6 +47,7 @@
#include "sbestates.H"
#include "sberegaccess.H"
#include "sbecmdmpipl.H"
+#include "sbecmdtracearray.H"
// Declaration
static const uint16_t HARDWARE_FENCED_STATE =
@@ -217,6 +218,21 @@ static sbeCmdStruct_t g_sbeRingAccessCmdArray [] =
},
};
+// @brief g_sbeArrayAccessCmdArray[]
+//
+////////////////////////////////////////////////////////////////
+static sbeCmdStruct_t g_sbeArrayAccessCmdArray[] =
+{
+ {NULL,
+ SBE_CMD_GET_FAST_ARRAY,
+ SBE_FENCE_AT_QUIESCE,
+ },
+ {sbeControlTraceArray,
+ SBE_CMD_CONTROL_TRACE_ARRAY,
+ SBE_FENCE_AT_QUIESCE,
+ },
+};
+
//////////////////////////////////////////////////////////////
// @brief g_sbeCoreStateControlCmdArray
//
@@ -320,6 +336,12 @@ uint8_t sbeGetCmdStructAttr (const uint8_t i_cmdClass,
*o_ppCmd = (sbeCmdStruct_t*)g_sbeMpiplCmdArray;
break;
+ case SBE_CMD_CLASS_ARRAY_ACCESS:
+ l_numCmds = sizeof(g_sbeArrayAccessCmdArray) /
+ sizeof(sbeCmdStruct_t);
+ *o_ppCmd = (sbeCmdStruct_t*)g_sbeArrayAccessCmdArray;
+ break;
+
// PSU Commands
case SBE_PSU_CMD_CLASS_CORE_STATE:
l_numCmds = sizeof(g_sbeCoreStateControlCmdArray) /
diff --git a/src/sbefw/sbecmdtracearray.C b/src/sbefw/sbecmdtracearray.C
new file mode 100644
index 00000000..e65b7e9a
--- /dev/null
+++ b/src/sbefw/sbecmdtracearray.C
@@ -0,0 +1,91 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/sbefw/sbecmdtracearray.C $ */
+/* */
+/* OpenPOWER sbe 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: ppe/sbe/sbefw/sbecmdtracearray.C
+ *
+ * @brief This file contains the SBE Control Tracearray chipOp
+ *
+ */
+#include "sbecmdtracearray.H"
+#include "sbefifo.H"
+#include "sbe_sp_intf.H"
+#include "sbetrace.H"
+#include "sbeFifoMsgUtils.H"
+#include "sbeutil.H"
+#include "fapi2.H"
+
+using namespace fapi2;
+
+static const uint32_t SIZE_OF_LENGTH_INWORDS = 1;
+
+uint32_t sbeControlTraceArray(uint8_t *i_pArg)
+{
+ #define SBE_FUNC " sbeControlTraceArray"
+ SBE_ENTER(SBE_FUNC);
+ uint32_t l_rc = SBE_SEC_OPERATION_SUCCESSFUL;
+
+ sbeControlTraceArrayCMD_t l_req = {};
+ sbeRespGenHdr_t respHdr;
+ respHdr.init();
+ sbeResponseFfdc_t l_ffdc;
+ ReturnCode l_fapiRc;
+ uint32_t l_NumWordsRead = 0;
+ uint32_t l_len = 0;
+
+ do
+ {
+ l_len = sizeof(sbeControlTraceArrayCMD_t)/sizeof(uint32_t);
+ l_rc = sbeUpFifoDeq_mult (l_len, (uint32_t *)&l_req); //EOT fetch
+
+ // If FIFO access failure
+ CHECK_SBE_RC_AND_BREAK_IF_NOT_SUCCESS(l_rc);
+
+ SBE_INFO(SBE_FUNC" targetType [0x%04X] chipletId [0x%02X]"
+ " traceArrayId [0x%04X] operation [0x%04X]",
+ l_req.targetType,
+ l_req.chipletId,
+ l_req.traceArrayId,
+ l_req.operation);
+
+ // Call trace array HWP in a loop
+
+ } while(false);
+
+ // Now build and enqueue response into downstream FIFO
+ // If there was a FIFO error, will skip sending the response,
+ // instead give the control back to the command processor thread
+ if ( SBE_SEC_OPERATION_SUCCESSFUL == l_rc )
+ {
+ l_len = SIZE_OF_LENGTH_INWORDS;
+ l_rc = sbeDownFifoEnq_mult (l_len, &(l_NumWordsRead));
+ if(SBE_SEC_OPERATION_SUCCESSFUL == l_rc)
+ {
+ l_rc = sbeDsSendRespHdr( respHdr, &l_ffdc);
+ }
+ }
+ SBE_EXIT(SBE_FUNC);
+ return l_rc;
+ #undef SBE_FUNC
+}
diff --git a/src/sbefw/sbecmdtracearray.H b/src/sbefw/sbecmdtracearray.H
new file mode 100644
index 00000000..ade451a4
--- /dev/null
+++ b/src/sbefw/sbecmdtracearray.H
@@ -0,0 +1,55 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/sbefw/sbecmdtracearray.H $ */
+/* */
+/* OpenPOWER sbe 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: ppe/sbe/sbefw/sbecmdtracearray.H
+ *
+ * @brief This file contains the Interfaces for the Tracearray Control chip-op
+ *
+ */
+
+#ifndef __SBEFW_SBECMDTRACEARRAY_H
+#define __SBEFW_SBECMDTRACEARRAY_H
+
+#include <stdint.h>
+
+typedef struct
+{
+ uint32_t targetType:16;
+ uint32_t reserved:8;
+ uint32_t chipletId:8;
+ uint32_t traceArrayId:16;
+ uint32_t operation:16;
+} sbeControlTraceArrayCMD_t;
+
+/**
+ * @brief Control Trace Array Command (0xA602)
+ *
+ * @param[in] i_pArg Buffer to be passed to the function (not used as of now)
+ *
+ * @return RC from the FIFO access utility
+ */
+uint32_t sbeControlTraceArray(uint8_t *i_pArg);
+
+#endif //__SBEFW_SBECMDTRACEARRAY_H
diff --git a/src/sbefw/sbefwfiles.mk b/src/sbefw/sbefwfiles.mk
index 28e484b2..3e44a5af 100644
--- a/src/sbefw/sbefwfiles.mk
+++ b/src/sbefw/sbefwfiles.mk
@@ -45,6 +45,7 @@ SBEFW-CPP-SOURCES += sbescom.C
SBEFW-CPP-SOURCES += sbecmdmpipl.C
SBEFW-CPP-SOURCES += sbefapiutil.C
SBEFW-CPP-SOURCES += sbeutil.C
+SBEFW-CPP-SOURCES += sbecmdtracearray.C
SBEFW-C-SOURCES =
SBEFW-S-SOURCES =
OpenPOWER on IntegriCloud