summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaja Das <rajadas2@in.ibm.com>2019-01-11 04:24:17 -0600
committerRAJA DAS <rajadas2@in.ibm.com>2019-01-28 00:07:45 -0600
commit0420efec88bd2bdc4e23ebd0bac1659bf2ae8747 (patch)
tree94af79571fd97817baec07be8fb1ae3539fbc508
parent2e253cebdaffb92d67fe19999d818e327daca1fb (diff)
downloadtalos-sbe-0420efec88bd2bdc4e23ebd0bac1659bf2ae8747.tar.gz
talos-sbe-0420efec88bd2bdc4e23ebd0bac1659bf2ae8747.zip
White/Black/Grey List Binary dump PSU Chip-op Support
Change-Id: Ib540a55fb7e315954dd96428b7257ebffd23c99f Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/70361 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Srikantha S. Meesala <srikantha@in.ibm.com> Reviewed-by: RAJA DAS <rajadas2@in.ibm.com>
-rw-r--r--src/sbefw/app/common/sbecmdgeneric.C42
-rw-r--r--src/sbefw/app/common/sbecmdgeneric.H11
-rw-r--r--src/sbefw/app/power/chipop_table.C5
-rw-r--r--src/sbefw/app/power/sbecmdgeneric.C3
-rw-r--r--src/sbefw/core/sbe_host_intf.H4
-rwxr-xr-xsrc/test/testcases/test.xml1
-rw-r--r--src/test/testcases/testPSUGetCapabilities.py4
-rw-r--r--src/test/testcases/testSecurityListDump.py103
-rwxr-xr-xsrc/test/testcases/testSecurityListDump.xml30
9 files changed, 197 insertions, 6 deletions
diff --git a/src/sbefw/app/common/sbecmdgeneric.C b/src/sbefw/app/common/sbecmdgeneric.C
index 3aae2a2e..708249c4 100644
--- a/src/sbefw/app/common/sbecmdgeneric.C
+++ b/src/sbefw/app/common/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. */
/* */
/* */
@@ -426,6 +426,46 @@ uint32_t sbeSetSystemFabricMap( uint8_t *i_pArg )
return l_rc;
#undef SBE_FUNC
}
+
+//----------------------------------------------------------------------------
+uint32_t sbeSecurityListBinDump( uint8_t *i_pArg )
+{
+ #define SBE_FUNC "sbeSecurityListBinDump"
+ SBE_ENTER(SBE_FUNC);
+ uint32_t rc = SBE_SEC_OPERATION_SUCCESSFUL;
+ uint32_t fapiRc = FAPI2_RC_SUCCESS;
+
+ do
+ {
+ uint64_t dumpAddr = 0;
+ rc = sbeReadPsu2SbeMbxReg(SBE_HOST_PSU_MBOX_REG1,
+ (sizeof(dumpAddr)/sizeof(uint64_t)),
+ &dumpAddr, true);
+
+ if(SBE_SEC_OPERATION_SUCCESSFUL != rc)
+ {
+ SBE_ERROR(SBE_FUNC" Failed to extract SBE_HOST_PSU_MBOX_REG1");
+ break;
+ }
+
+ SBE_INFO(SBE_FUNC "Security Dump Addr [0x%08X][%08X]",
+ SBE::higher32BWord(dumpAddr),
+ SBE::lower32BWord(dumpAddr));
+
+ ////////////////////////////////////////////////////////
+ // Do your processing here with dumpAddr
+ ////////////////////////////////////////////////////////
+
+ }while(0);
+
+ // Send the response
+ sbePSUSendResponse(SBE_GLOBAL->sbeSbe2PsuRespHdr, fapiRc, rc);
+
+ SBE_EXIT(SBE_FUNC);
+ return rc;
+ #undef SBE_FUNC
+}
+
#endif //__SBEFW_SEEPROM__
#ifndef __SBEFW_SEEPROM__
diff --git a/src/sbefw/app/common/sbecmdgeneric.H b/src/sbefw/app/common/sbecmdgeneric.H
index 633a6bad..cdbcf108 100644
--- a/src/sbefw/app/common/sbecmdgeneric.H
+++ b/src/sbefw/app/common/sbecmdgeneric.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2018 */
+/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -196,3 +196,12 @@ uint32_t sbeReadMem(uint8_t *i_pArg);
* @return Rc from the Psu access utility
*/
uint32_t sbePsuGetCapabilities(uint8_t *i_pArg);
+
+/**
+ * @brief SBE Psu Send Security List Binary Dump (0xD708)
+ *
+ * @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 sbeSecurityListBinDump(uint8_t *i_pArg);
diff --git a/src/sbefw/app/power/chipop_table.C b/src/sbefw/app/power/chipop_table.C
index c0f28da5..3cba24e8 100644
--- a/src/sbefw/app/power/chipop_table.C
+++ b/src/sbefw/app/power/chipop_table.C
@@ -323,6 +323,11 @@ CMD_ARR(
{sbeStashKeyAddrPair,
SBE_PSU_GENERIC_MSG_STASH_MPIPL_CONFIG,
SBE_NO_FENCE,
+ },
+
+ {sbeSecurityListBinDump,
+ SBE_PSU_GENERIC_MSG_SECURITY_LIST_BIN_DUMP,
+ SBE_NO_FENCE,
}
)
diff --git a/src/sbefw/app/power/sbecmdgeneric.C b/src/sbefw/app/power/sbecmdgeneric.C
index 0879ba29..c91ceec4 100644
--- a/src/sbefw/app/power/sbecmdgeneric.C
+++ b/src/sbefw/app/power/sbecmdgeneric.C
@@ -88,7 +88,8 @@ void updatePsuCapabilities(uint32_t * capability)
PSU_SET_FFDC_ADDRESS_SUPPORTED |
PSU_QUISCE_SUPPORTED |
PSU_SET_SYSTEM_FABRIC_ID_MAP_SUPPORTED |
- PSU_STASH_MPIPL_CONFIG_SUPPORTED;
+ PSU_STASH_MPIPL_CONFIG_SUPPORTED |
+ PSU_SECURITY_LIST_BIN_DUMP_SUPPORTED;
capability[PSU_GENERIC_CHIPOP_CAPABILITY_START_IDX+1] =
PSU_RESERVED_7;
diff --git a/src/sbefw/core/sbe_host_intf.H b/src/sbefw/core/sbe_host_intf.H
index 64ad2e0a..c4fde6e6 100644
--- a/src/sbefw/core/sbe_host_intf.H
+++ b/src/sbefw/core/sbe_host_intf.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2018 */
+/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -102,6 +102,7 @@ enum sbePsuGenericMessages
SBE_PSU_GENERIC_MSG_QUIESCE = 0x05,
SBE_PSU_GENERIC_MSG_SYSTEM_FABRIC_MAP = 0x06,
SBE_PSU_GENERIC_MSG_STASH_MPIPL_CONFIG = 0x07,
+ SBE_PSU_GENERIC_MSG_SECURITY_LIST_BIN_DUMP = 0x08,
SBE_PSU_GENERIC_MSG_UNKNOWN = 0xFF,
};
@@ -194,6 +195,7 @@ enum PSU_CAPABILITIES
PSU_QUISCE_SUPPORTED = 0xD7000010,
PSU_SET_SYSTEM_FABRIC_ID_MAP_SUPPORTED = 0xD7000020,
PSU_STASH_MPIPL_CONFIG_SUPPORTED = 0xD7000040,
+ PSU_SECURITY_LIST_BIN_DUMP_SUPPORTED = 0xD7000080,
PSU_RESERVED_7 = 0xD7800000,
};
diff --git a/src/test/testcases/test.xml b/src/test/testcases/test.xml
index c71e459b..e7b54cac 100755
--- a/src/test/testcases/test.xml
+++ b/src/test/testcases/test.xml
@@ -57,6 +57,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/testSystemFabricMap.xml</include>
+ <include>../simics/targets/p9_nimbus/sbeTest/testSecurityListDump.xml</include>
<include>../simics/targets/p9_nimbus/sbeTest/testExecutorCntrlTimer.xml</include>
<!-- temporarily disable in preparation for an update to the trace bus IDs <include>../simics/targets/p9_nimbus/sbeTest/testArrayAccess.xml</include> -->
<include>../simics/targets/p9_nimbus/sbeTest/testSecurity.xml</include>
diff --git a/src/test/testcases/testPSUGetCapabilities.py b/src/test/testcases/testPSUGetCapabilities.py
index 6fc53c21..922eb80e 100644
--- a/src/test/testcases/testPSUGetCapabilities.py
+++ b/src/test/testcases/testPSUGetCapabilities.py
@@ -5,7 +5,7 @@
#
# OpenPOWER sbe Project
#
-# Contributors Listed Below - COPYRIGHT 2017,2018
+# Contributors Listed Below - COPYRIGHT 2017,2019
# [+] International Business Machines Corp.
#
#
@@ -60,7 +60,7 @@ capMsg = (getsingleword(0xC000003F) +
getsingleword(0xD5800000) +
getsingleword(0xD6000001) +
getsingleword(0xD6800000) +
- getsingleword(0xD700007E) +
+ getsingleword(0xD70000FE) +
getsingleword(0xD7800000))
def getCapabilities(addr, size, exp_status):
diff --git a/src/test/testcases/testSecurityListDump.py b/src/test/testcases/testSecurityListDump.py
new file mode 100644
index 00000000..fb529b5a
--- /dev/null
+++ b/src/test/testcases/testSecurityListDump.py
@@ -0,0 +1,103 @@
+# IBM_PROLOG_BEGIN_TAG
+# This is an automatically generated prolog.
+#
+# $Source: src/test/testcases/testSecurityListDump.py $
+#
+# OpenPOWER sbe Project
+#
+# Contributors Listed Below - COPYRIGHT 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 testPSUUtil
+import testRegistry as reg
+import testUtil
+
+#-------------------------------
+# This is a Test Data
+#-------------------------------
+'''
+This data are the values or strings that needs to be validated for the test.
+'''
+
+sbe_test_data = (
+ #-----------------------------------------------------------------------------------------------------
+ # OP Reg ValueToWrite size Test Expected Data Description
+ #-----------------------------------------------------------------------------------------------------
+ ["write", reg.REG_MBOX0, "0000010000F0D708", 8, "None", "Writing to MBOX0 address"],
+ ["write", reg.REG_MBOX1, "0000000008000000", 8, "None", "Writing to MBOX1 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, "0000000000F0D708", "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
+
+ testUtil.runCycles( 1000000 );
+ print "\n Execute SBE Test [ System Fabric Map ] ...\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/testSecurityListDump.xml b/src/test/testcases/testSecurityListDump.xml
new file mode 100755
index 00000000..b135b582
--- /dev/null
+++ b/src/test/testcases/testSecurityListDump.xml
@@ -0,0 +1,30 @@
+<!-- IBM_PROLOG_BEGIN_TAG -->
+<!-- This is an automatically generated prolog. -->
+<!-- -->
+<!-- $Source: src/test/testcases/testSecurityListDump.xml $ -->
+<!-- -->
+<!-- OpenPOWER sbe Project -->
+<!-- -->
+<!-- Contributors Listed Below - COPYRIGHT 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/testSecurityListDump.py</simcmd>
+ <exitonerror>yes</exitonerror>
+ </testcase>
+
OpenPOWER on IntegriCloud