summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorspashabk-in <shakeebbk@in.ibm.com>2017-01-19 07:49:37 -0600
committerAMIT J. TENDOLKAR <amit.tendolkar@in.ibm.com>2017-04-07 05:33:00 -0400
commit8dda0b4d0afedc71cf34c54183f58aba71720ad1 (patch)
tree61cf4a5ecd06eaa65c67075bc1b4ea31ca22807a /src
parentec98e51acf6b7626d321adbc1eb93f000bf1abeb (diff)
downloadtalos-sbe-8dda0b4d0afedc71cf34c54183f58aba71720ad1.tar.gz
talos-sbe-8dda0b4d0afedc71cf34c54183f58aba71720ad1.zip
Set FFDC Chip-op
Change-Id: Ie0514aef2ea17bbc56096c7990d2b577f531c0ed Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/35090 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: RAJA DAS <rajadas2@in.ibm.com> Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com> Reviewed-by: AMIT J. TENDOLKAR <amit.tendolkar@in.ibm.com>
Diffstat (limited to 'src')
-rw-r--r--src/sbefw/sbeHostMsg.H31
-rw-r--r--src/sbefw/sbe_host_intf.H1
-rw-r--r--src/sbefw/sbecmdgeneric.C45
-rw-r--r--src/sbefw/sbecmdgeneric.H11
-rw-r--r--src/sbefw/sbecmdparser.C5
-rw-r--r--src/sbefw/sbeglobals.H5
-rwxr-xr-xsrc/test/testcases/test.xml1
-rw-r--r--src/test/testcases/testPSUSetFFDCAddr.py112
-rwxr-xr-xsrc/test/testcases/testPSUSetFFDCAddr.xml30
9 files changed, 240 insertions, 1 deletions
diff --git a/src/sbefw/sbeHostMsg.H b/src/sbefw/sbeHostMsg.H
index 8fa6fe2c..34d555e6 100644
--- a/src/sbefw/sbeHostMsg.H
+++ b/src/sbefw/sbeHostMsg.H
@@ -68,6 +68,37 @@ typedef struct
}
} sbePsu2SbeCmdReqHdr_t;
+/* @brief Address and size of memory allocated by Host
+ * for FFDC/pass through commands
+ */
+typedef struct
+{
+ uint32_t size;
+ uint64_t addr;
+} sbeHostAddr_t;
+
+/* @brief Set FFDC Address message
+ */
+typedef struct
+{
+ uint64_t ffdcDataSize:32;
+ uint64_t passCmdDataSize:32;
+ uint64_t ffdcAddr;
+ uint64_t passCmdDataAddr;
+
+ void getFFDCAddr(sbeHostAddr_t &i_hostFFDCAddr)
+ {
+ i_hostFFDCAddr.size = ffdcDataSize;
+ i_hostFFDCAddr.addr = ffdcAddr;
+ }
+
+ void getPassThroughCmdAddr(sbeHostAddr_t &i_hostPassCmdAddr)
+ {
+ i_hostPassCmdAddr.size = passCmdDataSize;
+ i_hostPassCmdAddr.addr = passCmdDataAddr;
+ }
+} sbeSetFFDCAddrReq_t;
+
/*****************************************************************/
/* SBE->PSU response structures */
/*****************************************************************/
diff --git a/src/sbefw/sbe_host_intf.H b/src/sbefw/sbe_host_intf.H
index 57d679bb..18112d04 100644
--- a/src/sbefw/sbe_host_intf.H
+++ b/src/sbefw/sbe_host_intf.H
@@ -87,6 +87,7 @@ enum sbePsuRingAccessMessages
*/
enum sbePsuGenericMessages
{
+ SBE_PSU_GENERIC_MSG_SET_FFDC_ADDR = 0x04,
SBE_PSU_GENERIC_MSG_QUIESCE = 0x05,
SBE_PSU_GENERIC_MSG_SYSTEM_FABRIC_MAP = 0x06,
SBE_PSU_GENERIC_MSG_UNKNOWN = 0xFF,
diff --git a/src/sbefw/sbecmdgeneric.C b/src/sbefw/sbecmdgeneric.C
index 8d9b324c..78bd5f23 100644
--- a/src/sbefw/sbecmdgeneric.C
+++ b/src/sbefw/sbecmdgeneric.C
@@ -260,6 +260,51 @@ uint32_t sbeFifoQuiesce( uint8_t *i_pArg )
#undef SBE_FUNC
}
+//---------------------------------------------------------------------------
+uint32_t sbeSetFFDCAddr(uint8_t *i_pArg)
+{
+#define SBE_FUNC "sbeSetFFDCAddr"
+ SBE_ENTER(SBE_FUNC);
+ uint32_t rc = SBE_SEC_OPERATION_SUCCESSFUL;
+ uint32_t l_fapiRc = FAPI2_RC_SUCCESS;
+ sbeSetFFDCAddrReq_t l_req = {};
+
+ do
+ {
+ // Extract the request
+ // and send Ack to Host via SBE_SBE2PSU_DOORBELL_SET_BIT1
+ rc = sbeReadPsu2SbeMbxReg(SBE_HOST_PSU_MBOX_REG1,
+ (sizeof(l_req)/sizeof(uint64_t)),
+ (uint64_t*)&l_req,
+ true);
+ if(SBE_SEC_OPERATION_SUCCESSFUL != rc)
+ {
+ SBE_ERROR(SBE_FUNC "Failed to extract SBE_HOST_PSU_MBOX_REG1 and "
+ "SBE_HOST_PSU_MBOX_REG2");
+ break;
+ }
+
+ l_req.getFFDCAddr(SBE_GLOBAL->hostFFDCAddr);
+ l_req.getPassThroughCmdAddr(SBE_GLOBAL->hostPassThroughCmdAddr);
+
+ SBE_INFO(SBE_FUNC" Global hostFFDCAddr size[0x%08X] Address[0x%08X%08X]",
+ static_cast<uint32_t>(SBE_GLOBAL->hostFFDCAddr.size),
+ static_cast<uint32_t>(SBE::higher32BWord(SBE_GLOBAL->hostFFDCAddr.addr)),
+ static_cast<uint32_t>(SBE::lower32BWord(SBE_GLOBAL->hostFFDCAddr.addr)));
+ SBE_INFO(SBE_FUNC" Global hostPassCmdAddr size[0x%08X] Address[0x%08X%08X]",
+ static_cast<uint32_t>(SBE_GLOBAL->hostPassThroughCmdAddr.size),
+ static_cast<uint32_t>(SBE::higher32BWord(SBE_GLOBAL->hostPassThroughCmdAddr.addr)),
+ static_cast<uint32_t>(SBE::lower32BWord(SBE_GLOBAL->hostPassThroughCmdAddr.addr)));
+
+ } while(false);
+ // Send the response
+ sbePSUSendResponse(SBE_GLOBAL->sbeSbe2PsuRespHdr, l_fapiRc, rc);
+
+ return rc;
+ SBE_EXIT(SBE_FUNC);
+#undef SBE_FUNC
+}
+
//----------------------------------------------------------------------------
uint32_t sbePsuQuiesce( uint8_t *i_pArg )
{
diff --git a/src/sbefw/sbecmdgeneric.H b/src/sbefw/sbecmdgeneric.H
index beaffbac..63f7d104 100644
--- a/src/sbefw/sbecmdgeneric.H
+++ b/src/sbefw/sbecmdgeneric.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016 */
+/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -62,6 +62,15 @@ uint32_t sbeGetCapabilities(uint8_t *i_pArg);
uint32_t sbeFifoQuiesce(uint8_t *i_pArg);
/**
+ * @brief SBE Psu Set FFDC Address(0xD704)
+ *
+ * @param[in] i_pArg Buffer to be passed to the function (not used as of now)
+ *
+ * @return Rc from the Psu access utility
+ */
+uint32_t sbeSetFFDCAddr(uint8_t *i_pArg);
+
+/**
* @brief SBE Psu Quiesce (0xD705)
*
* @param[in] i_pArg Buffer to be passed to the function (not used as of now)
diff --git a/src/sbefw/sbecmdparser.C b/src/sbefw/sbecmdparser.C
index e95f39ad..0fdc93f0 100644
--- a/src/sbefw/sbecmdparser.C
+++ b/src/sbefw/sbecmdparser.C
@@ -280,6 +280,11 @@ static sbeCmdStruct_t g_sbePutRingFromImageCmdArray [] =
//////////////////////////////////////////////////////////////
static sbeCmdStruct_t g_sbePsuGenericCmdArray[] =
{
+ {sbeSetFFDCAddr,
+ SBE_PSU_GENERIC_MSG_SET_FFDC_ADDR,
+ SBE_NO_FENCE,
+ },
+
{sbePsuQuiesce,
SBE_PSU_GENERIC_MSG_QUIESCE,
SBE_NO_FENCE,
diff --git a/src/sbefw/sbeglobals.H b/src/sbefw/sbeglobals.H
index 26f89391..8a958aca 100644
--- a/src/sbefw/sbeglobals.H
+++ b/src/sbefw/sbeglobals.H
@@ -68,6 +68,11 @@ class SBEGlobalsSingleton
sbeRole SBERole;
// SBE Frequency. Initially nest frequency is 133 MHZ
uint32_t sbefreq;
+ // Host specified memory allocations
+ // passthrough command address
+ sbeHostAddr_t hostPassThroughCmdAddr;
+ // ffdc address
+ sbeHostAddr_t hostFFDCAddr;
////////////////////////////////////////////////////////////////
//// @brief Stacks for Non-critical Interrupts and Threads
diff --git a/src/test/testcases/test.xml b/src/test/testcases/test.xml
index 37359528..ccd03050 100755
--- a/src/test/testcases/test.xml
+++ b/src/test/testcases/test.xml
@@ -39,6 +39,7 @@
<include>../simics/targets/p9_nimbus/sbeTest/testRegAccess.xml</include>
<include>../simics/targets/p9_nimbus/sbeTest/testFifoReset.xml</include>
<include>../simics/targets/p9_nimbus/sbeTest/testAduMem.xml</include>
+ <include>../simics/targets/p9_nimbus/sbeTest/testPSUSetFFDCAddr.xml</include>
<include>../simics/targets/p9_nimbus/sbeTest/testSystemFabricMap.xml</include>
<include>../simics/targets/p9_nimbus/sbeTest/testExecutorCntrlTimer.xml</include>
<include>../simics/targets/p9_nimbus/sbeTest/testArrayAccess.xml</include>
diff --git a/src/test/testcases/testPSUSetFFDCAddr.py b/src/test/testcases/testPSUSetFFDCAddr.py
new file mode 100644
index 00000000..5e0a3bc4
--- /dev/null
+++ b/src/test/testcases/testPSUSetFFDCAddr.py
@@ -0,0 +1,112 @@
+#!/usr/bin/python
+# IBM_PROLOG_BEGIN_TAG
+# This is an automatically generated prolog.
+#
+# $Source: src/test/testcases/testPSUSetFFDCAddr.py $
+#
+# OpenPOWER sbe Project
+#
+# Contributors Listed Below - COPYRIGHT 2016,2017
+#
+#
+# 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
+import testPSUUtil
+import testRegistry as reg
+import testUtil
+
+#-------------------------------
+# This is a Test Expected Data
+#-------------------------------
+'''
+This data are the values or strings that needs to be validated for the test.
+'''
+'''
+#------------------------------------------------------------------------------------------------------------------------------
+# SBE side test data -
+#------------------------------------------------------------------------------------------------------------------------------
+'''
+sbe_test_data = (
+ #-----------------------------------------------------------------------------------------------------
+ # OP Reg ValueToWrite size Test Expected Data Description
+ #-----------------------------------------------------------------------------------------------------
+ # FFDC Size, Pass CMD Size
+ ["write", reg.REG_MBOX0, "0000010000F0D704", 8, "None", "Writing to MBOX0 address"],
+ # FFDC Size, Pass CMD Size
+ ["write", reg.REG_MBOX1, "0000000100000001", 8, "None", "Writing to MBOX1 address"],
+ # FFDC Addr
+ ["write", reg.REG_MBOX2, "1234567898765432", 8, "None", "Writing to MBOX2 address"],
+ # Pass Cmd Addr
+ ["write", reg.REG_MBOX3, "9876543212345678", 8, "None", "Writing to MBOX3 address"],
+ ["write", reg.PSU_SBE_DOORBELL_REG_WO_OR, "8000000000000000", 8, "None", "Update SBE Doorbell register to interrupt SBE"],
+ )
+'''
+#---------------------
+# Host side test data - SUCCESS
+#---------------------
+'''
+host_test_data_success = (
+ #----------------------------------------------------------------------------------------------------------------
+ # OP Reg ValueToWrite size Test Expected Data Description
+ #----------------------------------------------------------------------------------------------------------------
+ ["read", reg.REG_MBOX4, "0", 8, "0000000000F0D704", "Reading Host MBOX4 data to Validate"],
+ )
+
+'''
+#-----------------------------------------------------------------------
+# Do not modify - Used to simulate interrupt on Ringing Doorbell on Host
+#-----------------------------------------------------------------------
+'''
+host_polling_data = (
+ #----------------------------------------------------------------------------------------------------------------
+ # OP Reg ValueToWrite size Test Expected Data Description
+ #----------------------------------------------------------------------------------------------------------------
+ ["read", reg.PSU_HOST_DOORBELL_REG_WO_OR, "0", 8, "8000000000000000", "Reading Host Doorbell for Interrupt"],
+ )
+
+#-------------------------
+# Main Function
+#-------------------------
+def main():
+ # Run Simics initially
+ testUtil.runCycles( 10000000 );
+
+ # Intialize the class obj instances
+ regObj = testPSUUtil.registry() # Registry obj def for operation
+
+ print "\n Execute SBE Test - Set FFDC Address\n"
+
+ '''
+ Test Case 1
+ '''
+ # HOST->SBE data set execution
+ regObj.ExecuteTestOp( testPSUUtil.simSbeObj, sbe_test_data )
+
+ print "\n Poll on Host side for INTR ...\n"
+ #Poll on HOST DoorBell Register for interrupt
+ regObj.pollingOn( testPSUUtil.simSbeObj, host_polling_data, 5 )
+
+ #SBE->HOST data set execution
+ regObj.ExecuteTestOp( testPSUUtil.simSbeObj, host_test_data_success )
+
+if __name__ == "__main__":
+ main()
+ if err:
+ print ( "\nTest Suite completed with error(s)" )
+ #sys.exit(1)
+ else:
+ print ( "\nTest Suite completed with no errors" )
+ #sys.exit(0);
+
+
diff --git a/src/test/testcases/testPSUSetFFDCAddr.xml b/src/test/testcases/testPSUSetFFDCAddr.xml
new file mode 100755
index 00000000..6a5abe49
--- /dev/null
+++ b/src/test/testcases/testPSUSetFFDCAddr.xml
@@ -0,0 +1,30 @@
+<!-- IBM_PROLOG_BEGIN_TAG -->
+<!-- This is an automatically generated prolog. -->
+<!-- -->
+<!-- $Source: src/test/testcases/testPSUSetFFDCAddr.xml $ -->
+<!-- -->
+<!-- OpenPOWER sbe Project -->
+<!-- -->
+<!-- Contributors Listed Below - COPYRIGHT 2016,2017 -->
+<!-- -->
+<!-- -->
+<!-- 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 -->
+<?xml version="1.0" encoding="UTF-8"?>
+
+ <testcase>
+ <simcmd>run-python-file targets/p9_nimbus/sbeTest/testPSUSetFFDCAddr.py</simcmd>
+ <exitonerror>yes</exitonerror>
+ </testcase>
+
OpenPOWER on IntegriCloud