Skip to content

Commit

Permalink
White/Black/Grey List Binary dump PSU Chip-op Support
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Raja Das committed Jan 28, 2019
1 parent 2e253ce commit 0420efe
Show file tree
Hide file tree
Showing 9 changed files with 197 additions and 6 deletions.
42 changes: 41 additions & 1 deletion src/sbefw/app/common/sbecmdgeneric.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER sbe Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015,2018 */
/* Contributors Listed Below - COPYRIGHT 2015,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -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__
Expand Down
11 changes: 10 additions & 1 deletion src/sbefw/app/common/sbecmdgeneric.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER sbe Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016,2018 */
/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -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);
5 changes: 5 additions & 0 deletions src/sbefw/app/power/chipop_table.C
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
)

Expand Down
3 changes: 2 additions & 1 deletion src/sbefw/app/power/sbecmdgeneric.C
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 3 additions & 1 deletion src/sbefw/core/sbe_host_intf.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER sbe Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016,2018 */
/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -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,
};

Expand Down Expand Up @@ -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,
};

Expand Down
1 change: 1 addition & 0 deletions src/test/testcases/test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
4 changes: 2 additions & 2 deletions src/test/testcases/testPSUGetCapabilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
# OpenPOWER sbe Project
#
# Contributors Listed Below - COPYRIGHT 2017,2018
# Contributors Listed Below - COPYRIGHT 2017,2019
# [+] International Business Machines Corp.
#
#
Expand Down Expand Up @@ -60,7 +60,7 @@ def getdoubleword(dataInInt):
getsingleword(0xD5800000) +
getsingleword(0xD6000001) +
getsingleword(0xD6800000) +
getsingleword(0xD700007E) +
getsingleword(0xD70000FE) +
getsingleword(0xD7800000))

def getCapabilities(addr, size, exp_status):
Expand Down
103 changes: 103 additions & 0 deletions src/test/testcases/testSecurityListDump.py
Original file line number Diff line number Diff line change
@@ -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);


30 changes: 30 additions & 0 deletions src/test/testcases/testSecurityListDump.xml
Original file line number Diff line number Diff line change
@@ -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>

0 comments on commit 0420efe

Please sign in to comment.