summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSunil Kumar <skumar8j@in.ibm.com>2019-01-03 05:23:44 -0600
committerRAJA DAS <rajadas2@in.ibm.com>2019-01-07 06:54:43 -0600
commit64cbaffb38a087fb92ce093d1127e5269e7faae0 (patch)
treea5d6a4aeb3a1b40fb25e067588b2e6e4e28088bb
parent658b2f4ef5f3057b1c7ea0cf0a0fa7579451a81e (diff)
downloadtalos-sbe-64cbaffb38a087fb92ce093d1127e5269e7faae0.tar.gz
talos-sbe-64cbaffb38a087fb92ce093d1127e5269e7faae0.zip
Flush NVDIMM Chipop
Change-Id: Ibf249b59fd20f883a8b01e640f3e9be5f4a68500 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/70070 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>
-rw-r--r--src/sbefw/app/power/chipop_table.C6
-rw-r--r--src/sbefw/app/power/sbecmdgeneric.C5
-rw-r--r--src/sbefw/app/power/sbecmdiplcontrol.C56
-rw-r--r--src/sbefw/app/power/sbecmdiplcontrol.H12
-rw-r--r--src/sbefw/core/sbe_sp_intf.H5
-rwxr-xr-xsrc/test/testcases/test.xml3
-rwxr-xr-xsrc/test/testcases/testFlushNVDIMM.py58
-rwxr-xr-xsrc/test/testcases/testFlushNVDIMM.xml30
8 files changed, 168 insertions, 7 deletions
diff --git a/src/sbefw/app/power/chipop_table.C b/src/sbefw/app/power/chipop_table.C
index fb0f6ea1..1431b343 100644
--- a/src/sbefw/app/power/chipop_table.C
+++ b/src/sbefw/app/power/chipop_table.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2017,2018 */
+/* Contributors Listed Below - COPYRIGHT 2017,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -93,6 +93,10 @@ CMD_ARR(
{sbeHandleSuspendIO,
SBE_CMD_SUSPEND_IO,
SBE_FENCE_AT_DUMPING,
+ },
+ {sbeHandleFlushNVDIMM,
+ SBE_CMD_FLUSH_NVDIMM,
+ HARDWARE_FENCED_STATE|SBE_FENCE_AT_DUMPING,
}
)
diff --git a/src/sbefw/app/power/sbecmdgeneric.C b/src/sbefw/app/power/sbecmdgeneric.C
index 4064da29..0879ba29 100644
--- a/src/sbefw/app/power/sbecmdgeneric.C
+++ b/src/sbefw/app/power/sbecmdgeneric.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2018 */
+/* Contributors Listed Below - COPYRIGHT 2015,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -99,7 +99,8 @@ void updateFifoCapabilities(uint32_t * capability)
// Update Capability flags based on lastes spec.
capability[IPL_CAPABILITY_START_IDX] =
EXECUTE_ISTEP_SUPPPORTED |
- SUSPEND_IO_SUPPPORTED;
+ SUSPEND_IO_SUPPPORTED |
+ FLUSH_NVDIMM_SUPPPORTED;
capability[IPL_CAPABILITY_START_IDX+1] =
RESERVED_A1_CAPABILITIES;
diff --git a/src/sbefw/app/power/sbecmdiplcontrol.C b/src/sbefw/app/power/sbecmdiplcontrol.C
index f18d41be..88eb9b8d 100644
--- a/src/sbefw/app/power/sbecmdiplcontrol.C
+++ b/src/sbefw/app/power/sbecmdiplcontrol.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2018 */
+/* Contributors Listed Below - COPYRIGHT 2015,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -47,6 +47,7 @@
#include "p9n2_quad_scom_addresses.H"
#include "p9_suspend_io.H"
+//#include "nvdimm_workarounds.H"
#include <p9_sbe_attr_setup.H>
@@ -305,6 +306,59 @@ uint32_t sbeHandleSuspendIO(uint8_t *i_pArg)
}
//----------------------------------------------------------------------------
+///////////////////////////////////////////////////////////////////////
+// @brief sbeHandleFlushNVDIMM Sbe flush NVDIMM function
+//
+// @return RC from the underlying FIFO utility
+///////////////////////////////////////////////////////////////////////
+
+//mss::workarounds::nvdimm::p9_flush_nvdimm_FP_t p9_flush_nvdimm_hwp = &mss::workarounds::nvdimm::trigger_csave;
+
+uint32_t sbeHandleFlushNVDIMM(uint8_t *i_pArg)
+{
+
+ #define SBE_FUNC " sbeHandleFlushNVDIMM "
+ SBE_ENTER(SBE_FUNC);
+ uint32_t rc = SBE_SEC_OPERATION_SUCCESSFUL;
+ ReturnCode fapiRc = FAPI2_RC_SUCCESS;
+ uint32_t len = 0;
+ sbeRespGenHdr_t respHdr;
+ respHdr.init();
+ sbeResponseFfdc_t ffdc;
+ //Target<TARGET_TYPE_PROC_CHIP > procTgt = plat_getChipTarget();
+
+ do
+ {
+ // Dequeue the EOT entry as no more data is expected.
+ rc = sbeUpFifoDeq_mult (len, NULL);
+ CHECK_SBE_RC_AND_BREAK_IF_NOT_SUCCESS(rc);
+
+ //SBE_EXEC_HWP(fapiRc, p9_flush_nvdimm_hwp, procTgt);
+ if( fapiRc != FAPI2_RC_SUCCESS )
+ {
+ SBE_ERROR(SBE_FUNC "p9_flush_NVDIMM_hwp failed");
+ respHdr.setStatus( SBE_PRI_GENERIC_EXECUTION_FAILURE,
+ SBE_SEC_HWP_FAILURE);
+ ffdc.setRc(fapiRc);
+ break;
+ }
+ }while(0);
+
+ // Create the Response to caller
+ do
+ {
+ // If there was a FIFO error, will skip sending the response,
+ // instead give the control back to the command processor thread
+ CHECK_SBE_RC_AND_BREAK_IF_NOT_SUCCESS(rc);
+ rc = sbeDsSendRespHdr( respHdr, &ffdc);
+ }while(0);
+
+ SBE_EXIT(SBE_FUNC);
+ return rc;
+ #undef SBE_FUNC
+}
+//----------------------------------------------------------------------------
+
ReturnCode performAttrSetup( )
{
#define SBE_FUNC "performAttrSetup "
diff --git a/src/sbefw/app/power/sbecmdiplcontrol.H b/src/sbefw/app/power/sbecmdiplcontrol.H
index 6e0993f0..9721b212 100644
--- a/src/sbefw/app/power/sbecmdiplcontrol.H
+++ b/src/sbefw/app/power/sbecmdiplcontrol.H
@@ -5,7 +5,8 @@
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2018 */
+/* Contributors Listed Below - COPYRIGHT 2015,2019 */
+/* [+] International Business Machines Corp. */
/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
@@ -44,6 +45,15 @@
*/
uint32_t sbeHandleSuspendIO(uint8_t *i_pArg);
+/**
+ * @brief execute flush NVDIMM chip-op (0xA103)
+ *
+ * @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 sbeHandleFlushNVDIMM(uint8_t *i_pArg);
+
// Utility function to do TPM reset
fapi2::ReturnCode performTpmReset();
diff --git a/src/sbefw/core/sbe_sp_intf.H b/src/sbefw/core/sbe_sp_intf.H
index 678ab626..3542823c 100644
--- a/src/sbefw/core/sbe_sp_intf.H
+++ b/src/sbefw/core/sbe_sp_intf.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2018 */
+/* Contributors Listed Below - COPYRIGHT 2015,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -73,6 +73,7 @@ enum sbeIplControlCommands
{
SBE_CMD_EXECUTE_ISTEP = 0x01, /* Execute istep */
SBE_CMD_SUSPEND_IO = 0x02, /* Suspend IO */
+ SBE_CMD_FLUSH_NVDIMM = 0x03, /* Flush NVDIMM */
};
/**
@@ -230,6 +231,7 @@ enum sbeSecondaryResponse
SBE_SEC_SPECIAL_WAKEUP_SCOM_FAILURE = 0x29,
SBE_SEC_S0_ARCH_REG_DUMP_FAILED = 0x2A,
SBE_SEC_LPC_ACCESS_FAILED = 0x2B,
+ SBE_SEC_HWP_FAILURE = 0x2C,
};
/**
@@ -280,6 +282,7 @@ enum
EXECUTE_ISTEP_SUPPPORTED = 0xA1000001,
SUSPEND_IO_SUPPPORTED = 0xA1000002,
+ FLUSH_NVDIMM_SUPPPORTED = 0xA1000003,
RESERVED_A1_CAPABILITIES = 0xA1800000,
GET_SCOM_SUPPPORTED = 0xA2000001,
diff --git a/src/test/testcases/test.xml b/src/test/testcases/test.xml
index ead04b00..c71e459b 100755
--- a/src/test/testcases/test.xml
+++ b/src/test/testcases/test.xml
@@ -5,7 +5,7 @@
<!-- -->
<!-- OpenPOWER sbe Project -->
<!-- -->
-<!-- Contributors Listed Below - COPYRIGHT 2015,2018 -->
+<!-- Contributors Listed Below - COPYRIGHT 2015,2019 -->
<!-- [+] International Business Machines Corp. -->
<!-- -->
<!-- -->
@@ -36,6 +36,7 @@
<include>../simics/targets/p9_nimbus/sbeTest/testPSUSetStashPair.xml</include>
<include>../simics/targets/p9_nimbus/sbeTest/testIstep.xml</include>
<include>../simics/targets/p9_nimbus/sbeTest/testSuspendIO.xml</include>
+ <include>../simics/targets/p9_nimbus/sbeTest/testFlushNVDIMM.xml</include>
<include>../simics/targets/p9_nimbus/sbeTest/testGeneric.xml</include>
<!-- Memory access testcases -->
<include>../simics/targets/p9_nimbus/sbeTest/testUnsecureMemRegions.xml</include>
diff --git a/src/test/testcases/testFlushNVDIMM.py b/src/test/testcases/testFlushNVDIMM.py
new file mode 100755
index 00000000..3350bd77
--- /dev/null
+++ b/src/test/testcases/testFlushNVDIMM.py
@@ -0,0 +1,58 @@
+# IBM_PROLOG_BEGIN_TAG
+# This is an automatically generated prolog.
+#
+# $Source: src/test/testcases/testFlushNVDIMM.py $
+#
+# OpenPOWER sbe Project
+#
+# Contributors Listed Below - COPYRIGHT 2017,2019
+#
+#
+# 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 sys
+sys.path.append("targets/p9_nimbus/sbeTest" )
+import testUtil
+err = False
+
+TESTDATA = [0,0,0,2,
+ 0,0,0xA1,0x03 ]
+
+EXPDATA = [0xc0,0xde,0xa1,0x03,
+ 0x0,0x0,0x0,0x0,
+ 0x00,0x0,0x0,0x3];
+
+
+# MAIN Test Run Starts Here...
+#-------------------------------------------------
+def main( ):
+ testUtil.runCycles( 10000000 )
+ testUtil.writeUsFifo( TESTDATA )
+ testUtil.writeEot( )
+ testUtil.readDsFifo( EXPDATA )
+ testUtil.readEot( )
+
+#-------------------------------------------------
+# Calling all test code
+#-------------------------------------------------
+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/testFlushNVDIMM.xml b/src/test/testcases/testFlushNVDIMM.xml
new file mode 100755
index 00000000..9effcbaa
--- /dev/null
+++ b/src/test/testcases/testFlushNVDIMM.xml
@@ -0,0 +1,30 @@
+<!-- IBM_PROLOG_BEGIN_TAG -->
+<!-- This is an automatically generated prolog. -->
+<!-- -->
+<!-- $Source: src/test/testcases/testFlushNVDIMM.xml $ -->
+<!-- -->
+<!-- OpenPOWER sbe Project -->
+<!-- -->
+<!-- Contributors Listed Below - COPYRIGHT 2017,2019 -->
+<!-- -->
+<!-- -->
+<!-- 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/testFlushNVDIMM.py</simcmd>
+ <exitonerror>yes</exitonerror>
+ </testcase>
+
OpenPOWER on IntegriCloud